]> review.fuel-infra Code Review - packages/trusty/mysql-wsrep-5.6.git/commitdiff
Security update: 88/22988/2 mos-9.0
authorIvan Suzdal <isuzdal@mirantis.com>
Wed, 6 Jul 2016 11:53:58 +0000 (14:53 +0300)
committerDmitry Teselkin <dteselkin@mirantis.com>
Fri, 8 Jul 2016 17:38:58 +0000 (20:38 +0300)
  * 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

2214 files changed:
debian/README.source [deleted file]
debian/additions/my.cnf [new file with mode: 0644]
debian/apparmor-profile
debian/changelog
debian/control
debian/gbp.conf [new file with mode: 0644]
debian/mysql-server-5.6.py [new file with mode: 0755]
debian/mysql-server-wsrep-5.6.postinst
debian/patches/disable_tests.patch [deleted file]
debian/patches/fix-mysqlhotcopy-test-failure.patch [new file with mode: 0644]
debian/patches/fix_standalone_tests.patch
debian/patches/hurd.patch
debian/patches/kfreebsd_tests.patch
debian/patches/mysql-5.6.23_wsrep_25.10.patch [deleted file]
debian/patches/scripts__mysqld_safe.sh__signals.patch
debian/patches/series
debian/patches/spelling.patch
debian/patches/wsrep_sst_mysqldump.patch [deleted file]
debian/rules
debian/tests/control
debian/tests/smoke [new file with mode: 0644]
debian/tests/upstream
mysql-wsrep-5.6/.gitignore [deleted file]
mysql-wsrep-5.6/BUILD-CMAKE [deleted file]
mysql-wsrep-5.6/BUILD/README
mysql-wsrep-5.6/BUILD/compile-pentium-valgrind-max-no-ndb
mysql-wsrep-5.6/CMakeLists.txt
mysql-wsrep-5.6/CONTRIBUTING.md [new file with mode: 0644]
mysql-wsrep-5.6/Docs/ChangeLog
mysql-wsrep-5.6/Docs/INFO_SRC [deleted file]
mysql-wsrep-5.6/Docs/INSTALL-BINARY [deleted file]
mysql-wsrep-5.6/Docs/mysql.info [new file with mode: 0644]
mysql-wsrep-5.6/INSTALL [new file with mode: 0644]
mysql-wsrep-5.6/INSTALL-SOURCE [deleted file]
mysql-wsrep-5.6/INSTALL-WIN-SOURCE [deleted file]
mysql-wsrep-5.6/README
mysql-wsrep-5.6/VERSION
mysql-wsrep-5.6/client/CMakeLists.txt
mysql-wsrep-5.6/client/client_priv.h
mysql-wsrep-5.6/client/mysql.cc
mysql-wsrep-5.6/client/mysql_config_editor.cc
mysql-wsrep-5.6/client/mysql_plugin.c
mysql-wsrep-5.6/client/mysql_upgrade.c
mysql-wsrep-5.6/client/mysqladmin.cc
mysql-wsrep-5.6/client/mysqlbinlog.cc
mysql-wsrep-5.6/client/mysqlcheck.c
mysql-wsrep-5.6/client/mysqldump.c
mysql-wsrep-5.6/client/mysqlimport.c
mysql-wsrep-5.6/client/mysqlshow.c
mysql-wsrep-5.6/client/mysqlslap.c
mysql-wsrep-5.6/client/mysqltest.cc
mysql-wsrep-5.6/client/sql_string.cc
mysql-wsrep-5.6/client/sql_string.h
mysql-wsrep-5.6/cmake/compile_flags.cmake
mysql-wsrep-5.6/cmake/configure.pl
mysql-wsrep-5.6/cmake/install_layout.cmake
mysql-wsrep-5.6/cmake/install_macros.cmake
mysql-wsrep-5.6/cmake/make_dist.cmake.in
mysql-wsrep-5.6/cmake/mysql_add_executable.cmake
mysql-wsrep-5.6/cmake/os/FreeBSD.cmake
mysql-wsrep-5.6/cmake/os/Windows.cmake
mysql-wsrep-5.6/cmake/os/WindowsCache.cmake
mysql-wsrep-5.6/cmake/package_name.cmake
mysql-wsrep-5.6/cmake/plugin.cmake
mysql-wsrep-5.6/cmake/ssl.cmake
mysql-wsrep-5.6/cmake/versioninfo.rc.in
mysql-wsrep-5.6/cmake/wsrep.cmake [new file with mode: 0644]
mysql-wsrep-5.6/cmd-line-utils/libedit/el_terminal.h
mysql-wsrep-5.6/cmd-line-utils/libedit/emacs.c
mysql-wsrep-5.6/cmd-line-utils/libedit/terminal.c
mysql-wsrep-5.6/cmd-line-utils/libedit/vi.c
mysql-wsrep-5.6/config.h.cmake
mysql-wsrep-5.6/configure.cmake
mysql-wsrep-5.6/extra/CMakeLists.txt
mysql-wsrep-5.6/extra/charset2html.c [deleted file]
mysql-wsrep-5.6/extra/my_print_defaults.c
mysql-wsrep-5.6/extra/resolve_stack_dump.cc [moved from mysql-wsrep-5.6/extra/resolve_stack_dump.c with 79% similarity]
mysql-wsrep-5.6/extra/yassl/README
mysql-wsrep-5.6/extra/yassl/certs/dsa512.der [deleted file]
mysql-wsrep-5.6/extra/yassl/certs/dsa512.pem [deleted file]
mysql-wsrep-5.6/extra/yassl/include/crypto_wrapper.hpp
mysql-wsrep-5.6/extra/yassl/include/openssl/crypto.h
mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h
mysql-wsrep-5.6/extra/yassl/include/yassl_error.hpp
mysql-wsrep-5.6/extra/yassl/include/yassl_int.hpp
mysql-wsrep-5.6/extra/yassl/src/buffer.cpp
mysql-wsrep-5.6/extra/yassl/src/cert_wrapper.cpp
mysql-wsrep-5.6/extra/yassl/src/crypto_wrapper.cpp
mysql-wsrep-5.6/extra/yassl/src/handshake.cpp
mysql-wsrep-5.6/extra/yassl/src/ssl.cpp
mysql-wsrep-5.6/extra/yassl/src/yassl_error.cpp
mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp
mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp
mysql-wsrep-5.6/extra/yassl/taocrypt/include/asn.hpp
mysql-wsrep-5.6/extra/yassl/taocrypt/src/asn.cpp
mysql-wsrep-5.6/extra/yassl/taocrypt/src/rsa.cpp
mysql-wsrep-5.6/extra/yassl/testsuite/cipher-test.sh
mysql-wsrep-5.6/extra/yassl/testsuite/test.hpp
mysql-wsrep-5.6/include/base64.h
mysql-wsrep-5.6/include/ft_global.h
mysql-wsrep-5.6/include/lf.h
mysql-wsrep-5.6/include/my_md5.h
mysql-wsrep-5.6/include/my_pthread.h
mysql-wsrep-5.6/include/mysql/psi/mysql_statement.h
mysql-wsrep-5.6/include/mysql/psi/psi.h
mysql-wsrep-5.6/include/mysql/psi/psi_abi_v0.h.pp
mysql-wsrep-5.6/include/mysql/psi/psi_abi_v1.h.pp
mysql-wsrep-5.6/include/mysql/psi/psi_abi_v2.h.pp
mysql-wsrep-5.6/include/mysql/thread_pool_priv.h
mysql-wsrep-5.6/include/sslopt-case.h
mysql-wsrep-5.6/include/sslopt-longopts.h
mysql-wsrep-5.6/include/sslopt-vars.h
mysql-wsrep-5.6/include/thr_lock.h
mysql-wsrep-5.6/include/violite.h
mysql-wsrep-5.6/include/welcome_copyright_notice.h
mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsp
mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsw
mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.sln
mysql-wsrep-5.6/libevent/http.c
mysql-wsrep-5.6/libevent/test/regress_http.c
mysql-wsrep-5.6/libmysql/CMakeLists.txt
mysql-wsrep-5.6/libmysql/conf_to_src.c
mysql-wsrep-5.6/libmysqld/lib_sql.cc
mysql-wsrep-5.6/man/comp_err.1
mysql-wsrep-5.6/man/innochecksum.1
mysql-wsrep-5.6/man/msql2mysql.1
mysql-wsrep-5.6/man/my_print_defaults.1
mysql-wsrep-5.6/man/myisam_ftdump.1
mysql-wsrep-5.6/man/myisamchk.1
mysql-wsrep-5.6/man/myisamlog.1
mysql-wsrep-5.6/man/myisampack.1
mysql-wsrep-5.6/man/mysql-stress-test.pl.1
mysql-wsrep-5.6/man/mysql-test-run.pl.1
mysql-wsrep-5.6/man/mysql.1
mysql-wsrep-5.6/man/mysql.server.1
mysql-wsrep-5.6/man/mysql_client_test.1
mysql-wsrep-5.6/man/mysql_config.1
mysql-wsrep-5.6/man/mysql_config_editor.1
mysql-wsrep-5.6/man/mysql_convert_table_format.1
mysql-wsrep-5.6/man/mysql_find_rows.1
mysql-wsrep-5.6/man/mysql_fix_extensions.1
mysql-wsrep-5.6/man/mysql_install_db.1
mysql-wsrep-5.6/man/mysql_plugin.1
mysql-wsrep-5.6/man/mysql_secure_installation.1
mysql-wsrep-5.6/man/mysql_setpermission.1
mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1
mysql-wsrep-5.6/man/mysql_upgrade.1
mysql-wsrep-5.6/man/mysql_waitpid.1
mysql-wsrep-5.6/man/mysql_zap.1
mysql-wsrep-5.6/man/mysqlaccess.1
mysql-wsrep-5.6/man/mysqladmin.1
mysql-wsrep-5.6/man/mysqlbinlog.1
mysql-wsrep-5.6/man/mysqlbug.1
mysql-wsrep-5.6/man/mysqlcheck.1
mysql-wsrep-5.6/man/mysqld.8
mysql-wsrep-5.6/man/mysqld_multi.1
mysql-wsrep-5.6/man/mysqld_safe.1
mysql-wsrep-5.6/man/mysqldump.1
mysql-wsrep-5.6/man/mysqldumpslow.1
mysql-wsrep-5.6/man/mysqlhotcopy.1
mysql-wsrep-5.6/man/mysqlimport.1
mysql-wsrep-5.6/man/mysqlshow.1
mysql-wsrep-5.6/man/mysqlslap.1
mysql-wsrep-5.6/man/mysqltest.1
mysql-wsrep-5.6/man/ndb-common-options.1 [deleted file]
mysql-wsrep-5.6/man/ndb_blob_tool.1 [deleted file]
mysql-wsrep-5.6/man/ndb_config.1 [deleted file]
mysql-wsrep-5.6/man/ndb_cpcd.1 [deleted file]
mysql-wsrep-5.6/man/ndb_delete_all.1 [deleted file]
mysql-wsrep-5.6/man/ndb_desc.1 [deleted file]
mysql-wsrep-5.6/man/ndb_drop_index.1 [deleted file]
mysql-wsrep-5.6/man/ndb_drop_table.1 [deleted file]
mysql-wsrep-5.6/man/ndb_error_reporter.1 [deleted file]
mysql-wsrep-5.6/man/ndb_index_stat.1 [deleted file]
mysql-wsrep-5.6/man/ndb_mgm.1 [deleted file]
mysql-wsrep-5.6/man/ndb_mgmd.8 [deleted file]
mysql-wsrep-5.6/man/ndb_print_backup_file.1 [deleted file]
mysql-wsrep-5.6/man/ndb_print_schema_file.1 [deleted file]
mysql-wsrep-5.6/man/ndb_print_sys_file.1 [deleted file]
mysql-wsrep-5.6/man/ndb_restore.1 [deleted file]
mysql-wsrep-5.6/man/ndb_select_all.1 [deleted file]
mysql-wsrep-5.6/man/ndb_select_count.1 [deleted file]
mysql-wsrep-5.6/man/ndb_setup.py.1 [deleted file]
mysql-wsrep-5.6/man/ndb_show_tables.1 [deleted file]
mysql-wsrep-5.6/man/ndb_size.pl.1 [deleted file]
mysql-wsrep-5.6/man/ndb_waiter.1 [deleted file]
mysql-wsrep-5.6/man/ndbd.8 [deleted file]
mysql-wsrep-5.6/man/ndbd_redo_log_reader.1 [deleted file]
mysql-wsrep-5.6/man/ndbinfo_select_all.1 [deleted file]
mysql-wsrep-5.6/man/ndbmtd.8 [deleted file]
mysql-wsrep-5.6/man/perror.1
mysql-wsrep-5.6/man/replace.1
mysql-wsrep-5.6/man/resolve_stack_dump.1
mysql-wsrep-5.6/man/resolveip.1
mysql-wsrep-5.6/mysql-test/CMakeLists.txt
mysql-wsrep-5.6/mysql-test/collections/README
mysql-wsrep-5.6/mysql-test/collections/default.daily
mysql-wsrep-5.6/mysql-test/collections/default.experimental
mysql-wsrep-5.6/mysql-test/collections/default.push
mysql-wsrep-5.6/mysql-test/collections/default.release [deleted file]
mysql-wsrep-5.6/mysql-test/collections/default.release.done [deleted file]
mysql-wsrep-5.6/mysql-test/collections/default.release.in
mysql-wsrep-5.6/mysql-test/collections/default.weekly
mysql-wsrep-5.6/mysql-test/collections/default.weekly.basic
mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog.test
mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_row.inc
mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_binlog_error.inc
mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_mts_relay_log_recovery.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_rollback_to_savepoint.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stress_test.inc
mysql-wsrep-5.6/mysql-test/include/assert_grep.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/check-testcase.test
mysql-wsrep-5.6/mysql-test/include/default_mysqld.cnf
mysql-wsrep-5.6/mysql-test/include/galera_clear_sync_point.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_cluster.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_connect.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_diff.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_end.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_init.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_resume.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_set_sync_point.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_signal_sync_point.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_suspend.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_wait_ready.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/galera_wait_sync_point.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/have_mysql_no_login_plugin.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/have_numa.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/have_wsrep.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/have_wsrep_enabled.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/have_wsrep_provider.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/kill_galera.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/mtr_check.sql
mysql-wsrep-5.6/mysql-test/include/mtr_warnings.sql
mysql-wsrep-5.6/mysql-test/include/mysqld--help.inc
mysql-wsrep-5.6/mysql-test/include/no_protocol.inc [moved from mysql-wsrep-5.6/mysql-test/suite/perfschema/include/no_protocol.inc with 89% similarity]
mysql-wsrep-5.6/mysql-test/include/not_wsrep.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/plugin.defs
mysql-wsrep-5.6/mysql-test/include/range.inc
mysql-wsrep-5.6/mysql-test/include/rpl_init.inc
mysql-wsrep-5.6/mysql-test/include/start_mysqld.inc
mysql-wsrep-5.6/mysql-test/include/subquery_mat.inc
mysql-wsrep-5.6/mysql-test/include/subquery_sj.inc
mysql-wsrep-5.6/mysql-test/include/wait_condition.inc
mysql-wsrep-5.6/mysql-test/include/wait_for_ndb_to_binlog.inc [deleted file]
mysql-wsrep-5.6/mysql-test/include/wait_for_slave_to_sync_with_master.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/include/wait_until_connected_again.inc
mysql-wsrep-5.6/mysql-test/include/wait_until_disconnected.inc
mysql-wsrep-5.6/mysql-test/include/write_var_to_file.inc
mysql-wsrep-5.6/mysql-test/lib/My/Config.pm
mysql-wsrep-5.6/mysql-test/lib/My/ConfigFactory.pm
mysql-wsrep-5.6/mysql-test/lib/My/ConfigFactory.pm.memcached [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm
mysql-wsrep-5.6/mysql-test/mtr.out-of-source
mysql-wsrep-5.6/mysql-test/mysql-test-run.pl
mysql-wsrep-5.6/mysql-test/r/alter_table.result
mysql-wsrep-5.6/mysql-test/r/connect_debug.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/ctype_utf8.result
mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4.result
mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_heap.result
mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_innodb.result
mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_myisam.result
mysql-wsrep-5.6/mysql-test/r/enable_cleartext_plugin.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/events_1.result
mysql-wsrep-5.6/mysql-test/r/explain.result
mysql-wsrep-5.6/mysql-test/r/fulltext.result
mysql-wsrep-5.6/mysql-test/r/func_math.result
mysql-wsrep-5.6/mysql-test/r/func_str.result
mysql-wsrep-5.6/mysql-test/r/func_str_debug.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/func_str_no_ps.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/galera_sst_mode.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/grant.result
mysql-wsrep-5.6/mysql-test/r/group_min_max.result
mysql-wsrep-5.6/mysql-test/r/have_wsrep.require [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/having.result
mysql-wsrep-5.6/mysql-test/r/information_schema.result
mysql-wsrep-5.6/mysql-test/r/insert.result
mysql-wsrep-5.6/mysql-test/r/loadxml.result
mysql-wsrep-5.6/mysql-test/r/log_empty_name.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/lowercase_fs_on.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/lowercase_table3.result [deleted file]
mysql-wsrep-5.6/mysql-test/r/mdl_sync.result
mysql-wsrep-5.6/mysql-test/r/myisam_recover.result [moved from mysql-wsrep-5.6/mysql-test/r/merge_recover.result with 59% similarity]
mysql-wsrep-5.6/mysql-test/r/mysql_binary_mode.result
mysql-wsrep-5.6/mysql-test/r/mysql_config_editor.result
mysql-wsrep-5.6/mysql-test/r/mysql_plugin.result
mysql-wsrep-5.6/mysql-test/r/mysql_upgrade.result
mysql-wsrep-5.6/mysql-test/r/mysqld--help-notwin.result
mysql-wsrep-5.6/mysql-test/r/mysqld--help-win.result
mysql-wsrep-5.6/mysql-test/r/mysqldump.result
mysql-wsrep-5.6/mysql-test/r/mysqltest.result
mysql-wsrep-5.6/mysql-test/r/not_embedded_server.result
mysql-wsrep-5.6/mysql-test/r/not_wsrep.require [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/partition_binlog.result
mysql-wsrep-5.6/mysql-test/r/partition_error.result
mysql-wsrep-5.6/mysql-test/r/partition_innodb.result
mysql-wsrep-5.6/mysql-test/r/partition_key_cache.result
mysql-wsrep-5.6/mysql-test/r/partition_mgm.result
mysql-wsrep-5.6/mysql-test/r/partition_mgm_err.result
mysql-wsrep-5.6/mysql-test/r/partition_open_files_limit.result
mysql-wsrep-5.6/mysql-test/r/partition_utf8.result
mysql-wsrep-5.6/mysql-test/r/perror-win.result
mysql-wsrep-5.6/mysql-test/r/plugin_auth_qa.result
mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256.result
mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_2.result
mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default.result
mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default_tls.result
mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_tls.result
mysql-wsrep-5.6/mysql-test/r/ps_grant.result
mysql-wsrep-5.6/mysql-test/r/range_all.result
mysql-wsrep-5.6/mysql-test/r/range_icp.result
mysql-wsrep-5.6/mysql-test/r/range_icp_mrr.result
mysql-wsrep-5.6/mysql-test/r/range_mrr.result
mysql-wsrep-5.6/mysql-test/r/range_mrr_cost.result
mysql-wsrep-5.6/mysql-test/r/range_none.result
mysql-wsrep-5.6/mysql-test/r/rewrite_general_log.result
mysql-wsrep-5.6/mysql-test/r/show_check.result
mysql-wsrep-5.6/mysql-test/r/sp-threads.result
mysql-wsrep-5.6/mysql-test/r/sp.result
mysql-wsrep-5.6/mysql-test/r/ssl_mode.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/ssl_mode_no_ssl.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/status_debug.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/r/subquery_mat.result
mysql-wsrep-5.6/mysql-test/r/subquery_mat_all.result
mysql-wsrep-5.6/mysql-test/r/subquery_mat_none.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_all.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka_nixbnl.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bkaunique.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bkaunique.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bkaunique.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka_nixbnl.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bkaunique.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bkaunique.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka_nixbnl.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bkaunique.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_nosj.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_none.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka_nixbnl.result
mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bkaunique.result
mysql-wsrep-5.6/mysql-test/r/table_open_cache_functionality.result
mysql-wsrep-5.6/mysql-test/r/trigger-trans.result
mysql-wsrep-5.6/mysql-test/r/update.result
mysql-wsrep-5.6/mysql-test/r/validate_password_plugin.result
mysql-wsrep-5.6/mysql-test/r/view.result
mysql-wsrep-5.6/mysql-test/r/xml.result
mysql-wsrep-5.6/mysql-test/std_data/binlog-header.log [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/binlog_transaction_with_GTID.000001 [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/binlog_transaction_with_anonymous_GTID.000001 [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/bug16171518_1.dat [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/bug16171518_2.dat [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/ca-cert-verify.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/dtrace.d [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/galera-cert.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/galera-key.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-ca-cert.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-server-cert.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-server-key.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/loadxml2.dat
mysql-wsrep-5.6/mysql-test/std_data/server-cert-verify-fail.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/server-cert-verify-pass.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/server-key-verify-fail.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/server-key-verify-pass.pem [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/slave-relay-bin_linux.index [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/slave-relay-bin_win.index [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/std_data/wsrep_notify.sh [new file with mode: 0755]
mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/cert_verify.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/mysql_no_login.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/cert_verify.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/mysql_no_login-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/mysql_no_login.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_database.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_enforce_gtid_consistency.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_error_action.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_exhausted.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_innodb.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_myisam.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_index.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_innodb_row.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_max_extension.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_rotate_bgc_sync.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_binlog.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_simplified_binlog_gtid_recovery.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_binlog.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
mysql-wsrep-5.6/mysql-test/suite/binlog/r/show_binlog_events_no_lock.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action.test
mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_exhausted-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_exhausted.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_index.test
mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_max_extension.test
mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_rotate_bgc_sync.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/binlog/t/disabled.def
mysql-wsrep-5.6/mysql-test/suite/binlog/t/show_binlog_events_no_lock.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/engines/funcs/r/up_multi_db_table.result
mysql-wsrep-5.6/mysql-test/suite/engines/funcs/t/up_multi_db_table.test
mysql-wsrep-5.6/mysql-test/suite/engines/iuds/r/strings_charsets_update_delete.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_val.inc
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/innodb_trig_03.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/is_columns_is.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/memory_trig_03.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/memory_trig_03e.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/myisam_trig_03.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/processlist_val_ps.result
mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_master.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_slave.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/galera_3nodes_as_slave.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/galera_4nodes.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_have_debug_sync.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_load_provider.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_reset_cluster_address.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_sst_restore.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_clean_slave.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_kill_slave.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_unload_provider.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_wsrep_recover.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/my.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/GAL-382.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-252.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-258.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-259.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-44.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_account_management.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_alter_engine_innodb.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_alter_engine_myisam.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_alter_table_force.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_applier_ftwrl_table.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_master.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_master_gtid.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_autoinc.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_gtid.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_nonprim.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_preordered.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_replication_bundle.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_for_update.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_lock_table.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_sleep.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_cache_size.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_checksum.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_row_image.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_function.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_procedure.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_table_like.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_trigger.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_defaults.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_delete_limit.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_drop_multi.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_enum.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_events.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_cascade_delete.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_cascade_update.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_conflict.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_mismatch.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_multicolumn.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_multitable.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_no_pk.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_selfreferential.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_setnull.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_flush.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_flush_local.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_forced_binlog_format.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ftwrl.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ftwrl_drain.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fulltext.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gcs_fc_limit.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gcs_fragment.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gra_log.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gtid.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_insert_ignore.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_insert_multi.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_mysqldump.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_recv_bind.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_restart_joiner.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_rsync.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_applier.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_ddl.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_largechanges.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_nochanges.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_smallchanges.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_lock_table.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_log_bin.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_log_output_csv.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_columns.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_indexes.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_rows.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_tables_nopk.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_tables_pk.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_mdl_race.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_migrate.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_multi_database.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_myisam_autocommit.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_myisam_transactions.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_bit.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_blob.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_large_varchar.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_unicode.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_simple.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_pc_ignore_sb.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_pk_bigint_signed.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_prepared_statement.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_query_cache.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_read_only.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_repl_key_format_flat16.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_repl_max_ws_size.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_restart_nochanges.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_add_pk.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_drop_pk.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_error.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_simple.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sbr.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sbr_binlog.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_schema_dirty_reads.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_serializable.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_split_brain.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sql_log_bin_zero.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ssl.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ssl_compression.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ssl_upgrade.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_mysqldump.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_rsync.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2-options.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_encrypt_with_key.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_status_cluster.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_status_local_index.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_status_local_state.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_suspend_slave.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sync_wait_show.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_error.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_locking.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_sequential.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ftwrl.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_lock_exclusive.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_lock_shared.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_transaction_read_only.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_transaction_replay.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_truncate.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_truncate_temporary.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_unicode_identifiers.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_unicode_pk.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_update_limit.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_v1_row_events.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_OSU_method.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_OSU_method2.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_cluster_address.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_desync_on.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_dirty_reads.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_fkchecks.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_load_data_splitting.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_log_bin.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_max_ws_size.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_node_address.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_notify_cmd.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_reject_queries.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_slave_threads.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_sync_wait.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wan.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wan_restart_ist.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wan_restart_sst.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_zero_length_column.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/lp1276424.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/lp1347768.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/lp1438990.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/lp959512.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#110.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#198.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#201.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#216.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#237.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#247.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#31.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#33.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#90.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/GAL-382.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-252.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-258.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-259.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-44-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-44.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/disabled.def [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_account_management.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_alter_engine_innodb.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_alter_engine_myisam.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_alter_table_force.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_autoinc.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_autoinc.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_gtid.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_gtid.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_nonprim.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_nonprim.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_preordered.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_preordered.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_for_update.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_sleep.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_cache_size.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_checksum.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_row_image.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_function.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_procedure.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_table_like.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_trigger.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_defaults.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_delete_limit.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_drop_multi.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_enum.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_events.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_cascade_delete.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_cascade_update.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_conflict.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_mismatch.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_multicolumn.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_multitable.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_no_pk.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_selfreferential.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_setnull.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush_local.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush_local.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_forced_binlog_format-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_forced_binlog_format.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ftwrl.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ftwrl_drain.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fulltext.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fc_limit.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fragment.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fragment.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_max_packet_size.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gra_log.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gtid-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gtid.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_insert_ignore.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_insert_multi.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_mysqldump.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_recv_bind.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_restart_joiner.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_rsync.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_rsync.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_applier.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_ddl.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_largechanges.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_nochanges.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_smallchanges.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_lock_table.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_bin-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_bin.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_output_csv-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_output_csv.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_columns.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_indexes.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_rows.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_tables_nopk.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_tables_pk.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_mdl_race.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_migrate.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_migrate.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_multi_database.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_myisam_autocommit.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_myisam_transactions.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_bit.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_blob.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_large_varchar.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_unicode.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_simple.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_pc_ignore_sb.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_pk_bigint_signed.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_prepared_statement.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_read_only.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_repl_max_ws_size.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_restart_nochanges.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_add_pk.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_drop_pk.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_error.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_simple.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sbr.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sbr_binlog.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_schema_dirty_reads.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_serializable.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_split_brain.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_compression.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_compression.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_upgrade.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_rsync.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_rsync.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_status_cluster.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_status_local_index.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_status_local_state.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_suspend_slave.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sync_wait_show.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_error.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_locking.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ftwrl.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_lock_exclusive.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_lock_shared.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_transaction_read_only.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_transaction_replay.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_truncate.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_truncate_temporary.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_udf-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_unicode_identifiers.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_unicode_pk.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_update_limit.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_v1_row_events-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_v1_row_events.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_OSU_method.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_OSU_method2.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_cluster_address.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_desync_on.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_dirty_reads.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_fkchecks.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_load_data_splitting.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_log_bin.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_log_bin.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_max_ws_size.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_node_address.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_node_address.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_notify_cmd.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_reject_queries.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_slave_threads.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_sync_wait.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_ist.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_sst.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_zero_length_column.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/lp1276424.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/lp1347768.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/lp1438990.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/lp959512.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#110.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#198.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#201.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#216.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#237.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#247.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#31.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#33.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#33.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#90.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/galera_3nodes.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/my.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_garbd.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_pc_bootstrap.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_slave_options_do.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_slave_options_ignore.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_var_dirty_reads2.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_garbd.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/include/import.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/alter_rename_existing.result [new file with mode: 0755]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/analyze_table.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/create-index.result
mysql-wsrep-5.6/mysql-test/suite/innodb/r/create_isl_with_direct.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/dropdb.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/import.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter-debug.result
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter.result
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-autoinc.result
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-index-debug.result
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-lock-inherit-read_commited.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_autoinc_reset.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_file_limit_check.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_force_recovery.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_monitor.result [deleted file]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/strict_checksum.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/tmpdir.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/r/xa_recovery.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/alter_rename_existing.test [new file with mode: 0755]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/analyze_table.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/create-index.test
mysql-wsrep-5.6/mysql-test/suite/innodb/t/create_isl_with_direct-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/create_isl_with_direct.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/dropdb.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/galera.skip [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/import.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-alter-debug.test
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-alter.test
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-autoinc.test
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-index-debug-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-index-debug.test
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-lock-inherit-read_commited.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_autoinc_reset.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60229-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60229.test
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_file_limit_check-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_file_limit_check.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_force_recovery.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_monitor.test [deleted file]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/strict_checksum.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/tmpdir.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb/t/xa_recovery.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility.result
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility_win.result
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fulltext.result
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fulltext_misc.result
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/phrase.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/sync.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/sync_block.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility.test
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility_win.test
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fulltext_misc.test
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/phrase.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/sync.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/sync_block.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/include/innodb_stress.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_blob.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_blob_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash_blob.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash_blob_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_blob.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_blob_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash_blob.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash_blob_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_blob.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_blob_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash_blob.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash_blob_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_nocompress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/Readme [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_nocompress-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_nocompress-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_nocompress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/load_generator.py [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/innodb_zip/r/innodb_16k.result
mysql-wsrep-5.6/mysql-test/suite/innodb_zip/r/innodb_wl6347_comp_indx_stat.result
mysql-wsrep-5.6/mysql-test/suite/innodb_zip/t/innodb_16k.test
mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_sjis-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_sjis.test
mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_ucs2.test
mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_ujis-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_ujis.test
mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_utf8-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_utf8.test
mysql-wsrep-5.6/mysql-test/suite/large_tests/r/alter_table.result
mysql-wsrep-5.6/mysql-test/suite/large_tests/t/alter_table.test
mysql-wsrep-5.6/mysql-test/suite/ndb/r/ndb_restore_discover.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/ndb/t/ndb_restart_nostart.inc
mysql-wsrep-5.6/mysql-test/suite/ndb/t/ndb_restart_start.inc
mysql-wsrep-5.6/mysql-test/suite/ndb/t/ndb_restore_discover.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/ndb_binlog/t/ndb_binlog_restore-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/ndb_binlog/t/ndb_binlog_restore.test
mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/range_no_prot.result
mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/range_ps_prot.result
mysql-wsrep-5.6/mysql-test/suite/opt_trace/t/disabled.def [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_alter4_innodb.result
mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_alter4_myisam.result
mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_10.result
mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_special_innodb.result
mysql-wsrep-5.6/mysql-test/suite/parts/t/partition_exch_qa_10.test
mysql-wsrep-5.6/mysql-test/suite/parts/t/partition_special_innodb.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/include/connection_setup.inc
mysql-wsrep-5.6/mysql-test/suite/perfschema/include/digest_setup.inc
mysql-wsrep-5.6/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
mysql-wsrep-5.6/mysql-test/suite/perfschema/include/sizing_auto.inc
mysql-wsrep-5.6/mysql-test/suite/perfschema/include/socket_event.inc
mysql-wsrep-5.6/mysql-test/suite/perfschema/include/stage_setup.inc
mysql-wsrep-5.6/mysql-test/suite/perfschema/include/start_server_common.inc
mysql-wsrep-5.6/mysql-test/suite/perfschema/include/table_aggregate_load.inc
mysql-wsrep-5.6/mysql-test/suite/perfschema/include/table_aggregate_setup.inc
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/digest_null_literal.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/digest_table_full.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/dml_setup_instruments.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/global_read_lock.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/misc.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/ortho_iter.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/privilege_table_io.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/query_cache.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/rpl_gtid_func.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/rpl_statements.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/sizing_default.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/sizing_high.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/sizing_low.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/sizing_med.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/sizing_off.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_disable_idle.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_disable_stages.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_disable_statements.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_disable_waits.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_innodb.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_low_digest.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_account.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_file_class.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_host.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_user.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_nothing.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_off.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_on.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/statement_digest.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/statement_digest_consumers.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/statement_digest_long_query.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_off.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_name.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/threads_mysql.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/unary_digest.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/r/view_table_io.result
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/digest_null_literal.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/disabled.def
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/dml_setup_instruments.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/global_read_lock.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/misc.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/nesting.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/ortho_iter.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/privilege_table_io.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/query_cache.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/rpl_gtid_func.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/rpl_statements.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/sizing_low.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/sizing_off.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_low_digest-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_low_digest.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/statement_digest_long_query.test
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/table_name.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/perfschema/t/unary_digest.test
mysql-wsrep-5.6/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_apply_binlog_with_anonymous_gtid.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_apply_binlog_with_anonymous_gtid_when_gtid_mode_on.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_apply_binlog_with_gtid_when_gtid_mode_off.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_avoid_temporal_upgrade.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_binlog_errors.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_binlog_failed_drop_table.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug33931.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_crc_check.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_db_fail.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_temp_tbl_with_rewrite_db.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_dump_thread_kill.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_empty_multi_update.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_events.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_warnings.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gap_in_retrieved_gtid_set.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_group_commit_deadlock.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_binlog_errors.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_empty_group.result [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode_off_new_master.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode_on_new_master.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_replay_relaylog.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_temp_table.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_transaction_split_across_relay_logs.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_killed_ddl.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_low_slave_net_time_out.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_missing_data_on_slave.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_stop_slave.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_change_master.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_worker_error.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_log_recovery_positions.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_USER.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_merge_engine.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_uuid.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp_privileges.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_special_charset.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_ignore.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_rollback_to_savepoint.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stop_slave_threads_error.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary_error_table_repository.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_unsafe_statements.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/disabled.def
mysql-wsrep-5.6/mysql-test/suite/rpl/t/mysql-wsrep#110-2.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_apply_binlog_with_anonymous_gtid.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_apply_binlog_with_anonymous_gtid_when_gtid_mode_on.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_apply_binlog_with_gtid_when_gtid_mode_off.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_autogen_query_multi_byte_char.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_avoid_temporal_upgrade.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_failed_drop_table-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_failed_drop_table.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug33931.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_crc_check-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_crc_check.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_db_filter-slave.opt
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_db_filter.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_sensitive-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_sensitive-slave.opt
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_sensitive.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_db_fail.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_tbl_with_rewrite_db-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_tbl_with_rewrite_db.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_dump_thread_kill.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_empty_multi_update.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_events.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_warnings.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gap_in_retrieved_gtid_set.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_group_commit_deadlock.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-slave.opt
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_group-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_group-slave.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_group.test [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-slave.opt
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode_off_new_master.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode_on_new_master.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off-master.opt [moved from mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_parallel-master.opt with 100% similarity]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_parallel-slave.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_replay_relaylog.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_temp_table.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_transaction_split_across_relay_logs.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_transaction_split_across_relay_logs.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_sensitive-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_sensitive-slave.opt
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_sensitive.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_killed_ddl.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_low_slave_net_time_out.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_missing_data_on_slave.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_missing_data_on_slave.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_stop_slave-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_stop_slave.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-slave.opt [deleted file]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_change_master.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_worker_error-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_worker_error.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_read_old_relay_log_info.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_relay_log_recovery_positions.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_USER.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_merge_engine.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_group_commit_deadlock.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_non_group_commit_deadlock.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.cnf
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp_privileges.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_special_charset-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_special_charset-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_special_charset.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_ignore-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_ignore.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mix_rollback_to_savepoint.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stop_slave_threads_error-slave.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stop_slave_threads_error.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary_error_table_repository.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_unsafe_statements.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/all_vars.result
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/avoid_temporal_upgrade_basic.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/character_set_connection_func.result
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/max_digest_length_basic.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/show_old_temporals_basic.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result [moved from mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result with 88% similarity]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result [deleted file]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result [moved from mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result with 89% similarity]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result [deleted file]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/all_vars.test
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/avoid_temporal_upgrade_basic.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/disabled.def
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_page_size_basic.test
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/max_digest_length_basic-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/max_digest_length_basic.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/show_old_temporals_basic.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test [moved from mysql-wsrep-5.6/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc with 93% similarity]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test [deleted file]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test [deleted file]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test [moved from mysql-wsrep-5.6/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc with 94% similarity]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test [deleted file]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test [deleted file]
mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/wsrep/my.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/alter_table.test
mysql-wsrep-5.6/mysql-test/t/audit_plugin.test
mysql-wsrep-5.6/mysql-test/t/auth_rpl.test
mysql-wsrep-5.6/mysql-test/t/connect_debug.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/ctype_utf8.test
mysql-wsrep-5.6/mysql-test/t/disabled.def
mysql-wsrep-5.6/mysql-test/t/enable_cleartext_plugin-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/enable_cleartext_plugin.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/events_1.test
mysql-wsrep-5.6/mysql-test/t/explain.test
mysql-wsrep-5.6/mysql-test/t/func_gconcat.test
mysql-wsrep-5.6/mysql-test/t/func_str.test
mysql-wsrep-5.6/mysql-test/t/func_str_debug.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/func_str_no_ps.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/grant.test
mysql-wsrep-5.6/mysql-test/t/group_min_max.test
mysql-wsrep-5.6/mysql-test/t/having.test
mysql-wsrep-5.6/mysql-test/t/insert.test
mysql-wsrep-5.6/mysql-test/t/loadxml.test
mysql-wsrep-5.6/mysql-test/t/log_empty_name.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/log_empty_name.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/lowercase_fs_on.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/lowercase_table3-master.opt [deleted file]
mysql-wsrep-5.6/mysql-test/t/lowercase_table3.test [deleted file]
mysql-wsrep-5.6/mysql-test/t/lowercase_table4.test
mysql-wsrep-5.6/mysql-test/t/mdl_sync.test
mysql-wsrep-5.6/mysql-test/t/myisam_recover-master.opt [moved from mysql-wsrep-5.6/mysql-test/t/merge_recover-master.opt with 100% similarity]
mysql-wsrep-5.6/mysql-test/t/myisam_recover.test [moved from mysql-wsrep-5.6/mysql-test/t/merge_recover.test with 58% similarity]
mysql-wsrep-5.6/mysql-test/t/myisam_row_rpl-master.opt
mysql-wsrep-5.6/mysql-test/t/myisam_row_rpl-slave.opt
mysql-wsrep-5.6/mysql-test/t/myisam_row_rpl.test
mysql-wsrep-5.6/mysql-test/t/mysql_upgrade.test
mysql-wsrep-5.6/mysql-test/t/mysqldump.test
mysql-wsrep-5.6/mysql-test/t/mysqltest.test
mysql-wsrep-5.6/mysql-test/t/not_embedded_server.test
mysql-wsrep-5.6/mysql-test/t/partition_error.test
mysql-wsrep-5.6/mysql-test/t/partition_innodb.test
mysql-wsrep-5.6/mysql-test/t/partition_key_cache.test
mysql-wsrep-5.6/mysql-test/t/partition_mgm_err.test
mysql-wsrep-5.6/mysql-test/t/partition_open_files_limit.test
mysql-wsrep-5.6/mysql-test/t/rewrite_general_log.test
mysql-wsrep-5.6/mysql-test/t/sp-threads.test
mysql-wsrep-5.6/mysql-test/t/sp.test
mysql-wsrep-5.6/mysql-test/t/ssl_mode.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/ssl_mode_no_ssl-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/ssl_mode_no_ssl.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/status_debug.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/t/table_open_cache_functionality.test
mysql-wsrep-5.6/mysql-test/t/trigger-trans.test
mysql-wsrep-5.6/mysql-test/t/update.test
mysql-wsrep-5.6/mysql-test/t/validate_password_plugin.test
mysql-wsrep-5.6/mysql-test/t/variables-big.test
mysql-wsrep-5.6/mysql-test/t/view.test
mysql-wsrep-5.6/mysql-test/t/wl6443_deprecation.test
mysql-wsrep-5.6/mysql-test/t/xml.test
mysql-wsrep-5.6/mysql-test/valgrind.supp
mysql-wsrep-5.6/mysys/CMakeLists.txt
mysql-wsrep-5.6/mysys/base64.c
mysql-wsrep-5.6/mysys/lf_hash.c
mysql-wsrep-5.6/mysys/mf_iocache.c
mysql-wsrep-5.6/mysys/mf_loadpath.c
mysql-wsrep-5.6/mysys/my_init.c
mysql-wsrep-5.6/mysys/my_isnan.c [deleted file]
mysql-wsrep-5.6/mysys/my_sync.c
mysql-wsrep-5.6/mysys/my_wincond.c
mysql-wsrep-5.6/mysys/psi_noop.c
mysql-wsrep-5.6/mysys/thr_lock.c
mysql-wsrep-5.6/mysys/waiting_threads.c
mysql-wsrep-5.6/mysys_ssl/my_default.cc
mysql-wsrep-5.6/mysys_ssl/my_getopt.cc
mysql-wsrep-5.6/mysys_ssl/my_md5.cc
mysql-wsrep-5.6/packaging/WiX/CMakeLists.txt
mysql-wsrep-5.6/packaging/WiX/CPackWixConfig.cmake
mysql-wsrep-5.6/packaging/WiX/ca/CMakeLists.txt
mysql-wsrep-5.6/packaging/WiX/create_msi.cmake.in
mysql-wsrep-5.6/packaging/WiX/custom_ui.wxs
mysql-wsrep-5.6/packaging/WiX/extra.wxs.in
mysql-wsrep-5.6/packaging/WiX/mysql_server.wxs.in
mysql-wsrep-5.6/packaging/WiX/mysql_server_extra.wxs.in
mysql-wsrep-5.6/packaging/deb-jessie/changelog [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/compat [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/control [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/copyright [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/extra/my.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/extra/mysql-systemd-start [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/extra/mysql_embedded.1 [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient-dev.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient-dev.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient18.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient18.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/libmysqld-dev.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/libmysqld-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-client.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-common.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-common.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-common.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-bench.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-bench.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-bench.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-client.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.config [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.mysql.init [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.mysql.service [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.postinst [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.postrm [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.preinst [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.prerm [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.templates [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-source.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-source.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.links [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-server.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-testsuite.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/mysql-testsuite.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/patches/fix-man-page-links.patch [moved from debian/patches/fix-man-page-links.patch with 87% similarity]
mysql-wsrep-5.6/packaging/deb-jessie/patches/fix-mtr-search-paths.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/patches/fix-mysql_install_db.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/patches/series [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/rules [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-jessie/source/format [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/source/include-binaries [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/source/lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-jessie/watch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/changelog
mysql-wsrep-5.6/packaging/deb-precise/compat
mysql-wsrep-5.6/packaging/deb-precise/control
mysql-wsrep-5.6/packaging/deb-precise/extra/apparmor-profile
mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient18.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/libmysqld-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/mysql-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/mysql-common.install
mysql-wsrep-5.6/packaging/deb-precise/mysql-common.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-bench.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.config [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.install
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.mysql.init
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.postinst [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.postrm [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.preinst [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.prerm [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.templates
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-source.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.dirs
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.install
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.links
mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/mysql-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/mysql-testsuite.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/patches/fix-mtr-search-paths.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-precise/patches/fix-mysql_install_db.patch
mysql-wsrep-5.6/packaging/deb-precise/patches/series
mysql-wsrep-5.6/packaging/deb-precise/rules
mysql-wsrep-5.6/packaging/deb-precise/source/include-binaries
mysql-wsrep-5.6/packaging/deb-trusty/changelog
mysql-wsrep-5.6/packaging/deb-trusty/compat
mysql-wsrep-5.6/packaging/deb-trusty/control
mysql-wsrep-5.6/packaging/deb-trusty/extra/apparmor-profile
mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient18.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/libmysqld-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.install
mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-bench.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.config [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.install
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.mysql.init
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.postinst [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.postrm [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.preinst [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.prerm [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.templates
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-source.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.install
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.links
mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/mysql-testsuite.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-mtr-search-paths.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-mysql_install_db.patch
mysql-wsrep-5.6/packaging/deb-trusty/patches/series
mysql-wsrep-5.6/packaging/deb-trusty/rules
mysql-wsrep-5.6/packaging/deb-trusty/source/include-binaries
mysql-wsrep-5.6/packaging/deb-utopic/changelog [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/compat [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/control [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/copyright [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/extra/apparmor-profile [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/extra/my.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/extra/mysql_embedded.1 [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient-dev.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient18.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient18.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/libmysqld-dev.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/libmysqld-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-client.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-common.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-common.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-common.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-bench.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-bench.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-client.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.config [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.mysql.init [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.postinst [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.postrm [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.preinst [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.prerm [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.templates [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-source.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-source.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-test.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-test.links [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-test.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-server.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-testsuite.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/mysql-testsuite.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/patches/fix-man-page-links.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/patches/fix-mtr-search-paths.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/patches/fix-mysql_install_db.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/patches/series [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/rules [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-utopic/source/format [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/source/include-binaries [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-utopic/watch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/changelog [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/compat [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/control [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/copyright [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/extra/apparmor-profile [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/extra/my.cnf.fallback [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql-systemd-start [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql.conf.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql_embedded.1 [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/extra/mysqld.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient-dev.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient18.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient18.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/libmysqld-dev.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/libmysqld-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-client.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.postinst [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.postrm [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-bench.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-bench.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-client.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.config [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.mysql.init [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.mysql.service [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.postinst [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.postrm [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.preinst [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.prerm [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.templates [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-source.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-source.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-test.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-test.links [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-test.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-server.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-testsuite.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/mysql-testsuite.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/patches/fix-man-page-links.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/patches/fix-mtr-search-paths.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/patches/fix-mysql_install_db.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/patches/series [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/rules [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-vivid/source/format [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/source/include-binaries [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-vivid/watch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/changelog
mysql-wsrep-5.6/packaging/deb-wheezy/compat
mysql-wsrep-5.6/packaging/deb-wheezy/control
mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient18.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/libmysqld-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.install
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-bench.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.config [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.install
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.mysql.init
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.postinst [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.postrm [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.preinst [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.prerm [changed mode: 0644->0755]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.templates
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-source.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.dirs
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.install
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.links
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/mysql-testsuite.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-mtr-search-paths.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-mysql_install_db.patch
mysql-wsrep-5.6/packaging/deb-wheezy/patches/series
mysql-wsrep-5.6/packaging/deb-wheezy/rules
mysql-wsrep-5.6/packaging/deb-wheezy/source/include-binaries
mysql-wsrep-5.6/packaging/deb-wheezy/source/lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/changelog [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/compat [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/control [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/copyright [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/extra/apparmor-profile [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/extra/my.cnf.fallback [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/extra/mysql-systemd-start [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/extra/mysql.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/extra/mysql.conf.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/extra/mysql_embedded.1 [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/extra/mysqld.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient-dev.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient18.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient18.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/libmysqld-dev.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/libmysqld-dev.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-client.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-common.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-common.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-common.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-common.postinst [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-common.postrm [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-bench.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-bench.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-client.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-client.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.config [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.dirs [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.mysql.init [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.mysql.service [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.postinst [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.postrm [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.preinst [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.prerm [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.templates [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-source.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-source.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-test.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-test.links [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-community-test.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-server.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-server.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-testsuite.install [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/mysql-testsuite.lintian-overrides [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/patches/fix-man-page-links.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/patches/fix-mtr-search-paths.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/patches/fix-mysql_install_db.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/patches/series [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/rules [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-wily/source/format [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/source/include-binaries [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-wily/watch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/rpm-docker/CMakeLists.txt [moved from mysql-wsrep-5.6/packaging/rpm-uln/CMakeLists.txt with 51% similarity]
mysql-wsrep-5.6/packaging/rpm-docker/my.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/rpm-docker/mysql.spec.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6.14-mysql-install.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-fedora/mysql-embedded-check.c [deleted file]
mysql-wsrep-5.6/packaging/rpm-fedora/mysql-systemd-start
mysql-wsrep-5.6/packaging/rpm-fedora/mysql.spec.in
mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5.5-libmysqlclient-symbols.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5096-charset-dir.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5172-charset-dir.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5173-charset-dir.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5545-charset-dir.patch [new file with mode: 0644]
mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6.14-mysql-install.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-oel/mysql-embedded-check.c [deleted file]
mysql-wsrep-5.6/packaging/rpm-oel/mysql-systemd-start
mysql-wsrep-5.6/packaging/rpm-oel/mysql.init
mysql-wsrep-5.6/packaging/rpm-oel/mysql.spec.in
mysql-wsrep-5.6/packaging/rpm-sles/mysql-systemd-start
mysql-wsrep-5.6/packaging/rpm-sles/mysql.conf
mysql-wsrep-5.6/packaging/rpm-sles/mysql.init
mysql-wsrep-5.6/packaging/rpm-sles/mysql.spec.in
mysql-wsrep-5.6/packaging/rpm-uln/README-ULN [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/README.mysql-docs [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/filter-requires-mysql.sh [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/generate-tarball.sh [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/my.cnf [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/my_config.h [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-fix-tests.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-libdir.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-mtr1.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-testing.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql-chain-certs.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql-embedded-check.c [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql-expired-certs.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql-install-test.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql-strmov.patch [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql.init [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/mysql.spec.sh [deleted file]
mysql-wsrep-5.6/packaging/rpm-uln/scriptstub.c [deleted file]
mysql-wsrep-5.6/plugin/auth/CMakeLists.txt
mysql-wsrep-5.6/plugin/auth/mysql_no_login.c [new file with mode: 0644]
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/.gitignore [deleted file]
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/config.h [new file with mode: 0644]
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached.c
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/include/memcached/util.h
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/t/binary-sasl.t [new file with mode: 0644]
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/utilities/util.c
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/.gitignore [deleted file]
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/cache-src/default_engine.c
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/config.h [new file with mode: 0644]
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/include/handler_api.h
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/include/innodb_api.h
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/include/innodb_cb_api.h
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/include/innodb_engine.h
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/handler_api.cc
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_api.c
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_engine_private.h
mysql-wsrep-5.6/plugin/password_validation/validate_password.cc
mysql-wsrep-5.6/plugin/semisync/semisync_master.cc
mysql-wsrep-5.6/plugin/semisync/semisync_master.h
mysql-wsrep-5.6/regex/main.c
mysql-wsrep-5.6/regex/regcomp.c
mysql-wsrep-5.6/scripts/CMakeLists.txt
mysql-wsrep-5.6/scripts/fill_help_tables.sql
mysql-wsrep-5.6/scripts/mysql_config.sh
mysql-wsrep-5.6/scripts/mysqld_safe.sh
mysql-wsrep-5.6/scripts/wsrep_sst_common.sh [new file with mode: 0644]
mysql-wsrep-5.6/scripts/wsrep_sst_mysqldump.sh [new file with mode: 0644]
mysql-wsrep-5.6/scripts/wsrep_sst_rsync.sh [new file with mode: 0644]
mysql-wsrep-5.6/scripts/wsrep_sst_xtrabackup-v2.sh [new file with mode: 0644]
mysql-wsrep-5.6/scripts/wsrep_sst_xtrabackup.sh [new file with mode: 0644]
mysql-wsrep-5.6/sql-bench/limits/access_odbc.cfg
mysql-wsrep-5.6/sql-common/client.c
mysql-wsrep-5.6/sql/CMakeLists.txt
mysql-wsrep-5.6/sql/binlog.cc
mysql-wsrep-5.6/sql/binlog.h
mysql-wsrep-5.6/sql/event_data_objects.cc
mysql-wsrep-5.6/sql/event_db_repository.cc
mysql-wsrep-5.6/sql/event_scheduler.cc
mysql-wsrep-5.6/sql/events.cc
mysql-wsrep-5.6/sql/field.h
mysql-wsrep-5.6/sql/field_conv.cc
mysql-wsrep-5.6/sql/filesort.cc
mysql-wsrep-5.6/sql/gcalc_tools.cc
mysql-wsrep-5.6/sql/gen_lex_token.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/ha_ndbcluster.cc
mysql-wsrep-5.6/sql/ha_ndbcluster_binlog.cc
mysql-wsrep-5.6/sql/ha_partition.cc
mysql-wsrep-5.6/sql/ha_partition.h
mysql-wsrep-5.6/sql/handler.cc
mysql-wsrep-5.6/sql/handler.h
mysql-wsrep-5.6/sql/hostname.cc
mysql-wsrep-5.6/sql/item.cc
mysql-wsrep-5.6/sql/item.h
mysql-wsrep-5.6/sql/item_cmpfunc.cc
mysql-wsrep-5.6/sql/item_cmpfunc.h
mysql-wsrep-5.6/sql/item_func.cc
mysql-wsrep-5.6/sql/item_func.h
mysql-wsrep-5.6/sql/item_geofunc.h
mysql-wsrep-5.6/sql/item_strfunc.cc
mysql-wsrep-5.6/sql/item_strfunc.h
mysql-wsrep-5.6/sql/item_subselect.cc
mysql-wsrep-5.6/sql/item_sum.cc
mysql-wsrep-5.6/sql/item_sum.h
mysql-wsrep-5.6/sql/item_xmlfunc.cc
mysql-wsrep-5.6/sql/lock.cc
mysql-wsrep-5.6/sql/log.cc
mysql-wsrep-5.6/sql/log.h
mysql-wsrep-5.6/sql/log_event.cc
mysql-wsrep-5.6/sql/log_event.h
mysql-wsrep-5.6/sql/log_event_old.cc
mysql-wsrep-5.6/sql/mdl.cc
mysql-wsrep-5.6/sql/mdl.h
mysql-wsrep-5.6/sql/message.h
mysql-wsrep-5.6/sql/message.rc
mysql-wsrep-5.6/sql/mysqld.cc
mysql-wsrep-5.6/sql/mysqld.h
mysql-wsrep-5.6/sql/opt_range.cc
mysql-wsrep-5.6/sql/partition_info.cc
mysql-wsrep-5.6/sql/partition_info.h
mysql-wsrep-5.6/sql/protocol.cc
mysql-wsrep-5.6/sql/protocol.h
mysql-wsrep-5.6/sql/records.cc
mysql-wsrep-5.6/sql/rpl_gtid.h
mysql-wsrep-5.6/sql/rpl_gtid_cache.cc
mysql-wsrep-5.6/sql/rpl_gtid_set.cc
mysql-wsrep-5.6/sql/rpl_info_factory.cc
mysql-wsrep-5.6/sql/rpl_master.cc
mysql-wsrep-5.6/sql/rpl_rli.cc
mysql-wsrep-5.6/sql/rpl_rli.h
mysql-wsrep-5.6/sql/rpl_rli_pdb.cc
mysql-wsrep-5.6/sql/rpl_rli_pdb.h
mysql-wsrep-5.6/sql/rpl_slave.cc
mysql-wsrep-5.6/sql/scheduler.cc
mysql-wsrep-5.6/sql/set_var.h
mysql-wsrep-5.6/sql/share/errmsg-utf8.txt
mysql-wsrep-5.6/sql/sp.cc
mysql-wsrep-5.6/sql/sp_head.cc
mysql-wsrep-5.6/sql/sp_instr.cc
mysql-wsrep-5.6/sql/sp_instr.h
mysql-wsrep-5.6/sql/sql_acl.cc
mysql-wsrep-5.6/sql/sql_admin.cc
mysql-wsrep-5.6/sql/sql_alter.cc
mysql-wsrep-5.6/sql/sql_alter.h
mysql-wsrep-5.6/sql/sql_audit.cc
mysql-wsrep-5.6/sql/sql_audit.h
mysql-wsrep-5.6/sql/sql_base.cc
mysql-wsrep-5.6/sql/sql_binlog.cc
mysql-wsrep-5.6/sql/sql_builtin.cc.in
mysql-wsrep-5.6/sql/sql_cache.cc
mysql-wsrep-5.6/sql/sql_class.cc
mysql-wsrep-5.6/sql/sql_class.h
mysql-wsrep-5.6/sql/sql_connect.cc
mysql-wsrep-5.6/sql/sql_cursor.cc
mysql-wsrep-5.6/sql/sql_delete.cc
mysql-wsrep-5.6/sql/sql_digest.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/sql_digest.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/sql_digest_stream.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/sql_executor.cc
mysql-wsrep-5.6/sql/sql_handler.cc
mysql-wsrep-5.6/sql/sql_handler.h
mysql-wsrep-5.6/sql/sql_insert.cc
mysql-wsrep-5.6/sql/sql_lex.cc
mysql-wsrep-5.6/sql/sql_lex.h
mysql-wsrep-5.6/sql/sql_load.cc
mysql-wsrep-5.6/sql/sql_optimizer.cc
mysql-wsrep-5.6/sql/sql_optimizer.h
mysql-wsrep-5.6/sql/sql_parse.cc
mysql-wsrep-5.6/sql/sql_parse.h
mysql-wsrep-5.6/sql/sql_partition.cc
mysql-wsrep-5.6/sql/sql_partition.h
mysql-wsrep-5.6/sql/sql_partition_admin.cc
mysql-wsrep-5.6/sql/sql_planner.cc
mysql-wsrep-5.6/sql/sql_plugin.cc
mysql-wsrep-5.6/sql/sql_prepare.cc
mysql-wsrep-5.6/sql/sql_reload.cc
mysql-wsrep-5.6/sql/sql_resolver.cc
mysql-wsrep-5.6/sql/sql_select.cc
mysql-wsrep-5.6/sql/sql_show.cc
mysql-wsrep-5.6/sql/sql_show.h
mysql-wsrep-5.6/sql/sql_signal.cc
mysql-wsrep-5.6/sql/sql_string.cc
mysql-wsrep-5.6/sql/sql_string.h
mysql-wsrep-5.6/sql/sql_table.cc
mysql-wsrep-5.6/sql/sql_tmp_table.cc
mysql-wsrep-5.6/sql/sql_trigger.cc
mysql-wsrep-5.6/sql/sql_truncate.cc
mysql-wsrep-5.6/sql/sql_update.cc
mysql-wsrep-5.6/sql/sql_view.cc
mysql-wsrep-5.6/sql/sql_yacc.cc [deleted file]
mysql-wsrep-5.6/sql/sql_yacc.h [deleted file]
mysql-wsrep-5.6/sql/sql_yacc.yy
mysql-wsrep-5.6/sql/sys_vars.cc
mysql-wsrep-5.6/sql/table.cc
mysql-wsrep-5.6/sql/table.h
mysql-wsrep-5.6/sql/transaction.cc
mysql-wsrep-5.6/sql/unireg.cc
mysql-wsrep-5.6/sql/wsrep_applier.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_applier.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_binlog.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_binlog.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_check_opts.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_hton.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_mysqld.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_mysqld.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_notify.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_priv.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_sst.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_sst.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_thd.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_thd.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_utils.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_utils.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_var.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_var.h [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_xid.cc [new file with mode: 0644]
mysql-wsrep-5.6/sql/wsrep_xid.h [new file with mode: 0644]
mysql-wsrep-5.6/storage/federated/ha_federated.cc
mysql-wsrep-5.6/storage/innobase/CMakeLists.txt
mysql-wsrep-5.6/storage/innobase/api/api0api.cc
mysql-wsrep-5.6/storage/innobase/btr/btr0btr.cc
mysql-wsrep-5.6/storage/innobase/btr/btr0cur.cc
mysql-wsrep-5.6/storage/innobase/buf/buf0buf.cc
mysql-wsrep-5.6/storage/innobase/buf/buf0checksum.cc
mysql-wsrep-5.6/storage/innobase/buf/buf0dump.cc
mysql-wsrep-5.6/storage/innobase/buf/buf0flu.cc
mysql-wsrep-5.6/storage/innobase/dict/dict0dict.cc
mysql-wsrep-5.6/storage/innobase/dict/dict0mem.cc
mysql-wsrep-5.6/storage/innobase/dict/dict0stats.cc
mysql-wsrep-5.6/storage/innobase/fil/fil0fil.cc
mysql-wsrep-5.6/storage/innobase/fsp/fsp0fsp.cc
mysql-wsrep-5.6/storage/innobase/fts/fts0fts.cc
mysql-wsrep-5.6/storage/innobase/fts/fts0opt.cc
mysql-wsrep-5.6/storage/innobase/fts/fts0que.cc
mysql-wsrep-5.6/storage/innobase/handler/ha_innodb.cc
mysql-wsrep-5.6/storage/innobase/handler/ha_innodb.h
mysql-wsrep-5.6/storage/innobase/handler/handler0alter.cc
mysql-wsrep-5.6/storage/innobase/handler/i_s.cc
mysql-wsrep-5.6/storage/innobase/include/api0api.h
mysql-wsrep-5.6/storage/innobase/include/dict0dict.h
mysql-wsrep-5.6/storage/innobase/include/dict0dict.ic
mysql-wsrep-5.6/storage/innobase/include/dict0mem.h
mysql-wsrep-5.6/storage/innobase/include/fil0fil.h
mysql-wsrep-5.6/storage/innobase/include/fts0fts.h
mysql-wsrep-5.6/storage/innobase/include/fts0types.h
mysql-wsrep-5.6/storage/innobase/include/ha_prototypes.h
mysql-wsrep-5.6/storage/innobase/include/hash0hash.h
mysql-wsrep-5.6/storage/innobase/include/ibuf0ibuf.ic
mysql-wsrep-5.6/storage/innobase/include/lock0lock.h
mysql-wsrep-5.6/storage/innobase/include/os0file.h
mysql-wsrep-5.6/storage/innobase/include/os0sync.h
mysql-wsrep-5.6/storage/innobase/include/page0page.h
mysql-wsrep-5.6/storage/innobase/include/rem0rec.h
mysql-wsrep-5.6/storage/innobase/include/row0log.h
mysql-wsrep-5.6/storage/innobase/include/row0merge.h
mysql-wsrep-5.6/storage/innobase/include/row0purge.h
mysql-wsrep-5.6/storage/innobase/include/srv0srv.h
mysql-wsrep-5.6/storage/innobase/include/sync0sync.h
mysql-wsrep-5.6/storage/innobase/include/sync0sync.ic
mysql-wsrep-5.6/storage/innobase/include/trx0sys.h
mysql-wsrep-5.6/storage/innobase/include/trx0sys.ic
mysql-wsrep-5.6/storage/innobase/include/trx0trx.h
mysql-wsrep-5.6/storage/innobase/lock/lock0lock.cc
mysql-wsrep-5.6/storage/innobase/lock/lock0wait.cc
mysql-wsrep-5.6/storage/innobase/log/log0log.cc
mysql-wsrep-5.6/storage/innobase/log/log0recv.cc
mysql-wsrep-5.6/storage/innobase/os/os0file.cc
mysql-wsrep-5.6/storage/innobase/os/os0sync.cc
mysql-wsrep-5.6/storage/innobase/page/page0page.cc
mysql-wsrep-5.6/storage/innobase/page/page0zip.cc
mysql-wsrep-5.6/storage/innobase/que/que0que.cc
mysql-wsrep-5.6/storage/innobase/rem/rem0rec.cc
mysql-wsrep-5.6/storage/innobase/row/row0ftsort.cc
mysql-wsrep-5.6/storage/innobase/row/row0import.cc
mysql-wsrep-5.6/storage/innobase/row/row0ins.cc
mysql-wsrep-5.6/storage/innobase/row/row0log.cc
mysql-wsrep-5.6/storage/innobase/row/row0merge.cc
mysql-wsrep-5.6/storage/innobase/row/row0mysql.cc
mysql-wsrep-5.6/storage/innobase/row/row0purge.cc
mysql-wsrep-5.6/storage/innobase/row/row0sel.cc
mysql-wsrep-5.6/storage/innobase/row/row0upd.cc
mysql-wsrep-5.6/storage/innobase/srv/srv0conc.cc
mysql-wsrep-5.6/storage/innobase/srv/srv0srv.cc
mysql-wsrep-5.6/storage/innobase/srv/srv0start.cc
mysql-wsrep-5.6/storage/innobase/sync/sync0arr.cc
mysql-wsrep-5.6/storage/innobase/sync/sync0sync.cc
mysql-wsrep-5.6/storage/innobase/trx/trx0roll.cc
mysql-wsrep-5.6/storage/innobase/trx/trx0sys.cc
mysql-wsrep-5.6/storage/innobase/trx/trx0trx.cc
mysql-wsrep-5.6/storage/myisam/ft_boolean_search.c
mysql-wsrep-5.6/storage/myisam/ft_parser.c
mysql-wsrep-5.6/storage/myisam/ft_update.c
mysql-wsrep-5.6/storage/myisam/mi_check.c
mysql-wsrep-5.6/storage/myisam/rt_split.c
mysql-wsrep-5.6/storage/ndb/clusterj/clusterj-test/src/main/java/regression/Bug54619.java
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/mgmapi_logevent/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_async/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_async1/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_blob/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_blob_ndbrecord/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_event/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_recattr_vs_record/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_retries/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_s_i_ndbrecord/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_scan/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_simple/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/logger/message.h
mysql-wsrep-5.6/storage/ndb/src/common/logger/message.rc
mysql-wsrep-5.6/storage/ndb/src/common/mgmcommon/printConfig/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/transporter/basictest/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/transporter/failoverSCI/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/transporter/perftest/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/prioSCI/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/prioSHM/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/prioTCP/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/util/testConfigValues/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/util/testProperties/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/common/util/testSimpleProperties/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/kernel/vm/al_test/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/kernel/vm/testCopy/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/kernel/vm/testDataBuffer/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/kernel/vm/testSimplePropertiesSection/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/mgmapi/mgmapi.cpp
mysql-wsrep-5.6/storage/ndb/src/mgmapi/test/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/mgmclient/test_cpcd/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/src/mgmsrv/Config.cpp
mysql-wsrep-5.6/storage/ndb/src/mgmsrv/mkconfig/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/test/crund/Makefile [new file with mode: 0755]
mysql-wsrep-5.6/storage/ndb/test/crund/martins_little_helpers/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/test/crund/martins_little_helpers/src/utils/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/test/crund/src/crundndb/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/test/crund/src/tables_ora8.sql
mysql-wsrep-5.6/storage/ndb/test/crund/tws/tws_cpp/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/basic/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/bulk_read/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/ptr_binding/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/ndb/test/newtonapi/perf_test/Makefile [new file with mode: 0644]
mysql-wsrep-5.6/storage/perfschema/CMakeLists.txt
mysql-wsrep-5.6/storage/perfschema/pfs.cc
mysql-wsrep-5.6/storage/perfschema/pfs_account.cc
mysql-wsrep-5.6/storage/perfschema/pfs_column_types.h
mysql-wsrep-5.6/storage/perfschema/pfs_con_slice.cc
mysql-wsrep-5.6/storage/perfschema/pfs_digest.cc
mysql-wsrep-5.6/storage/perfschema/pfs_digest.h
mysql-wsrep-5.6/storage/perfschema/pfs_engine_table.cc
mysql-wsrep-5.6/storage/perfschema/pfs_events_stages.cc
mysql-wsrep-5.6/storage/perfschema/pfs_events_statements.cc
mysql-wsrep-5.6/storage/perfschema/pfs_events_statements.h
mysql-wsrep-5.6/storage/perfschema/pfs_events_waits.cc
mysql-wsrep-5.6/storage/perfschema/pfs_global.cc
mysql-wsrep-5.6/storage/perfschema/pfs_global.h
mysql-wsrep-5.6/storage/perfschema/pfs_host.cc
mysql-wsrep-5.6/storage/perfschema/pfs_instr.cc
mysql-wsrep-5.6/storage/perfschema/pfs_instr.h
mysql-wsrep-5.6/storage/perfschema/pfs_instr_class.cc
mysql-wsrep-5.6/storage/perfschema/pfs_server.cc
mysql-wsrep-5.6/storage/perfschema/pfs_server.h
mysql-wsrep-5.6/storage/perfschema/pfs_setup_actor.cc
mysql-wsrep-5.6/storage/perfschema/pfs_setup_object.cc
mysql-wsrep-5.6/storage/perfschema/pfs_timer.cc
mysql-wsrep-5.6/storage/perfschema/pfs_user.cc
mysql-wsrep-5.6/storage/perfschema/table_events_stages.cc
mysql-wsrep-5.6/storage/perfschema/table_events_statements.cc
mysql-wsrep-5.6/storage/perfschema/table_events_statements.h
mysql-wsrep-5.6/storage/perfschema/table_events_waits.cc
mysql-wsrep-5.6/storage/perfschema/table_helper.cc
mysql-wsrep-5.6/storage/perfschema/table_helper.h
mysql-wsrep-5.6/storage/perfschema/table_session_connect.cc
mysql-wsrep-5.6/storage/perfschema/unittest/CMakeLists.txt
mysql-wsrep-5.6/storage/perfschema/unittest/pfs-t.cc
mysql-wsrep-5.6/storage/perfschema/unittest/pfs_account-oom-t.cc
mysql-wsrep-5.6/storage/perfschema/unittest/pfs_host-oom-t.cc
mysql-wsrep-5.6/storage/perfschema/unittest/pfs_instr-oom-t.cc
mysql-wsrep-5.6/storage/perfschema/unittest/pfs_instr-t.cc
mysql-wsrep-5.6/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
mysql-wsrep-5.6/storage/perfschema/unittest/pfs_instr_class-t.cc
mysql-wsrep-5.6/storage/perfschema/unittest/pfs_misc-t.cc [new file with mode: 0644]
mysql-wsrep-5.6/storage/perfschema/unittest/pfs_server_stubs.cc [moved from mysql-wsrep-5.6/storage/perfschema/unittest/stub_server_misc.h with 74% similarity]
mysql-wsrep-5.6/storage/perfschema/unittest/pfs_user-oom-t.cc
mysql-wsrep-5.6/storage/perfschema/unittest/stub_pfs_global.h
mysql-wsrep-5.6/storage/perfschema/unittest/stub_print_error.h
mysql-wsrep-5.6/strings/ctype-ucs2.c
mysql-wsrep-5.6/strings/ctype-utf8.c
mysql-wsrep-5.6/strings/ctype.c
mysql-wsrep-5.6/strings/decimal.c
mysql-wsrep-5.6/support-files/CMakeLists.txt
mysql-wsrep-5.6/support-files/MacOSX/ReadMe.txt
mysql-wsrep-5.6/support-files/build-tags
mysql-wsrep-5.6/support-files/cmake-no-wix.patch [new file with mode: 0644]
mysql-wsrep-5.6/support-files/mysql-rpmlintrc [new file with mode: 0644]
mysql-wsrep-5.6/support-files/mysql.5.6.16.spec [deleted file]
mysql-wsrep-5.6/support-files/mysql.server.sh
mysql-wsrep-5.6/support-files/mysql.spec.sh
mysql-wsrep-5.6/support-files/wsrep.cnf [new file with mode: 0644]
mysql-wsrep-5.6/support-files/wsrep.cnf.sh [new file with mode: 0644]
mysql-wsrep-5.6/support-files/wsrep_notify.sh [new file with mode: 0644]
mysql-wsrep-5.6/tests/fork_big2.pl
mysql-wsrep-5.6/tests/mysql_client_test.c
mysql-wsrep-5.6/unittest/gunit/CMakeLists.txt
mysql-wsrep-5.6/unittest/gunit/debug_sync-t.cc
mysql-wsrep-5.6/unittest/gunit/my_regex-t.cc
mysql-wsrep-5.6/unittest/gunit/stdcxx-t.cc [deleted file]
mysql-wsrep-5.6/unittest/gunit/test_utils.cc
mysql-wsrep-5.6/vio/vio.c
mysql-wsrep-5.6/vio/viosocket.c
mysql-wsrep-5.6/vio/viossl.c
mysql-wsrep-5.6/vio/viosslfactories.c
mysql-wsrep-5.6/wsrep/CMakeLists.txt [new file with mode: 0644]
mysql-wsrep-5.6/wsrep/Makefile.am [new file with mode: 0644]
mysql-wsrep-5.6/wsrep/wsrep_api.h [new file with mode: 0644]
mysql-wsrep-5.6/wsrep/wsrep_dummy.c [new file with mode: 0644]
mysql-wsrep-5.6/wsrep/wsrep_gtid.c [new file with mode: 0644]
mysql-wsrep-5.6/wsrep/wsrep_loader.c [new file with mode: 0644]
mysql-wsrep-5.6/wsrep/wsrep_uuid.c [new file with mode: 0644]

diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644 (file)
index 2060aa5..0000000
+++ /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 (file)
index 0000000..4df5bd0
--- /dev/null
@@ -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/
index 3e1f1b05fa6ba6423c24b91368245c6849717c8e..04272ac1f7d062b4a56d39b7f63c36d0a185bfb7 100644 (file)
@@ -1,45 +1 @@
-# vim:syntax=apparmor
-# Last Modified: Tue Jun 19 17:37:30 2007
-#include <tunables/global>
-
-/usr/sbin/mysqld {
-  #include <abstractions/base>
-  #include <abstractions/nameservice>
-  #include <abstractions/user-tmp>
-  #include <abstractions/mysql>
-  #include <abstractions/winbind>
-
-  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 <local/usr.sbin.mysqld>
-}
+# This file is intensionally empty to disable apparmor by default
index 53896f0eecae6ac1bc2bc7e14bfeb7c75dd85ec6..e86798b7bb480ffb92c3eac1cb7c4ad8022f4f32 100644 (file)
@@ -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 <mos-linux-team@mirantis.com>  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 <sgolovatiuk@mirantis.com> 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 <dbilunov@mirantis.com>  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:
index ad3d7b68cb8015f62fecf2cbb8bec03859ce25c2..9272a803127d78f85d840c7844062e14568f853a 100644 (file)
@@ -1,7 +1,7 @@
 Source: mysql-wsrep-5.6
 Section: database
 Priority: optional
-Maintainer: MOS Linux team <mos-linux@mirantis.com>
+Maintainer: MOS Linux team <mos-linux-team@mirantis.com>
 XSBC-Orig-Maintainer: Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>
 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 (file)
index 0000000..7ade7b1
--- /dev/null
@@ -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 (executable)
index 0000000..3888c05
--- /dev/null
@@ -0,0 +1,52 @@
+'''apport package hook for mysql-5.6
+
+(c) 2009 Canonical Ltd.
+Author: Mathias Gug <mathias.gug@canonical.com>
+'''
+
+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]))
index 128268c0ecea469f6acff411370e28fc606e9304..6fca71c6de1e4b82b7a9b5771bd5f86dd2c2eb7b 100644 (file)
@@ -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 (file)
index 0626bc2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Author: Clint Byrum <clint@ubuntu.com>
-Subject: Convenient place to disable tests that are currently failing
-Forwarded: not-needed
-Last-Update: 2012-03-07
-Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
---- 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 (file)
index 0000000..0209176
--- /dev/null
@@ -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 <james.page@ubuntu.com>
+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
index 5a2f13700855284e311afb1c77ad5372193554b1..faedcc42c89df4c7c6abe2d4862e1d9addf4fffe 100644 (file)
@@ -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,
index dbd44e791f020459a4620248728e097c27954f98..b64feeba713630f0e814c576018136d073f912ba 100644 (file)
@@ -29,7 +29,7 @@ Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
 +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');
index 3aaa8ce5d958395541237507b3a9b89badf17006..981e0a9afc791d810f805a95f587d08daa228a18 100644 (file)
@@ -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 (file)
index 39ff8b9..0000000
+++ /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 <TARGET>")
-+ LIST(APPEND CMAKE_C_LINK_EXECUTABLE "dsymutil <TARGET>")
-+ LIST(APPEND CMAKE_CXX_CREATE_SHARED_LIBRARY "dsymutil <TARGET>")
-+ LIST(APPEND CMAKE_C_CREATE_SHARED_LIBRARY "dsymutil <TARGET>")
-+ LIST(APPEND CMAKE_CXX_CREATE_SHARED_MODULE "dsymutil <TARGET>")
-+ LIST(APPEND CMAKE_C_CREATE_SHARED_MODULE "dsymutil <TARGET>")
-+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 <info@codership.com>.
-+# 
-+# 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 <my_sys.h>
-+  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 <my_pthread.h>
- #include <my_list.h>
-@@ -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.<suffix>] group to be
-+# used for connecting to [mysqld.<suffix>]
-+#
-+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.<suffix>]
-+ $self->post_check_client_group($config,
-+                              'client',
-+                              $first_mysqld->name());
-+
-+ # Then generate [client.<suffix>] for each [mysqld.<suffix>]
-+ 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.<suffix>]
-+#
-+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.<suffix>] section for each
-+  # defined [cluster_config.<suffix>] 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.<suffix>]
-+    $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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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
-+<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; 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_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; 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_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; 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 <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 <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 <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 = .*?;/<BASE_DIR>;/sgio;
-+      $wsrep_provider_options =~ s/base_host = .*?;/<BASE_HOST>;/sgio;
-+      $wsrep_provider_options =~ s/base_port = .*?;/<BASE_PORT>;/sgio;
-+      $wsrep_provider_options =~ s/gcache\.dir = .*?;/<GCACHE_DIR>;/sgio;
-+      $wsrep_provider_options =~ s/gcache\.name = .*?;/<GCACHE_NAME>;/sgio;
-+      $wsrep_provider_options =~ s/gmcast\.listen_addr = .*?;/<GMCAST_LISTEN_ADDR>;/sgio;
-+      $wsrep_provider_options =~ s/ist\.recv_addr = .*?;/<IST_RECV_ADDR>;/sgio;
-+      $wsrep_provider_options =~ s/evs\.evict = .*?;/<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<LEX_STRING> *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 <hash.h>
- #include <assert.h>
-+#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 <my_dir.h>
- #include <stdarg.h>
- #include <m_ctype.h>                          // 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 <mysql/psi/mysql_statement.h>
-+#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 <mysql/psi/mysql_stage.h>
- #include <my_murmur3.h>
-+#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<set_var_base> *var_list);
-+#endif
- int sys_var_init();
- int sys_var_add_options(std::vector<my_option> *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 <io.h>
- #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<Item> &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<Item> 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) : "<nil>")
- #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 <temporary table> 
-+         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 <info@codership.com>
-+
-+   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 <http://www.codership.com>
-+
-+   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 <sys/types.h>
-+
-+/* 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 <info@codership.com>
-+
-+   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 <info@codership.com>
-+
-+   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 <http://www.codership.com>
-+
-+   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 <mysqld.h>
-+#include <sql_class.h>
-+//#include <sql_plugin.h>
-+//#include <set_var.h>
-+
-+#include "wsrep_mysqld.h"
-+
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <ctype.h>
-+
-+/* 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<char**>(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<void*>(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 <http://www.codership.com>
-+
-+   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 <mysqld.h>
-+#include "sql_base.h"
-+#include "binlog.h"
-+#include "rpl_filter.h"
-+#include <sql_class.h>
-+#include "wsrep_mysqld.h"
-+#include "wsrep_binlog.h"
-+#include <cstdio>
-+#include <cstdlib>
-+
-+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 <http://www.codership.com>
-+
-+   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 <mysqld.h>
-+#include <sql_class.h>
-+#include <sql_parse.h>
-+#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 <cstdio>
-+#include <cstdlib>
-+#include "log_event.h"
-+#include <rpl_slave.h>
-+
-+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<XID*>(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<XID*>(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, &gtid);
-+
-+    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<LEX_STRING> 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 <http://www.codership.com>
-+
-+   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 <sql_priv.h>
-+#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 <http://www.codership.com>
-+
-+   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 <mysqld.h>
-+#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 <http://www.codership.com>
-+
-+   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 <log.h>
-+#include <pthread.h>
-+#include <cstdio>
-+
-+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 <http://www.codership.com>
-+
-+   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 <mysqld.h>
-+#include <sql_class.h>
-+#include <set_var.h>
-+#include <sql_acl.h>
-+#include <sql_reload.h>
-+#include <sql_parse.h>
-+#include "wsrep_priv.h"
-+#include "wsrep_utils.h"
-+#include <cstdio>
-+#include <cstdlib>
-+
-+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<char*>(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 <addr>' 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<char*>(*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, &not_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 (&current_gtid->uuid, uuid_str, sizeof(uuid_str));
-+
-+  int ret;
-+  if (!strcmp (WSREP_SST_MYSQLDUMP, method))
-+  {
-+    ret = sst_donate_mysqldump(data, &current_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 <info@codership.com>
-+
-+   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 <mysql.h> // 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 <info@codership.com>
-+
-+   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 <info@codership.com>
-+
-+   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 <http://www.codership.com>
-+
-+   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 <sql_class.h>
-+
-+#include <spawn.h>    // posix_spawn()
-+#include <unistd.h>   // pipe()
-+#include <errno.h>    // errno
-+#include <string.h>   // strerror()
-+#include <sys/wait.h> // waitpid()
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <netdb.h>    // getaddrinfo()
-+
-+#ifdef HAVE_GETIFADDRS
-+#include <net/if.h>
-+#include <ifaddrs.h>
-+#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<char*>(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<char*>(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<const wsrep_uuid_t*>(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<const XID*>(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 <info@codership.com>
-+
-+   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 <http://www.codership.com>
-+
-+   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 <mysqld.h>
-+#include <sql_class.h>
-+#include <sql_plugin.h>
-+#include <set_var.h>
-+#include <sql_acl.h>
-+#include "wsrep_priv.h"
-+#include "wsrep_thd.h"
-+#include <my_dir.h>
-+#include <cstdio>
-+#include <cstdlib>
-+
-+#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 <info@codership.com>
-+
-+   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 <wsrep_mysqld.h>
-+#include <my_md5.h>
-+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 <openssl/md5.h>
-+#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,            /*!<in: clustered index record */
-+      dict_index_t*   index,          /*!<in: clustered index */
-+      ibool           referenced,     /*!<in: is check for referenced table */
-+      ibool           shared)         /*!<in: is shared access */
-+{
-+      THD*    thd             = (THD*)trx->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; j<len+1; j++) {
-+              fprintf(stderr, " %hhX, ", key[j]);
-+      }
-+      fprintf(stderr, "\n");
-+#endif
-+      char *p = strchr(cache_key, '/');
-+      if (p) {
-+              *p = '\0';
-+      } else {
-+              WSREP_WARN("unexpected foreign key table %s %s",
-+                         foreign->referenced_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; i<key_len; i++) {
-+              fprintf(stderr, "%hhX, ", key[i]);
-+      }
-+      fprintf(stderr, "\n");
-+#endif
-+      wsrep_buf_t wkey_part[3];
-+      wsrep_key_t wkey = {wkey_part, 3};
-+      if (!wsrep_prepare_key_for_innodb(
-+                      (const uchar*)table_share->table_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; i<table->s->keys; ++i) {
-+                      KEY*  key_info  = table->key_info + i;
-+                      if (key_info->flags & HA_NOSAME) {
-+                              hasPK = true;
-+                      }
-+              }
-+
-+              for (i=0; i<table->s->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 <wsrep_mysqld.h>
-+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 <sql_acl.h>  // 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 <set>
-+#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<enum lock_mode>(mode),
-+                      block, heap_no, trx))) {
-+#else
-       } else if (lock_rec_other_has_conflicting(
-                       static_cast<enum lock_mode>(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<enum lock_mode>(
-+                          LOCK_X | LOCK_GAP | LOCK_INSERT_INTENTION),
-+                  block, next_rec_heap_no, trx))) {
-+#else
-       if (lock_rec_other_has_conflicting(
-                   static_cast<enum lock_mode>(
-                           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 <ha_prototypes.h>
-+#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 <algorithm>
- /* 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 <mysql-build@oss.oracle.com> 
-+Packager:       Codership Oy <info@galeracluster.com>
- 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 <joerg.bruehe@fromdual.com>
-+- 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 <joerg.bruehe@fromdual.com>
-+- 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 <teemu.ollakka@galeracluster.com>
-+
-+- Reworked to build wsrep patched packages exclusively
-+- OBS compatible
-+
- * Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
- - 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 <joerg.bruehe@oracle.com>
-+* Thu Feb 10 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- - 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 <mvensson@mysql.com>
-+* Fri Oct 09 2009 Magnus Blaudd <mvensson@mysql.com>
- - Removed mysql_fix_privilege_tables
-@@ -1668,7 +1666,7 @@ echo "====="                                     >> $STATUS_HISTORY
- - Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS
--* Tue Mar 07 2006 Kent Boortz <kent@mysql.com>
-+* Wed Mar 08 2006 Kent Boortz <kent@mysql.com>
- - Changed product name from "Community Edition" to "Community Server"
-@@ -1763,7 +1761,7 @@ echo "====="                                     >> $STATUS_HISTORY
- * Thu Sep 29 2005 Lenz Grimmer <lenz@mysql.com>
--- 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 <lenz@mysql.com>
-@@ -1916,7 +1914,7 @@ echo "====="                                     >> $STATUS_HISTORY
- - marked /etc/logrotate.d/mysql as a config file (BUG 2156)
--* Sat Dec 13 2003 Lenz Grimmer <lenz@mysql.com>
-+* Fri Dec 12 2003 Lenz Grimmer <lenz@mysql.com>
- - 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 <davida@mysql.com>
-+* Wed Sep 29 1999 David Axmark <davida@mysql.com>
- - 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 <address|hostname>[: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:<root password>
-+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 <address|hostname>[: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:<root password>
-+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 <info@codership.com>
-+
-+   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 <stdint.h>
-+#include <stdbool.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <time.h>
-+
-+#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 <info@codersihp.com>
-+
-+   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 <errno.h>
-+#include <stdbool.h>
-+#include <string.h>
-+
-+/*! 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 <info@codership.com>",
-+    &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 <info@codersihp.com>
-+
-+   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 <errno.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <inttypes.h>
-+
-+#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, &gtid->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(&gtid->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 <info@codersihp.com>
-+
-+   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 <dlfcn.h>
-+#include <errno.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+#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 <info@codersihp.com>
-+
-+   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 <errno.h>
-+#include <ctype.h>
-+#include <stdio.h>
-+
-+#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;
-+    }
-+}
index de6c806679061f3c9b7325f3b7eeed47ab8ff2f3..984fd8ccc08fbd1287826564a1ca01b2f2f9a98d 100644 (file)
@@ -29,7 +29,7 @@ Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
        ;;
      *)
        echo "Internal program error (non-fatal):" \
-@@ -740,6 +737,13 @@ mysqld daemon not started"
+@@ -815,6 +815,13 @@ mysqld daemon not started"
  fi
  
  #
index eae7eb5e160e1c595750b6aa3788c603bd1cffd6..c92237ffac8888d3283c8ebc30ca0a266628d8de 100644 (file)
@@ -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
index 4fbf5eb67c387bb16223f5e757a78d9d5bfb59ce..7b7b8d186e44a3477967bdc14904d59cdb5628d4 100644 (file)
@@ -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<Relay_log_info*>(rli), thd)))
      {
        const_cast<Relay_log_info*>(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 (file)
index 6b97076..0000000
+++ /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
index 8cc125f6def08fc3b659dc001ecdb3699d4c59aa..9b64bc2303ae9eaaf0f94fefd9525c0e08ec3630 100755 (executable)
@@ -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
-
index 43c5651064d7bc7824ac6405f331c6fbdc73ab96..ba148bb2081890e7e6230435d2b57b644dc78cff 100644 (file)
@@ -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 (file)
index 0000000..58afe8b
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+set -ex
+
+# dep8 smoke test for mysql-server
+# Author: Robie Basak <robie.basak at canonical.com>
+#
+# 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 <<EOT
+mysql-server-5.6 mysql-server/root_password password rootpassword
+mysql-server-5.6 mysql-server/root_password_again password rootpassword
+EOT
+
+DEBIAN_FRONTEND=noninteractive dpkg-reconfigure mysql-server-5.6
+
+mysql --user=root --password=rootpassword <<EOT
+CREATE DATABASE testdatabase;
+CREATE USER 'testuser'@'localhost' identified by 'testpassword';
+GRANT ALL ON testdatabase.* TO 'testuser'@'localhost';
+EOT
+
+mysql --user=testuser --password=testpassword testdatabase <<EOT
+CREATE TABLE foo (bar INTEGER);
+INSERT INTO foo (bar) VALUES (41);
+EOT
+
+result=`echo 'SELECT bar+1 FROM foo;'|mysql --batch --skip-column-names --user=testuser --password=testpassword testdatabase`
+if [ "$result" != "42" ]; then
+       echo "Unexpected result" >&2
+       exit 1
+fi
+
+mysql --user=testuser --password=testpassword testdatabase <<EOT
+DROP TABLE foo;
+EOT
+
+mysql --user=root --password=rootpassword <<EOT
+DROP DATABASE testdatabase;
+DROP USER 'testuser'@'localhost';
+EOT
index 9729a933b75bfcfa69be267d2e1288f6578d3c7d..0a8b952d28ff4e98e64a9e38719f040e2574e439 100755 (executable)
@@ -23,6 +23,7 @@ echo "using tmpdir: $WORKDIR/tmp"
 echo "Setting up skip-tests-list"
 cat > $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 (file)
index 8bbfde4..0000000
+++ /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 (file)
index c293cb3..0000000
+++ /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
index 711ab0c1f6135b49a93502d832423ff96c58b6a6..49386c756c94bfd89feb9ae4a2ce3c3f27534e07 100644 (file)
@@ -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 <some build directory>
-cmake <path to source directonry>
+cmake <path to source directory>
 
-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.
index 7c3e68dc34d8d982e3bc2c3a8eadcb396e5fdd2d..8da6c8b5606f659149f293487c72f81d684fbdce 100755 (executable)
@@ -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
index 5be5e9240a49ff16e9b251d78566e1f9a61cb566..ae62d194b0beabc02bb90a4223c9f7d929d7341d 100644 (file)
@@ -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_<Lang>_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 <stdio.h>")
+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 <stdio.h>")
+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 (file)
index 0000000..76c4ff7
--- /dev/null
@@ -0,0 +1 @@
+If you would like to contribute code to this repository, please <a href="https://www.clahub.com/agreements/codership/mysql-wsrep">sign the Contributor License Agreement</a>.
index 9988db36aed522b63c022d0bdc7471b80b81272d..e1775d5f3b3ba7f1afa91246207922179ba1a7df 100644 (file)
@@ -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 (file)
index fbc1a6c..0000000
+++ /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 (file)
index 864415f..0000000
+++ /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 (file)
index 0000000..a812a06
--- /dev/null
@@ -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 (file)
index 0000000..3bd68dc
--- /dev/null
@@ -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 (file)
index ac57860..0000000
+++ /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
-<mysql-build@oss.oracle.com>" 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 <mysql-build@oss.oracle.
-com>"
-1 new user ID
-gpg: key 5072E1F5: "MySQL Release Engineering <mysql-build@oss.oracle.
-com>"
-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 <mysql-build@oss.o
-racle.com>"
-
-   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 <mysql-build@oss.o
-racle.com>"
-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:
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-  <dict>
-    <key>KeepAlive</key>
-    <true/>
-    <key>Label</key>
-    <string>com.mysql.mysqld</string>
-    <key>ProgramArguments</key>
-    <array>
-    <string>/usr/local/mysql/bin/mysqld_safe</string>
-    <string>--user=mysql</string>
-    </array>
-  </dict>
-</plist>
-
-
-   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 <stdio.h>. 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 (file)
index 26161d9..0000000
+++ /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.
index d7ae7e1c65be4972b5c8c86dc46c604f537a6845..108364d0b37825e665d132e08606263f7aa5c2a2 100644 (file)
@@ -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.
 
index f84d42f3acc4084972d0fb33cfd3c05cc3c0dd81..373e0b2d4b9486b4efc424d230ec990c1f735610 100644 (file)
@@ -1,4 +1,4 @@
 MYSQL_VERSION_MAJOR=5
 MYSQL_VERSION_MINOR=6
-MYSQL_VERSION_PATCH=23
+MYSQL_VERSION_PATCH=30
 MYSQL_VERSION_EXTRA=
index abf09a95402226b100e9fcfd66c88c75197a91fc..d24555a5d5632fd622c278db944b30cf0b01d13d 100644 (file)
@@ -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)
index bd7f0111598ee09f5f514a6d40aed34f970da761..fbe60f4f5f7e523b5df03b37731b1690a49b4b74 100644 (file)
@@ -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;
+}
index 450bda04cc8c40cef9d02432c26df29931fd8a9f..af0af9d1e4ed3c3b1146414bf5716a076bf0c8fa 100644 (file)
@@ -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 &&
index 5997e63af09b41824fa347b87147dc0e0a2b084e..51a4d09c93258f2b0c37a2c5e9dc3b246310dd94 100644 (file)
@@ -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,
index d959280c5b6c2184bb36d23b93401d743f2cc222..ab7ee09825be144aec833a9c5c2a19f73924aaab 100644 (file)
@@ -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] <plugin> 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__
index 929d8be678f7706300bcd243f40be130a3137eb8..f8df0cd4fce421756c47101d077de76e3e1715d9 100644 (file)
@@ -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 <sslopt-case.h>
   }
 
   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");
 
index 4d3f67497c4831c1b37b84a18c0bd51f01eaa36c..ab959c71da25ba9a7f0220a6c4a9ba5889483c4c 100644 (file)
@@ -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]) 
       {
index 711f9b3ea7bb833505d1795f0f809b73ac3a593e..e305de00dc3ac81279f33d17916669b0e752cc02 100644 (file)
@@ -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,
index e40fb75adeb4ef5ed3adefecc33aa27645a5dcd4..6c3f4064f526555b4b109f966630959c978f7627 100644 (file)
@@ -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);
index b440ccfe2832a4e3af612039ce108b0a7f2316af..f7d7241249a0c8bb4f7f9847114f607468a324f5 100644 (file)
@@ -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;
index 94a1d711ec14d26b49444f8baf4fa9a50999f353..487fcfc662a457ebc3ee82c5941736ed99a44664 100644 (file)
@@ -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
 #include "client_priv.h"
 #include "my_default.h"
 #include "mysql_version.h"
-#ifdef HAVE_LIBPTHREAD
-#include <my_pthread.h>
-#endif
 
 #include <welcome_copyright_notice.h>   /* 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)))
index 755ef31df72c5e84b4c54f3db1179bbc80493d1d..aeaa05e536181d87563ef5a6cac448182bd646ba 100644 (file)
@@ -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",
index 5458503464ac864952340b254af8908fcdc84c95..6ef47367bd4bdb30f67446e12662acd373e1ccdf 100644 (file)
@@ -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 |\r
+                                    CLIENT_REMEMBER_OPTIONS;\r
 
 
 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));
     }
 
index 2def9bdde6eac23cb60d9839445e7dcc59f76612..0ac93bb059f6627bb8bbeb3de4867391a0c5be57 100644 (file)
@@ -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)
index 98c9d72acefbd8e01ca46bde15344729533caa3c..decd776d515651bd55fbd637aeeb3ebbe5f4e129 100644 (file)
@@ -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);
index 71842f82ed176e8f411deaae11dbc8a75e29a011..866f6bc779426f51aa2306055d92f78cb53f3dbc 100644 (file)
@@ -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)
index 5e872f981b0cd27991d3751b0bc8791c5df2746e..b39bf7b79d65c3bf9532bbf8f636bff21abfbd4c 100644 (file)
@@ -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
 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})
index 22c132916611f82738803db9536ca0de1c6184a7..0a6a3cf635df3ca8e392d219afaa240b7ea2d2fd 100644 (file)
@@ -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=" .
index 4adda0b6eacb9c5965eaac82c86826c5065bd192..5cd47af0343c12e4c21236f08fdce033c2520c1e 100644 (file)
@@ -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()
index 83bd6bd059560322020a032ae3ef3fed728f6e1e..4f66008303289fbf16c750b761d3f0a0402f7df0 100644 (file)
 # 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 <TARGET>")
+ LIST(APPEND CMAKE_C_LINK_EXECUTABLE "dsymutil <TARGET>")
+ LIST(APPEND CMAKE_CXX_CREATE_SHARED_LIBRARY "dsymutil <TARGET>")
+ LIST(APPEND CMAKE_C_CREATE_SHARED_LIBRARY "dsymutil <TARGET>")
+ LIST(APPEND CMAKE_CXX_CREATE_SHARED_MODULE "dsymutil <TARGET>")
+ LIST(APPEND CMAKE_C_CREATE_SHARED_MODULE "dsymutil <TARGET>")
+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()
 
index 8b845b92f1e7b781ffc2faae621948588b0fce7f..768e08741d364c0f1b8833f1485d7173992c95f1 100644 (file)
@@ -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()
index 0c93fb179f5fd9dc7e5e2807bb502c776dab0326..b1e1d3129e6c77e5b505272e1315ba85b74bb1ef 100644 (file)
@@ -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.\r
+# \r
+# This program is free software; you can redistribute it and/or modify\r
+# it under the terms of the GNU General Public License as published by\r
+# the Free Software Foundation; version 2 of the License.\r
+#\r
+# This program is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+# GNU General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU General Public License\r
+# along with this program; if not, write to the Free Software\r
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+\r
+# Add executable plus some additional MySQL specific stuff\r
+# Usage (same as for standard CMake's ADD_EXECUTABLE)\r
+#\r
+# MYSQL_ADD_EXECUTABLE(target source1...sourceN)\r
+#\r
+# MySQL specifics:\r
+# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory\r
+# On Windows :\r
+# - add version resource\r
+# - instruct CPack to do autenticode signing if SIGNCODE is set\r
+\r
+INCLUDE(cmake_parse_arguments)\r
+\r
+FUNCTION (MYSQL_ADD_EXECUTABLE)\r
+  # Pass-through arguments for ADD_EXECUTABLE\r
+  MYSQL_PARSE_ARGUMENTS(ARG\r
+   "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"\r
+   ""\r
+   ${ARGN}\r
+  )\r
+  LIST(GET ARG_DEFAULT_ARGS 0 target)\r
+  LIST(REMOVE_AT  ARG_DEFAULT_ARGS 0)\r
+  \r
+  SET(sources ${ARG_DEFAULT_ARGS})\r
+  ADD_VERSION_INFO(${target} EXECUTABLE sources)\r
+  ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})\r
+  # tell CPack where to install\r
+  IF(NOT ARG_EXCLUDE_FROM_ALL)\r
+    IF(NOT ARG_DESTINATION)\r
+      SET(ARG_DESTINATION ${INSTALL_BINDIR})\r
     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()\r
+    MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})\r
+  ENDIF()\r
 ENDFUNCTION()
index e09592942c1821b98fd860d67618dc753ad78a6b..bd72a58c68a60e18818f85d8951a3a3d5f97adf1 100644 (file)
@@ -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 "")
index d320bf3b0ffcd8290b23d256e33ec7e15f56767b..188982a837de7c9ae9fd365d8baeae0fd8391cb3 100644 (file)
@@ -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)
index a1764ad7e7588eefd7e8800b567259ab05ced424..7b60a268f7e83002832363f06b8b1b64c48f2281 100644 (file)
@@ -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 "")
index 4cb5c9545f157024f8e8f4b284eeb838acb0ed57..882259c1ef02f2f20888cecb7cd270772b6968ce 100644 (file)
@@ -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}")
index e946f0ff86354144c3fb9d7c87e913588773bf89..51e8610850d637d8f846c97b2059eb3cbc1e453e 100644 (file)
@@ -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
index 81719d2e9aa55ecb8f4899eba3cd1cf9c2ce09e4..8108f90429c5376c6ecac83c28cb9a8991b797b3 100644 (file)
@@ -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()
 
index 6daf7403d41514ff37dc54cb83ad0b24c5f3a777..f849a9fcb59d43e4a199280c0b4f25ee9672e771 100644 (file)
@@ -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 <windows.h>
-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.\r
+// \r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; version 2 of the License.\r
+// \r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+// \r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
+\r
+#include <windows.h>\r
+VS_VERSION_INFO VERSIONINFO\r
+FILEVERSION     @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0\r
+PRODUCTVERSION  @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0\r
+FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK\r
+FILEFLAGS       0\r
+FILEOS          VOS__WINDOWS32\r
+FILETYPE        @FILETYPE@\r
+FILESUBTYPE     VFT2_UNKNOWN\r
+BEGIN\r
+    BLOCK "StringFileInfo"\r
+    BEGIN\r
+        BLOCK "040904E4"\r
+        BEGIN\r
+            VALUE "FileVersion",      "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0"\r
+            VALUE "ProductVersion",   "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0"\r
+        END\r
+    END\r
+    BLOCK "VarFileInfo"\r
+    BEGIN\r
+        VALUE "Translation", 0x409, 1252\r
+    END\r
+END\r
diff --git a/mysql-wsrep-5.6/cmake/wsrep.cmake b/mysql-wsrep-5.6/cmake/wsrep.cmake
new file mode 100644 (file)
index 0000000..1f5eebb
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (c) 2011, Codership Oy <info@codership.com>.
+# 
+# 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()
+
+#
index 807c651783ed97aa5eed72e93e1e3a8dce525c91..db0bb94fa93927d0596313eadd566de32bd5eb7f 100644 (file)
@@ -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 *);
 
index 554d39704859606d2adf6c1d1bdb4270928a23e3..1f1033a1cb7e0a00e68389aa270e05c8f2785801 100644 (file)
@@ -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
index 8cfbeac7c522bafa96179f6152afec0798ad64d3..e1f45ca14648ea97789e7199d38868dba8d3110d 100644 (file)
@@ -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;
+       }
 }
 
 
index 732a1a655640d21cea04d3291e1c4c24fbe2da25..a35716f6581ca7be3efd873d599a7b0de9fbb12f 100644 (file)
@@ -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
index 987be271ec858170ca1ec395a11ed853884094e6..e9d795e93318ae7f84b3d65a7ec4a36308178d4f 100644 (file)
@@ -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
 #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
 #cmakedefine HAVE_UINT64 1
 #cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@
 #cmakedefine HAVE_BOOL 1
+#cmakedefine HAVE_STRUCT_TIMESPEC
 
 #cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@
 
 #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
 /* CPU information */
 
 #cmakedefine CPU_LEVEL1_DCACHE_LINESIZE @CPU_LEVEL1_DCACHE_LINESIZE@
+#cmakedefine HAVE_LIBNUMA 1
 
 #endif
index e1c1793692f825f33222f898927cac0f80869552..f94b0000775885855a046a4ca4c7f8979880873f 100644 (file)
@@ -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 <install_path>/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 <numa.h>
+    #include <numaif.h>
+    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()
index b6656077100a8e6b3c47f05ca883fc8874030578..886691a07d7e7e889e224b972986a127ebe5547f 100644 (file)
@@ -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 (file)
index 3800b87..0000000
+++ /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 <my_global.h>
-#include <m_ctype.h>
-#include <my_sys.h>
-#include <mysql_version.h>
-
-#include <stdio.h>
-
-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("<HTML>\n");
-  printf("<HEAD>\n");
-  printf("</HEAD>\n");
-  printf("<BODY><PRE>\n");
-  printf("Charset %s\n",cs->name);
-
-  printf("<TABLE>\n");
-  printf("<TR><TH>Code<TH>Uni<TH>Sort<TH>Ctype<TH>Ch<TH>Lo<TH>Up</TR>");
-  
-  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("<TR bgcolor=#%s>",clr ? "DDDDDD" : "EEEE99");
-    printf("<TD>%02X",ch[i].cod);
-    printf("<TD>%04X",ch[i].uni);
-    printf("<TD>%02X",ch[i].srt);
-    
-    printf("<TD>%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("<TD>ctrl<TD>ctrl<TD>ctrl");
-    }
-    else
-    {
-      printf("<TD>&#%d;",ch[i].uni);
-      printf("<TD>&#%d;",ch[i].low);
-      printf("<TD>&#%d;",ch[i].upp);
-    }
-    printf("</TR>\n");
-    srt=ch[i].srt;
-  }
-  printf("</TABLE>\n");
-  printf("</PRE></BODY>\n");
-  printf("</HTML>\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("<table border=1>\n");
-  printf("<tr bgcolor=EEEE99><th>ID<th>Charset<th>Collation<th>Def<th>Bin<th>Com<th>Comment\n");
-  for (cs=all_charsets ; cs < all_charsets+256; cs++)
-  {
-    if (!cs[0])
-      continue;
-    printf("<tr bgcolor=#%s><td><a href=\"?%s\">%d</a><td>%s<td>%s<td>%s<td>%s<td>%s<td>%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 " : "&nbsp;",
-          (cs[0]->state & MY_CS_BINSORT)  ? "bin " : "&nbsp;",
-          (cs[0]->state & MY_CS_COMPILED) ? "com " : "&nbsp;",
-          cs[0]->comment);
-  }
-  printf("</table>\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;
-}
index 72e1f8eb5a3b34e381b85c1fd2360c6b0023fa8f..9587077dc300802adccd1b12cb8ba278744718cc 100644 (file)
@@ -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);
 
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 c261c9540e1b220d2e33a648e4ecf3c635495595..c94a1bbe4dc580dc12c4bb205ed59f1cefae0539 100644 (file)
@@ -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
    versions into symbolic names. By Sasha Pachev <sasha@mysql.com>
  */
 
+#include <my_config.h>
+#include <stdio.h>                              // Needed on SunOS 5.10
+#include <vector>
+#include <string>
+
 #include <my_global.h>
 #include <m_ctype.h>
 #include <my_sys.h>
 #include <mysql_version.h>
 #include <errno.h>
 #include <my_getopt.h>
+#include <welcome_copyright_notice.h> /* 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_entry> 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);
index da399c3d141e8ac11455b5d3520f93024b004f3f..b5eb88824fb0dee69b300c17eb9c537828fdde69 100644 (file)
@@ -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 (file)
index fe79ccb..0000000
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 (file)
index 04a3dd9..0000000
+++ /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-----
index db9136c5368a32c185c45aaa398fbc233612519e..c0395cb27e3f00a6553c181c59514d7bd60cfbe5 100644 (file)
@@ -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);
 
index 103fcbb0e30e803e4daec888356a558fbb935e3d..fc2971ab0802725dcefe91038f5a598c51d077a5 100644 (file)
@@ -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
    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
index a6ef8232ef6fa45770e5040cda9f339addb3d1ac..b74a289ecb9c3a5ead63a465542dcddb2208a0cd 100644 (file)
@@ -34,7 +34,7 @@
 #include "rsa.h"
 
 
-#define YASSL_VERSION "2.3.7"
+#define YASSL_VERSION "2.3.9b"
 
 
 #if defined(__cplusplus)
index beba7b0b5ddbcbd7f458c6c1c96889b405b906f5..d63244dca90e35ab7f1c80ae607259e776f92254 100644 (file)
@@ -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 !!!!
 
index 3735827b577ac36e4f34eb8c4265d2d662408fee..986e5b0c7699ad09b1511e23565a98f69f2538d8 100644 (file)
@@ -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();
index 231e0aece75c48f03c535716dd230807049c9d37..954fdb52837e716115f5fc658951c9c6f9080e36 100644 (file)
@@ -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;
index af94f5bc24fd22bf4b98dab205aa13130a0c822e..1092e428351b28c084a8e6f82fc17f5cde01a0c9 100644 (file)
@@ -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());
 }
 
 
index 5299436455330856a8221de634678fee84449631..12f956e6cbd4a5502b7104c19fa28b5ff587155a 100644 (file)
@@ -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
 {
index e63d69e9e8a8e6d249df5da68c8bf608c0cbcf1c..29815882f779c15b7aadeb7c01f8b2f72fa7f831 100644 (file)
@@ -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<output_buffer> out(NEW_YS output_buffer);
index 028e0fa428c3b49edbd907c646c94e48aa9c65bd..ad79002a6a86a57b69c9f03e0b5e901493a5678f 100644 (file)
@@ -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 <stdio.h>
 
 #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;
index e5d69367339b7eeb769a1fec70f98c59e66c17fa..5169b7dd5d0f87abdf07a9f3e1f4f18d7b8a6540 100644 (file)
@@ -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);
index 69ba469b928a225f36537021a4b3398bf3d2a067..f190761604df47ae7dc9d6afa1edba35dc54581e 100644 (file)
@@ -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);
index 16858a6eec6e16b961b6d965a046c0db2a7f8f64..17d68989b2fdc5b10ae4b91293d882e065e1f0ee 100644 (file)
@@ -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_;
 }
 
index bc3eebe6bf061f3fa4d7ff695c86dd75de8eb228..28c7c8f582ed9bdd2b1ccf35eb255b8492676f71 100644 (file)
@@ -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_;
index 7c9e91e12addd1d273520236032f5df67f9086d3..24f7664893f9295832e13b71f41502dcea79e804 100644 (file)
@@ -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)))
index 79a8a8f1c4f21848f5e3454320097da6fb71212d..73f678e2674c270ff89284b34655f1c03c5854ea 100644 (file)
@@ -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)
     {
index 5ce29459d074ab749b4f9bf48fdd595250cb5097..d3e6914609739edf724d82a76958ee1b5e5a7206 100644 (file)
@@ -4,6 +4,7 @@
 # 
 
 
+no_pid=-1
 server_pid=$no_pid
 
 
index 3e15ce81489d8a9cccca07663288d5c3cbdfe71a..94ab24fd041f8e540cd91e518d6802ed27b52788 100644 (file)
@@ -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);
     }
index 5fb2e9b800cf8d2e77420c97b99e222b8554bd43..640680807126b5d37607fca5918f3e8b7e698717 100644 (file)
@@ -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 */
index 06ef4ecda6126e6d7f69953008d1195fba4ffa6e..1ff70cef09e05283c333692622a6a292c3227fd1 100644 (file)
@@ -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 "+ -><()~*:\"\"&|"
 
index 44c8279f8b1ececff42487b57edd3358035bdfd2..d807b216651b350ff4a0def0ccaac61d56bfce9a 100644 (file)
@@ -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()
index 452676e461a79c06ee73c3bf1d600c15fa1e53ce..4f8910593e1e0228198600ea6bb9437672a4d725 100644 (file)
@@ -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
index 4e099c7066ec56d452fa68af82c9654c9b292f55..6463ceeac3480ccf47bbbbd6540a85b50b36a270 100644 (file)
@@ -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);
index d7a76ee25e4d96aa3bbb17b252bf25b2e05a4f55..3d5943fa55ade1794ff4d9091d05ceaa4389051c 100644 (file)
@@ -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)
   #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
 
index 30f2709be0f623524840e2c9c93f3fc983a9d381..7fcff89c8b6b34d80c7c18433ed977262902d767 100644 (file)
@@ -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
 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
index b46b38ed144b6551840b4ee93ceb6f7cba8a178c..17d61016a6812b515b9c8b7e464277148640f05b 100644 (file)
@@ -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;
index fa2bf724b5e64e86eb9a0e5dd956fe971197679b..2e2d7a79fe174d589491d820e9f358a294e2ac9e 100644 (file)
@@ -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;
index 458013b43e4638354a811bcc189f9648143597f1..c3dba0a9b76668b52b0e4419b7b2fc5c5f5bcb75 100644 (file)
@@ -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;
index d5d12ef1065b5b55d94f1e8bd4187ab718075a5d..ee19770976749a2b5d12f52248ed7bb5e7c41aa9 100644 (file)
@@ -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 <debug_sync.h>
 #include <sql_profile.h>
 #include <table.h>
+#include "field.h"
 #include <set>
 
 typedef std::set<THD*>::iterator Thread_iterator;
index 25817587aacfcee76059dfc43ac8f8a238c774b6..bf9cc03925dac3f784f58bad5f6f51a3b7183e9f 100644 (file)
@@ -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
       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 */
index 8280f3b8f109f5e0a2deb646565820fe64575f19..f21d28f4c5f4ecb80cd0c7d157e9cb4c28b28a76 100644 (file)
@@ -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 */
index 6da4dfd8ad853cdb1242c24ea209dcc64df8e376..e840edce4bf8b3438897081740923c829af051e4 100644 (file)
@@ -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 */
index c5638ec2cdead9296b5ad9e094685fca98e671c9..6b0741f1fd24b748030b47e04146389368a9ea19 100644 (file)
 #ifdef __cplusplus
 extern "C" {
 #endif
+#ifdef WITH_WSREP
+#include <my_sys.h>
+  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 <my_pthread.h>
 #include <my_list.h>
@@ -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;
 
 
index 00e26e8a1c677065eabd03ca1ef049a9812c052c..1cd9c8792cd6e03fe0ebf890a87b2551ac9cf8e9 100644 (file)
@@ -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);
 
index eb2bf260af3acff993d29828608f507b34c29547..7b6c28c2f5665f1dd7f6697255a4a1bac83a3dc1 100644 (file)
@@ -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
index 61e9bc848eed9874e170b6f6da2bfea37318842e..e9848f7fc01e55e90c47682c8ea62c02e61000c8 100644 (file)
-# 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>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Static Library" 0x0104\r
+\r
+CFG=libevent - Win32 Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "libevent.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "libevent.mak" CFG="libevent - Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "libevent - Win32 Release" (based on "Win32 (x86) Static Library")\r
+!MESSAGE "libevent - Win32 Debug" (based on "Win32 (x86) Static Library")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "libevent - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release"\r
+# PROP BASE Intermediate_Dir "Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Release"\r
+# PROP Intermediate_Dir "Release"\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c\r
+# ADD CPP /nologo /W3 /GX /O2 /I "..\\" /I "..\WIN32-Code" /I "..\compat" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LIB32=link.exe -lib\r
+# ADD BASE LIB32 /nologo\r
+# ADD LIB32 /nologo\r
+\r
+!ELSEIF  "$(CFG)" == "libevent - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Debug"\r
+# PROP Intermediate_Dir "Debug"\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c\r
+# 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\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LIB32=link.exe -lib\r
+# ADD BASE LIB32 /nologo\r
+# ADD LIB32 /nologo\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "libevent - Win32 Release"\r
+# Name "libevent - Win32 Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=..\log.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\event.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE="..\WIN32-Code\misc.c"\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE="..\WIN32-Code\win32.c"\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# Begin Source File\r
+\r
+SOURCE=..\acconfig.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE="..\WIN32-Code\config.h"\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\compat\err.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\event.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE="..\WIN32-Code\misc.h"\r
+# End Source File\r
+# End Group\r
+# End Target\r
+# End Project\r
index 99a00cdf8651ed1a68ae8268e3c60c8f9faf8e42..fb05451ca25338eb71973cbec5104057daa316ee 100644 (file)
@@ -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\r
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r
+\r
+###############################################################################\r
+\r
+Project: "event_test"=".\event_test\event_test.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+    Begin Project Dependency\r
+    Project_Dep_Name libevent\r
+    End Project Dependency\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "libevent"=".\libevent.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "signal_test"=".\signal_test\signal_test.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+    Begin Project Dependency\r
+    Project_Dep_Name libevent\r
+    End Project Dependency\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "time_test"=".\time_test\time_test.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+    Begin Project Dependency\r
+    Project_Dep_Name libevent\r
+    End Project Dependency\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Global:\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<3>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
index 3036ad7888e9c1b2217052190d96abe32eed90b8..17e0c98bae642adc02cedc63be1cd9eceee1675d 100644 (file)
@@ -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
+\r
+Microsoft Visual Studio Solution File, Format Version 9.00\r
+# Visual Studio 2005\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "event_test", "event_test\event_test.vcproj", "{52099A8B-455B-4BE9-8E61-A3D6E8A4338D}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "libevent.vcproj", "{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "signal_test", "signal_test\signal_test.vcproj", "{768DB9DD-2694-4274-89B8-74106E8F7786}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "time_test", "time_test\time_test.vcproj", "{D4BE29FB-E45C-4177-9647-74BBAFDC1257}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regress", "regress\regress.vcproj", "{F7C26008-6066-4AD3-8543-452EFE58BD2E}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}\r
+       EndProjectSection\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Debug|Win32.Build.0 = Debug|Win32\r
+               {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Release|Win32.ActiveCfg = Release|Win32\r
+               {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Release|Win32.Build.0 = Release|Win32\r
+               {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Debug|Win32.Build.0 = Debug|Win32\r
+               {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Release|Win32.ActiveCfg = Release|Win32\r
+               {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Release|Win32.Build.0 = Release|Win32\r
+               {768DB9DD-2694-4274-89B8-74106E8F7786}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {768DB9DD-2694-4274-89B8-74106E8F7786}.Debug|Win32.Build.0 = Debug|Win32\r
+               {768DB9DD-2694-4274-89B8-74106E8F7786}.Release|Win32.ActiveCfg = Release|Win32\r
+               {768DB9DD-2694-4274-89B8-74106E8F7786}.Release|Win32.Build.0 = Release|Win32\r
+               {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Debug|Win32.Build.0 = Debug|Win32\r
+               {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Release|Win32.ActiveCfg = Release|Win32\r
+               {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Release|Win32.Build.0 = Release|Win32\r
+               {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Debug|Win32.Build.0 = Debug|Win32\r
+               {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Release|Win32.ActiveCfg = Release|Win32\r
+               {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
index 871bc2e4d0cd84a53625b6fb539e73181e30cc94..3687698ddb5c4f78b0e352d44b60febb62eaccf6 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Copyright (c) 2002-2006 Niels Provos <provos@citi.umich.edu>
  * 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
 
 #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;
 
index 1e2a1eb062a3cdbc674a3aad45b50e2b418beb71..f9eba92171eb69f039fcfa99d7afcdaaf2be380d 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Copyright (c) 2003-2006 Niels Provos <provos@citi.umich.edu>
  * 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));
index 16a6a5e1541dfc98082c6eb7bce076b97ae167c6..790888b533173c1a7371bfa2ec5275ba7bc8ffc9 100644 (file)
@@ -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
index 7f2ebe06893ad32196ce2c0460dcebc4f4919b2e..4209a834d242a0bcfe1ed414d8661daaf62d73eb 100644 (file)
@@ -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);
index 33b50ea8bbbfa0994e2a44e96a1ab03ae900f67e..4cdb5ec99f9d6f47c685a3e4e911955c54b2ea41 100644 (file)
@@ -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<char*>(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;
index 7d311abea8952789b493a38e6e690c3cac186ccb..be76ce5b3d0a972f4cf36ca37b3147d9956a5c4f 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index bf8a4e3b0aaaf30a68d8f77cf22142a65ddcfa97..91804062895f6e96ad360783bdb25de41ed4d645 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBinnochecksum\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 472e2e6409ac082dc347efaefa44460fbf988f6d..8fcf95547fda4466084c2fd6445dbede70335d0b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmsql2mysql\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 83b5f960725d6b410b12b4b9b5f9f16a96e67eea..f1ab6e5abcdf11ccb6041dff617b02676e541ee0 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index d08a4f6fa4633c592deb5c80af6a3a995111637a..5bfada6851059f2d8e85edfdba8b954edf7224b3 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 7d3839793acc24e986cda93e8054f73e49d14656..b7fa9bd64dd7612b7cb0dfbe50cc95971f920b09 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmyisamchk\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 393dfb28d5c6089d826487a27276e86fbe1a7e3d..d8d223ed8b292487731433876c1e221a1ddb7270 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmyisamlog\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 2dad2da503c8dc4ab4e29b4993f919f6a273a4a0..294e20ee3d71ed90c5dba904a341ecec54eb528e 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmyisampack\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 9fc64e783b42e0c6459bba456697d59598ab0553..029040dd0b631cccf239ff61e470b84f6ba6dcc9 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index a4d880d4e64b60deca7c433324a4712674522808..856c0a66f229460ffdefdc5f01669760e87bbbb8 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 4cef6582ba6c5f5371b5f4a918669779bce99865..9c25395156b6fc67f4b2a4b3b4d273ca4970cf7b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 8fe9b922411fa8408ef2a0383ff3ff18416c31ac..a31ebd9d56bf7020daa5cdc8b72792d3e41259e6 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 5b590540724fca9a6c6b3e21087a739ecf4a69fc..1c6a0288d48437791a3bf56b6fb419adf081343f 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 1d33b086dfa927240e2210e16780079f1b314848..b9978958152eb6426fbe698466f98896ea6252ae 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 2c45bc347629bbc0ea583f4f112f483f993f3b41..b3131eda107746905e76be9590b0800e2534b0cb 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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 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
index 0b86e45462b43c8a826beacfb21f8866d9aba481..b5f829f963c8bd4615b26ba78a23a97d0ffae228 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 18f6af8718ae0e9196844088486a191ce738a76e..36fa1071393fead52d0b00b212e935c599826af3 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 6c6f7152d87b708c0349f4c3d77a7395863ddeaf..c28a9733cef8cb43cb4220d972d6c669b98d7dec 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 8b9ce8be82139a3b8a622729689dbccbf5d5cd55..ebb9cb851e9b594e46d4a292e14d5f08fb67e8af 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index b23399887d03196cc0c7df66dcd89a45941f2d8a..c4550ae98b593049fb4ce7acf71f406b3b4a256b 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 9b3384bf6d44baf23fb97531bd94e191daf03ab0..676fe753863226c7bc21611fce3b366be2a25cae 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 822e10c3a4305b70cf41c879006751d66df4604a..8551c7f8e985c2fe0b452c9cc3ef64b4f2d96b54 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 80d6b2dd6a6b3e85eb3bcab7be0ab519b50220a8..d112436748d598e6cb0bfea2668faaa5c2cbb3ce 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index d0f89e75fb4d35ae31f254f72c5dfee66ac9404a..afa7883276cd09cf6041b3d56bbeaa7aa1e2aa45 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index bb9be3af20ff5d56e842761d3c3f574919726e55..c0d4fdd7679ad15b57ecbcce9281fe9149541a6e 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 9928a46f20059151445744bcb7036ff7911b2545..9068c1e61a921a72dfe5f403def43adf44ac123a 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 7cabeb6c998b0813e048a444b514d9894a5e3e9d..5f8bd5ae83a2991cc618ca4a400972ab012500ef 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlaccess\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index bc36a2ddb16390c4622795ebeb120bdbf30ad716..f8b908bc8ab64f504b5eed8ab8020b601bb5457b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqladmin\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 0eb82b81537eeda02564261b8fa27aff2b8dfac2..c638e55136062e1e2b897fc214e4b005d85e97d0 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlbinlog\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index c95041603c0715eebab96450d6fb6e56e95b5334..644baec37c2a92e83bf8415a56fcc08d0562e5e7 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlbug\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 70585a8b77ff28b3b3a0a440e50797ef9ec8cb61..48b95db9c931100ea74b679487ac225bb44b2838 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlcheck\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 4913cd1d79f4e3d8d5bdd4779e47a16e7128a39f..39a26f7e6c9f44bb71d6f19766b4be2af2f74c7c 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqld\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index ce737a581c9dd5ee52ea989c72bb5654ca6f2123..94b79a8deee25530f4512782241c0c92811bd9e5 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index b0863bc354e7490cf3c095be67eed38598d8f56f..93495090f206af2604aab1e09224615b0075a168 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 747190818abc7f462ac3ea1d6863e9acbaaae1cc..84140c91b7d8d4feaff6a36ec06e8afe1868873d 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqldump\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 4f7fc9125385b0e07c73e056d11144a4daa74ae7..8a8451f4cc2ea0e103473159d24827ca73e0c327 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqldumpslow\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 9e585051e898c1b576d03ffed163c086f7b0f46a..8d7114c050162299e6279bba1acf6ec2c85f68aa 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlhotcopy\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index a42b7050ffb34d55142ae9a22557cb7cc656170d..07bbb54c18aec8af8eb9d432c336173e5c2f0b4e 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlimport\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index b49434881c77c67d4026cc84162aaa6755847267..fad8568ea997851ce55d3a51af76b6906e7922e5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlshow\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 496a230eaeffbbd508345f753fa9ad0405f89a8c..1a12182f61941c420e0254988aae280b739858bd 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlslap\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 98def1e5da400eddbc433e1896fe839ba9b3c96a..b4eb96761646269a31f7e0f49c55e151a9897c82 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqltest\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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 (file)
index e21c2c3..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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=<id>;][host=]<hostname>[:<port>].
-      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 (file)
index 13a702d..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index de1958a..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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
-<configvariables protocolversion="1" ndbversionstring="5\&.6\&.22\-ndb\-7\&.3\&.9"
-                    ndbversion="458758" ndbversionmajor="7" ndbversionminor="0"
-                    ndbversionbuild="6">
-  <section name="SYSTEM">
-    <param name="Name" comment="Name of system (NDB Cluster)" type="string"
-              mandatory="true"/>
-    <param name="PrimaryMGMNode" comment="Node id of Primary ndb_mgmd(MGM) node"
-              type="unsigned" default="0" min="0" max="4294967039"/>
-    <param name="ConfigGenerationNumber" comment="Configuration generation number"
-              type="unsigned" default="0" min="0" max="4294967039"/>
-  </section>
-  <section name="NDBD">
-    <param name="MaxNoOfSubscriptions" 
-              comment="Max no of subscriptions (default 0 == MaxNoOfTables)"
-              type="unsigned" default="0" min="0" max="4294967039"/>
-    <param name="MaxNoOfSubscribers" 
-              comment="Max no of subscribers (default 0 == 2 * MaxNoOfTables)"
-              type="unsigned" default="0" min="0" max="4294967039"/>
-    \&...
-  </section>
-  \&...
-</configvariables>
-.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
-<param>
-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
-<param>
-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
-<param name="Diskless" comment="Run wo/ disk" type="bool" default="false" 
-          \fIrestart="system" initial="true"\fR/>
-.fi
-.if n \{\
-.RE
-.\}
-.sp
-Currently, no
-initial
-attribute is included in the XML output for
-<param>
-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 (file)
index c1b5d68..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index cb1a796..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 197054f..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index a468fa9..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 7c73fcd..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 07c5c68..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 6e5ed09..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 3b892e7..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 28d1a8a..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index ac788d1..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index d28b3a5..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index a49701f..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index e6b312a..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 467e884..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 37fd7e4..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 773767a..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index d84124d..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 149f3d3..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 8c7c83e..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 449f7b0..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index fec5339..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index 0736aa7..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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 (file)
index b884308..0000000
+++ /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 <http://docbook.sf.net/>
-.\"      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/).
index c6551e0321802c9f4587eb59f2143706fae47eb9..f9f15180208e0b272a30057de07b07274a7baa36 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBperror\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index cbb772939f99240a3a61da71585ea3e53103aeaa..e4c2ef8f126c731deaefc6ef3d5478cfbface046 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBreplace\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index b0c0ad9e26aae60102cc278c05b56fe10b5ea2f4..e3d1ab18f5787ab828082a49fa223b91c600e1c4 100644 (file)
@@ -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 <http://docbook.sf.net/>
-.\"      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
index 4efad013e2ea5fa9d07804ce0469a88958aa089a..97b76581bd20da538ae664c1910d0929dc4f38c9 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBresolveip\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 56c43225abf899f0d5c72266548901f296941fcd..9e677b80289d74665fd8afa37e8ee1b46e676edb 100644 (file)
@@ -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
index cdbccc39a62904ef9ed06f580c6f5057f082bfe5..45a2f49c4401fd7baaba7bbdf0fc17db95bc9132 100644 (file)
@@ -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.
index 67c4c293d8f9ee6dc908ffdabe6e1bc58ef043ab..a04eff968b6a12377f8a91db4a446e274ac15ef9 100644 (file)
@@ -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 
index 25194282d30061b9e261850e01a0e1a475799b37..1cfa4c5d0de2a7a54d3db0ef7e5aa4c5b7e9498a 100644 (file)
@@ -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!
-
index 872b97fc5e0aeb882e0f904dc01182a0389de759..31ee3ba6818dab8f2a77f65430df6d74399a4047 100644 (file)
@@ -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 (file)
index 9ac7af5..0000000
+++ /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 (file)
index 3d1016b..0000000
+++ /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
index b4d36e538d553954bc1afe43e4eed026d89e5be0..c8904d86b9a711433d2b22f0e8ea13d0246c39d2 100644 (file)
@@ -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
index 2ea6dc0c0da1a3bd99df2ff2bd5374694ab0603c..cde8e75d8a6bd144e9881033c1a0c0a0df82fd66 100644 (file)
@@ -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
index 5491110abec7f25feb280b0edd8723dc88191105..954f8b892bb0af50f678cfa4755cba5cc13d169b 100644 (file)
@@ -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
index 8a36566f747d0c23d3be8f17f421d65ee81f7fc5..c332c015c858bd4afd10ce31cf71c474f96cc645 100644 (file)
@@ -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;
 
index a9d0232a551334b3683a8f977a9c87ab3f344ada..8a76032ee2c1ead42b051561a0011e58003b5c6a 100644 (file)
@@ -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`;
index 2ee3046277759f0287e834639f5bff6f4406b8b1..b59d7dfe1bc88aac409e237a0fad31e70473ccca 100644 (file)
@@ -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 (file)
index 0000000..5ffd487
--- /dev/null
@@ -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 (file)
index 0000000..c6a56ad
--- /dev/null
@@ -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 (file)
index 0000000..af22389
--- /dev/null
@@ -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
index be50f38c7133d567e9add8f5bd4ba2038ccb0e8f..608e4d1ee4f9f5ce72647d28d1138c09d401ce7c 100644 (file)
@@ -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 (file)
index 0000000..a980a6d
--- /dev/null
@@ -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 (<FILE>) {
+    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
index fe5c7562cdd37ad9773f433644fd2598cbe2d22a..6ef3aece4e4e056de6ee154344de2f022e0f92a5 100644 (file)
@@ -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
index cecd4a6568924075bb4d203a6f32b8ad47b4a744..1c98245b4f5188ef75b875d01e1b765cc5eb1aeb 100644 (file)
@@ -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 (file)
index 0000000..589522a
--- /dev/null
@@ -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 (file)
index 0000000..bc65222
--- /dev/null
@@ -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 (file)
index 0000000..bfd9b18
--- /dev/null
@@ -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 (file)
index 0000000..6043b58
--- /dev/null
@@ -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 (file)
index 0000000..0fb5479
--- /dev/null
@@ -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 (file)
index 0000000..7c79d6f
--- /dev/null
@@ -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 (file)
index 0000000..232cb46
--- /dev/null
@@ -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 (file)
index 0000000..5fe4e8c
--- /dev/null
@@ -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 (file)
index 0000000..eaa5cdd
--- /dev/null
@@ -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 (file)
index 0000000..3495ad2
--- /dev/null
@@ -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 (file)
index 0000000..5652538
--- /dev/null
@@ -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 (file)
index 0000000..cf3a498
--- /dev/null
@@ -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 (file)
index 0000000..d005304
--- /dev/null
@@ -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 (file)
index 0000000..bd1c7d7
--- /dev/null
@@ -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 (file)
index 0000000..52220ed
--- /dev/null
@@ -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 (file)
index 0000000..1b5948f
--- /dev/null
@@ -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 (file)
index 0000000..bb5cbc0
--- /dev/null
@@ -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 (file)
index 0000000..c61bad8
--- /dev/null
@@ -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
index 3bd25834903328fa4e18c959a0ba51751ea83cf6..c08a32bb6c4ace69919a2d81b7b75b18712f1461 100644 (file)
@@ -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
index 9de3058c8bb89186bdf07b4492a6992d7389098f..228ccce95f85b004d487df925dcd69e6aa52adb9 100644 (file)
@@ -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||
index e156cfd6afc45cdf21e2b88fd9b0082d27e60131..8b3b387f724ec2d9865455a1df7ae19804e98b66 100644 (file)
@@ -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
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 451c22f62e38fa72d02aba58744c893aeb998036..8ffd3509afcce71abef9425b7508ca5511138a8e 100644 (file)
@@ -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 (file)
index 0000000..3314b5c
--- /dev/null
@@ -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;
index f5818cd3301382073a3d1269933a7c286283e9f8..a1a378a9c7c460ff6e061672c933e41a094b0722 100644 (file)
@@ -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
index f59e3ed1629f295bf4e0889911ff175693a59258..e8c01f0524404f267783508dd3fe513b3f2a8294 100644 (file)
@@ -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
index f0f6e32f7f68cc153a57d3834e2ef7b2c504f788..ade2e580d50a183367284c52676a60df3289a46c 100644 (file)
@@ -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
 
index 983c566821e85405323a0c8353c4641c819328e1..4ee3d17810cbb15e8f6b01efbfea0300e714981b 100644 (file)
@@ -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
-
index 15de01bc4b3d168e767cc5e0d2f4e757327bde1e..f88faed891e3c25c914cc41c4fa11053e59cddbd 100644 (file)
@@ -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;
index 208932cb17e2547da6ba2e4f9c2b92aa3d0c0da3..8a95c37c2c353ab84cae139b438e5620c36d9a39 100644 (file)
@@ -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.
 
index 34bc59fb7b6ac7060015a6a7608034bb81fc0127..de53fb598ddcf10076db9aa5b28c33324316ac6f 100644 (file)
@@ -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 (file)
index c1f9480..0000000
+++ /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 (file)
index 0000000..bae56fb
--- /dev/null
@@ -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;
+
index c7bb774929a69e236b82903d9384aa56c024490b..c45917e7776c00867fa012f7643143d91eb88bc0 100644 (file)
@@ -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
index 8a989becc1819c7c1bb67a1eb47f1b84d6e66a1b..56889d14c34f899f84e816b6761071e71c2d8f3f 100644 (file)
@@ -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;
index 8bb9e7280fb0bc7dc97ffa4ec4e211440c2bc51a..6ee04c7cd9feba12972e8f704c2c7da847f1bb69 100644 (file)
@@ -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'
 }
index 535df07871dedede045b1cb58a6689602ef787c1..642ee0a3accc926449061c9942f56b38da21eb81 100644 (file)
@@ -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': $!";
 
index bf2a8fad2f55670a41b7af405348cc5c8235fa7a..fca7f9d1086bb02895d723ab868f8b45c2c376f1 100644 (file)
@@ -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 (file)
index 0000000..0b0e468
--- /dev/null
@@ -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.<suffix>] group to be
+# used for connecting to [mysqld.<suffix>]
+#
+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.<suffix>]
+ $self->post_check_client_group($config,
+                               'client',
+                               $first_mysqld->name());
+
+ # Then generate [client.<suffix>] for each [mysqld.<suffix>]
+ 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.<suffix>]
+#
+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.<suffix>] section for each
+  # defined [cluster_config.<suffix>] 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.<suffix>]
+    $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;
+
index 45867d214ee1434c07e02ce171f208f5fdc170b4..b9e4fb1a2b1bddedb1a718a353fb1c76a43b67dc 100644 (file)
@@ -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)
        {
 
index 2c634b3eb4ee986eeba09f1cd1f48f6655e0b187..51713517ae194ed1923fbb02767b6028bbe3e53e 100644 (file)
@@ -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);
index 82b5d1c683cf349b701cb7237eeea27634bbcddb..879a9d85ef88f4133a687c03cd4db860247ba024 100755 (executable)
@@ -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.
 
index fc505a087feecf6e23a99e6289d9bf1670a57ced..c16757684d186502a96c5b21cedc152d19707f1d 100644 (file)
@@ -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 (file)
index 0000000..7adb23d
--- /dev/null
@@ -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.
+
index 52e84818dedb64a482c23c7d4dbe98ccd82d2e44..04e91815f2a7527853a87f44159f3b983b8c5c69 100644 (file)
@@ -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
index 3b7a56049dcaf80bdd8d39dfd26932a22e271f5d..e1824d4c453792eca0a73b903ff932aad3b61384 100644 (file)
@@ -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
index 1c6b997abc8b109e173f2b014852c71c71aa38a2..5902c6b3b5c6702bca7e1d80594882aa1652e912 100644 (file)
@@ -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
index ff2d9bc5572da040fa6fa6ac6c1fac46f0b6dc2b..473bc2f8a06408f96f13fe080717250ff7dfd3b5 100644 (file)
@@ -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
index f1e77a51b25d47062f4f7238eabe4034f03c6ca8..bd165a2710375dc3aec143af07e6450a122bc19b 100644 (file)
@@ -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 (file)
index 0000000..d986fd9
--- /dev/null
@@ -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;
index f50915aaefa17c011468cc2001c4a6772b1293e6..8f2c74166be55947536d3ff87b710d3e08a3ca21 100644 (file)
@@ -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
index 66396e11ff761e628ce69db09d9ed1e0093c3aeb..2c600cfd86ddb9865dcb1ceca58e368e4751c65e 100644 (file)
@@ -554,3 +554,18 @@ NULL       UNION RESULT    <union1,2>      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
index 57daf7986af9bc8f14078cf2c3905a37bd576f0f..175c1807639594d5997f5d55b181ed7f2f9f3807 100644 (file)
@@ -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');
index 0eda71e3b1b07426910a740ccb6a948ca9854c72..b1111da2292c2e35aa579ed9d9a5232189965f28 100644 (file)
@@ -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;
index 61b8c58732727e16f9369feb981e88a0f61649c1..000e8eea67bf68ef724f7105d2ce290247c487d0 100644 (file)
@@ -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 (file)
index 0000000..7737cce
--- /dev/null
@@ -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 (file)
index 0000000..31f3666
--- /dev/null
@@ -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 (file)
index 0000000..ea25b32
--- /dev/null
@@ -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
index 5f7d2a7c88b3586345b6be9192c42414f7920456..25a094b99329b970515ba83238b705496dd98697 100644 (file)
@@ -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;
index 78ae001290725b201ab8f7804fa11d6fac9bcfc0..a7fd7b8fee80dcb6fbfddafcbc3002de6df427ef 100644 (file)
@@ -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 (file)
index 0000000..af32ac7
--- /dev/null
@@ -0,0 +1,2 @@
+Variable_name  Value
+wsrep_on       ON
index 083e89676343c7a6b8eef8c01186e4661afa1da5..782b3f2f59cfdc965b4ee8c74d629c1e4b3d8029 100644 (file)
@@ -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
index fce2f40dd89bd674bcb7d3d85b7d0cf361229765..149babcb8aa39e264050ccc3ea177cf426d7f7ea 100644 (file)
@@ -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;
index 6f7169e9356cad718967ca00cfbdcb60154b2aad..0763b89c498bbda9b3f4ec2193bdf9cfd21229c0 100644 (file)
@@ -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;
index d7ae2a401bdcd62347941089a24cd2fcbb9a8b3e..1128caf91225c19d91b844790ed24e516c10f03e 100644 (file)
@@ -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\r
+line2\r
 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 (file)
index 0000000..2ff2e0f
--- /dev/null
@@ -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 (file)
index 0000000..a090f46
--- /dev/null
@@ -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 (file)
index 1beed10..0000000
+++ /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;
index a1ab0bafc5d9ce3f2f243f09988655fa4e4607e9..a9cee65d7f417f9084bab7ff5d95fdc25a317f94 100644 (file)
@@ -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
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 871c12ca4c001af9e94d43feabef89f65b4a51e7..be8286943de9ce18fb7db433c3769343e0416e64 100644 (file)
@@ -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;
index 0eee0f815f9043da438b0c0a3b7c014b9975d3bf..cb23003710887d5d8b18501fff6cbadd1b908631 100644 (file)
@@ -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\r
 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\r
+B` VALUES("A\r
 B");
-SELECT HEX(c1) FROM `A
+SELECT HEX(c1) FROM `A\r
 B`;
 HEX(c1)
 410042
 410D0A42
 
 FLUSH LOGS;
-DROP TABLE `A
+DROP TABLE `A\r
 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\r
 B`;
 HEX(c1)
 410042
 410D0A42
 
-DROP TABLE `A
+DROP TABLE `A\r
 B`;
 RESET MASTER;
 include/assert.inc [Table and contents created through mysqltest match 0x610D0A62.]
index a84fa3085715402bbf8ba5c1fbcfff6a7cfcc414..f1acfc7370908120bc669c170a08f3d3050fcb27 100644 (file)
@@ -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
index b2ccdce1c5cb00aac252a847a2e6c52b452d98b5..e971d8bca3c25462bbfbf12ceee4ad6e9dfa115c 100644 (file)
@@ -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.
 
index 627f359a24f4ca3f82dfe173f1cd111ca4521421..5c1616a0fd5b6a25b4aa50b86656106474a75003 100644 (file)
@@ -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
index 18b21ffd3e1948520e2ca792aee745d1865daddc..ab5251c6f97f49470becc7a3f855f22c4713aca9 100644 (file)
@@ -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'.
index 7e5e25963ec393b80411b011d61a39db304b67b9..f51feb5396af650114f0fc36c1032dbccd267f38 100644 (file)
@@ -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
index c1299119386151ec6ee1b0fb7725a7127b06703c..4e3c686308caf46fb464a29518150f4cc8e08b93 100644 (file)
@@ -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;
index f3ba8cd91a4fa039765b85e45d9a1a45cf71c816..671ece0a409e25ecb7ffab24d87a0ef23a5261dc 100644 (file)
@@ -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
index 17ec114e5cd9a0d905894c8523ee2cd0073d964d..571013d3cfa9df1b7dbc09780bce7e6636fbfa25 100644 (file)
@@ -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 (file)
index 0000000..7c8e74a
--- /dev/null
@@ -0,0 +1,2 @@
+HAVE_WSREP
+0
index 488ff7d4f00e9570ecf2b94013b49bf6dc92563a..82080d0de314eeb0b9f8b106b83d7183b3563305 100644 (file)
@@ -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
index cc484c9e0de98ecc21f659333a77e4fe9ee1a2ba..5e8ad51abfe5f7307e0bc662ea5957de13de75aa 100644 (file)
@@ -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
index 02fe9a47e9e62d677854d1b4ba98d20e94df88af..c50c4e2e8ce8475f0042a2a2033cbf422b249ea7 100644 (file)
@@ -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;
index 154f2008a96c1c45f63f63471689d6a9bef21947..5e3d3d6b685316528519d8b30d6d90d6f501bbd2 100644 (file)
@@ -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'
index 5e817b5ee070d6657e648c7c63767c722731c190..13916a7e4b73320144d0d2ed181d25cb9e45ca10 100644 (file)
@@ -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;
 #
index cbf45a2b7be7ce91d239856debeb13e54cd96f2b..3c394fd7f8251af6538348f0c7d65475fd09c015 100644 (file)
@@ -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;
index 3cea9dcfd53197be104ce0288c5b80cb9f2dc6b5..76b0dfd48046bd422258f62d4281006b668e803b 100644 (file)
@@ -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) 
index 339871f1f4a9265023cd0e620e8b509f5df13d3c..19dfc4f6940a770ac4f4c758c5a7a4f012a89a10 100644 (file)
@@ -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)
index 2f6c5a23a69744c70862ec55cf7b9063651c82b0..139b566757fea90e45f5a1b3e740a9b955bf4358 100644 (file)
@@ -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.\r
 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).\r
 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.\r
 Illegal error code: 30000
index 8b0f23c304754d614e11e897c0b75170d55f9603..fbc06d73f3c98e9bac712f8c9d6806fbc4c092c9 100644 (file)
@@ -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';
index 3ba4c1c3109e1f2636a758b3b7f0f23c4fe95a5c..7ad5deed7da77db6a133c74a7080ffe6868fce11 100644 (file)
@@ -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 '<non-deterministic-password-hash>'
+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('');
index 38c537d2cf84dd6bb9b12f6b1170d2d45aae9a7b..261bb623461e24bbd0e5b3ad494a2dbf573879bd 100644 (file)
@@ -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 '<non-deterministic-password-hash>'
+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
index 6f1aa20b16ed9dfce840234b7edbe3a7ecffc391..6e57e74fde37df6ebd3bcd98d36bee9ee6b3f255 100644 (file)
@@ -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 '<non-deterministic-password-hash>'
+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('');
index 76ec29a1f69c42d9113fa90a9b4084e9bead18bf..0a4a920fd3a1cb5586572ab43ec214a3186cc2d6 100644 (file)
@@ -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 '<non-deterministic-password-hash>'
+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('');
index 79b45feff8f4a96cc66588f9f0b99e5e07e9190a..975393b2c34e093d3bee6cc59c84bc85c5f4cd22 100644 (file)
@@ -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 '<non-deterministic-password-hash>'
+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('');
index 388f6aa7c912b2c6dff8c56e30f1772130c1f7c9..a35cc0d17cf005ece132a105b4e0f74655dc70c1 100644 (file)
@@ -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 <secret>
 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 <secret>
 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 <secret>
 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'
index aa8b35359cef5b95085ad7aca90443fceaaad40a..a4b2c4acd778afaa5f863beac444db5153f83b29 100644 (file)
@@ -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;
index eacb2548cde6179ff2f80b428c1174c94efd0147..361fcb0d6f15be10c4bbed06f4d007a801f0eaa7 100644 (file)
@@ -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;
index c6ebadfab4aa507add63c7f70d4dd7acbcb17ac2..1550bcf0ac7d41008e9a1288d308e9603905fb9d 100644 (file)
@@ -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;
index 4e9f0bc3651e63281964c2d90a8231ea33afed2c..6c612d0884c731e2e55f9121fff6560e00e1b293 100644 (file)
@@ -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;
index bd7c80cadfc1095ceb61e7a3f63dff51b1084bed..decf2550f9ac7a056dc5662495fc2e372a6fa56e 100644 (file)
@@ -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;
index 0a5d35edc52b45b0aa05b185b1364c63ed69ed44..ef718a40b2debd972e7b95f0e1ea6176d6b82684 100644 (file)
@@ -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;
index 332999c55b57b75ca16fbc25d9c44340133e9756..5cb844ed218e8a6c951ea124f52cfd070528c37c 100644 (file)
@@ -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!
+
index 92d314703505457f6de3a2a13c2cd3e46eec28ea..8bc7b0ec7738806dcf36a84eef151d83b763f202 100644 (file)
@@ -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
index 31974b6657b85ca19bdfa88267f736baeb4a026f..194f21335565b089546ddb25fcdba79f532428c3 100644 (file)
@@ -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;
index 1659947da9acbcf866dd6c2cbc2a46f7dd92235a..800d7b3191ef189651a30282bf2e786175e640d8 100644 (file)
@@ -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 (file)
index 0000000..6a95e20
--- /dev/null
@@ -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 (file)
index 0000000..4955efa
--- /dev/null
@@ -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 (file)
index 0000000..59d94b2
--- /dev/null
@@ -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;
index d2fe3159c95685e715de0a858ddf04ab3794279d..9398f5816431063a35352452f7c46f6a6ba5dcd2 100644 (file)
@@ -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          Using where
-2      SUBQUERY        t2      ALL     NULL    NULL    NULL    NULL          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 (
index fff4b4d5f3f4bda0a342ace92e00c133e36e7506..b9137e77e245c0621a8c21373673451c82a895b5 100644 (file)
@@ -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          Using where
-2      SUBQUERY        t2      ALL     NULL    NULL    NULL    NULL          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 (
index 9f70f1a706035b96929e00ceaf133029efd94881..f0a072c3737d7a81e8789e0111e65437fd71f817 100644 (file)
@@ -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          Using where
-2      DEPENDENT SUBQUERY      t2      ALL     NULL    NULL    NULL    NULL          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 (
index 098f71ebe80b34da29b4178c88f0061af7b9aba6..b0408bf0f5c41fcf213ffbdc348e1b6f050fd510 100644 (file)
@@ -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": "<subquery2>",
+          "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": [
+            "<subquery2>.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` = `<subquery2>`.`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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     a       a       5       <subquery2>.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  <subquery2>     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` = `<subquery2>`.`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  <subquery2>     eq_ref  <auto_key>      <auto_key>      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        <subquery3>     ALL     NULL    NULL    NULL    NULL    NULL    NULL
+2      SUBQUERY        grandparent1    ref     col_varchar_key col_varchar_key 3       <subquery3>.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;
index 55d7d63d784dd9ff352dceddee78f5a2b6a844d8..acf5190a4ee88e1c415fc189850eda3d505d9338 100644 (file)
@@ -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": "<subquery2>",
+          "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": [
+            "<subquery2>.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` = `<subquery2>`.`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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     a       a       5       <subquery2>.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  <subquery2>     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` = `<subquery2>`.`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  <subquery2>     eq_ref  <auto_key>      <auto_key>      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        <subquery3>     ALL     NULL    NULL    NULL    NULL    NULL    NULL
+2      SUBQUERY        grandparent1    ref     col_varchar_key col_varchar_key 3       <subquery3>.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;
index 52f4ae6de022c8a251e60c87bfa250574e2ac41b..85d3b8e3e260ab7f3940eb1665614408d07d9a66 100644 (file)
@@ -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": "<subquery2>",
+          "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": [
+            "<subquery2>.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` = `<subquery2>`.`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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     a       a       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    0.00    Using where
+1      SIMPLE  a       eq_ref  PRIMARY PRIMARY 4       <subquery2>.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` = `<subquery2>`.`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  <subquery2>     eq_ref  <auto_key>      <auto_key>      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        <subquery3>     ALL     NULL    NULL    NULL    NULL    NULL    NULL
+2      SUBQUERY        grandparent1    ref     col_varchar_key col_varchar_key 3       <subquery3>.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;
index f05ca11bc3a30098768b9c75066edd628f8cc70a..b3540ad107f5acd77094baf95f3de7cadd716b6b 100644 (file)
@@ -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": "<subquery2>",
+          "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": [
+            "<subquery2>.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` = `<subquery2>`.`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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     a       a       5       <subquery2>.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  <subquery2>     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` = `<subquery2>`.`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  <subquery2>     eq_ref  <auto_key>      <auto_key>      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        <subquery3>     ALL     NULL    NULL    NULL    NULL    NULL    NULL
+2      SUBQUERY        grandparent1    ref     col_varchar_key col_varchar_key 3       <subquery3>.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;
index c9c4e7ad149bc30b4fa6aa3da89d24994d8f2160..e17ca8e373bff9e4dc0f602988dd61ad90da4a84 100644 (file)
@@ -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 (<cache>('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": "<if>(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": "<if>(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(<in_optimizer>('8',<exists>(/* 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 (<cache>('8') = `test`.`parent1`.`col_int_key`))))))
+Note   1003    /* select#1 */ select '8' AS `g1` from dual where (not(<in_optimizer>('8',<exists>(/* 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 (<cache>('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;
index 7ce8131c5e6aa23fe774d870692df8ce4eb1734c..3b5bd304ca65f2d5f427c169ab71c207a9c2db6f 100644 (file)
@@ -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 (<cache>('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": "<if>(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": "<if>(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(<in_optimizer>('8',<exists>(/* 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 (<cache>('8') = `test`.`parent1`.`col_int_key`))))))
+Note   1003    /* select#1 */ select '8' AS `g1` from dual where (not(<in_optimizer>('8',<exists>(/* 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 (<cache>('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;
index b355b9bffc5d75a324cbf11316fe4d8b64d7dbe1..0128f4269db0c693875fea50e97083cf01043177 100644 (file)
@@ -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;
index b30cc4002e36f19d83b06bb40d5bd4389c1127cc..d68b572385e228c46a7381c17d95f194c16eba24 100644 (file)
@@ -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 (<cache>('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": "<if>(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": "<if>(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(<in_optimizer>('8',<exists>(/* 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 (<cache>('8') = `test`.`parent1`.`col_int_key`))))))
+Note   1003    /* select#1 */ select '8' AS `g1` from dual where (not(<in_optimizer>('8',<exists>(/* 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 (<cache>('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;
index 190cae50034ef6846e8733dbbe0275b12ab3c3ce..6f96debab33af5a49fc8aa7da9879849017cd9ab 100644 (file)
@@ -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": "<if>(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 (<cache>('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(<in_optimizer>('8',<exists>(/* 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 (<cache>('8') = `test`.`parent1`.`col_int_key`))))))
+Note   1003    /* select#1 */ select '8' AS `g1` from dual where (not(<in_optimizer>('8',<exists>(/* 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 (<cache>('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": [
-                  "<auto_key0>"
-                ],
-                "key": "<auto_key0>",
-                "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": "<if>(is_not_null_compl(t1), (`test`.`t1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`), true)"
+          "attached_condition": "<if>(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
 #
index 76682cd38fd60cafa282ca771f8553a14e628831..40521dba6f5f99b7ab3a4884b9bd6fb4d613e9b8 100644 (file)
@@ -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": "<if>(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 (<cache>('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(<in_optimizer>('8',<exists>(/* 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 (<cache>('8') = `test`.`parent1`.`col_int_key`))))))
+Note   1003    /* select#1 */ select '8' AS `g1` from dual where (not(<in_optimizer>('8',<exists>(/* 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 (<cache>('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": [
-                  "<auto_key0>"
-                ],
-                "key": "<auto_key0>",
-                "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": "<if>(is_not_null_compl(t1), (`test`.`t1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`), true)"
+          "attached_condition": "<if>(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
 #
index c0ac2b51c7431b596ab96c42ce5bb0f85338dbee..8d6f932232eebd127eb87268b051c5f043837e76 100644 (file)
@@ -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
 #
index 0f5d9ac2f00a713e47c6773a323b5df14780c9f4..28d2780a52e13f493421b0a8ae883a5f161c3478 100644 (file)
@@ -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": "<if>(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 (<cache>('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(<in_optimizer>('8',<exists>(/* 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 (<cache>('8') = `test`.`parent1`.`col_int_key`))))))
+Note   1003    /* select#1 */ select '8' AS `g1` from dual where (not(<in_optimizer>('8',<exists>(/* 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 (<cache>('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": [
-                  "<auto_key0>"
-                ],
-                "key": "<auto_key0>",
-                "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": "<if>(is_not_null_compl(t1), (`test`.`t1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`), true)"
+          "attached_condition": "<if>(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
 #
index 91bc76e6d6a24be72131ee725d4c205755d9239f..85ade1fecbb599adcf5adec53d31953bd846bd5a 100644 (file)
@@ -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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t2      ref     b       b       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     b       b       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    #       Using where
+1      SIMPLE  t3      ref     b       b       5       <subquery2>.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
index 86688f7798a34395db006e038477813e21c3744c..b269d1d45dad011305281b05df4cee2c1af7f5b5 100644 (file)
@@ -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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t2      ref     b       b       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     b       b       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    #       Using where
+1      SIMPLE  t3      ref     b       b       5       <subquery2>.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
index e2407ec246eca16148c4b0e7b000c24a2362af61..6d68085f5920552b732020f30f029cb061c1db68 100644 (file)
@@ -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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t2      ref     b       b       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     b       b       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    #       Using where
+1      SIMPLE  t3      ref     b       b       5       <subquery2>.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
index f5f395a8dc69abf38a65263b130eb3cd7b86da18..222aa38a91677460152cd0fa81bbdab981a8061e 100644 (file)
@@ -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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t2      ref     b       b       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     b       b       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    #       Using where
+1      SIMPLE  t3      ref     b       b       5       <subquery2>.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
index 2529cca22d1d1f27f7a69bcfa9d5f9271af0e01e..50177f0b6cc59de856a8ceac051959c48f609e31 100644 (file)
@@ -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 (<cache>('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": "<if>(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": "<if>(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(<in_optimizer>('8',<exists>(/* 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 (<cache>('8') = `test`.`parent1`.`col_int_key`))))))
+Note   1003    /* select#1 */ select '8' AS `g1` from dual where (not(<in_optimizer>('8',<exists>(/* 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 (<cache>('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;
index c0f3fd5515949789ecccb4bd5f68e3703306dc83..e79aa141cd062c33e5046be2288fc3ac6b27bddb 100644 (file)
@@ -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 (<cache>('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": "<if>(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": "<if>(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(<in_optimizer>('8',<exists>(/* 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 (<cache>('8') = `test`.`parent1`.`col_int_key`))))))
+Note   1003    /* select#1 */ select '8' AS `g1` from dual where (not(<in_optimizer>('8',<exists>(/* 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 (<cache>('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;
index dbb80885a42df210e3519c38ad6dc38f03505ca3..37d314d5cde3def91b1fae45b5af7f9d578138a4 100644 (file)
@@ -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;
index 8207454faf5bad9a88ed69206c81e0f1a677c3cc..98a23d3a297e039541d775d43efec0b792382446 100644 (file)
@@ -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 (<cache>('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": "<if>(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": "<if>(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(<in_optimizer>('8',<exists>(/* 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 (<cache>('8') = `test`.`parent1`.`col_int_key`))))))
+Note   1003    /* select#1 */ select '8' AS `g1` from dual where (not(<in_optimizer>('8',<exists>(/* 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 (<cache>('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;
index acd322bd77d062e43af89bfd805cc2198f86ca18..4f0885a30cf6c219aaea512e10e61cd4dadf5bcc 100644 (file)
@@ -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": "<subquery2>",
+          "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": [
+            "<subquery2>.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` = `<subquery2>`.`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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     a       a       5       <subquery2>.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  <subquery2>     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` = `<subquery2>`.`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  <subquery2>     eq_ref  <auto_key>      <auto_key>      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        <subquery3>     ALL     NULL    NULL    NULL    NULL    NULL    NULL
+2      SUBQUERY        grandparent1    ref     col_varchar_key col_varchar_key 3       <subquery3>.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;
index 7864846ea3961973f2db87c6243935613d72944d..5aef86498523d993c1ac0bcc36e81564bb77b1f8 100644 (file)
@@ -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": "<subquery2>",
+          "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": [
+            "<subquery2>.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` = `<subquery2>`.`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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     a       a       5       <subquery2>.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  <subquery2>     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` = `<subquery2>`.`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  <subquery2>     eq_ref  <auto_key>      <auto_key>      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        <subquery3>     ALL     NULL    NULL    NULL    NULL    NULL    NULL
+2      SUBQUERY        grandparent1    ref     col_varchar_key col_varchar_key 3       <subquery3>.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;
index d7705d4925ace62bd9d1732fd90c4d5e23b5086a..53ea4f1f7f1d9ed669547466996e27594a683c59 100644 (file)
@@ -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": "<subquery2>",
+          "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": [
+            "<subquery2>.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` = `<subquery2>`.`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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     a       a       5       <subquery2>.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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    0.00    Using where
+1      SIMPLE  a       eq_ref  PRIMARY PRIMARY 4       <subquery2>.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` = `<subquery2>`.`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  <subquery2>     eq_ref  <auto_key>      <auto_key>      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        <subquery3>     ALL     NULL    NULL    NULL    NULL    NULL    NULL
+2      SUBQUERY        grandparent1    ref     col_varchar_key col_varchar_key 3       <subquery3>.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;
index 48dda60189c30277e3fda17b02c69c9d366eb60c..d7d4d0f5c979d63e1476d7529d2c5dc8dce413c5 100644 (file)
@@ -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": "<subquery2>",
+          "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": [
+            "<subquery2>.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` = `<subquery2>`.`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  <subquery2>     ALL     NULL    NULL    NULL    NULL    NULL    Using where
+1      SIMPLE  t3      ref     a       a       5       <subquery2>.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  <subquery2>     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` = `<subquery2>`.`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  <subquery2>     eq_ref  <auto_key>      <auto_key>      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        <subquery3>     ALL     NULL    NULL    NULL    NULL    NULL    NULL
+2      SUBQUERY        grandparent1    ref     col_varchar_key col_varchar_key 3       <subquery3>.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;
index 6d169a9cea4a79c89192e8e635368153420be61d..46aa563bfdeeb98e43f2255d5ecfd65a9d1dde0e 100644 (file)
@@ -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;
index cf5d6bf6e395e9d00b5872a46e53813f64e896db..90d4a19c25e788cb490fdedec819fdad0acb06f7 100644 (file)
@@ -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;
index 65efb8c161c1b1931a27a48d6dd1ea994ed27937..27eb308f1d5e8f6b53939e44294f66a184019a1a 100644 (file)
@@ -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;
index 8455f48f465f9bb5e482011f5e83c9987d152da6..217f7fb47f1fac8468aae99070b544aa00010625 100644 (file)
@@ -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;
index c55f71794ffa3cef32691da088366aa096861576..6936ca24f43f1ce14ff03855668bbc67425921a3 100644 (file)
@@ -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;
index 7f9121f2f7c2656e98a65f6979f43a36ea314fbc..a44bd322a7ed3223174b1bc963a2d6ad660ba75c 100644 (file)
@@ -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----------------------#'
index 722ac79854d1e1c5225b119d63d60560c7cec62a..cab7336cbe548df8aef567fef36c383b76d2f610 100644 (file)
@@ -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;
index 881ccf7bb03d995ed1020213be154e75931269c8..6de8cfadc553337bf41dc4f95d4e071e34d2aede 100644 (file)
@@ -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;
index e0aef415d1af6f72d9b1357c7d72e1124e7918eb..532cecc7dba34ec68eb68cc972d0327f6d42903c 100644 (file)
@@ -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
index dc6fb575e3eafee30d1abec3bd2b96281f4d63b9..f63c80ae37b9d00f5a63b1369e487be0e9aa0e0c 100644 (file)
@@ -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;
index 30aa77ddf378aba28310a5fb922587c1daca1a3f..07113eaeef33f15da0421a8ee5a358e6235a1dcc 100644 (file)
@@ -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 = '<MESSAGE><DATA1>HOLA</DATA1></MESSAGE>';
+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 (file)
index 0000000..c415a57
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 (file)
index 0000000..e7d8af5
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 (file)
index 0000000..e0fac26
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 (file)
index 0000000..b65b935
--- /dev/null
@@ -0,0 +1,59 @@
+<test_rows>
+  <row>
+    <col1>0bc</col1>
+    <col2>def</col2>
+    <col3>ghi</col3>
+    <col4>jkl</col4>
+  </row>
+  <row>
+    <col1>1no</col1>
+    <col2/>
+    <col3>pqr</col3>
+    <col4>stu</col4>
+  </row>
+
+  <row>
+    <col1>2BC</col1>
+    <col2>DEF</col2>
+    <col3>GHI</col3>
+    <col4>JKL</col4>
+  </row>
+  <row>
+    <col1>3NO</col1>
+    <col2 />
+    <col3>PQR</col3>
+    <col4>STU</col4>
+  </row>
+
+  <row col1="4bc" col2="def" col3="ghi" col4="jkl"/>
+  <row col1="5no"   col2="pqr"   col3="stu"   col4="vwx"   />
+
+  <row>
+    <field name='col1'>6BC</field>
+    <field name='col2'>DEF</field>
+    <field name='col3'></field>
+    <field name='col4'>JKL</field>
+  </row>
+  <row>
+    <field name='col1'>7NO</field>
+    <field name='col2'>PQR</field>
+    <field name='col3'>STU</field>
+    <field name='col4'>VWX</field>
+  </row>
+
+  <row>
+    <col1>8bc</col1>
+    <col2>def</col2>
+    <col3>ghi</col3>
+    <col4 />
+  </row>
+  <row>
+    <col1>9kl</col1>
+    <col2/>
+    <col3>mno</col3>
+    <col4>pqr</col4>
+  </row>
+
+  <row col1="ABC" col2="DEF" col3="" col4="JKL"/>
+  <row col1="MNO" col2="" col3="STU" col4="VWX"/>
+</test_rows>
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 (file)
index 0000000..8a48333
--- /dev/null
@@ -0,0 +1,12 @@
+<test_rows>
+  <row>
+    <col1>ABC</col1>
+    <col2>DEF</col2>
+    <col3 />
+  </row>
+  <row>
+    <col1>GHI</col1>
+    <col2 />
+    <col3>123</col3>
+  </row>
+</test_rows>
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 (file)
index 0000000..21d6264
--- /dev/null
@@ -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 (file)
index 0000000..4af7dc2
--- /dev/null
@@ -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 (file)
index 0000000..2996b33
--- /dev/null
@@ -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 (file)
index 0000000..c88c613
--- /dev/null
@@ -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 (file)
index 0000000..13d27e8
--- /dev/null
@@ -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 (file)
index 0000000..3af8b1a
--- /dev/null
@@ -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 (file)
index 0000000..d243c9e
--- /dev/null
@@ -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-----
index e1b29627d9821cdf4704d55e18df93e5e8b56f13..f0d966cf9b69b6eca6c9e2b5c09a31af4677bd32 100644 (file)
@@ -10,8 +10,8 @@
        <table_data name="t1">
        <row>
                <field name="id">1</field>
-               <field name="text">line1
-line2
+               <field name="text">line1\r
+line2\r
 line3</field>
        </row>
        </table_data>
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 (file)
index 0000000..4203425
--- /dev/null
@@ -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 (file)
index 0000000..f8780f1
--- /dev/null
@@ -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 (file)
index 0000000..af1ae1e
--- /dev/null
@@ -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 (file)
index 0000000..7ecc44f
--- /dev/null
@@ -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 (file)
index 0000000..13eac4c
--- /dev/null
@@ -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 (file)
index 0000000..b79f3b9
--- /dev/null
@@ -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 (executable)
index 0000000..7036f60
--- /dev/null
@@ -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 (file)
index 0000000..1da7732
--- /dev/null
@@ -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 (file)
index 0000000..e732fa9
--- /dev/null
@@ -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 (file)
index 0000000..1515fc6
--- /dev/null
@@ -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 (file)
index 0000000..abae27a
--- /dev/null
@@ -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 (file)
index 0000000..594d6c6
--- /dev/null
@@ -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
index f315aaabeb5534c74cb2ef6e5df6167fedbae837..810d7b778596c5fec8b4bc14bbc85518c1314c57 100644 (file)
@@ -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;
 
index a61c52fe5a0a8c553e663199d6dae3bf24cc8d72..6e9cd693d62bd00c1156db3461d8f6f15f43a6c9 100644 (file)
@@ -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;
index 9d96137821d24f35d635e2bf1735e2bdd52013c7..a5b70fb3bae81de1d117033fcc78f0ddbf19fe3b 100644 (file)
@@ -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 (file)
index 0000000..e98a3d0
--- /dev/null
@@ -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;
index 18d5719b03a08b5a23361c9514a2b160b4d7a423..8516f25891d0e56f6c68e2f333ee225491cf9096 100644 (file)
@@ -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
index e4dd6c31eadd81452dd3474b9b877dcf85dc0b52..f3f4fa6d484d7f445d3c684e29f5e0bb2062cdc7 100644 (file)
@@ -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 */
index a1a29d3b6b77154e842ca9d9fdeb62adc8f658bc..59adb4e84d27d1383387dd25e1e238a768b6aead 100644 (file)
@@ -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 */
index 6ebc7ff5e633a4d16ed3566117b76ffd65dd2948..a1d357ed6cdc5f52c53c91b3d1728e0fc88f17b4 100644 (file)
@@ -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;
index 449a908680a73805dc73938bf2c6a6ac15bf33c7..4f1ee073b6d2dbad81164f382ada6dcc75a066d9 100644 (file)
@@ -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
index e0e38a3fad65986a8f64e12ec9322a2d86360a97..cef4189809e630d7d3b375440301a436b7342c67 100644 (file)
@@ -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)
index 0f0aa26cdeb48befa36f9725699971e1466f53da..746e5d0dc617e6772417c82a79cc6239965d4779 100644 (file)
@@ -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
index f4a79b05c3a4cba1e1134f86b6310c714f4dbd4f..51dee704bcee0f6d1662b9e78e231cb051d16b9a 100644 (file)
@@ -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 */
index 2d2fd8970f73506b9e1b1f4d9158c29a758a79c7..bcba6d9e63c49f31c0325b5a94525e55fcd009bc 100644 (file)
@@ -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 (file)
index 0000000..d11a673
--- /dev/null
@@ -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;
index f60f80cb924ee9a128d52186995ba7d20e435a61..ff3805423423ac1065ec0fc308f85465f0ea3e2c 100644 (file)
@@ -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;
index 50e2fd16be3ac30243632679b5742be09cf3698b..8d0b6a5fcef23c0c846d56a4ecb36de6d6395c74 100644 (file)
@@ -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`
index d3b8f544fef46576480483c6fe78e2eafe4a8fe3..b9e99041146bcf570f7cfbdca2c9983bc989b8c8 100644 (file)
@@ -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 (file)
index 0000000..40b50b8
--- /dev/null
@@ -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
index e0cc9cabcc056b9a4cd58b8d7a2874a435db6c7b..8842ace9f65c160bf91ca89939c546dd546d71aa 100644 (file)
@@ -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;
index 3e4b8005dd6b73c9734ab216f2e8ed6032b70971..03b2af089224c0e344ea8dca81a576bd51cdca17 100644 (file)
@@ -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 (file)
index 0000000..e21765d
--- /dev/null
@@ -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 (file)
index 0000000..6cce02a
--- /dev/null
@@ -0,0 +1 @@
+--no-console --skip-core-file --log-error=$MYSQLTEST_VARDIR/tmp/binlog_error_action.err
index 548c5e2ad01a96a7628de1472c20b163f1c1c59a..9daea6a30873bbf5b4637352bb1d05797d542e70 100644 (file)
@@ -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 (file)
index 0000000..7e17eec
--- /dev/null
@@ -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 (file)
index 0000000..bf1d42a
--- /dev/null
@@ -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;
index ed4be5b0431b8ea9d65fc27581610ad3584e19af..41c4a852fb45d55c984b339ec9f34dc6ce699530 100644 (file)
@@ -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;
index 0bbbc877566dc83494a7da0fac2c0ea4c206eccd..6d3fa29b78b945f62af9bceb7dda681a3797cc0b 100644 (file)
@@ -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 (file)
index 0000000..bd6f140
--- /dev/null
@@ -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 (file)
index 0000000..5337e7b
--- /dev/null
@@ -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
+
index 888298bbb09e2eebe1471f7dde7bdc4bff6f2b9e..b74382895d2ceae497f3e9fa70a5d609835b1e3a 100644 (file)
@@ -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 (file)
index 0000000..8f03c8f
--- /dev/null
@@ -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
index fc415da58bdefae15ed88419ecf039872d1c48a9..743be148f42f929c22c21066d1b9a2326386c1da 100644 (file)
@@ -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
index a68ef533ccbdb24d6dc37253c30e3917de3ed3e0..0d180a0c71c53bbf8e908609bc10ca10757900cf 100644 (file)
@@ -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;
index fdd1a4be2903e03704c4cf6ea2543c5905ce0ed2..a881e2b89f263bcb8cd45d20090538b31a6a9474 100644 (file)
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
index d8e4c1ed6a339e9dbfce49389010e5d9abd9321b..bbfedace8fa7f3187cb82e181f52043885002e25 100644 (file)
@@ -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
index 9e876a2a97b4fa81d8ba1408794c1bc3f10ec9cc..cc1aaa473367ff165f12ce97854c97c1bbe53a45 100644 (file)
@@ -93,9 +93,11 @@ echo
 #
 # 1. Just dump what we get
 --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;
 --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
+--replace_result "init" STATE "starting" STATE "cleaning up" STATE
 --sorted_result
 SHOW FULL PROCESSLIST;
 #
@@ -168,9 +170,11 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
 --source include/wait_condition.inc
 # 1. Just dump what we get
 --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;
 --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
+--replace_result "init" STATE "starting" STATE "cleaning up" STATE
 --sorted_result
 SHOW FULL PROCESSLIST;
 #
@@ -215,9 +219,11 @@ echo
 ;
 connection con1;
 --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;
 --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
+--replace_result "init" STATE "starting" STATE "cleaning up" STATE
 --sorted_result
 SHOW FULL PROCESSLIST;
 
@@ -251,9 +257,11 @@ echo
 connection con2;
 # Just dump what we get
 --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;
 --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
+--replace_result "init" STATE "starting" STATE "cleaning up" STATE
 --sorted_result
 SHOW FULL PROCESSLIST;
 #
@@ -313,9 +321,11 @@ WHERE ID = @test_user_con2_id AND Command IN('Query','Execute')
 --source include/wait_condition.inc
 # 1. Just dump what we get
 --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;
 --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
+--replace_result "init" STATE "starting" STATE "cleaning up" STATE
 --sorted_result
 SHOW FULL PROCESSLIST;
 #
@@ -386,6 +396,7 @@ let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
 # Expect to see the state 'Waiting for table metadata lock' for the third
 # connection because the SELECT collides with the WRITE TABLE LOCK.
 --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;
 UNLOCK TABLES;
@@ -446,12 +457,15 @@ echo
 # SHOW PROCESSLIST                               statement truncated after 100 char
 ;
 --replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
+--replace_result "init" STATE "starting" STATE "cleaning up" STATE
 --sorted_result
 SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
 --replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
+--replace_result "init" STATE "starting" STATE "cleaning up" STATE
 --sorted_result
 SHOW FULL PROCESSLIST;
 --replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
+--replace_result "init" STATE "starting" STATE "cleaning up" STATE
 --sorted_result
 SHOW PROCESSLIST;
 UNLOCK TABLES;
index db92ea5644407a3bd5a4670742ceb809e8eb0629..c8e3977023b9b5e20394715dfa12f831f6bca5e7 100644 (file)
@@ -189,7 +189,7 @@ current_user
 test_yesprivs@localhost
 show grants;
 Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 create trigger trg4a_2 before INSERT  on t1 for each row
 set new.f1 = 'trig 3.5.3.7-2a';
 insert into t1 (f1) values ('insert 3.5.3.7-2b');
@@ -220,7 +220,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg4b_1 before UPDATE on t1 for each row
@@ -247,7 +247,7 @@ trig 3.5.3.7-2a
 drop trigger trg4b_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg4b_2 before UPDATE  on t1 for each row
@@ -292,7 +292,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg4c_1 before INSERT on t1 for each row
@@ -311,7 +311,7 @@ trig 3.5.3.7-2b
 drop trigger trg4c_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg4c_2 before INSERT  on t1 for each row
@@ -345,7 +345,7 @@ Grants for test_noprivs@%
 GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg4d_1 before INSERT on t1 for each row
@@ -365,7 +365,7 @@ trig 3.5.3.7-2c
 drop trigger trg4d_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg4d_2 before INSERT  on t1 for each row
@@ -422,7 +422,7 @@ current_user
 test_yesprivs@localhost
 show grants;
 Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 create trigger trg5a_2 before INSERT  on t1 for each row
 set @test_var= new.f1;
 set @test_var= 'before trig 3.5.3.8-2a';
@@ -454,7 +454,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg5b_1 before UPDATE on t1 for each row
@@ -472,7 +472,7 @@ before trig 3.5.3.8-1b
 drop trigger trg5b_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg5b_2 before UPDATE  on t1 for each row
@@ -507,7 +507,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg5c_1 before INSERT on t1 for each row
@@ -521,7 +521,7 @@ before trig 3.5.3.8-1c
 drop trigger trg5c_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg5c_2 before INSERT  on t1 for each row
@@ -551,7 +551,7 @@ GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C497
 GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg5d_1 before INSERT on t1 for each row
@@ -565,7 +565,7 @@ before trig 3.5.3.8-1d
 drop trigger trg5d_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg5d_2 before INSERT  on t1 for each row
index f41c304751a00a0ff7d09a18895dd8df1257a5e0..12ce83c137e93fbf9f88cc94c1da3ab611b6e6cb 100644 (file)
@@ -139,7 +139,7 @@ current_user
 test_yesprivs@localhost
 show grants for test_yesprivs@localhost;
 Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 drop trigger trg1_2;
 ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
@@ -387,7 +387,7 @@ current_user
 test_yesprivs@localhost
 show grants for test_yesprivs@localhost;
 Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 drop trigger trg1_2;
 select current_user;
@@ -1269,7 +1269,7 @@ current_user
 test_yesprivs@localhost
 show grants;
 Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
 GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 create definer=not_ex_user@localhost trigger trg1_3
index f0ab3a77d0d370d5b2399dc7dafad18770e2fd58..ec485d417d5ce91c4e70000185a3888304a7d2b4 100644 (file)
@@ -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)
index 31de6d2759e55e71760eea0a4fa8c11c1baf00ea..901a6f4155a21fa60c90d6665d17cd12abac06c5 100644 (file)
@@ -190,7 +190,7 @@ current_user
 test_yesprivs@localhost
 show grants;
 Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 create trigger trg4a_2 before INSERT  on t1 for each row
 set new.f1 = 'trig 3.5.3.7-2a';
 insert into t1 (f1) values ('insert 3.5.3.7-2b');
@@ -221,7 +221,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg4b_1 before UPDATE on t1 for each row
@@ -248,7 +248,7 @@ trig 3.5.3.7-2a
 drop trigger trg4b_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg4b_2 before UPDATE  on t1 for each row
@@ -293,7 +293,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg4c_1 before INSERT on t1 for each row
@@ -312,7 +312,7 @@ trig 3.5.3.7-2b
 drop trigger trg4c_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg4c_2 before INSERT  on t1 for each row
@@ -346,7 +346,7 @@ Grants for test_noprivs@%
 GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg4d_1 before INSERT on t1 for each row
@@ -366,7 +366,7 @@ trig 3.5.3.7-2c
 drop trigger trg4d_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg4d_2 before INSERT  on t1 for each row
@@ -423,7 +423,7 @@ current_user
 test_yesprivs@localhost
 show grants;
 Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 create trigger trg5a_2 before INSERT  on t1 for each row
 set @test_var= new.f1;
 set @test_var= 'before trig 3.5.3.8-2a';
@@ -455,7 +455,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg5b_1 before UPDATE on t1 for each row
@@ -473,7 +473,7 @@ before trig 3.5.3.8-1b
 drop trigger trg5b_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg5b_2 before UPDATE  on t1 for each row
@@ -508,7 +508,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg5c_1 before INSERT on t1 for each row
@@ -522,7 +522,7 @@ before trig 3.5.3.8-1c
 drop trigger trg5c_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg5c_2 before INSERT  on t1 for each row
@@ -552,7 +552,7 @@ GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C497
 GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg5d_1 before INSERT on t1 for each row
@@ -566,7 +566,7 @@ before trig 3.5.3.8-1d
 drop trigger trg5d_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg5d_2 before INSERT  on t1 for each row
index f4b82fa861a3a1e207d3b09e1be29d7336deaeb2..8692e4c293f75d0bcd2175ef5fc9a9c88aa48255 100644 (file)
@@ -140,7 +140,7 @@ current_user
 test_yesprivs@localhost
 show grants for test_yesprivs@localhost;
 Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 drop trigger trg1_2;
 ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
@@ -388,7 +388,7 @@ current_user
 test_yesprivs@localhost
 show grants for test_yesprivs@localhost;
 Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 drop trigger trg1_2;
 select current_user;
@@ -1270,7 +1270,7 @@ current_user
 test_yesprivs@localhost
 show grants;
 Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
 GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 create definer=not_ex_user@localhost trigger trg1_3
index 31de6d2759e55e71760eea0a4fa8c11c1baf00ea..901a6f4155a21fa60c90d6665d17cd12abac06c5 100644 (file)
@@ -190,7 +190,7 @@ current_user
 test_yesprivs@localhost
 show grants;
 Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 create trigger trg4a_2 before INSERT  on t1 for each row
 set new.f1 = 'trig 3.5.3.7-2a';
 insert into t1 (f1) values ('insert 3.5.3.7-2b');
@@ -221,7 +221,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg4b_1 before UPDATE on t1 for each row
@@ -248,7 +248,7 @@ trig 3.5.3.7-2a
 drop trigger trg4b_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg4b_2 before UPDATE  on t1 for each row
@@ -293,7 +293,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg4c_1 before INSERT on t1 for each row
@@ -312,7 +312,7 @@ trig 3.5.3.7-2b
 drop trigger trg4c_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg4c_2 before INSERT  on t1 for each row
@@ -346,7 +346,7 @@ Grants for test_noprivs@%
 GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg4d_1 before INSERT on t1 for each row
@@ -366,7 +366,7 @@ trig 3.5.3.7-2c
 drop trigger trg4d_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg4d_2 before INSERT  on t1 for each row
@@ -423,7 +423,7 @@ current_user
 test_yesprivs@localhost
 show grants;
 Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 create trigger trg5a_2 before INSERT  on t1 for each row
 set @test_var= new.f1;
 set @test_var= 'before trig 3.5.3.8-2a';
@@ -455,7 +455,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg5b_1 before UPDATE on t1 for each row
@@ -473,7 +473,7 @@ before trig 3.5.3.8-1b
 drop trigger trg5b_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg5b_2 before UPDATE  on t1 for each row
@@ -508,7 +508,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49
 GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg5c_1 before INSERT on t1 for each row
@@ -522,7 +522,7 @@ before trig 3.5.3.8-1c
 drop trigger trg5c_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg5c_2 before INSERT  on t1 for each row
@@ -552,7 +552,7 @@ GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C497
 GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 show grants;
 Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
 use priv_db;
 create trigger trg5d_1 before INSERT on t1 for each row
@@ -566,7 +566,7 @@ before trig 3.5.3.8-1d
 drop trigger trg5d_1;
 show grants;
 Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 use priv_db;
 create trigger trg5d_2 before INSERT  on t1 for each row
index 7f3f318d3235c44092800007cee8ac835513fc5f..75144066bca0c29b1871ba0c1414772f1f62b126 100644 (file)
@@ -140,7 +140,7 @@ current_user
 test_yesprivs@localhost
 show grants for test_yesprivs@localhost;
 Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
 drop trigger trg1_2;
 ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
@@ -388,7 +388,7 @@ current_user
 test_yesprivs@localhost
 show grants for test_yesprivs@localhost;
 Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 drop trigger trg1_2;
 select current_user;
@@ -1270,7 +1270,7 @@ current_user
 test_yesprivs@localhost
 show grants;
 Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
 GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
 create definer=not_ex_user@localhost trigger trg1_3
index 8f6a005f8cdd30b3b5b101e1fd5b14f87fd01048..5e715a7e0624db234f8b35b97df76beb9ace682c 100644 (file)
@@ -34,15 +34,15 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
-ID     root    HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     root    HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 SELECT * FROM processlist  ORDER BY id;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
-ID     root    HOST_NAME       information_schema      Query   TIME    executing       SELECT * FROM processlist  ORDER BY id
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
+ID     root    HOST_NAME       information_schema      Query   TIME    executing       SELECT * FROM processlist  ORDER BY id
 SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist  ORDER BY id;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
-ID     root    HOST_NAME       information_schema      Query   TIME    executing       SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist  ORDER BY id
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
+ID     root    HOST_NAME       information_schema      Query   TIME    executing       SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist  ORDER BY id
 CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
 UPDATE test.t_processlist SET user='horst' WHERE id=1  ;
 INSERT INTO processlist SELECT * FROM test.t_processlist;
@@ -104,7 +104,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 SELECT * FROM processlist  ORDER BY id;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
 ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    executing       SELECT * FROM processlist  ORDER BY id
@@ -132,7 +132,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
 ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
 SHOW GRANTS;
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 CREATE INDEX i_processlist ON processlist (user);
 ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
 DROP TABLE processlist;
@@ -166,10 +166,10 @@ SHOW/SELECT shows only the processes (1) of the user.
 ####################################################################################
 SHOW GRANTS;
 Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 SELECT * FROM information_schema.processlist;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
 ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    executing       SELECT * FROM information_schema.processlist
@@ -179,10 +179,10 @@ SHOW/SELECT shows all processes/threads.
 ####################################################################################
 SHOW GRANTS;
 Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     root    HOST_NAME       information_schema      Sleep   TIME            NULL
 SELECT * FROM information_schema.processlist;
@@ -205,7 +205,7 @@ Grants for @localhost
 GRANT PROCESS ON *.* TO ''@'localhost'
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID             HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID             HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     root    HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -227,10 +227,10 @@ ddicttestuser1 are visible.
 ####################################################################################
 SHOW GRANTS;
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 SELECT * FROM information_schema.processlist;
@@ -269,7 +269,7 @@ Grants for ddicttestuser1@localhost
 GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -291,10 +291,10 @@ Only the processes of ddicttestuser1 are visible.
 ####################################################################################
 SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -339,7 +339,7 @@ ddicttestuser2 has now the PROCESS privilege and sees all connections
 ####################################################################################
 SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
 Grants for ddicttestuser2@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
 ID             HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -351,7 +351,7 @@ ID  ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
-ID     ddicttestuser2  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser2  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     root    HOST_NAME       information_schema      Sleep   TIME            NULL
 SELECT * FROM information_schema.processlist;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
@@ -377,10 +377,10 @@ ddicttestuser2 has no more the PROCESS privilege and can only see own connects
 ####################################################################################
 SHOW GRANTS;
 Grants for ddicttestuser2@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser2  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser2  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser2  HOST_NAME       information_schema      Sleep   TIME            NULL
 SELECT * FROM information_schema.processlist;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
@@ -398,12 +398,12 @@ He is also unable to GRANT the PROCESS privilege to ddicttestuser2
 ####################################################################################
 SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
 ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -435,10 +435,10 @@ Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
 ####################################################################################
 SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
index 157f975622970c55ba07983dc48c540890128649..45df9707ff40cf501cde1e626328e3290b52a12b 100644 (file)
@@ -34,15 +34,15 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
-ID     root    HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     root    HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 SELECT * FROM processlist  ORDER BY id;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
-ID     root    HOST_NAME       information_schema      Execute TIME    executing       SELECT * FROM processlist  ORDER BY id
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
+ID     root    HOST_NAME       information_schema      Execute TIME    executing       SELECT * FROM processlist  ORDER BY id
 SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist  ORDER BY id;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
-ID     root    HOST_NAME       information_schema      Execute TIME    executing       SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist  ORDER BY id
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
+ID     root    HOST_NAME       information_schema      Execute TIME    executing       SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist  ORDER BY id
 CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
 UPDATE test.t_processlist SET user='horst' WHERE id=1  ;
 INSERT INTO processlist SELECT * FROM test.t_processlist;
@@ -104,7 +104,7 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 SELECT * FROM processlist  ORDER BY id;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
 ID     ddicttestuser1  HOST_NAME       information_schema      Execute TIME    executing       SELECT * FROM processlist  ORDER BY id
@@ -132,7 +132,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
 ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
 SHOW GRANTS;
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 CREATE INDEX i_processlist ON processlist (user);
 ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
 DROP TABLE processlist;
@@ -166,10 +166,10 @@ SHOW/SELECT shows only the processes (1) of the user.
 ####################################################################################
 SHOW GRANTS;
 Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 SELECT * FROM information_schema.processlist;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
 ID     ddicttestuser1  HOST_NAME       information_schema      Execute TIME    executing       SELECT * FROM information_schema.processlist
@@ -179,10 +179,10 @@ SHOW/SELECT shows all processes/threads.
 ####################################################################################
 SHOW GRANTS;
 Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     root    HOST_NAME       information_schema      Sleep   TIME            NULL
 SELECT * FROM information_schema.processlist;
@@ -205,7 +205,7 @@ Grants for @localhost
 GRANT PROCESS ON *.* TO ''@'localhost'
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID             HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID             HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     root    HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -227,10 +227,10 @@ ddicttestuser1 are visible.
 ####################################################################################
 SHOW GRANTS;
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 SELECT * FROM information_schema.processlist;
@@ -269,7 +269,7 @@ Grants for ddicttestuser1@localhost
 GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -291,10 +291,10 @@ Only the processes of ddicttestuser1 are visible.
 ####################################################################################
 SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -339,7 +339,7 @@ ddicttestuser2 has now the PROCESS privilege and sees all connections
 ####################################################################################
 SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
 Grants for ddicttestuser2@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
 ID             HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -351,7 +351,7 @@ ID  ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
-ID     ddicttestuser2  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser2  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     root    HOST_NAME       information_schema      Sleep   TIME            NULL
 SELECT * FROM information_schema.processlist;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
@@ -377,10 +377,10 @@ ddicttestuser2 has no more the PROCESS privilege and can only see own connects
 ####################################################################################
 SHOW GRANTS;
 Grants for ddicttestuser2@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser2  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser2  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser2  HOST_NAME       information_schema      Sleep   TIME            NULL
 SELECT * FROM information_schema.processlist;
 ID     USER    HOST    DB      COMMAND TIME    STATE   INFO
@@ -398,12 +398,12 @@ He is also unable to GRANT the PROCESS privilege to ddicttestuser2
 ####################################################################################
 SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
 ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
@@ -435,10 +435,10 @@ Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
 ####################################################################################
 SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
 Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD <secret>
 SHOW processlist;
 Id     User    Host    db      Command Time    State   Info
-ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    init    SHOW processlist
+ID     ddicttestuser1  HOST_NAME       information_schema      Query   TIME    STATE   SHOW processlist
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
 ID     ddicttestuser1  HOST_NAME       information_schema      Sleep   TIME            NULL
index 3dd4670ce1550b12ae4142494840f735254532cc..7338743393e94d7ca735823f7de0cda4ffcce405 100644 (file)
@@ -29,7 +29,7 @@ ID    USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   root    <HOST_NAME>     test    Query   <TIME>  executing       SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   root    <HOST_NAME>     test    Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   root    <HOST_NAME>     test    Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 SET @default_id = CONNECTION_ID();
 SELECT COUNT(*)  = 1 AS "Expect exact one connection with this id"
 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = @default_id;
@@ -77,7 +77,7 @@ ID    USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   root    <HOST_NAME>     information_schema      Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   root    <HOST_NAME>     information_schema      Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SELECT ID,TIME INTO @test_user_con1_id,@time FROM INFORMATION_SCHEMA.PROCESSLIST
 WHERE COMMAND = 'Sleep' AND USER = 'test_user';
@@ -110,7 +110,7 @@ ID  USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  executing       SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 # Ensure that the user test_user sees all connections with his username.
 #----------------------------------------------------------------------------
 
@@ -128,7 +128,7 @@ ID  USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 # ----- switch to connection default (user = root) -----
 
@@ -155,7 +155,7 @@ ID  USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   root    <HOST_NAME>     information_schema      Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   root    <HOST_NAME>     information_schema      Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 <ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  User sleep      SELECT sleep(10), 17
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SELECT STATE, TIME, INFO INTO @state, @time, @info
index 7bcaefa01c23715b15f887e6417e12ef8a0faf28..2d59d42ea523017e3fc6b2be12c8a1843a1bd972 100644 (file)
@@ -29,7 +29,7 @@ ID    USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   root    <HOST_NAME>     test    Execute <TIME>  executing       SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   root    <HOST_NAME>     test    Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   root    <HOST_NAME>     test    Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 SET @default_id = CONNECTION_ID();
 SELECT COUNT(*)  = 1 AS "Expect exact one connection with this id"
 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = @default_id;
@@ -77,7 +77,7 @@ ID    USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   root    <HOST_NAME>     information_schema      Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   root    <HOST_NAME>     information_schema      Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SELECT ID,TIME INTO @test_user_con1_id,@time FROM INFORMATION_SCHEMA.PROCESSLIST
 WHERE COMMAND = 'Sleep' AND USER = 'test_user';
@@ -110,7 +110,7 @@ ID  USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   test_user       <HOST_NAME>     information_schema      Execute <TIME>  executing       SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 # Ensure that the user test_user sees all connections with his username.
 #----------------------------------------------------------------------------
 
@@ -128,7 +128,7 @@ ID  USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 # ----- switch to connection default (user = root) -----
 
@@ -155,7 +155,7 @@ ID  USER    HOST    DB      COMMAND TIME    STATE   INFO
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SHOW FULL PROCESSLIST;
 Id     User    Host    db      Command Time    State   Info
-<ID>   root    <HOST_NAME>     information_schema      Query   <TIME>  init    SHOW FULL PROCESSLIST
+<ID>   root    <HOST_NAME>     information_schema      Query   <TIME>  STATE   SHOW FULL PROCESSLIST
 <ID>   test_user       <HOST_NAME>     information_schema      Query   <TIME>  User sleep      SELECT sleep(10), 17
 <ID>   test_user       <HOST_NAME>     information_schema      Sleep   <TIME>          NULL
 SELECT STATE, TIME, INFO INTO @state, @time, @info
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes.cnf
new file mode 100644 (file)
index 0000000..6dda00e
--- /dev/null
@@ -0,0 +1,58 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+default-storage-engine=InnoDB
+
+[mysqld.1]
+binlog-format=row
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;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='repl.causal_read_timeout=PT90S;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-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_master.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_master.cnf
new file mode 100644 (file)
index 0000000..51f6207
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# 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]
+default-storage-engine=InnoDB
+
+[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-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_slave.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_slave.cnf
new file mode 100644 (file)
index 0000000..ae762d2
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# 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]
+log-slave-updates
+log-bin=mysqld-bin
+binlog-format=row
+default-storage-engine=InnoDB
+
+[mysqld.1]
+server-id=1
+
+[mysqld.2]
+server-id=2
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;pc.ignore_sb=true'
+
+# 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]
+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;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;pc.ignore_sb=true'
+
+# 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.3.port
+NODE_MYSOCK_3= @mysqld.3.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-wsrep-5.6/mysql-test/suite/galera/galera_3nodes_as_slave.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/galera_3nodes_as_slave.cnf
new file mode 100644 (file)
index 0000000..4f3fdb0
--- /dev/null
@@ -0,0 +1,91 @@
+#
+# 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]
+log-slave-updates
+log-bin=mysqld-bin
+binlog-format=row
+
+[mysqld.1]
+server-id=1
+
+[mysqld.2]
+server-id=2
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;'
+
+# 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]
+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;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;'
+
+# 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
+
+[mysqld.4]
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;'
+
+# 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
+
+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.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_MYPORT_3= @mysqld.4.port
+NODE_MYSOCK_3= @mysqld.4.socket
+
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+NODE_GALERAPORT_4= @mysqld.4.#galera_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-wsrep-5.6/mysql-test/suite/galera/galera_4nodes.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/galera_4nodes.cnf
new file mode 100644 (file)
index 0000000..068c734
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_have_debug_sync.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_have_debug_sync.inc
new file mode 100644 (file)
index 0000000..7c01560
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_load_provider.inc
new file mode 100644 (file)
index 0000000..0ecf43e
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_reset_cluster_address.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_reset_cluster_address.inc
new file mode 100644 (file)
index 0000000..02937ec
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_sst_restore.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_sst_restore.inc
new file mode 100644 (file)
index 0000000..a08b148
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc
new file mode 100644 (file)
index 0000000..5f87d23
--- /dev/null
@@ -0,0 +1,23 @@
+#
+# 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';
+
+--let $wsrep_sst_auth_orig = `SELECT @@wsrep_sst_auth`
+SET GLOBAL wsrep_sst_auth = 'sst:';
+
+--connection node_2
+--source include/wait_until_connected_again.inc
+--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-wsrep-5.6/mysql-test/suite/galera/include/galera_st_clean_slave.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_clean_slave.inc
new file mode 100644 (file)
index 0000000..3a49f4f
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
new file mode 100644 (file)
index 0000000..c886974
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_st_kill_slave.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_kill_slave.inc
new file mode 100644 (file)
index 0000000..534d7b6
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc
new file mode 100644 (file)
index 0000000..8b99b1e
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc
new file mode 100644 (file)
index 0000000..6c09b0c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_unload_provider.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_unload_provider.inc
new file mode 100644 (file)
index 0000000..edc7eb3
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/include/galera_wsrep_recover.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/include/galera_wsrep_recover.inc
new file mode 100644 (file)
index 0000000..3126955
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/my.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/my.cnf
new file mode 100644 (file)
index 0000000..ca163a5
--- /dev/null
@@ -0,0 +1 @@
+!include galera_2nodes.cnf
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/GAL-382.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/GAL-382.result
new file mode 100644 (file)
index 0000000..0c7365f
--- /dev/null
@@ -0,0 +1,6 @@
+create table t1 (i int, j int, k int, primary key pk(i)) engine=innodb;
+insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
+create table t2 (i int, j int, k int, primary key pk(i, j, k), index idx(i, k, j)) engine=innodb;
+replace into t2 (i, j, k) select /*!99997 */ i, k, j from t1;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-252.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-252.result
new file mode 100644 (file)
index 0000000..c422edc
--- /dev/null
@@ -0,0 +1,7 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+FLUSH TABLES WITH READ LOCK;
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+UNLOCK TABLES;
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-258.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-258.result
new file mode 100644 (file)
index 0000000..1b4d4ae
--- /dev/null
@@ -0,0 +1,34 @@
+CREATE TABLE t1 (f1 INTEGER);
+LOCK TABLE t1 WRITE;
+value prior to RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+Variable_name  Value
+wsrep_desync_count     0
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name  Value
+wsrep_desync   OFF
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_osu_method = RSU;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_osu_method = RSU;
+ALTER TABLE t1 ADD COLUMN f3 INTEGER;;
+value during RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+Variable_name  Value
+wsrep_desync_count     2
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name  Value
+wsrep_desync   OFF
+UNLOCK TABLES;
+value after RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+Variable_name  Value
+wsrep_desync_count     0
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name  Value
+wsrep_desync   OFF
+SET GLOBAL wsrep_desync=0;
+Warnings:
+Warning        1231    'wsrep_desync' is already OFF.
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-259.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-259.result
new file mode 100644 (file)
index 0000000..5e963e6
--- /dev/null
@@ -0,0 +1,11 @@
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_desync=0;
+Warnings:
+Warning        1231    'wsrep_desync' is already OFF.
+SET wsrep_OSU_method=RSU;
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_desync=1;;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+DROP TABLE t1;
+SET GLOBAL wsrep_desync=0;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-44.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-44.result
new file mode 100644 (file)
index 0000000..28a6f1a
--- /dev/null
@@ -0,0 +1,14 @@
+TRUNCATE TABLE mysql.general_log;
+TRUNCATE TABLE mysql.general_log;
+SET SESSION wsrep_osu_method=TOI;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET SESSION wsrep_osu_method=RSU;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET SESSION wsrep_osu_method=TOI;
+SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
+COUNT(*) = 0
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_account_management.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_account_management.result
new file mode 100644 (file)
index 0000000..9b3ae9b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_alter_engine_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_alter_engine_innodb.result
new file mode 100644 (file)
index 0000000..2b30ac5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_alter_engine_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_alter_engine_myisam.result
new file mode 100644 (file)
index 0000000..280cb58
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_alter_table_force.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_alter_table_force.result
new file mode 100644 (file)
index 0000000..401ab46
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_applier_ftwrl_table.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_applier_ftwrl_table.result
new file mode 100644 (file)
index 0000000..cecbfc1
--- /dev/null
@@ -0,0 +1,15 @@
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+FLUSH TABLE t1 WITH READ LOCK;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+SET SESSION wsrep_sync_wait = 0;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = 7;
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result
new file mode 100644 (file)
index 0000000..ee96735
--- /dev/null
@@ -0,0 +1,26 @@
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION lock_wait_timeout = 60;
+SET SESSION innodb_lock_wait_timeout=60;
+SET SESSION wait_timeout=60;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+FLUSH TABLE t1 WITH READ LOCK;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SELECT 1 FROM DUAL;
+1
+1
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
+COUNT(*) = 1
+1
+UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = 7;
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `f1` int(11) NOT NULL,
+  `f2` int(11) DEFAULT NULL,
+  PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
+COUNT(*) = 0
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_master.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_master.result
new file mode 100644 (file)
index 0000000..cca5535
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_as_master_gtid.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_master_gtid.result
new file mode 100644 (file)
index 0000000..8dfe462
--- /dev/null
@@ -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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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= '<effective_uuid>: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-wsrep-5.6/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result
new file mode 100644 (file)
index 0000000..80fbccf
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave.result
new file mode 100644 (file)
index 0000000..ee789fa
--- /dev/null
@@ -0,0 +1,17 @@
+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;
+RESET MASTER;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_autoinc.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_autoinc.result
new file mode 100644 (file)
index 0000000..a8f5ec8
--- /dev/null
@@ -0,0 +1,84 @@
+START SLAVE USER='root';
+Warnings:
+Note   1759    Sending passwords in plain text without SSL/TLS is extremely insecure.
+SET SESSION binlog_format='STATEMENT';
+CREATE TABLE t1 (
+i int(11) NOT NULL AUTO_INCREMENT,
+c char(32) DEFAULT 'dummy_text',
+PRIMARY KEY (i)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+insert into t1(i) values(null);
+select * from t1;
+i      c
+1      dummy_text
+insert into t1(i) values(null), (null), (null);
+select * from t1;
+i      c
+1      dummy_text
+2      dummy_text
+3      dummy_text
+4      dummy_text
+SET SESSION auto_increment_increment=7;
+insert into t1(i) values(null), (null), (null);
+SET SESSION auto_increment_offset=5;
+insert into t1(i) values(null), (null), (null);
+select * from t1;
+i      c
+1      dummy_text
+2      dummy_text
+3      dummy_text
+4      dummy_text
+8      dummy_text
+15     dummy_text
+22     dummy_text
+33     dummy_text
+40     dummy_text
+47     dummy_text
+show variables like 'binlog_format';
+Variable_name  Value
+binlog_format  STATEMENT
+show variables like '%auto_increment%';
+Variable_name  Value
+auto_increment_increment       7
+auto_increment_offset  5
+wsrep_auto_increment_control   ON
+select * from t1;
+i      c
+1      dummy_text
+2      dummy_text
+3      dummy_text
+4      dummy_text
+8      dummy_text
+15     dummy_text
+22     dummy_text
+33     dummy_text
+40     dummy_text
+47     dummy_text
+show variables like 'binlog_format';
+Variable_name  Value
+binlog_format  ROW
+show variables like 'auto_increment_increment';
+Variable_name  Value
+auto_increment_increment       2
+select * from t1;
+i      c
+1      dummy_text
+2      dummy_text
+3      dummy_text
+4      dummy_text
+8      dummy_text
+15     dummy_text
+22     dummy_text
+33     dummy_text
+40     dummy_text
+47     dummy_text
+show variables like 'binlog_format';
+Variable_name  Value
+binlog_format  ROW
+show variables like 'auto_increment_increment';
+Variable_name  Value
+auto_increment_increment       2
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
+RESET MASTER;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_gtid.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_gtid.result
new file mode 100644 (file)
index 0000000..f7ee666
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_nonprim.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_nonprim.result
new file mode 100644 (file)
index 0000000..99cb484
--- /dev/null
@@ -0,0 +1,20 @@
+START SLAVE USER='root';
+Warnings:
+Note   1759    Sending passwords in plain text without SSL/TLS is extremely insecure.
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+expected_error
+1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+START SLAVE;
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
+CALL mtr.add_suppression("Slave SQL: Error 'WSREP has not yet prepared node for application use' on query");
+CALL mtr.add_suppression("Slave: WSREP has not yet prepared node for application use Error_code: 1047");
+CALL mtr.add_suppression("Transport endpoint is not connected");
+CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213");
+CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
+RESET MASTER;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_preordered.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_preordered.result
new file mode 100644 (file)
index 0000000..27a08e7
--- /dev/null
@@ -0,0 +1,19 @@
+START SLAVE USER='root';
+Warnings:
+Note   1759    Sending passwords in plain text without SSL/TLS is extremely insecure.
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
+SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
+COUNT(DISTINCT f1) = 2 * 100 * 10 * 10
+1
+SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
+COUNT(*) = 2 * 100 * 10 * 10
+1
+SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
+COUNT(DISTINCT f1) = 2 * 100 * 10 * 10
+1
+DROP TABLE t1;
+DROP TABLE ten;
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_replication_bundle.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_replication_bundle.result
new file mode 100644 (file)
index 0000000..a86bfd2
--- /dev/null
@@ -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);
+INSERT INTO t1 VALUES(3);
+INSERT INTO t1 VALUES(4);
+INSERT INTO t1 VALUES(5);
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result
new file mode 100644 (file)
index 0000000..228d7c6
--- /dev/null
@@ -0,0 +1,36 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+CREATE PROCEDURE p1 ()
+BEGIN
+DECLARE x INT DEFAULT 1;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+WHILE 1 DO
+INSERT INTO t1 VALUES (DEFAULT);
+COMMIT;
+END WHILE;
+END|
+CALL p1();;
+CALL p1();;
+Killing server ...
+INSERT INTO t1 VALUES (DEFAULT);
+INSERT INTO t1 VALUES (DEFAULT);
+Got one of the listed errors
+Got one of the listed errors
+count_equal
+1
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort.result
new file mode 100644 (file)
index 0000000..c55f1a4
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result
new file mode 100644 (file)
index 0000000..d6ff0c2
--- /dev/null
@@ -0,0 +1,14 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+FLUSH TABLES t1 FOR EXPORT;
+INSERT INTO t1 VALUES (2);
+SET SESSION wsrep_sync_wait = 0;
+UNLOCK TABLES;
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+wsrep_local_aborts_increment
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_for_update.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_for_update.result
new file mode 100644 (file)
index 0000000..3978a3d
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result
new file mode 100644 (file)
index 0000000..e381917
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result
new file mode 100644 (file)
index 0000000..2e44a77
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_lock_table.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_lock_table.result
new file mode 100644 (file)
index 0000000..7510e48
--- /dev/null
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+LOCK TABLE t1 WRITE;
+INSERT INTO t1 VALUES (2);
+UNLOCK TABLES;
+COMMIT;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+wsrep_local_aborts_increment
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_sleep.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_sleep.result
new file mode 100644 (file)
index 0000000..8e85a5f
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_cache_size.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_cache_size.result
new file mode 100644 (file)
index 0000000..9726cf2
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_checksum.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_checksum.result
new file mode 100644 (file)
index 0000000..a6ab623
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result
new file mode 100644 (file)
index 0000000..4156c0c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result
new file mode 100644 (file)
index 0000000..984a943
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_row_image.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_row_image.result
new file mode 100644 (file)
index 0000000..a1f0fb4
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result
new file mode 100644 (file)
index 0000000..80ae3d0
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_create_function.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_function.result
new file mode 100644 (file)
index 0000000..41c8927
--- /dev/null
@@ -0,0 +1,58 @@
+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
+SELECT 1 FROM DUAL;
+1
+1
+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-wsrep-5.6/mysql-test/suite/galera/r/galera_create_procedure.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_procedure.result
new file mode 100644 (file)
index 0000000..997bbba
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_create_table_like.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_table_like.result
new file mode 100644 (file)
index 0000000..b335101
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_create_trigger.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_trigger.result
new file mode 100644 (file)
index 0000000..7e65608
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_defaults.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_defaults.result
new file mode 100644 (file)
index 0000000..aaad574
--- /dev/null
@@ -0,0 +1,117 @@
+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_DIRTY_READS      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_REJECT_QUERIES   NONE
+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
+<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; 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_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 128M; gcomm.thread_prio = ; 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; <RECV_Q_HARD_LIMIT>;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; 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 = PT90S; 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(*)
+57
+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_DESYNC_COUNT
+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-wsrep-5.6/mysql-test/suite/galera/r/galera_delete_limit.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_delete_limit.result
new file mode 100644 (file)
index 0000000..72bee18
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_drop_multi.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_drop_multi.result
new file mode 100644 (file)
index 0000000..d82ae3b
--- /dev/null
@@ -0,0 +1,20 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t4 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t5 (f1 INTEGER);
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+DROP TABLE t1, t2, t3, t4;
+INSERT INTO t5 VALUES (1);
+COMMIT;
+SHOW CREATE TABLE t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+SHOW CREATE TABLE t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+SHOW CREATE TABLE t3;
+ERROR 42S02: Table 'test.t3' doesn't exist
+SHOW CREATE TABLE t4;
+ERROR 42S02: Table 'test.t4' doesn't exist
+CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test.t2,test.t4'' on query\. Default database: 'test'\. Query: 'DROP TABLE t1, t2, t3, t4', Error_code: 1051");
+DROP TABLE t5;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_enum.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_enum.result
new file mode 100644 (file)
index 0000000..e853c5c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_events.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_events.result
new file mode 100644 (file)
index 0000000..09d8406
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_cascade_delete.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_cascade_delete.result
new file mode 100644 (file)
index 0000000..89f4301
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_cascade_update.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_cascade_update.result
new file mode 100644 (file)
index 0000000..2ab2ad3
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_conflict.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_conflict.result
new file mode 100644 (file)
index 0000000..ae6c482
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_mismatch.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_mismatch.result
new file mode 100644 (file)
index 0000000..07cdb1b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_multicolumn.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_multicolumn.result
new file mode 100644 (file)
index 0000000..a86b87a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_multitable.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_multitable.result
new file mode 100644 (file)
index 0000000..e77128d
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_no_pk.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_no_pk.result
new file mode 100644 (file)
index 0000000..e4f9286
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_selfreferential.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_selfreferential.result
new file mode 100644 (file)
index 0000000..25c3704
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_setnull.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fk_setnull.result
new file mode 100644 (file)
index 0000000..f7fb9d0
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_flush.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_flush.result
new file mode 100644 (file)
index 0000000..68b506f
--- /dev/null
@@ -0,0 +1,70 @@
+DROP TABLE IF EXISTS t1, t2;
+FLUSH DES_KEY_FILE;
+wsrep_last_committed_diff
+1
+FLUSH HOSTS;
+wsrep_last_committed_diff
+1
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+INSERT INTO mysql.user VALUES('localhost','user1',PASSWORD('pass1'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N');
+FLUSH PRIVILEGES;
+DELETE FROM mysql.user WHERE user = 'user1';
+SET GLOBAL wsrep_replicate_myisam = FALSE;
+FLUSH PRIVILEGES;
+FLUSH QUERY CACHE;
+wsrep_last_committed_diff
+1
+FLUSH STATUS;
+wsrep_last_committed_diff
+1
+FLUSH USER_RESOURCES;
+wsrep_last_committed_diff
+1
+FLUSH TABLES;
+wsrep_last_committed_diff
+1
+CREATE TABLE t2 (f1 INTEGER);
+FLUSH TABLES t2;
+wsrep_last_committed_diff
+1
+FLUSH ERROR LOGS;
+wsrep_last_committed_diff
+1
+FLUSH SLOW LOGS;
+wsrep_last_committed_diff
+1
+FLUSH GENERAL LOGS;
+wsrep_last_committed_diff
+1
+FLUSH ENGINE LOGS;
+wsrep_last_committed_diff
+1
+FLUSH RELAY LOGS;
+wsrep_last_committed_diff
+1
+CREATE TABLE t1 (f1 INTEGER);
+FLUSH LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+wsrep_last_committed_diff
+1
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+wsrep_last_committed_diff
+1
+LOCK TABLES t1 READ;
+FLUSH TABLES t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+wsrep_last_committed_diff
+1
+FLUSH TABLES t1;
+wsrep_last_committed_diff
+1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_flush_local.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_flush_local.result
new file mode 100644 (file)
index 0000000..da66a55
--- /dev/null
@@ -0,0 +1,140 @@
+DROP TABLE IF EXISTS t1, t2, x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+FLUSH LOCAL DES_KEY_FILE;
+FLUSH LOCAL HOSTS;
+FLUSH LOCAL QUERY CACHE;
+FLUSH LOCAL STATUS;
+FLUSH LOCAL PRIVILEGES;
+FLUSH LOCAL USER_RESOURCES;
+FLUSH LOCAL TABLES;
+FLUSH LOCAL TABLES t2;
+FLUSH LOCAL ERROR LOGS;
+FLUSH LOCAL SLOW LOGS;
+FLUSH LOCAL GENERAL LOGS;
+FLUSH LOCAL ENGINE LOGS;
+FLUSH LOCAL RELAY LOGS;
+FLUSH LOCAL LOGS;
+FLUSH LOCAL BINARY LOGS;
+FLUSH LOCAL TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH LOCAL TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+FLUSH LOCAL TABLES t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1;
+ANALYZE LOCAL TABLE t1, t2;
+Table  Op      Msg_type        Msg_text
+test.t1        analyze status  OK
+test.t2        analyze status  OK
+OPTIMIZE LOCAL TABLE t1, t2;
+Table  Op      Msg_type        Msg_text
+test.t1        optimize        note    Table does not support optimize, doing recreate + analyze instead
+test.t1        optimize        status  OK
+test.t2        optimize        note    Table does not support optimize, doing recreate + analyze instead
+test.t2        optimize        status  OK
+REPAIR LOCAL TABLE x1, x2;
+Table  Op      Msg_type        Msg_text
+test.x1        repair  status  OK
+test.x2        repair  status  OK
+wsrep_last_committed_diff
+1
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10 FROM x1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10000 FROM t2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10 FROM x2;
+COUNT(*) = 10
+1
+DROP TABLE t1, t2, x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+set wsrep_on=0;
+FLUSH DES_KEY_FILE;
+FLUSH HOSTS;
+FLUSH QUERY CACHE;
+FLUSH STATUS;
+FLUSH PRIVILEGES;
+FLUSH USER_RESOURCES;
+FLUSH TABLES;
+FLUSH TABLES t2;
+FLUSH ERROR LOGS;
+FLUSH SLOW LOGS;
+FLUSH GENERAL LOGS;
+FLUSH ENGINE LOGS;
+FLUSH RELAY LOGS;
+FLUSH LOGS;
+FLUSH BINARY LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+FLUSH TABLES t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+FLUSH TABLES t1;
+ANALYZE TABLE t1, t2;
+Table  Op      Msg_type        Msg_text
+test.t1        analyze status  OK
+test.t2        analyze status  OK
+OPTIMIZE TABLE t1, t2;
+Table  Op      Msg_type        Msg_text
+test.t1        optimize        note    Table does not support optimize, doing recreate + analyze instead
+test.t1        optimize        status  OK
+test.t2        optimize        note    Table does not support optimize, doing recreate + analyze instead
+test.t2        optimize        status  OK
+REPAIR TABLE x1, x2;
+Table  Op      Msg_type        Msg_text
+test.x1        repair  status  OK
+test.x2        repair  status  OK
+wsrep_last_committed_diff
+1
+wsrep_last_committed_diff2
+1
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10 FROM x1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10000 FROM t2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10 FROM x2;
+COUNT(*) = 10
+1
+set wsrep_on=1;
+SET GLOBAL wsrep_replicate_myisam = FALSE;
+DROP TABLE t1, t2, x1, x2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_forced_binlog_format.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_forced_binlog_format.result
new file mode 100644 (file)
index 0000000..857e44d
--- /dev/null
@@ -0,0 +1,18 @@
+RESET MASTER;
+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);
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+mysqld-bin.000001      <Pos>   Query   1       <End_log_pos>   use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
+mysqld-bin.000001      <Pos>   Query   1       <End_log_pos>   BEGIN
+mysqld-bin.000001      <Pos>   Table_map       1       <End_log_pos>   table_id: ### (test.t1)
+mysqld-bin.000001      <Pos>   Write_rows      1       <End_log_pos>   table_id: ### flags: STMT_END_F
+mysqld-bin.000001      <Pos>   Xid     1       <End_log_pos>   COMMIT /* xid=### */
+mysqld-bin.000001      <Pos>   Query   1       <End_log_pos>   BEGIN
+mysqld-bin.000001      <Pos>   Table_map       1       <End_log_pos>   table_id: ### (test.t1)
+mysqld-bin.000001      <Pos>   Write_rows      1       <End_log_pos>   table_id: ### flags: STMT_END_F
+mysqld-bin.000001      <Pos>   Xid     1       <End_log_pos>   COMMIT /* xid=### */
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ftwrl.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ftwrl.result
new file mode 100644 (file)
index 0000000..c216b52
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_ftwrl_drain.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ftwrl_drain.result
new file mode 100644 (file)
index 0000000..d704699
--- /dev/null
@@ -0,0 +1,26 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+FLUSH TABLES WITH READ LOCK;;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET SESSION lock_wait_timeout = 1;
+SET SESSION innodb_lock_wait_timeout=1;
+SET SESSION wait_timeout=1;
+INSERT INTO t2 VALUES (2);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+UNLOCK TABLES;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+INSERT INTO t1 VALUES (3);
+SELECT COUNT(*) = 2 FROM t1;
+COUNT(*) = 2
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fulltext.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_fulltext.result
new file mode 100644 (file)
index 0000000..84ae0a1
--- /dev/null
@@ -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;
+SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
+COUNT(f2) = 1000
+1
+UPDATE t1 SET f2 = 'abcdefjhk';
+SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
+COUNT(f2) = 1000
+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-wsrep-5.6/mysql-test/suite/galera/r/galera_gcs_fc_limit.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gcs_fc_limit.result
new file mode 100644 (file)
index 0000000..9463b5f
--- /dev/null
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
+LOCK TABLE t1 WRITE;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+UNLOCK TABLES;
+INSERT INTO t1 VALUES (6);
+SELECT COUNT(*) = 6 FROM t1;
+COUNT(*) = 6
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gcs_fragment.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gcs_fragment.result
new file mode 100644 (file)
index 0000000..0c9c181
--- /dev/null
@@ -0,0 +1,24 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
+SET GLOBAL wsrep_cluster_address='';
+SET SESSION wsrep_sync_wait=0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,gcs_core_after_frag_send';
+SET SESSION wsrep_retry_autocommit=0;
+INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+SET GLOBAL wsrep_provider_options = 'signal=gcs_core_after_frag_send';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+SELECT * FROM t1;
+f1     f2
+2      bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+3      cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+SELECT * FROM t1;
+f1     f2
+2      bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+3      cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result
new file mode 100644 (file)
index 0000000..606cb54
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_gra_log.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gra_log.result
new file mode 100644 (file)
index 0000000..9f5cbdd
--- /dev/null
@@ -0,0 +1,41 @@
+SET SESSION wsrep_on=OFF;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t1 (f1 INTEGER);
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# at 4
+<ISO TIMESTAMP> server id 2  end_log_pos 120   Start: binlog v 4, server v 5.6.24-debug-log created 150804 11:37:14 at startup
+# Warning: this binlog is either in use or was not closed properly.
+ROLLBACK/*!*/;
+BINLOG '
+unnAVQ8CAAAAdAAAAHgAAAABAAQANS42LjI0LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAC6ecBVEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAKNu
+Jfk=
+'/*!*/;
+# at 120
+<ISO TIMESTAMP> server id 1  end_log_pos 91    Query   thread_id=<QUERY_THREAD_ID>     exec_time=0     error_code=0
+use `test`/*!*/;
+SET TIMESTAMP=<TIMESTAMP>/*!*/;
+SET @@session.pseudo_thread_id=<PSEUDO_THREAD_ID>/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=1073741824/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+CREATE TABLE t1 (f1 INTEGER)
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+SET SESSION wsrep_on=ON;
+CALL mtr.add_suppression("Slave SQL: Error 'Table 't1' already exists' on query");
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gtid.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_gtid.result
new file mode 100644 (file)
index 0000000..50d561d
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_insert_ignore.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_insert_ignore.result
new file mode 100644 (file)
index 0000000..2d6e38e
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_insert_multi.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_insert_multi.result
new file mode 100644 (file)
index 0000000..3371778
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result
new file mode 100644 (file)
index 0000000..5421b23
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_mysqldump.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_mysqldump.result
new file mode 100644 (file)
index 0000000..9a5b4e8
--- /dev/null
@@ -0,0 +1,284 @@
+Setting SST method to mysqldump ...
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = '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-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_recv_bind.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_recv_bind.result
new file mode 100644 (file)
index 0000000..de4e07f
--- /dev/null
@@ -0,0 +1,13 @@
+SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
+@@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'
+1
+SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
+@@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'
+1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_restart_joiner.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_restart_joiner.result
new file mode 100644 (file)
index 0000000..f7a1386
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_rsync.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_rsync.result
new file mode 100644 (file)
index 0000000..175e744
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result
new file mode 100644 (file)
index 0000000..175e744
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_applier.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_applier.result
new file mode 100644 (file)
index 0000000..fe49116
--- /dev/null
@@ -0,0 +1,4 @@
+Got one of the listed errors
+Got one of the listed errors
+Got one of the listed errors
+Got one of the listed errors
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_ddl.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_ddl.result
new file mode 100644 (file)
index 0000000..8dd3649
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_largechanges.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_largechanges.result
new file mode 100644 (file)
index 0000000..a37056a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_nochanges.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_nochanges.result
new file mode 100644 (file)
index 0000000..accace9
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_smallchanges.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_kill_smallchanges.result
new file mode 100644 (file)
index 0000000..8409740
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_lock_table.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_lock_table.result
new file mode 100644 (file)
index 0000000..16e9037
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_log_bin.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_log_bin.result
new file mode 100644 (file)
index 0000000..522e723
--- /dev/null
@@ -0,0 +1,54 @@
+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: # (test.t1)
+0.000002       366     Write_rows      1       406     table_id: # flags: STMT_END_F
+0.000002       406     Xid     1       437     COMMIT /* xid=# */
+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: # (test.t2)
+0.000002       671     Write_rows      1       711     table_id: # flags: STMT_END_F
+0.000002       711     Xid     1       742     COMMIT /* xid=# */
+0.000002       742     Query   1       819     BEGIN
+0.000002       819     Table_map       1       864     table_id: # (test.t2)
+0.000002       864     Write_rows      1       904     table_id: # flags: STMT_END_F
+0.000002       904     Xid     1       935     COMMIT /* xid=# */
+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: # (test.t1)
+0.000001       357     Write_rows      1       397     table_id: # flags: STMT_END_F
+0.000001       397     Xid     1       428     COMMIT /* xid=# */
+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: # (test.t2)
+0.000001       653     Write_rows      1       693     table_id: # flags: STMT_END_F
+0.000001       693     Xid     1       724     COMMIT /* xid=# */
+0.000001       724     Query   1       792     BEGIN
+0.000001       792     Table_map       1       837     table_id: # (test.t2)
+0.000001       837     Write_rows      1       877     table_id: # flags: STMT_END_F
+0.000001       877     Xid     1       908     COMMIT /* xid=# */
+0.000001       908     Query   1       1018    use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
+DROP TABLE t1;
+DROP TABLE t2;
+RESET MASTER;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_log_output_csv.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_log_output_csv.result
new file mode 100644 (file)
index 0000000..cdb5ee4
--- /dev/null
@@ -0,0 +1,18 @@
+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 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-wsrep-5.6/mysql-test/suite/galera/r/galera_many_columns.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_columns.result
new file mode 100644 (file)
index 0000000..6fa574e
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_many_indexes.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_indexes.result
new file mode 100644 (file)
index 0000000..ab6eec5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_many_rows.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_rows.result
new file mode 100644 (file)
index 0000000..a34367d
--- /dev/null
@@ -0,0 +1,32 @@
+SET SESSION innodb_lock_wait_timeout=600;
+SET SESSION lock_wait_timeout=600;
+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;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_sync_wait = 7;
+SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H';
+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
+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-wsrep-5.6/mysql-test/suite/galera/r/galera_many_tables_nopk.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_tables_nopk.result
new file mode 100644 (file)
index 0000000..7a4f364
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_many_tables_pk.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_tables_pk.result
new file mode 100644 (file)
index 0000000..6b6899d
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_mdl_race.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_mdl_race.result
new file mode 100644 (file)
index 0000000..ae4e6ed
--- /dev/null
@@ -0,0 +1,31 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+CREATE TABLE t2 (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;
+LOCK TABLE t2 WRITE;
+SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";
+SELECT * FROM t2;;
+SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
+UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
+UNLOCK TABLES;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+COUNT(*) = 1
+1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_migrate.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_migrate.result
new file mode 100644 (file)
index 0000000..aab3ffb
--- /dev/null
@@ -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';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+GRANT ALL PRIVILEGES ON *.* TO '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-wsrep-5.6/mysql-test/suite/galera/r/galera_multi_database.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_multi_database.result
new file mode 100644 (file)
index 0000000..a04eb48
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_myisam_autocommit.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_myisam_autocommit.result
new file mode 100644 (file)
index 0000000..3f8d93b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_myisam_transactions.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_myisam_transactions.result
new file mode 100644 (file)
index 0000000..284f92b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_bit.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_bit.result
new file mode 100644 (file)
index 0000000..5723dac
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_blob.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_blob.result
new file mode 100644 (file)
index 0000000..7491b71
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_large_varchar.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_large_varchar.result
new file mode 100644 (file)
index 0000000..abca81e
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_unicode.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_nopk_unicode.result
new file mode 100644 (file)
index 0000000..68d049a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result
new file mode 100644 (file)
index 0000000..85ba022
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result
new file mode 100644 (file)
index 0000000..1f163f4
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result
new file mode 100644 (file)
index 0000000..05ce328
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_simple.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_simple.result
new file mode 100644 (file)
index 0000000..294a94b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_pc_ignore_sb.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_pc_ignore_sb.result
new file mode 100644 (file)
index 0000000..5fcccfe
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_pk_bigint_signed.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_pk_bigint_signed.result
new file mode 100644 (file)
index 0000000..a307599
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result
new file mode 100644 (file)
index 0000000..441926e
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_prepared_statement.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_prepared_statement.result
new file mode 100644 (file)
index 0000000..138d443
--- /dev/null
@@ -0,0 +1,33 @@
+CREATE TABLE t1 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t3 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t4 (f1 CHAR(5)) ENGINE=InnoDB;
+SET SESSION sql_mode='STRICT_ALL_TABLES';
+PREPARE st1 FROM 'INSERT INTO t1 VALUES ("abc")';
+PREPARE st2 FROM 'INSERT INTO t2 VALUES ("abc")';
+PREPARE st3 FROM 'INSERT INTO t3 VALUES ("abc")';
+PREPARE st4 FROM 'INSERT INTO t4 VALUES ("abc")';
+EXECUTE st1;
+EXECUTE st2;
+EXECUTE st3;
+EXECUTE st4;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t3;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t4;
+COUNT(*) = 1
+1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+ALTER TABLE t1 DROP COLUMN f1;
+EXECUTE st1;
+ERROR HY000: Incorrect integer value: 'abc' for column 'f2' at row 1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_query_cache.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_query_cache.result
new file mode 100644 (file)
index 0000000..502d8a5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result
new file mode 100644 (file)
index 0000000..e9faff8
--- /dev/null
@@ -0,0 +1,45 @@
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1;
+MAX(id)
+1
+INSERT INTO t1 VALUES (2);
+SELECT MAX(id) FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+FLUSH QUERY CACHE;
+SET SESSION wsrep_sync_wait = 7;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+INSERT INTO t1 VALUES (3);
+SELECT MAX(id) FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+INSERT INTO t1 VALUES (4);
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1;
+MAX(id)
+4
+SET SESSION wsrep_sync_wait = 7;
+FLUSH STATUS;
+SELECT MAX(id) FROM t1;
+MAX(id)
+4
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 1
+1
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+INSERT INTO t1 VALUES (5);
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1 ;
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+MAX(id)
+5
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 1
+1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_read_only.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_read_only.result
new file mode 100644 (file)
index 0000000..d2af386
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_repl_key_format_flat16.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_repl_key_format_flat16.result
new file mode 100644 (file)
index 0000000..4acf014
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_repl_max_ws_size.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_repl_max_ws_size.result
new file mode 100644 (file)
index 0000000..6e1054c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_restart_nochanges.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_restart_nochanges.result
new file mode 100644 (file)
index 0000000..accace9
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_add_pk.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_add_pk.result
new file mode 100644 (file)
index 0000000..3fd24af
--- /dev/null
@@ -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 SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION 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 SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION wsrep_OSU_method = "TOI";
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_drop_pk.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_drop_pk.result
new file mode 100644 (file)
index 0000000..039fb68
--- /dev/null
@@ -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 SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 DROP PRIMARY KEY;
+SET SESSION 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 SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 DROP PRIMARY KEY;
+SET SESSION 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-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_error.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_error.result
new file mode 100644 (file)
index 0000000..bfe4139
--- /dev/null
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t1 VALUES (1), (1);
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SET SESSION 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-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_simple.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_simple.result
new file mode 100644 (file)
index 0000000..4c2780a
--- /dev/null
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+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-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result
new file mode 100644 (file)
index 0000000..1330cb3
--- /dev/null
@@ -0,0 +1,39 @@
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_desync=1;
+SET wsrep_OSU_method=RSU;
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_desync=0;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `f1` int(11) DEFAULT NULL,
+  `f2` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name  Value
+wsrep_desync   OFF
+SET wsrep_OSU_method=TOI;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_desync=0;
+Warnings:
+Warning        1231    'wsrep_desync' is already OFF.
+SET wsrep_OSU_method=RSU;
+SET DEBUG_SYNC = 'alter_table_before_create_table_no_lock WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_desync=1;;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SET GLOBAL wsrep_desync=0;
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `f1` int(11) DEFAULT NULL,
+  `f2` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SET wsrep_OSU_method=TOI;
+DROP TABLE t1;
+CALL mtr.add_suppression("Protocol violation");
+CALL mtr.add_suppression("desync failed");
+CALL mtr.add_suppression("Protocol violation");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sbr.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sbr.result
new file mode 100644 (file)
index 0000000..66ca8cf
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_sbr_binlog.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sbr_binlog.result
new file mode 100644 (file)
index 0000000..66ca8cf
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_schema_dirty_reads.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_schema_dirty_reads.result
new file mode 100644 (file)
index 0000000..edf20da
--- /dev/null
@@ -0,0 +1,13 @@
+USE information_schema;
+SELECT * FROM SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep_dirty_reads";
+VARIABLE_NAME  VARIABLE_VALUE
+WSREP_DIRTY_READS      OFF
+SET GLOBAL wsrep_reject_queries=ALL;
+SELECT * FROM SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep_dirty_reads";
+VARIABLE_NAME  VARIABLE_VALUE
+WSREP_DIRTY_READS      OFF
+SET GLOBAL wsrep_reject_queries=NONE;
+SET SESSION wsrep_dirty_reads=TRUE;
+SELECT * FROM SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep_dirty_reads";
+VARIABLE_NAME  VARIABLE_VALUE
+WSREP_DIRTY_READS      ON
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_serializable.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_serializable.result
new file mode 100644 (file)
index 0000000..90fe628
--- /dev/null
@@ -0,0 +1,27 @@
+CREATE TABLE t1 (id INT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+START TRANSACTION;
+SELECT * FROM t1;
+id     f2
+INSERT INTO t1 VALUES (1,1);
+SELECT * FROM t1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ROLLBACK;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1,1);
+START TRANSACTION;
+SELECT * FROM t1;
+id     f2
+1      1
+UPDATE t1 SET f2 = 2;
+UPDATE t1 SET f2 = 3;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ROLLBACK;
+DELETE FROM t1;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (1,2);
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_split_brain.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_split_brain.result
new file mode 100644 (file)
index 0000000..6156150
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_sql_log_bin_zero.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sql_log_bin_zero.result
new file mode 100644 (file)
index 0000000..89ab8d5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_ssl.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ssl.result
new file mode 100644 (file)
index 0000000..569c3c6
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_ssl_compression.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ssl_compression.result
new file mode 100644 (file)
index 0000000..f25b614
--- /dev/null
@@ -0,0 +1,22 @@
+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 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
+SET GLOBAL wsrep_provider_options = "socket.ssl_compression=No";
+ERROR HY000: Incorrect arguments to SET
+CREATE TABLE t1 (f1 VARCHAR(333) PRIMARY KEY, f2 BLOB) Engine=InnoDB;
+INSERT INTO t1 VALUES (REPEAT('a', 333), REPEAT('b', 65535));
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('a', 333) AND f2 = REPEAT('b', 65535);
+COUNT(*) = 1
+1
+DROP TABLE t1;
+CALL mtr.add_suppression("Unknown parameter 'socket\.ssl_compression'");
+CALL mtr.add_suppression("Set options returned 7");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ssl_upgrade.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ssl_upgrade.result
new file mode 100644 (file)
index 0000000..c0f2e84
--- /dev/null
@@ -0,0 +1,24 @@
+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 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 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 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
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_mysqldump.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_mysqldump.result
new file mode 100644 (file)
index 0000000..e35c405
--- /dev/null
@@ -0,0 +1,459 @@
+Setting SST method to mysqldump ...
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = '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-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
new file mode 100644 (file)
index 0000000..7d30b35
--- /dev/null
@@ -0,0 +1,108 @@
+Setting SST method to mysqldump ...
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+SET GLOBAL wsrep_sst_method = 'mysqldump';
+CREATE USER sslsst;
+GRANT ALL PRIVILEGES ON *.* TO sslsst;
+GRANT USAGE ON *.* TO sslsst REQUIRE SSL;
+SET GLOBAL wsrep_sst_auth = 'sslsst:';
+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;
+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");
+DROP USER sslsst;
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_rsync.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_rsync.result
new file mode 100644 (file)
index 0000000..750d73b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2-options.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2-options.result
new file mode 100644 (file)
index 0000000..990e0a2
--- /dev/null
@@ -0,0 +1,3 @@
+SELECT 1;
+1
+1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result
new file mode 100644 (file)
index 0000000..750d73b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_encrypt_with_key.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_encrypt_with_key.result
new file mode 100644 (file)
index 0000000..990e0a2
--- /dev/null
@@ -0,0 +1,3 @@
+SELECT 1;
+1
+1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_status_cluster.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_status_cluster.result
new file mode 100644 (file)
index 0000000..d7cf671
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_status_local_index.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_status_local_index.result
new file mode 100644 (file)
index 0000000..4e886ac
--- /dev/null
@@ -0,0 +1,13 @@
+CREATE TABLE wsrep_local_indexes (wsrep_local_index INTEGER);
+INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
+INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
+SELECT COUNT(*) = 2 FROM wsrep_local_indexes;
+COUNT(*) = 2
+1
+SELECT COUNT(DISTINCT wsrep_local_index) = 2 FROM wsrep_local_indexes;
+COUNT(DISTINCT wsrep_local_index) = 2
+1
+SELECT COUNT(*) = 0 FROM wsrep_local_indexes WHERE wsrep_local_index NOT IN (0, 1);
+COUNT(*) = 0
+1
+DROP TABLE wsrep_local_indexes;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_status_local_state.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_status_local_state.result
new file mode 100644 (file)
index 0000000..65713f1
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_suspend_slave.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_suspend_slave.result
new file mode 100644 (file)
index 0000000..25dc0b4
--- /dev/null
@@ -0,0 +1,12 @@
+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;
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sync_wait_show.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sync_wait_show.result
new file mode 100644 (file)
index 0000000..6602d49
--- /dev/null
@@ -0,0 +1,39 @@
+SET SESSION wsrep_sync_wait = 1;
+CREATE DATABASE db1;
+SHOW CREATE DATABASE db1;
+Database       Create Database
+db1    CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */
+DROP DATABASE db1;
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+SHOW CREATE PROCEDURE p1;
+Procedure      sql_mode        Create Procedure        character_set_client    collation_connection    Database Collation
+p1     NO_ENGINE_SUBSTITUTION  CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SELECT 1 FROM DUAL     latin1  latin1_swedish_ci       latin1_swedish_ci
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+SHOW PROCEDURE CODE p1;
+Pos    Instruction
+0      stmt "SELECT 1 FROM DUAL"
+DROP PROCEDURE p1;
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+SHOW CREATE FUNCTION f1;
+Function       sql_mode        Create Function character_set_client    collation_connection    Database Collation
+f1     NO_ENGINE_SUBSTITUTION  CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 123     latin1  latin1_swedish_ci       latin1_swedish_ci
+DROP FUNCTION f1;
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+SHOW FUNCTION CODE f1;
+Pos    Instruction
+0      freturn 3 123
+DROP FUNCTION f1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
+SHOW CREATE TRIGGER tr1;
+Trigger        sql_mode        SQL Original Statement  character_set_client    collation_connection    Database Collation
+tr1    NO_ENGINE_SUBSTITUTION  CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1  latin1_swedish_ci       latin1_swedish_ci
+DROP TABLE t1;
+CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
+SHOW CREATE EVENT event1;
+Event  sql_mode        time_zone       Create Event    character_set_client    collation_connection    Database Collation
+event1 NO_ENGINE_SUBSTITUTION  SYSTEM  CREATE DEFINER=`root`@`localhost` EVENT `event1` ON SCHEDULE AT '2038-01-01 23:59:59' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO SELECT 1   latin1  latin1_swedish_ci       latin1_swedish_ci
+DROP EVENT event1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result
new file mode 100644 (file)
index 0000000..f914153
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_error.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_error.result
new file mode 100644 (file)
index 0000000..656e20b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result
new file mode 100644 (file)
index 0000000..81781fb
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_locking.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_locking.result
new file mode 100644 (file)
index 0000000..d961f04
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result
new file mode 100644 (file)
index 0000000..41e693c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_sequential.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ddl_sequential.result
new file mode 100644 (file)
index 0000000..9dfa433
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ftwrl.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_ftwrl.result
new file mode 100644 (file)
index 0000000..594717c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_lock_exclusive.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_lock_exclusive.result
new file mode 100644 (file)
index 0000000..eac50e8
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_lock_shared.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_toi_lock_shared.result
new file mode 100644 (file)
index 0000000..36c3886
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_transaction_read_only.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_transaction_read_only.result
new file mode 100644 (file)
index 0000000..3cd1076
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_transaction_replay.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_transaction_replay.result
new file mode 100644 (file)
index 0000000..eec9ba0
--- /dev/null
@@ -0,0 +1,59 @@
+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,commit_monitor_enter_sync';
+COMMIT;;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_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;
+CREATE TABLE t1 (i int primary key, j int) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1, 0), (3, 0);
+SELECT * FROM t1;
+i      j
+1      0
+3      0
+PREPARE stmt1 FROM "UPDATE t1 SET j = 1 where i > 0";
+SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+EXECUTE stmt1;;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+INSERT INTO t1 VALUES(2,2);
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+SELECT * FROM t1;
+i      j
+1      1
+2      2
+3      1
+SELECT * FROM t1;
+i      j
+1      1
+2      2
+3      1
+DEALLOCATE PREPARE stmt1;
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_truncate.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_truncate.result
new file mode 100644 (file)
index 0000000..eeeb672
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_truncate_temporary.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_truncate_temporary.result
new file mode 100644 (file)
index 0000000..0bdc4e3
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_unicode_identifiers.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_unicode_identifiers.result
new file mode 100644 (file)
index 0000000..212c6c6
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_unicode_pk.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_unicode_pk.result
new file mode 100644 (file)
index 0000000..d59615b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_update_limit.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_update_limit.result
new file mode 100644 (file)
index 0000000..c26eb1c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_v1_row_events.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_v1_row_events.result
new file mode 100644 (file)
index 0000000..a6ab623
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_OSU_method.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_OSU_method.result
new file mode 100644 (file)
index 0000000..8e47443
--- /dev/null
@@ -0,0 +1,14 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET SESSION wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+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
+SET SESSION wsrep_OSU_method = "TOI";
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_OSU_method2.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_OSU_method2.result
new file mode 100644 (file)
index 0000000..67fc63a
--- /dev/null
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET SESSION wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (1,2);
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (3,4);
+SET GLOBAL wsrep_OSU_method = "TOI";
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result
new file mode 100644 (file)
index 0000000..92b69fb
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result
new file mode 100644 (file)
index 0000000..8859209
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result
new file mode 100644 (file)
index 0000000..35dabb7
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_cluster_address.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_cluster_address.result
new file mode 100644 (file)
index 0000000..1f067ee
--- /dev/null
@@ -0,0 +1,67 @@
+SET GLOBAL wsrep_cluster_address = 'foo://';
+SHOW STATUS;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET SESSION wsrep_sync_wait=0;
+SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
+COUNT(*) > 0
+1
+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 COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
+COUNT(*) > 0
+1
+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");
+CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
+CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_desync_on.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_desync_on.result
new file mode 100644 (file)
index 0000000..f286ae7
--- /dev/null
@@ -0,0 +1,31 @@
+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
+CALL mtr.add_suppression("Protocol violation");
+DROP TABLE t1;
+CALL mtr.add_suppression("Protocol violation");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_dirty_reads.result
new file mode 100644 (file)
index 0000000..da842e7
--- /dev/null
@@ -0,0 +1,47 @@
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+i
+1
+SET @@global.wsrep_cluster_address = '';
+SET @@session.wsrep_dirty_reads=OFF;
+SET SESSION wsrep_sync_wait=0;
+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
+SELECT * FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT 1 FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SET @@session.wsrep_dirty_reads=ON;
+SELECT * FROM t1;
+i
+1
+SELECT 1 FROM t1;
+1
+1
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
+i      variable_name   variable_value
+1      WSREP_DIRTY_READS       ON
+SET @@session.wsrep_dirty_reads=OFF;
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT 1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+USE information_schema;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
+VARIABLE_NAME  VARIABLE_VALUE
+WSREP_DIRTY_READS      OFF
+SELECT COUNT(*) >= 10 FROM performance_schema.events_statements_history;
+COUNT(*) >= 10
+1
+USE test;
+SELECT * FROM t1;
+i
+1
+DROP TABLE t1;
+# End of test
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_fkchecks.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_fkchecks.result
new file mode 100644 (file)
index 0000000..342212a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
new file mode 100644 (file)
index 0000000..912e45a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_load_data_splitting.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_load_data_splitting.result
new file mode 100644 (file)
index 0000000..db145fd
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_log_bin.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_log_bin.result
new file mode 100644 (file)
index 0000000..a6ab623
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_max_ws_size.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_max_ws_size.result
new file mode 100644 (file)
index 0000000..6db5c24
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result
new file mode 100644 (file)
index 0000000..f2a951c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_node_address.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_node_address.result
new file mode 100644 (file)
index 0000000..fa88f4b
--- /dev/null
@@ -0,0 +1,9 @@
+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);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_notify_cmd.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_notify_cmd.result
new file mode 100644 (file)
index 0000000..e9e4605
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_reject_queries.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_reject_queries.result
new file mode 100644 (file)
index 0000000..0ed2f29
--- /dev/null
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INTEGER);
+SET SESSION wsrep_reject_queries = ALL;
+ERROR HY000: Variable 'wsrep_reject_queries' is a GLOBAL variable and should be set with SET GLOBAL
+SET GLOBAL wsrep_reject_queries = ALL;
+SELECT * FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SET GLOBAL wsrep_reject_queries = ALL_KILL;
+ERROR HY000: Lost connection to MySQL server during query
+SELECT * FROM t1;
+ERROR HY000: Lost connection to MySQL server during query
+SELECT * FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_reject_queries = NONE;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result
new file mode 100644 (file)
index 0000000..c8b7907
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result
new file mode 100644 (file)
index 0000000..73a0576
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_slave_threads.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_slave_threads.result
new file mode 100644 (file)
index 0000000..6b84f03
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_sync_wait.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_sync_wait.result
new file mode 100644 (file)
index 0000000..f6136a4
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result
new file mode 100644 (file)
index 0000000..8b1c4eb
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_wan.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wan.result
new file mode 100644 (file)
index 0000000..6be32b2
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_wan_restart_ist.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wan_restart_ist.result
new file mode 100644 (file)
index 0000000..e58bff3
--- /dev/null
@@ -0,0 +1,53 @@
+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);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (13);
+Shutting down server ...
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (131);
+INSERT INTO t1 VALUES (22);
+Shutting down server ...
+INSERT INTO t1 VALUES (21);
+INSERT INTO t1 VALUES (23);
+INSERT INTO t1 VALUES (24);
+INSERT INTO t1 VALUES (221);
+INSERT INTO t1 VALUES (34);
+Shutting down server ...
+INSERT INTO t1 VALUES (31);
+INSERT INTO t1 VALUES (32);
+INSERT INTO t1 VALUES (33);
+INSERT INTO t1 VALUES (341);
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+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");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+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");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wan_restart_sst.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wan_restart_sst.result
new file mode 100644 (file)
index 0000000..15de0fa
--- /dev/null
@@ -0,0 +1,54 @@
+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);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (13);
+Killing server ...
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (131);
+INSERT INTO t1 VALUES (22);
+Killing server ...
+INSERT INTO t1 VALUES (21);
+INSERT INTO t1 VALUES (23);
+INSERT INTO t1 VALUES (24);
+INSERT INTO t1 VALUES (221);
+INSERT INTO t1 VALUES (34);
+Killing server ...
+INSERT INTO t1 VALUES (31);
+INSERT INTO t1 VALUES (32);
+INSERT INTO t1 VALUES (33);
+INSERT INTO t1 VALUES (341);
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+1
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 4
+1
+SELECT COUNT(*) = 19 FROM t1;
+COUNT(*) = 19
+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");
+CALL mtr.add_suppression("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+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");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result
new file mode 100644 (file)
index 0000000..06fc27a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result
new file mode 100644 (file)
index 0000000..e3f2fa4
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result
new file mode 100644 (file)
index 0000000..681e460
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/galera_zero_length_column.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_zero_length_column.result
new file mode 100644 (file)
index 0000000..2e6119b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/lp1276424.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/lp1276424.result
new file mode 100644 (file)
index 0000000..5f09ec9
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/lp1347768.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/lp1347768.result
new file mode 100644 (file)
index 0000000..c085059
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/lp1438990.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/lp1438990.result
new file mode 100644 (file)
index 0000000..b53bc18
--- /dev/null
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging;
+INSERT t3 VALUES (x);
+END;
+SAVEPOINT event_logging;
+INSERT INTO t2 VALUES (x);
+RELEASE SAVEPOINT event_logging;
+END|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/lp959512.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/lp959512.result
new file mode 100644 (file)
index 0000000..55adfa3
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#110.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#110.result
new file mode 100644 (file)
index 0000000..551c366
--- /dev/null
@@ -0,0 +1,38 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging;
+INSERT t3 VALUES (x);
+END;
+SAVEPOINT event_logging;
+INSERT INTO t2 VALUES (x);
+END|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t3;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t3;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP PROCEDURE p1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#198.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#198.result
new file mode 100644 (file)
index 0000000..25ba2cb
--- /dev/null
@@ -0,0 +1,18 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+LOCK TABLE t2 WRITE;
+OPTIMIZE TABLE t1,t2;;
+REPAIR TABLE t1,t2;;
+SET SESSION wsrep_sync_wait = 0;
+INSERT INTO t2 VALUES (1);
+UNLOCK TABLES;
+Table  Op      Msg_type        Msg_text
+test.t1        optimize        note    Table does not support optimize, doing recreate + analyze instead
+test.t1        optimize        status  OK
+test.t2        optimize        note    Table does not support optimize, doing recreate + analyze instead
+test.t2        optimize        status  OK
+Table  Op      Msg_type        Msg_text
+test.t1        repair  note    The storage engine for the table doesn't support repair
+test.t2        repair  note    The storage engine for the table doesn't support repair
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#201.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#201.result
new file mode 100644 (file)
index 0000000..1c0998e
--- /dev/null
@@ -0,0 +1,4 @@
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (DEFAULT);
+SET GLOBAL query_cache_size=1355776;
+SET SESSION wsrep_sync_wait = 7;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#216.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#216.result
new file mode 100644 (file)
index 0000000..5d9a7f5
--- /dev/null
@@ -0,0 +1,10 @@
+SET GLOBAL wsrep_debug = ON;
+CREATE USER u1 IDENTIFIED BY 'plaintext_password';
+CREATE USER u1 IDENTIFIED BY 'plaintext_password';
+ERROR HY000: Operation CREATE USER failed for 'u1'@'%'
+0
+0
+4
+1
+DROP USER u1;
+CALL mtr.add_suppression('Operation CREATE USER failed');
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#237.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#237.result
new file mode 100644 (file)
index 0000000..3fd9aed
--- /dev/null
@@ -0,0 +1,10 @@
+CREATE TABLE t (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET DEBUG_SYNC = 'wsrep_before_replication WAIT_FOR continue';
+INSERT INTO t values (1);;
+SET SESSION wsrep_sync_wait = 0;
+FLUSH TABLES;
+SELECT SLEEP(1);
+SLEEP(1)
+0
+SET DEBUG_SYNC= 'now SIGNAL continue';
+DROP TABLE t;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#247.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#247.result
new file mode 100644 (file)
index 0000000..1b00f51
--- /dev/null
@@ -0,0 +1,11 @@
+SET GLOBAL wsrep_desync=1;
+SET wsrep_OSU_method=RSU;
+CREATE TABLE t1 (i int primary key);
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name  Value
+wsrep_desync   ON
+SET GLOBAL wsrep_desync=0;
+DROP TABLE t1;
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name  Value
+wsrep_desync   OFF
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#31.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#31.result
new file mode 100644 (file)
index 0000000..a21bb3e
--- /dev/null
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES('test');
+CREATE DATABASE db;
+Shutting down server 2 ...
+Recovering server 2 ...
+Performing --wsrep-recover ...
+Restarting server ...
+Using --wsrep-start-position when starting mysqld ...
+DROP TABLE t1;
+DROP DATABASE db;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#33.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#33.result
new file mode 100644 (file)
index 0000000..62af519
--- /dev/null
@@ -0,0 +1,103 @@
+Setting SST method to mysqldump ...
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = '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;
+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");
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#90.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#90.result
new file mode 100644 (file)
index 0000000..da57b9d
--- /dev/null
@@ -0,0 +1,31 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (1,2);
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+INSERT INTO t1 VALUES (3,4);
+DROP TABLE t1;
+SET GLOBAL WSREP_OSU_METHOD = TOI;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/GAL-382.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/GAL-382.test
new file mode 100644 (file)
index 0000000..0cc90e2
--- /dev/null
@@ -0,0 +1,15 @@
+#
+# GAL-382 InnoDB: Failing assertion: xid_seqno > trx_sys_cur_xid_seqno in trx0sys.cc line 356
+#
+
+--source include/galera_cluster.inc
+
+--connection node_1
+
+create table t1 (i int, j int, k int, primary key pk(i)) engine=innodb;
+insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
+create table t2 (i int, j int, k int, primary key pk(i, j, k), index idx(i, k, j)) engine=innodb;
+replace into t2 (i, j, k) select /*!99997 */ i, k, j from t1;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-252.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-252.test
new file mode 100644 (file)
index 0000000..3137aea
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# MW-252 - Check that FTWRL causes the node to become desynced
+# and not subject to flow control
+#
+
+--source include/galera_cluster.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+FLUSH TABLES WITH READ LOCK;
+
+# Node #1 is now desynced
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Donor/Desynced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Node #2 can issue updates without flow control kicking in
+--connection node_2
+
+--let $count = 100
+--disable_query_log
+while ($count)
+{
+  INSERT INTO t1 VALUES (1);
+  --dec $count
+}
+--enable_query_log
+
+# Restore cluster
+--connection node_1
+UNLOCK TABLES;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 100 FROM t1
+--source include/wait_condition.inc
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-258.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-258.test
new file mode 100644 (file)
index 0000000..b7b9769
--- /dev/null
@@ -0,0 +1,40 @@
+--source include/galera_cluster.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+LOCK TABLE t1 WRITE;
+--echo value prior to RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+SHOW VARIABLES LIKE 'wsrep_desync';
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_osu_method = RSU;
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1b
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_osu_method = RSU;
+--send ALTER TABLE t1 ADD COLUMN f3 INTEGER;
+
+--sleep 5
+--connection node_1
+--echo value during RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+SHOW VARIABLES LIKE 'wsrep_desync';
+UNLOCK TABLES;
+
+--connection node_1a
+--reap
+--connection node_1b
+--reap
+
+--connection node_1
+--echo value after RSU:
+SHOW STATUS LIKE 'wsrep_desync_count';
+SHOW VARIABLES LIKE 'wsrep_desync';
+SET GLOBAL wsrep_desync=0;
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-259.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-259.test
new file mode 100644 (file)
index 0000000..293b321
--- /dev/null
@@ -0,0 +1,38 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync=0;
+SET wsrep_OSU_method=RSU;
+
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_1a
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+# wsrep_desync=1 will block
+--send SET GLOBAL wsrep_desync=1;
+
+--connection node_1b
+--sleep 2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Opening tables' and INFO = 'SET GLOBAL wsrep_desync=1'
+--source include/wait_condition.inc
+
+SET DEBUG_SYNC= 'now SIGNAL continue';
+DROP TABLE t1;
+SET GLOBAL wsrep_desync=0;
+
+--connection node_1
+--reap
+
+--connection node_1a
+--reap
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-44-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-44-master.opt
new file mode 100644 (file)
index 0000000..a15aa0a
--- /dev/null
@@ -0,0 +1 @@
+--log-output=TABLE
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-44.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-44.test
new file mode 100644 (file)
index 0000000..843d33a
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# MW-44: DDL is logged in the general_log on the slave
+#
+
+--source include/galera_cluster.inc
+
+--connection node_1
+TRUNCATE TABLE mysql.general_log;
+
+--connection node_2
+TRUNCATE TABLE mysql.general_log;
+
+--connection node_1
+SET SESSION wsrep_osu_method=TOI;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET SESSION wsrep_osu_method=RSU;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+SET SESSION wsrep_osu_method=TOI;
+
+SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/disabled.def b/mysql-wsrep-5.6/mysql-test/suite/galera/t/disabled.def
new file mode 100644 (file)
index 0000000..120d7a4
--- /dev/null
@@ -0,0 +1,5 @@
+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
+galera_sst_xtrabackup-v2-options : SST Encryption does not work with xtrabackup 2.4.2
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_account_management.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_account_management.test
new file mode 100644 (file)
index 0000000..357319a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_alter_engine_innodb.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_alter_engine_innodb.test
new file mode 100644 (file)
index 0000000..bc914a3
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_alter_engine_myisam.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_alter_engine_myisam.test
new file mode 100644 (file)
index 0000000..6d41d27
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_alter_table_force.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_alter_table_force.test
new file mode 100644 (file)
index 0000000..1fcc9d4
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test
new file mode 100644 (file)
index 0000000..6747977
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# Test that applying plays well with FLUSH TABLE table_name WITH READ LOCK. The applier
+# thread should block until UNLOCK TABLEs.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+FLUSH TABLE t1 WITH READ LOCK;
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+UNLOCK TABLES;
+
+SET SESSION wsrep_sync_wait = 7;
+SELECT COUNT(*) = 2 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt
new file mode 100644 (file)
index 0000000..d8ecaac
--- /dev/null
@@ -0,0 +1 @@
+--lock_wait_timeout=5 --innodb_lock_wait_timeout=5 --wait_timeout=5
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test
new file mode 100644 (file)
index 0000000..99c45c0
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# Test that applying a DDL plays well with FLUSH TABLE table_name WITH READ LOCK. The applier
+# thread should block until UNLOCK TABLEs.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+
+# Those values are valid only for connection node_1. The global values from the -master.opt file apply to applier threads.
+SET SESSION lock_wait_timeout = 60;
+SET SESSION innodb_lock_wait_timeout=60;
+SET SESSION wait_timeout=60;
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+FLUSH TABLE t1 WITH READ LOCK;
+
+--connection node_2
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_1
+SELECT 1 FROM DUAL;
+# Sleep for longer than the global timeout ...
+--sleep 6
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
+
+UNLOCK TABLES;
+
+SET SESSION wsrep_sync_wait = 7;
+
+SHOW CREATE TABLE t1;
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master.cnf
new file mode 100644 (file)
index 0000000..52fd309
--- /dev/null
@@ -0,0 +1 @@
+!include ../galera_2nodes_as_master.cnf
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master.test
new file mode 100644 (file)
index 0000000..3367a20
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid.cnf
new file mode 100644 (file)
index 0000000..1951755
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid.test
new file mode 100644 (file)
index 0000000..9db104b
--- /dev/null
@@ -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 <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 <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 <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-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf
new file mode 100644 (file)
index 0000000..1951755
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test
new file mode 100644 (file)
index 0000000..23606d7
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave.cnf
new file mode 100644 (file)
index 0000000..9449ec9
--- /dev/null
@@ -0,0 +1 @@
+!include ../galera_2nodes_as_slave.cnf
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave.test
new file mode 100644 (file)
index 0000000..3786e5f
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# 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;
+
+--connection node_1
+RESET MASTER;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_autoinc.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_autoinc.cnf
new file mode 100644 (file)
index 0000000..9449ec9
--- /dev/null
@@ -0,0 +1 @@
+!include ../galera_2nodes_as_slave.cnf
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_autoinc.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_autoinc.test
new file mode 100644 (file)
index 0000000..bf04b27
--- /dev/null
@@ -0,0 +1,84 @@
+#
+# 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
+
+##
+## Verify the correct operation of the auto-increment when
+## the binlog format set to the 'STATEMENT' on the master node:
+##
+
+SET SESSION binlog_format='STATEMENT';
+
+CREATE TABLE t1 (
+     i int(11) NOT NULL AUTO_INCREMENT,
+     c char(32) DEFAULT 'dummy_text',
+     PRIMARY KEY (i)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+insert into t1(i) values(null);
+
+select * from t1;
+
+insert into t1(i) values(null), (null), (null);
+
+select * from t1;
+
+SET SESSION auto_increment_increment=7;
+insert into t1(i) values(null), (null), (null);
+
+SET SESSION auto_increment_offset=5;
+insert into t1(i) values(null), (null), (null);
+
+select * from t1;
+
+show variables like 'binlog_format';
+show variables like '%auto_increment%';
+
+--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(*) = 10 FROM t1;
+--source include/wait_condition.inc
+
+select * from t1;
+
+show variables like 'binlog_format';
+show variables like 'auto_increment_increment';
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+
+select * from t1;
+
+show variables like 'binlog_format';
+show variables like 'auto_increment_increment';
+
+--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;
+
+--connection node_1
+RESET MASTER;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_gtid.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_gtid.cnf
new file mode 100644 (file)
index 0000000..92f6a16
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_gtid.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_gtid.test
new file mode 100644 (file)
index 0000000..02fe5f7
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_nonprim.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_nonprim.cnf
new file mode 100644 (file)
index 0000000..5a44e56
--- /dev/null
@@ -0,0 +1 @@
+!include ../galera_3nodes_as_slave.cnf
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_nonprim.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
new file mode 100644 (file)
index 0000000..0c06941
--- /dev/null
@@ -0,0 +1,97 @@
+#
+# Test the behavior of a Galera async slave if it goes non-prim. Async replication
+# should abort with an error but it should be possible to restart it.
+#
+# The galera/galera_2node_slave.cnf describes the setup of the nodes
+#
+
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+--source include/big_test.inc
+
+# Step #1. Establish replication
+#
+# 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';
+SET SESSION wsrep_sync_wait = 0;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+--sleep 1
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+# Step #2. Force async slave to go non-primary
+
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+--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
+
+# Step #3. Force async replication to fail by creating a replication event while the slave is non-prim
+
+--connection node_1
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+
+--connection node_2
+--sleep 5
+
+--let $value = query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1)
+--connection node_3
+--disable_query_log
+--eval SELECT "$value" IN ("Error 'WSREP has not yet prepared node for application use' on query. Default database: 'test'. Query: 'BEGIN'", "Node has dropped from cluster") AS expected_error
+--enable_query_log
+
+# Step #4. Bring back the async slave and restart replication
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+
+--connection node_3
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--connection node_2
+--source include/galera_wait_ready.inc
+--source include/wait_until_connected_again.inc
+
+START SLAVE;
+
+# Confirm that the replication events have arrived
+
+--let $wait_condition = SELECT COUNT(*) = 5 FROM t1;
+--source include/wait_condition.inc
+
+--connection node_1
+DROP TABLE t1;
+
+--sleep 2
+--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;
+
+CALL mtr.add_suppression("Slave SQL: Error 'WSREP has not yet prepared node for application use' on query");
+CALL mtr.add_suppression("Slave: WSREP has not yet prepared node for application use Error_code: 1047");
+CALL mtr.add_suppression("Transport endpoint is not connected");
+CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213");
+CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
+
+
+--connection node_1
+RESET MASTER;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_preordered.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_preordered.cnf
new file mode 100644 (file)
index 0000000..d1a0fb1
--- /dev/null
@@ -0,0 +1,3 @@
+!include ../galera_2nodes_as_slave.cnf
+[mysqld]
+wsrep-preordered=TRUE
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_preordered.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_preordered.test
new file mode 100644 (file)
index 0000000..6f221f8
--- /dev/null
@@ -0,0 +1,84 @@
+#
+# Test Galera as a slave to a MySQL master with --wsrep-preordered=TRUE
+#
+# 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';
+
+#
+# Issue many large-ish transaction on the async master
+#
+
+--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 PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
+
+--disable_query_log
+--let $count = 100
+while ($count)
+{
+  --eval INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;
+  --dec $count
+}
+--enable_query_log
+
+#
+# While the async transactions are being applied, issue another set of transactions
+# on the Galera node.
+#
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $count = 100
+--disable_query_log
+while ($count)
+{
+  --eval INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;
+  --dec $count
+}
+--enable_query_log
+
+#
+# Confirm that all transactions successfully committed
+#
+
+--let $wait_condition = SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
+--source include/wait_condition.inc
+
+SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
+SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
+
+#
+# Cleanup
+#
+
+--connection node_1
+DROP TABLE t1;
+DROP TABLE ten;
+
+--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-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.cnf
new file mode 100644 (file)
index 0000000..d092d88
--- /dev/null
@@ -0,0 +1,4 @@
+!include ../galera_2nodes_as_slave.cnf
+
+[mysqld]
+wsrep-mysql-replication-bundle=2
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_replication_bundle.test
new file mode 100644 (file)
index 0000000..df1d72f
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Test the wsrep_replication_bundle variable. We expect that multiple async replication events
+# will be grouped together and thus a smaller number of wsrep_last_committed transactions will
+# be reported.
+#
+
+--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);
+INSERT INTO t1 VALUES(2);
+INSERT INTO t1 VALUES(3);
+INSERT INTO t1 VALUES(4);
+INSERT INTO t1 VALUES(5);
+
+--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(*) = 4 FROM t1;
+--source include/wait_condition.inc
+
+# With wsrep_mysql_replication_bundle = 2, the last insert is not delivered
+# because there are not enough events remaining to complete an entire bundle
+SELECT COUNT(*) = 4 FROM t1;
+
+# Bundle is now complete, the last INSERT and the DROP are delivered
+--connection node_1
+DROP TABLE t1;
+
+--connection node_2
+--sleep 1
+--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-wsrep-5.6/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
new file mode 100644 (file)
index 0000000..7d684ce
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test
new file mode 100644 (file)
index 0000000..251450f
--- /dev/null
@@ -0,0 +1,95 @@
+#
+# Test that autoincrement works correctly while the cluster membership
+# is changing and IST takes place.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--let $connection_id = `SELECT CONNECTION_ID()`
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+
+# Issue an endless stream of autoincrement inserts
+
+DELIMITER |;
+CREATE PROCEDURE p1 ()
+BEGIN
+       DECLARE x INT DEFAULT 1;
+       DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+
+       WHILE 1 DO
+               INSERT INTO t1 VALUES (DEFAULT);
+               COMMIT;
+       END WHILE;
+END|
+DELIMITER ;|
+
+--send CALL p1();
+--sleep 2
+
+--connection node_2
+--send CALL p1();
+--sleep 2
+
+# Kill and restart node #2
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--source include/kill_galera.inc
+
+--sleep 10
+--source include/start_mysqld.inc
+--sleep 25
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (DEFAULT);
+
+# Terminate the stored procedure
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+--disable_query_log
+--eval KILL CONNECTION $connection_id
+--enable_query_log
+
+INSERT INTO t1 VALUES (DEFAULT);
+
+--connection node_1
+# CR_SERVER_LOST
+--error 2013,2006
+--reap
+
+--connection node_2
+# CR_SERVER_LOST
+--error 2013,2006
+--reap
+
+--sleep 10
+
+# Confirm that the count is correct and that the cluster is intact
+
+--connection node_1a
+--let $count = `SELECT COUNT(*) FROM t1`
+
+--connection node_2a
+--disable_query_log
+--eval SELECT COUNT(*) = $count AS count_equal FROM t1
+--enable_query_log
+
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
+
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--connection node_1a
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort.test
new file mode 100644 (file)
index 0000000..69825ea
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test
new file mode 100644 (file)
index 0000000..e98a768
--- /dev/null
@@ -0,0 +1,38 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test that a local FLUSH TABLES FOR BACKUP will NOT 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'`
+FLUSH TABLES t1 FOR EXPORT;
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+UNLOCK TABLES;
+
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+COMMIT;
+SET AUTOCOMMIT=ON;
+SELECT COUNT(*) = 1 FROM t1;
+
+--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 = 0 AS wsrep_local_aborts_increment;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_for_update.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_for_update.test
new file mode 100644 (file)
index 0000000..24c2977
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test
new file mode 100644 (file)
index 0000000..44398e7
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test
new file mode 100644 (file)
index 0000000..72fc1c5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test
new file mode 100644 (file)
index 0000000..4582f3f
--- /dev/null
@@ -0,0 +1,36 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# Test that a local LOCK TABLE will NOT 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;
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+UNLOCK TABLES;
+
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+COMMIT;
+SELECT COUNT(*) = 1 FROM t1;
+
+--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 = 0 AS wsrep_local_aborts_increment;
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_sleep.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_sleep.test
new file mode 100644 (file)
index 0000000..8d135dc
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_cache_size.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_cache_size.test
new file mode 100644 (file)
index 0000000..6ce9072
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt
new file mode 100644 (file)
index 0000000..c8e53f0
--- /dev/null
@@ -0,0 +1 @@
+--binlog-checksum=CRC32 --master-verify-checksum=1 --slave-sql-verify-checksum=1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_checksum.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_checksum.test
new file mode 100644 (file)
index 0000000..4866930
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
new file mode 100644 (file)
index 0000000..a36d213
--- /dev/null
@@ -0,0 +1 @@
+--binlog-row-event-max-size=4294967295
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test
new file mode 100644 (file)
index 0000000..d0cc234
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# 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
+--source include/big_test.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-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt
new file mode 100644 (file)
index 0000000..2217475
--- /dev/null
@@ -0,0 +1 @@
+--binlog-row-event-max-size=256
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test
new file mode 100644 (file)
index 0000000..00b5533
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_row_image.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_row_image.test
new file mode 100644 (file)
index 0000000..70262ec
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test
new file mode 100644 (file)
index 0000000..95bc85c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_create_function.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_function.test
new file mode 100644 (file)
index 0000000..0d7cec0
--- /dev/null
@@ -0,0 +1,53 @@
+--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
+# Work around codership/mysql-wsrep#228 - SHOW CREATE FUNCTION not covered by wsrep_sync_wait
+SELECT 1 FROM DUAL;
+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-wsrep-5.6/mysql-test/suite/galera/t/galera_create_procedure.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_procedure.test
new file mode 100644 (file)
index 0000000..30bc85f
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_create_table_like.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_table_like.test
new file mode 100644 (file)
index 0000000..0e0e8b0
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_create_trigger.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_trigger.test
new file mode 100644 (file)
index 0000000..74dc616
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_defaults.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_defaults.test
new file mode 100644 (file)
index 0000000..d7c0b6f
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# 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 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 = .*?;/<BASE_DIR>;/sgio;
+       $wsrep_provider_options =~ s/base_host = .*?;/<BASE_HOST>;/sgio;
+       $wsrep_provider_options =~ s/base_port = .*?;/<BASE_PORT>;/sgio;
+       $wsrep_provider_options =~ s/gcache\.dir = .*?;/<GCACHE_DIR>;/sgio;
+       $wsrep_provider_options =~ s/gcache\.name = .*?;/<GCACHE_NAME>;/sgio;
+       $wsrep_provider_options =~ s/gmcast\.listen_addr = .*?;/<GMCAST_LISTEN_ADDR>;/sgio;
+       $wsrep_provider_options =~ s/ist\.recv_addr = .*?;/<IST_RECV_ADDR>;/sgio;
+       $wsrep_provider_options =~ s/evs\.evict = .*?;/<EVS_EVICT>;/sgio;
+       $wsrep_provider_options =~ s/signal = .*?;\s*//sgio;
+       $wsrep_provider_options =~ s/dbug = .*?;\s*//sgio;
+       $wsrep_provider_options =~ s/gcs.recv_q_hard_limit = .*?;\s*/<RECV_Q_HARD_LIMIT>;/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-wsrep-5.6/mysql-test/suite/galera/t/galera_delete_limit.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_delete_limit.test
new file mode 100644 (file)
index 0000000..4cbadbd
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_drop_multi.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_drop_multi.test
new file mode 100644 (file)
index 0000000..44b1b61
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# Test that multi-table DROP TABLE statements are properly replicated
+# See http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-20.html
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t4 (f1 INTEGER) ENGINE=InnoDB;
+
+CREATE TABLE t5 (f1 INTEGER);
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+
+DROP TABLE t1, t2, t3, t4;
+
+INSERT INTO t5 VALUES (1);
+
+COMMIT;
+
+--connection node_2
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t1;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t2;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t3;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t4;
+
+CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test.t2,test.t4'' on query\. Default database: 'test'\. Query: 'DROP TABLE t1, t2, t3, t4', Error_code: 1051");
+
+--connection node_1
+DROP TABLE t5;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_enum.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_enum.test
new file mode 100644 (file)
index 0000000..ff53324
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_events.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_events.test
new file mode 100644 (file)
index 0000000..ae9940f
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_cascade_delete.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_cascade_delete.test
new file mode 100644 (file)
index 0000000..9b79b4c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_cascade_update.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_cascade_update.test
new file mode 100644 (file)
index 0000000..e736803
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_conflict.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_conflict.test
new file mode 100644 (file)
index 0000000..cb6f95e
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_mismatch.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_mismatch.test
new file mode 100644 (file)
index 0000000..bded413
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_multicolumn.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_multicolumn.test
new file mode 100644 (file)
index 0000000..ad42f65
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_multitable.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_multitable.test
new file mode 100644 (file)
index 0000000..6adfb81
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_no_pk.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_no_pk.test
new file mode 100644 (file)
index 0000000..d1f9c26
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_selfreferential.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_selfreferential.test
new file mode 100644 (file)
index 0000000..e2c1900
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_setnull.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fk_setnull.test
new file mode 100644 (file)
index 0000000..46ba82d
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_flush-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush-master.opt
new file mode 100644 (file)
index 0000000..5a1fb67
--- /dev/null
@@ -0,0 +1 @@
+--query_cache_type=1 --query_cache_size=1000000
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush.test
new file mode 100644 (file)
index 0000000..d62cbad
--- /dev/null
@@ -0,0 +1,225 @@
+#
+# Test that various FLUSH commands are replicated. Whenever possible, check the slave for the effects.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_perfschema.inc
+--source include/have_query_cache.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2; 
+--enable_warnings
+#
+# The following FLUSH statements should be replicated
+#
+
+--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
+FLUSH DES_KEY_FILE;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--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
+FLUSH HOSTS;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_1
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+INSERT INTO mysql.user VALUES('localhost','user1',PASSWORD('pass1'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N');
+FLUSH PRIVILEGES;
+--connect node_2a, 127.0.0.1, user1, pass1, test, $NODE_MYPORT_2
+--connection node_1
+DELETE FROM mysql.user WHERE user = 'user1';
+SET GLOBAL wsrep_replicate_myisam = FALSE;
+FLUSH PRIVILEGES;
+
+
+--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
+FLUSH QUERY CACHE;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--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
+FLUSH STATUS;
+
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--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
+FLUSH USER_RESOURCES;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--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
+FLUSH TABLES;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_1
+CREATE TABLE t2 (f1 INTEGER);
+
+--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
+FLUSH TABLES t2;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--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
+FLUSH ERROR LOGS;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--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
+FLUSH SLOW LOGS;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--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
+FLUSH GENERAL LOGS;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--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
+FLUSH ENGINE LOGS;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--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
+FLUSH RELAY LOGS;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+#
+# The following statements should not be replicated: FLUSH LOGS, FLUSH TABLES WITH LOCKS
+#
+
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+
+--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
+FLUSH LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+
+--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
+
+
+## Test LOCK TABLES with FLUSH TABLES
+## LOCK TABLES t1 write followed by flush tables t1 should succeed due to MDL upgrade.
+## LOCK tables t2 read followed by flush tables t2 should fail with ER_TABLE_NOT_LOCKED_FOR_WRITE
+
+
+--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
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--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
+LOCK TABLES t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH TABLES t1;
+UNLOCK TABLES;
+--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
+--connection node_1
+FLUSH TABLES t1;
+--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 + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush_local.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush_local.opt
new file mode 100644 (file)
index 0000000..698bbef
--- /dev/null
@@ -0,0 +1 @@
+--query_cache_type=1 --query_cache_size=1000000 --innodb_track_changed_pages=1 --userstat=1 --thread_statistics=1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush_local.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_flush_local.test
new file mode 100644 (file)
index 0000000..73c305a
--- /dev/null
@@ -0,0 +1,137 @@
+#
+# Test that various FLUSH LOCAL commands are replicated. Whenever possible, check the slave for the effects.
+# PXC-391
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_query_cache.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, x1, x2;
+--enable_warnings
+#
+# The following FLUSH LOCAL statements should *not* be replicated
+#
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+--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
+FLUSH LOCAL DES_KEY_FILE;
+FLUSH LOCAL HOSTS;
+FLUSH LOCAL QUERY CACHE;
+FLUSH LOCAL STATUS;
+FLUSH LOCAL PRIVILEGES;
+FLUSH LOCAL USER_RESOURCES;
+FLUSH LOCAL TABLES;
+FLUSH LOCAL TABLES t2;
+FLUSH LOCAL ERROR LOGS;
+FLUSH LOCAL SLOW LOGS;
+FLUSH LOCAL GENERAL LOGS;
+FLUSH LOCAL ENGINE LOGS;
+FLUSH LOCAL RELAY LOGS;
+FLUSH LOCAL LOGS;
+FLUSH LOCAL BINARY LOGS;
+FLUSH LOCAL TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH LOCAL TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH LOCAL TABLES t1;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1;
+ANALYZE LOCAL TABLE t1, t2;
+OPTIMIZE LOCAL TABLE t1, t2;
+REPAIR LOCAL TABLE x1, x2;
+--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
+
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM x1;
+SELECT COUNT(*) = 10000 FROM t2;
+SELECT COUNT(*) = 10 FROM x2;
+
+
+--connection node_1
+DROP TABLE t1, t2, x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+
+--connection node_2
+--let $wsrep_last_committed_before2 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+set wsrep_on=0;
+FLUSH DES_KEY_FILE;
+FLUSH HOSTS;
+FLUSH QUERY CACHE;
+FLUSH STATUS;
+FLUSH PRIVILEGES;
+FLUSH USER_RESOURCES;
+FLUSH TABLES;
+FLUSH TABLES t2;
+FLUSH ERROR LOGS;
+FLUSH SLOW LOGS;
+FLUSH GENERAL LOGS;
+FLUSH ENGINE LOGS;
+FLUSH RELAY LOGS;
+FLUSH LOGS;
+FLUSH BINARY LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH TABLES t1;
+UNLOCK TABLES;
+FLUSH TABLES t1;
+ANALYZE TABLE t1, t2;
+OPTIMIZE TABLE t1, t2;
+REPAIR TABLE x1, x2;
+--connection node_2
+--let $wsrep_last_committed_after2 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after2 = $wsrep_last_committed_before2 AS wsrep_last_committed_diff;
+--eval SELECT $wsrep_last_committed_after2 = $wsrep_last_committed_before + 9 AS wsrep_last_committed_diff2;
+--enable_query_log
+
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM x1;
+SELECT COUNT(*) = 10000 FROM t2;
+SELECT COUNT(*) = 10 FROM x2;
+
+--connection node_1
+set wsrep_on=1;
+SET GLOBAL wsrep_replicate_myisam = FALSE;
+DROP TABLE t1, t2, x1, x2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_forced_binlog_format-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_forced_binlog_format-master.opt
new file mode 100644 (file)
index 0000000..8c58b59
--- /dev/null
@@ -0,0 +1 @@
+--log-bin --wsrep_forced_binlog_format=ROW
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_forced_binlog_format.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_forced_binlog_format.test
new file mode 100644 (file)
index 0000000..934c153
--- /dev/null
@@ -0,0 +1,25 @@
+#
+# Test that wsrep_forced_binlog_format=ROW indeed prevents the log to be switched to STATEMENT format on a per-connection basis
+# 
+
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+--connection node_1
+RESET MASTER;
+
+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);
+
+--replace_regex /xid=[0-9]+/xid=###/ /table_id: [0-9]+/table_id: ###/
+--replace_column 2 <Pos> 5 <End_log_pos>
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ftwrl.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ftwrl.test
new file mode 100644 (file)
index 0000000..de8310e
--- /dev/null
@@ -0,0 +1,40 @@
+--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 causality 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-wsrep-5.6/mysql-test/suite/galera/t/galera_ftwrl_drain.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ftwrl_drain.test
new file mode 100644 (file)
index 0000000..690e890
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# Test the following sequence of events:
+#
+# 1. issue a remote transaction
+# 2. applier is blocked from applying the transaction locally using apply_monitor_slave_enter_sync
+# 3. FTWRL is issued and blocks in ApplyOrder>::drain_common
+# 4. applier is unblocked
+# 5. remote transaction is applied
+# 6. FTWRL is granted
+#
+
+--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
+
+--connection node_1
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+
+--let $galera_sync_point = apply_monitor_slave_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+
+# Wait until applier has blocked
+--source include/galera_wait_sync_point.inc
+
+SELECT COUNT(*) = 0 FROM t1;
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--send FLUSH TABLES WITH READ LOCK;
+
+--connection node_2
+--sleep 1
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Init' AND INFO = 'FLUSH TABLES WITH READ LOCK'
+--source include/wait_condition.inc
+
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+--connection node_2a
+--reap
+
+--connection node_2
+
+SET SESSION lock_wait_timeout = 1;
+SET SESSION innodb_lock_wait_timeout=1;
+SET SESSION wait_timeout=1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t2 VALUES (2);
+
+--connection node_2a
+UNLOCK TABLES;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+INSERT INTO t1 VALUES (3);
+
+--connection node_1
+SELECT COUNT(*) = 2 FROM t1;
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fulltext.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_fulltext.test
new file mode 100644 (file)
index 0000000..a90cab1
--- /dev/null
@@ -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 1K rows
+INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
+
+--connection node_2
+SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
+
+UPDATE t1 SET f2 = 'abcdefjhk';
+
+--connection node_1
+SELECT COUNT(f2) = 1000 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-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fc_limit.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fc_limit.test
new file mode 100644 (file)
index 0000000..721d84e
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# 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
+SELECT COUNT(*) = 1 FROM t1;
+--sleep 1
+
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
+
+# Block the slave applier thread
+LOCK TABLE t1 WRITE;
+
+--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 2
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'query end' AND INFO = 'INSERT INTO t1 VALUES (5)';
+--source include/wait_condition.inc
+
+--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-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fragment.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fragment.cnf
new file mode 100644 (file)
index 0000000..aae3fee
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fragment.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fragment.test
new file mode 100644 (file)
index 0000000..ae1e0d8
--- /dev/null
@@ -0,0 +1,66 @@
+# Test fragmentation over configuration changes
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Prepare table
+CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
+
+# Stop node2
+
+# Disconnect node_2 from group
+--connection node_2
+--let $wsrep_cluster_address_orig = `select @@wsrep_cluster_address`
+SET GLOBAL wsrep_cluster_address='';
+
+# Connection for sync points
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET SESSION wsrep_sync_wait=0;
+
+# Set breakpoint in gcs after first fragment send
+
+--let $galera_sync_point = gcs_core_after_frag_send
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit=0;
+--send INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+
+--connection node_1a
+--source include/galera_wait_sync_point.inc
+--source include/galera_clear_sync_point.inc
+
+
+# Restart node_2, wait until it joins the group and then make INSERT
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'
+--enable_query_log
+SET SESSION wsrep_on = 0;
+--source include/galera_wait_ready.inc
+SET SESSION wsrep_on = 1;
+
+INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+# Signal node_1 to continue
+--connection node_1a
+--source include/galera_signal_sync_point.inc
+
+# Deadlock error should be returned since write set send was
+# interrupted by gcs
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+# Do additional insert to verify that node_1 remain operational
+INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+
+# Nodes node_1 and node_2 should now contain rows 2 and 3
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+--connection node_1
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf
new file mode 100644 (file)
index 0000000..aae3fee
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_max_packet_size.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_max_packet_size.test
new file mode 100644 (file)
index 0000000..98be4f6
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# 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
+--source include/big_test.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-wsrep-5.6/mysql-test/suite/galera/t/galera_gra_log.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gra_log.test
new file mode 100644 (file)
index 0000000..5329dc2
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Test that GRA_* files are generated on applier failure and are readable.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_2
+--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
+
+# Create applier failure
+
+SET SESSION wsrep_on=OFF;
+CREATE TABLE t1 (f1 INTEGER);
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+
+# Compose a valid binlog from a header file and the GRA file
+
+--let $gra_binlog_file = $MYSQLTEST_VARDIR/tmp/gra.log
+--exec rm -rf $gra_binlog_file 
+
+--exec cp std_data/binlog-header.log $gra_binlog_file
+--exec cat $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log >> $gra_binlog_file
+
+# Make sure the binlog thus produced is readable and contains the failure
+--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /#[0-9]+ +[0-9]+:[0-9]+:[0-9]+/<ISO TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/ /thread_id=[0-9]+/thread_id=<QUERY_THREAD_ID>/
+--exec $MYSQL_BINLOG $gra_binlog_file
+
+SET SESSION wsrep_on=ON;
+
+CALL mtr.add_suppression("Slave SQL: Error 'Table 't1' already exists' on query");
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gtid-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gtid-master.opt
new file mode 100644 (file)
index 0000000..48e46d7
--- /dev/null
@@ -0,0 +1 @@
+--gtid-mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gtid.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gtid.test
new file mode 100644 (file)
index 0000000..97e7d1f
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_insert_ignore.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_insert_ignore.test
new file mode 100644 (file)
index 0000000..4b4b0a6
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_insert_multi.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_insert_multi.test
new file mode 100644 (file)
index 0000000..d62283a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf
new file mode 100644 (file)
index 0000000..41a1aab
--- /dev/null
@@ -0,0 +1,14 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth=root:
+
+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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test
new file mode 100644 (file)
index 0000000..0783870
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf
new file mode 100644 (file)
index 0000000..db6b7d5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_mysqldump.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_mysqldump.test
new file mode 100644 (file)
index 0000000..a9ff8c4
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf
new file mode 100644 (file)
index 0000000..2628f05
--- /dev/null
@@ -0,0 +1,8 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;ist.recv_bind=127.0.0.1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;ist.recv_bind=127.0.0.1'
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_recv_bind.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_recv_bind.test
new file mode 100644 (file)
index 0000000..c04238d
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Test ist.recv_bind option. Since MTR can not do proper testing with multiple interfaces and such, we
+# simply confirm that the option can be set (in the galera_ist_recv_bind.cnf file) and that IST works as expected
+#
+
+--source include/galera_cluster.inc
+
+--connection node_1
+SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
+
+--connection node_2
+SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
+
+# Isolate node #2 
+
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
+--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
+
+--connection node_2
+SET SESSION wsrep_on = OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+SET SESSION wsrep_on = ON;
+
+# Node #2 is now isolated. Run some transactions to accumulate writesets for IST
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+# Restore node #2
+
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
+
+--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
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+# Confirm that IST has taken place
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
+--source include/wait_condition.inc
+
+# Cleanup
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf
new file mode 100644 (file)
index 0000000..10958aa
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
new file mode 100644 (file)
index 0000000..eae28bd
--- /dev/null
@@ -0,0 +1,108 @@
+#
+# 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 ...
+--let $galera_sync_point = recv_IST_after_apply_trx
+--source include/galera_set_sync_point.inc
+
+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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_rsync.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_rsync.cnf
new file mode 100644 (file)
index 0000000..bbe0f60
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_rsync.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_rsync.test
new file mode 100644 (file)
index 0000000..41d1a0c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf
new file mode 100644 (file)
index 0000000..a762b93
--- /dev/null
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth=root:
+
+[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-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test
new file mode 100644 (file)
index 0000000..8b399e7
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_applier.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_applier.test
new file mode 100644 (file)
index 0000000..e14a8b9
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# This test checks that applier threads are immune to KILL QUERY and KILL STATEMENT
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1`
+
+--disable_query_log
+--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
+--eval KILL $applier_thread
+
+--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
+--eval KILL QUERY $applier_thread
+
+--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1`
+
+--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
+--eval KILL $aborter_thread
+
+--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
+--eval KILL QUERY $aborter_thread
+--enable_query_log
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_ddl.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_ddl.test
new file mode 100644 (file)
index 0000000..3c2bce5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_largechanges.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_largechanges.test
new file mode 100644 (file)
index 0000000..e9a32ce
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_nochanges.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_nochanges.test
new file mode 100644 (file)
index 0000000..1903df4
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_smallchanges.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_kill_smallchanges.test
new file mode 100644 (file)
index 0000000..d998032
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_lock_table.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_lock_table.test
new file mode 100644 (file)
index 0000000..bd58184
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_log_bin-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_bin-master.opt
new file mode 100644 (file)
index 0000000..8a755e9
--- /dev/null
@@ -0,0 +1 @@
+--log-bin --log-slave-updates
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_bin.test
new file mode 100644 (file)
index 0000000..0f4ba92
--- /dev/null
@@ -0,0 +1,41 @@
+--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
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+SHOW BINLOG EVENTS IN '0.000002' FROM 120;
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+SHOW BINLOG EVENTS IN '0.000001' FROM 120;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--connection node_1
+RESET MASTER;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_output_csv-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_output_csv-master.opt
new file mode 100644 (file)
index 0000000..2f71b14
--- /dev/null
@@ -0,0 +1 @@
+--log-output=TABLE --log-queries-not-using-indexes --general-log --slow-query-log
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_output_csv.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_log_output_csv.test
new file mode 100644 (file)
index 0000000..94ae3dd
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# 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
+
+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-wsrep-5.6/mysql-test/suite/galera/t/galera_many_columns.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_columns.test
new file mode 100644 (file)
index 0000000..1961eae
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_many_indexes.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_indexes.test
new file mode 100644 (file)
index 0000000..e01d0b2
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_many_rows.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_rows.test
new file mode 100644 (file)
index 0000000..653dc2d
--- /dev/null
@@ -0,0 +1,54 @@
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+SET SESSION innodb_lock_wait_timeout=600;
+SET SESSION lock_wait_timeout=600;
+
+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
+SET SESSION wsrep_sync_wait = 0;
+--let $wsrep_provider_options_node2 = `SELECT @@wsrep_provider_options`
+SET SESSION wsrep_sync_wait = 7;
+
+SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H';
+
+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;
+
+--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;
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node2';
+--enable_query_log
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_tables_nopk.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_tables_nopk.test
new file mode 100644 (file)
index 0000000..2496d14
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_many_tables_pk.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_tables_pk.test
new file mode 100644 (file)
index 0000000..886cb7c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_mdl_race.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_mdl_race.test
new file mode 100644 (file)
index 0000000..c7f03ba
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# This test tests a potential race condition in MDL locking
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+CREATE TABLE t2 (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;
+
+# block access to t2
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+LOCK TABLE t2 WRITE;
+
+# Block before MLD lock wait
+--connection node_1
+  SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";     
+--send SELECT * FROM t2;
+
+# Wait for SELECT to be blocked
+--connection node_1a
+#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIS  WHERE STATE = 'System lock';
+#--source include/wait_condition.inc
+#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
+#--source include/wait_condition.inc
+
+# block applier to wait after BF victim is locked
+SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
+
+# Issue a conflicting update on node #2
+--connection node_2
+UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
+
+--sleep 3
+
+# Unblock the SELECT, to enter wsrep_thd_is_BF
+--connection node_1a
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
+
+--sleep 3
+
+# unblock applier to try to BF the SELECT
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
+
+
+# table lock is not needed anymore
+--sleep 3
+UNLOCK TABLES;
+
+# SELECT succeeds
+--connection node_1
+
+--error ER_LOCK_DEADLOCK
+--reap
+
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_migrate.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_migrate.cnf
new file mode 100644 (file)
index 0000000..dfaf4a6
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_migrate.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_migrate.test
new file mode 100644 (file)
index 0000000..5d498d3
--- /dev/null
@@ -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';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+GRANT ALL PRIVILEGES ON *.* TO '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-wsrep-5.6/mysql-test/suite/galera/t/galera_multi_database.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_multi_database.test
new file mode 100644 (file)
index 0000000..6e06aaa
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_myisam_autocommit.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_myisam_autocommit.test
new file mode 100644 (file)
index 0000000..b01b5dc
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_myisam_transactions.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_myisam_transactions.test
new file mode 100644 (file)
index 0000000..00e0bf3
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_bit.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_bit.test
new file mode 100644 (file)
index 0000000..4292a6d
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_blob.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_blob.test
new file mode 100644 (file)
index 0000000..08e3b99
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_large_varchar.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_large_varchar.test
new file mode 100644 (file)
index 0000000..bb9bcd5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_unicode.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_nopk_unicode.test
new file mode 100644 (file)
index 0000000..e036e14
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test
new file mode 100644 (file)
index 0000000..7c49a57
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test
new file mode 100644 (file)
index 0000000..f280e49
--- /dev/null
@@ -0,0 +1,51 @@
+##
+## This test tests parallel application of multiple auto-increment insert transactions
+##
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.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-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test
new file mode 100644 (file)
index 0000000..8680d62
--- /dev/null
@@ -0,0 +1,54 @@
+##
+## Tests the parallel application of many small-ish auto-increment insert transactions
+##
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.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-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_simple.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_simple.test
new file mode 100644 (file)
index 0000000..b1dc14d
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_pc_ignore_sb.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_pc_ignore_sb.test
new file mode 100644 (file)
index 0000000..4be7331
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_pk_bigint_signed.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_pk_bigint_signed.test
new file mode 100644 (file)
index 0000000..12a8a8f
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test
new file mode 100644 (file)
index 0000000..2bb02d5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_prepared_statement.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_prepared_statement.test
new file mode 100644 (file)
index 0000000..1d561e3
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# A simple test for PREPARE / EXECUTE -style prepared statements with Galera
+#
+# C-API-level prepared-statements can not be triggered from inside mysqltest, however
+# can be exercised when running an MTR test suite with the --ps-protocol switch.
+#
+
+--source include/galera_cluster.inc
+
+CREATE TABLE t1 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t3 (f1 CHAR(5)) ENGINE=InnoDB;
+CREATE TABLE t4 (f1 CHAR(5)) ENGINE=InnoDB;
+
+SET SESSION sql_mode='STRICT_ALL_TABLES';
+
+PREPARE st1 FROM 'INSERT INTO t1 VALUES ("abc")';
+PREPARE st2 FROM 'INSERT INTO t2 VALUES ("abc")';
+PREPARE st3 FROM 'INSERT INTO t3 VALUES ("abc")';
+PREPARE st4 FROM 'INSERT INTO t4 VALUES ("abc")';
+
+EXECUTE st1;
+EXECUTE st2;
+EXECUTE st3;
+EXECUTE st4;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+SELECT COUNT(*) = 1 FROM t3;
+SELECT COUNT(*) = 1 FROM t4;
+
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+ALTER TABLE t1 DROP COLUMN f1;
+
+--connection node_1
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+EXECUTE st1;
+
+--connection node_1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache-master.opt
new file mode 100644 (file)
index 0000000..18f8004
--- /dev/null
@@ -0,0 +1,2 @@
+--query_cache_type=1
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache.test
new file mode 100644 (file)
index 0000000..900faba
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt
new file mode 100644 (file)
index 0000000..a00258b
--- /dev/null
@@ -0,0 +1 @@
+--query_cache_type=1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test
new file mode 100644 (file)
index 0000000..0634eba
--- /dev/null
@@ -0,0 +1,90 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source include/have_query_cache.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1; # first lookup miss
+
+#
+# Query cache hit, wait timeout
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT MAX(id) FROM t1;
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+FLUSH QUERY CACHE;
+SET SESSION wsrep_sync_wait = 7;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+
+#
+# Query cache miss, wait timeout
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT MAX(id) FROM t1;
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+#
+# Query cache miss
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (4);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1;
+SET SESSION wsrep_sync_wait = 7;
+
+#
+# Query cache hit
+#
+
+FLUSH STATUS;
+SELECT MAX(id) FROM t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+
+#
+# Query cache invalidated
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (5);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 7;
+--send SELECT MAX(id) FROM t1 
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+--connection node_2
+--reap
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig"
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_read_only.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_read_only.test
new file mode 100644 (file)
index 0000000..828f35d
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test
new file mode 100644 (file)
index 0000000..8749c20
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_repl_max_ws_size.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_repl_max_ws_size.test
new file mode 100644 (file)
index 0000000..255e292
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_restart_nochanges.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_restart_nochanges.test
new file mode 100644 (file)
index 0000000..3772c23
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# 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
+--source include/galera_wait_ready.inc
+
+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-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_add_pk.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_add_pk.test
new file mode 100644 (file)
index 0000000..7db990d
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# 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 SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION 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 SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION wsrep_OSU_method = "TOI";
+
+DROP TABLE t1;
+DROP TABLE ten;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_drop_pk.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_drop_pk.test
new file mode 100644 (file)
index 0000000..e642594
--- /dev/null
@@ -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 SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 DROP PRIMARY KEY;
+SET SESSION 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 SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 DROP PRIMARY KEY;
+SET SESSION 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-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_error.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_error.test
new file mode 100644 (file)
index 0000000..cad8154
--- /dev/null
@@ -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 SESSION wsrep_OSU_method = "RSU";
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+SET SESSION 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-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_simple.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_simple.test
new file mode 100644 (file)
index 0000000..5841dbd
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# 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 SESSION wsrep_OSU_method = "RSU";
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+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-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test
new file mode 100644 (file)
index 0000000..d0c6414
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Test manipulating wsrep_desync while an RSU operation is in progress
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+# First, test wsrep_desync 1 > 0 during DDL
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync=1;
+SET wsrep_OSU_method=RSU;
+
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_desync=0;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SHOW CREATE TABLE t1;
+SHOW VARIABLES LIKE 'wsrep_desync';
+SET wsrep_OSU_method=TOI;
+
+DROP TABLE t1;
+
+# Next, test wsrep_desync 0 > 1 during DDL, currently not allowed
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync=0;
+SET wsrep_OSU_method=RSU;
+
+SET DEBUG_SYNC = 'alter_table_before_create_table_no_lock WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_1a
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_create_table_no_lock'
+--source include/wait_condition.inc
+
+# wsrep_desync=1 will block
+--send SET GLOBAL wsrep_desync=1;
+
+
+--connection node_1b
+--sleep 2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Opening tables' and INFO = 'SET GLOBAL wsrep_desync=1'
+--source include/wait_condition.inc
+
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+--connection node_1a
+--reap
+SET GLOBAL wsrep_desync=0;
+
+SHOW CREATE TABLE t1;
+SET wsrep_OSU_method=TOI;
+DROP TABLE t1;
+
+CALL mtr.add_suppression("Protocol violation");
+CALL mtr.add_suppression("desync failed");
+
+--connection node_2
+CALL mtr.add_suppression("Protocol violation");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sbr.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sbr.test
new file mode 100644 (file)
index 0000000..b598759
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt
new file mode 100644 (file)
index 0000000..beae84b
--- /dev/null
@@ -0,0 +1 @@
+--log-bin
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sbr_binlog.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sbr_binlog.test
new file mode 100644 (file)
index 0000000..23e490a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_schema_dirty_reads.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_schema_dirty_reads.test
new file mode 100644 (file)
index 0000000..93e2424
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# Dirty reads from INFORMATION_SCHEMA tables.
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--disable_info
+USE information_schema;
+SELECT * FROM SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep_dirty_reads";
+SET GLOBAL wsrep_reject_queries=ALL;
+SELECT * FROM SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep_dirty_reads";
+SET GLOBAL wsrep_reject_queries=NONE;
+SET SESSION wsrep_dirty_reads=TRUE;
+SELECT * FROM SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep_dirty_reads";
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_serializable.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_serializable.test
new file mode 100644 (file)
index 0000000..b12d57f
--- /dev/null
@@ -0,0 +1,76 @@
+#
+# Test that the SERIALIZABLE isolation level behaves as expected.
+# A local serializable transaction is aborted by an incoming remote update
+#
+# wsrep_sync_wait does not work well with serializable, see mysql-wsrep#130
+# hence the need to use --sleep .
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (id INT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+
+#
+# Read (local transaction) / Write (remote transaction) conflict
+#
+
+SET AUTOCOMMIT=OFF;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+START TRANSACTION;
+
+SELECT * FROM t1;
+
+--connection node_2
+INSERT INTO t1 VALUES (1,1);
+
+--sleep 2
+--connection node_1
+--error ER_LOCK_DEADLOCK
+SELECT * FROM t1;
+
+ROLLBACK;
+DELETE FROM t1;
+
+#
+# Write (local transaction) / Write (remote transaction) conflict
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (1,1);
+START TRANSACTION;
+SELECT * FROM t1;
+
+--connection node_2
+UPDATE t1 SET f2 = 2;
+
+--sleep 2
+--connection node_1
+--error ER_LOCK_DEADLOCK
+UPDATE t1 SET f2 = 3;
+
+ROLLBACK;
+DELETE FROM t1;
+
+#
+# Write (local transaction) / Write (remote transaction) conflict
+# Local transaction writes before remote one.
+# Nothing special happens here - ordinary deadlock on COMMIT
+#
+
+--connection node_1
+START TRANSACTION;
+
+--connection node_1
+INSERT INTO t1 VALUES (1,1);
+
+--connection node_2
+INSERT INTO t1 VALUES (1,2);
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_split_brain.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_split_brain.test
new file mode 100644 (file)
index 0000000..27e7582
--- /dev/null
@@ -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 10
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/wait_until_connected_again.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test
new file mode 100644 (file)
index 0000000..b6965fa
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl.cnf
new file mode 100644 (file)
index 0000000..59ea286
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl.test
new file mode 100644 (file)
index 0000000..8dc94dc
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_compression.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_compression.cnf
new file mode 100644 (file)
index 0000000..d6fd2c4
--- /dev/null
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+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;socket.ssl_compression=YES'
+
+[mysqld.2]
+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;socket.ssl_compression=YES'
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_compression.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_compression.test
new file mode 100644 (file)
index 0000000..cdecf48
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# Test SSL compression. The accompanying galera_ssl_compression.cnf has a customized wsrep_provider_options setting that enables SSL and compression.
+#
+# Unfortunately there is no wire-level traffic bytes counter that would allow us to determine that compression kicked in, so we can only 
+# perform a most basic replication check.
+#
+
+--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';
+
+--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';
+
+--connection node_1
+
+# Check that the socket.ssl_compression provider option is not dynamic
+--error ER_WRONG_ARGUMENTS
+SET GLOBAL wsrep_provider_options = "socket.ssl_compression=No";
+
+CREATE TABLE t1 (f1 VARCHAR(333) PRIMARY KEY, f2 BLOB) Engine=InnoDB;
+INSERT INTO t1 VALUES (REPEAT('a', 333), REPEAT('b', 65535));
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('a', 333) AND f2 = REPEAT('b', 65535);
+
+--connection node_1
+DROP TABLE t1;
+
+CALL mtr.add_suppression("Unknown parameter 'socket\.ssl_compression'");
+CALL mtr.add_suppression("Set options returned 7");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf
new file mode 100644 (file)
index 0000000..2954ae0
--- /dev/null
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+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'
+
+[mysqld.2]
+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'
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_upgrade.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl_upgrade.test
new file mode 100644 (file)
index 0000000..07aac0f
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Test upgrading the SSL certificates in a rolling fashion.
+#
+# 1. The starting state with the old key and cert is is described in galera_ssl_upgrade.cnf
+#
+
+--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';
+
+# 2. Restart node #1 with a socket.ssl_ca that includes both the new and the old certificate
+
+--connection node_1
+--source include/shutdown_mysqld.inc
+--let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/galera-key.pem
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.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';
+
+# 3. Restart node #2 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key 
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+--let $start_mysqld_params = --wsrep_provider_options=base_port=$NODE_GALERAPORT_2;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/galera-upgrade-server-cert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/galera-upgrade-server-key.pem
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.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';
+
+# 4. Restart node #1 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key 
+
+--connection node_1
+--source include/shutdown_mysqld.inc
+--let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/galera-upgrade-server-cert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/galera-upgrade-server-key.pem
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.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';
+
+# Upgrade complete. Both nodes now use the new key and certificate
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf
new file mode 100644 (file)
index 0000000..574ae28
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump.test
new file mode 100644 (file)
index 0000000..0b71715
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf
new file mode 100644 (file)
index 0000000..e108484
--- /dev/null
@@ -0,0 +1,22 @@
+!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'
+
+[mysqld]
+wsrep_debug=ON
+
+ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
+ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
+ssl-key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem
+
+[client]
+ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
+ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem 
+ssl-key=@ENV.MYSQL_TEST_DIR/std_data/client-key.pem
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
new file mode 100644 (file)
index 0000000..c813e04
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# Test mysqldump SST with client SSL key. See galera_sst_mysqldump_with_key.cnf for the configuration on the client side.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_openssl.inc
+
+--source suite/galera/include/galera_sst_set_mysqldump.inc
+
+--connection node_1
+CREATE USER sslsst;
+GRANT ALL PRIVILEGES ON *.* TO sslsst;
+GRANT USAGE ON *.* TO sslsst REQUIRE SSL;
+
+SET GLOBAL wsrep_sst_auth = 'sslsst:';
+
+--source suite/galera/include/galera_st_disconnect_slave.inc
+
+--source suite/galera/include/galera_sst_restore.inc
+DROP USER sslsst;
+
+--connection node_2
+# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108
+# Otherwise MTR's check_testcases complains
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_rsync.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_rsync.cnf
new file mode 100644 (file)
index 0000000..93981d9
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_rsync.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_rsync.test
new file mode 100644 (file)
index 0000000..c682379
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf
new file mode 100644 (file)
index 0000000..31bd1af
--- /dev/null
@@ -0,0 +1,24 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+[xtrabackup]
+backup-locks
+close-files
+compact
+# compression requires qpress from the Percona repositories
+# compress
+# compress-threads=2
+encryption=AES256
+encrypt-key=4FA92C5873672E20FB163A0BCB2BB4A4
+galera-info
+history=backup
+parallel=2
+
+[SST]
+encrypt=1
+encrypt-algo=AES256
+encrypt-key=4FA92C5873672E20FB163A0BCB2BB4A4
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test
new file mode 100644 (file)
index 0000000..4573f17
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# This test checks that various options can be passed to xtrabackup via the my.cnf file
+# Initial SST happens via xtrabackup, so there is not much to do in the body of the test
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+SELECT 1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf
new file mode 100644 (file)
index 0000000..47cb3e0
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test
new file mode 100644 (file)
index 0000000..c682379
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf
new file mode 100644 (file)
index 0000000..969516f
--- /dev/null
@@ -0,0 +1,11 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+[SST]
+tkey=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem
+tcert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
+encrypt=3
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test
new file mode 100644 (file)
index 0000000..24d9589
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# This test checks that key and cert encryption options can be passed to xtrabackup via the my.cnf file
+# Initial SST happens via xtrabackup, so there is not much to do in the body of the test
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+SELECT 1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_status_cluster.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_status_cluster.test
new file mode 100644 (file)
index 0000000..3299613
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_status_local_index.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_status_local_index.test
new file mode 100644 (file)
index 0000000..b61b8ce
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# Test that a two-node cluster has distinct values for wsrep_local_index for its nodes
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE wsrep_local_indexes (wsrep_local_index INTEGER);
+INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
+
+--connection node_2
+INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
+
+
+--connection node_1
+SELECT COUNT(*) = 2 FROM wsrep_local_indexes;
+SELECT COUNT(DISTINCT wsrep_local_index) = 2 FROM wsrep_local_indexes;
+SELECT COUNT(*) = 0 FROM wsrep_local_indexes WHERE wsrep_local_index NOT IN (0, 1);
+
+DROP TABLE wsrep_local_indexes; 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_status_local_state.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_status_local_state.test
new file mode 100644 (file)
index 0000000..09cdb25
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_suspend_slave.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_suspend_slave.test
new file mode 100644 (file)
index 0000000..ecc551f
--- /dev/null
@@ -0,0 +1,57 @@
+##
+## 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,ER_LOCK_DEADLOCK
+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;
+
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+
+--connection node_1
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sync_wait_show.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sync_wait_show.test
new file mode 100644 (file)
index 0000000..d025c82
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# Test that the various SHOW commands obey wsrep_sync_wait - codership/mysql-wsrep#228
+#
+
+--source include/galera_cluster.inc
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 1;
+
+
+--connection node_1
+CREATE DATABASE db1;
+
+--connection node_2
+SHOW CREATE DATABASE db1;
+DROP DATABASE db1;
+
+
+--connection node_1
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+
+--connection node_2
+SHOW CREATE PROCEDURE p1;
+DROP PROCEDURE p1;
+
+
+
+--connection node_1
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+
+--connection node_2
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+
+--connection node_1
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+
+--connection node_2
+SHOW CREATE FUNCTION f1;
+DROP FUNCTION f1;
+
+
+--connection node_1
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+
+--connection node_2
+SHOW FUNCTION CODE f1;
+DROP FUNCTION f1;
+
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
+
+--connection node_2
+SHOW CREATE TRIGGER tr1;
+DROP TABLE t1;
+
+
+--connection node_1
+CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
+
+--connection node_2
+SHOW CREATE EVENT event1;
+DROP EVENT event1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test
new file mode 100644 (file)
index 0000000..641d210
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_error.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_error.test
new file mode 100644 (file)
index 0000000..c586d97
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test
new file mode 100644 (file)
index 0000000..1f44693
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_locking.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_locking.test
new file mode 100644 (file)
index 0000000..24f918a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test
new file mode 100644 (file)
index 0000000..821f7a6
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test
new file mode 100644 (file)
index 0000000..51eae70
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ftwrl.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_ftwrl.test
new file mode 100644 (file)
index 0000000..4d0edef
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_lock_exclusive.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_lock_exclusive.test
new file mode 100644 (file)
index 0000000..3c66286
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_lock_shared.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_toi_lock_shared.test
new file mode 100644 (file)
index 0000000..6857a0e
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_transaction_read_only.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_transaction_read_only.test
new file mode 100644 (file)
index 0000000..386d73f
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_transaction_replay.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_transaction_replay.test
new file mode 100644 (file)
index 0000000..8e9bfa4
--- /dev/null
@@ -0,0 +1,124 @@
+#
+# 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
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+--send COMMIT;
+
+# Wait until commit is blocked
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--source include/galera_wait_sync_point.inc
+
+# Issue a conflicting update on node #2
+--connection node_2
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+
+# Wait for both transactions to be blocked
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'System lock';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
+--source include/wait_condition.inc
+
+# Unblock the commit
+--connection node_1a
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+# 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;
+
+#echo "# test for PS replaying"
+
+#
+# test replaying of prepared statements
+#
+--connection node_1
+CREATE TABLE t1 (i int primary key, j int) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1, 0), (3, 0);
+SELECT * FROM t1;
+
+PREPARE stmt1 FROM "UPDATE t1 SET j = 1 where i > 0";
+
+# block the commit of PS
+--connection node_1a
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+--send EXECUTE stmt1;
+
+# Wait until commit is blocked
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--source include/galera_wait_sync_point.inc
+
+# Issue a conflicting update on node_2
+--connection node_2
+#UPDATE t1 SET j=2;
+INSERT INTO t1 VALUES(2,2);
+
+
+# Wait until applying begins in node_1
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Write_rows_log_event::write_row%';
+--source include/wait_condition.inc
+
+# Unblock the PS commit
+--connection node_1a
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+# Commit succeeds
+--connection node_1
+--reap
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+--connection node_1
+DEALLOCATE PREPARE stmt1;
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_truncate.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_truncate.test
new file mode 100644 (file)
index 0000000..79f9bad
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_truncate_temporary.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_truncate_temporary.test
new file mode 100644 (file)
index 0000000..3ad94eb
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_udf-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_udf-master.opt
new file mode 100644 (file)
index 0000000..14dfe3e
--- /dev/null
@@ -0,0 +1,2 @@
+$UDF_EXAMPLE_LIB_OPT
+--query_cache_type=1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_unicode_identifiers.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_unicode_identifiers.test
new file mode 100644 (file)
index 0000000..2f255e9
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_unicode_pk.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_unicode_pk.test
new file mode 100644 (file)
index 0000000..0d571f5
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_update_limit.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_update_limit.test
new file mode 100644 (file)
index 0000000..baacf2a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_v1_row_events-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_v1_row_events-master.opt
new file mode 100644 (file)
index 0000000..dc82542
--- /dev/null
@@ -0,0 +1 @@
+--log-bin-use-v1-row-events=1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_v1_row_events.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_v1_row_events.test
new file mode 100644 (file)
index 0000000..0c0a044
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_OSU_method.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_OSU_method.test
new file mode 100644 (file)
index 0000000..6190d5c
--- /dev/null
@@ -0,0 +1,39 @@
+#
+# Test that the  wsrep_var_OSU_method variable can be changed in the middle of an ALTER without adverse effects.
+# In-depth testing of various OSU methods is implemented in separate tests.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET SESSION wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--connection node_2
+# The ALTER above is not visible on node_2
+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--connection node_1
+SET SESSION wsrep_OSU_method = "TOI";
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_OSU_method2.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_OSU_method2.test
new file mode 100644 (file)
index 0000000..abc01ee
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Test that the  wsrep_var_OSU_method variable can be changed in the middle of an ALTER without adverse effects.
+# In-depth testing of various OSU methods is implemented in separate tests.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET SESSION wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+INSERT INTO t1 VALUES (1,2);
+
+--connection node_2
+# The ALTER above is visible on node_2
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+INSERT INTO t1 VALUES (3,4);
+
+--connection node_1
+SET GLOBAL wsrep_OSU_method = "TOI";
+DROP TABLE t1;
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test
new file mode 100644 (file)
index 0000000..c0bbe5a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test
new file mode 100644 (file)
index 0000000..59f2615
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test
new file mode 100644 (file)
index 0000000..f7967da
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_cluster_address.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_cluster_address.test
new file mode 100644 (file)
index 0000000..cc031e0
--- /dev/null
@@ -0,0 +1,108 @@
+#
+# 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 0
+SELECT COUNT(*) > 0 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 0
+SELECT COUNT(*) > 0 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");
+CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
+CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_desync_on.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_desync_on.test
new file mode 100644 (file)
index 0000000..06c5d30
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# 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;
+
+CALL mtr.add_suppression("Protocol violation");
+DROP TABLE t1;
+
+--connection node_1
+CALL mtr.add_suppression("Protocol violation");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_dirty_reads.test
new file mode 100644 (file)
index 0000000..5082ab5
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Check the handling of @@wsrep_dirty_reads
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_2
+--let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address`
+
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+SELECT * FROM t1;
+
+SET @@global.wsrep_cluster_address = '';
+SET @@session.wsrep_dirty_reads=OFF;
+
+# Set wsrep_sync_wait to avoid ER_LOCK_WAIT_TIMEOUT.
+SET SESSION wsrep_sync_wait=0;
+
+# Must return 'OFF'
+SHOW STATUS LIKE 'wsrep_ready';
+
+# Must return 'Non-primary'
+SHOW STATUS LIKE 'wsrep_cluster_status';
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT * FROM t1;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT 1 FROM t1;
+
+SET @@session.wsrep_dirty_reads=ON;
+
+SELECT * FROM t1;
+SELECT 1 FROM t1;
+
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
+
+SET @@session.wsrep_dirty_reads=OFF;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT 1;
+
+--error ER_UNKNOWN_COM_ERROR
+USE information_schema;
+
+SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
+
+SELECT COUNT(*) >= 10 FROM performance_schema.events_statements_history;
+
+--disable_query_log
+--eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_saved'
+--enable_query_log
+--source include/wait_until_connected_again.inc
+
+--connection node_1
+USE test;
+SELECT * FROM t1;
+# Cleanup
+DROP TABLE t1;
+
+--source include/galera_end.inc
+--echo # End of test
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_fkchecks.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_fkchecks.test
new file mode 100644 (file)
index 0000000..c771b50
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
new file mode 100644 (file)
index 0000000..c08483b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_load_data_splitting.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_load_data_splitting.test
new file mode 100644 (file)
index 0000000..38dab0a
--- /dev/null
@@ -0,0 +1,39 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_log_bin.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_log_bin.cnf
new file mode 100644 (file)
index 0000000..68bc0a0
--- /dev/null
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+log-bin=log1
+
+[mysqld.2]
+log-bin=log2
+
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_log_bin.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_log_bin.test
new file mode 100644 (file)
index 0000000..c0ab124
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# A simple test that confirms that Galera works with log-bin enabled, that is
+# when MySQL's binlog is in effect rather than the Galera 'dummy' implementation.
+#
+
+--source include/have_binlog_format_row.inc
+--source include/galera_cluster.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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_max_ws_size.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_max_ws_size.test
new file mode 100644 (file)
index 0000000..bd98bab
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test
new file mode 100644 (file)
index 0000000..642d939
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_node_address.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_node_address.cnf
new file mode 100644 (file)
index 0000000..0de0eda
--- /dev/null
@@ -0,0 +1,10 @@
+!include ../galera_4nodes.cnf
+
+[mysqld.2]
+wsrep_node_address=127.0.0.1
+
+[mysqld.3]
+wsrep_node_address=localhost
+
+[mysqld.4]
+wsrep_node_address=lo
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_node_address.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_node_address.test
new file mode 100644 (file)
index 0000000..cf118cf
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# Test wsrep_node_address . The galera_var_node_address.cnf contains various settings for
+# wsrep_node_address, so in this test we simply confirm that the cluster has started up correctly.
+#
+
+--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);
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt
new file mode 100644 (file)
index 0000000..70dfc98
--- /dev/null
@@ -0,0 +1 @@
+--wsrep_notify_cmd=$MYSQL_TEST_DIR/std_data/wsrep_notify.sh --wsrep-sync-wait=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_notify_cmd.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_notify_cmd.test
new file mode 100644 (file)
index 0000000..4fea69f
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_reject_queries.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_reject_queries.test
new file mode 100644 (file)
index 0000000..92fdfa8
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# Test wsrep_reject_queries
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER);
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+--connection node_1
+--error ER_GLOBAL_VARIABLE
+SET SESSION wsrep_reject_queries = ALL;
+
+SET GLOBAL wsrep_reject_queries = ALL;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT * FROM t1;
+
+# Lost connection
+--error 2013
+SET GLOBAL wsrep_reject_queries = ALL_KILL;
+
+--connection node_1a
+--error 2013
+SELECT * FROM t1;
+
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--error ER_UNKNOWN_COM_ERROR
+SELECT * FROM t1;
+
+# Confirm that replication continues
+
+--connection node_2
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+INSERT INTO t1 VALUES (1);
+
+--connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET GLOBAL wsrep_reject_queries = NONE;
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test
new file mode 100644 (file)
index 0000000..a981128
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test
new file mode 100644 (file)
index 0000000..a09ba2e
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_slave_threads.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_slave_threads.test
new file mode 100644 (file)
index 0000000..a83924c
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_sync_wait.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_sync_wait.test
new file mode 100644 (file)
index 0000000..935c271
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test
new file mode 100644 (file)
index 0000000..783b787
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_wan.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan.cnf
new file mode 100644 (file)
index 0000000..37ac58a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_wan.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan.test
new file mode 100644 (file)
index 0000000..a8fd351
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf
new file mode 100644 (file)
index 0000000..3f7d2a2
--- /dev/null
@@ -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=2'
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_ist.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_ist.test
new file mode 100644 (file)
index 0000000..42f63df
--- /dev/null
@@ -0,0 +1,148 @@
+#
+# Test that even after multiple restarts in a WAN context with two segments, the cluster continues to operate correctly.
+#
+# We can not easily restart the first node, so instead we restart all the other nodes. MTR does not allow multiple nodes
+# to be down at the same time, so restarts are sequential.
+#
+# 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/big_test.inc
+--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);
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+INSERT INTO t1 VALUES (2);
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+INSERT INTO t1 VALUES (3);
+
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+--connection node_4
+INSERT INTO t1 VALUES (4);
+
+#
+# Restart node #3
+#
+
+--connection node_3
+INSERT INTO t1 VALUES (13);
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+--sleep 5
+
+--connection node_1
+INSERT INTO t1 VALUES (11);
+
+--connection node_2
+INSERT INTO t1 VALUES (12);
+
+--connection node_4
+INSERT INTO t1 VALUES (14);
+
+--connection node_3
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (131);
+
+#
+# Restart node #2
+#
+
+--connection node_2
+INSERT INTO t1 VALUES (22);
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+--sleep 5
+
+--connection node_1
+INSERT INTO t1 VALUES (21);
+
+--connection node_3
+INSERT INTO t1 VALUES (23);
+
+--connection node_4
+INSERT INTO t1 VALUES (24);
+
+--connection node_2
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (221);
+
+#
+# Restart node #4
+#
+
+--connection node_4
+INSERT INTO t1 VALUES (34);
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+--sleep 5
+
+--connection node_1
+INSERT INTO t1 VALUES (31);
+
+--connection node_2
+INSERT INTO t1 VALUES (32);
+
+--connection node_3
+INSERT INTO t1 VALUES (33);
+
+--connection node_4
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (341);
+
+
+#
+# Check all nodes
+#
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_2
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_3
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_4
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_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");
+
+--connection node_2
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+--connection node_3
+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");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+--connection node_4
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf
new file mode 100644 (file)
index 0000000..3f7d2a2
--- /dev/null
@@ -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=2'
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_sst.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wan_restart_sst.test
new file mode 100644 (file)
index 0000000..9b12eee
--- /dev/null
@@ -0,0 +1,149 @@
+#
+# Test that even after multiple restarts in a WAN context with two segments, the cluster continues to operate correctly.
+#
+# We can not easily restart the first node, so instead we restart all the other nodes. MTR does not allow multiple nodes
+# to be down at the same time, so restarts are sequential.
+#
+# 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/big_test.inc
+--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);
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+INSERT INTO t1 VALUES (2);
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+INSERT INTO t1 VALUES (3);
+
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+--connection node_4
+INSERT INTO t1 VALUES (4);
+
+#
+# Restart node #3
+#
+
+--connection node_3
+INSERT INTO t1 VALUES (13);
+
+--source include/kill_galera.inc
+--sleep 5
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+INSERT INTO t1 VALUES (11);
+
+--connection node_2
+INSERT INTO t1 VALUES (12);
+
+--connection node_4
+INSERT INTO t1 VALUES (14);
+
+--connection node_3
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (131);
+
+#
+# Restart node #2
+#
+
+--connection node_2
+INSERT INTO t1 VALUES (22);
+
+--source include/kill_galera.inc
+--sleep 5
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+INSERT INTO t1 VALUES (21);
+
+--connection node_3
+INSERT INTO t1 VALUES (23);
+
+--connection node_4
+INSERT INTO t1 VALUES (24);
+
+--connection node_2
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (221);
+
+#
+# Restart node #4
+#
+
+--connection node_4
+INSERT INTO t1 VALUES (34);
+
+--source include/kill_galera.inc
+--sleep 5
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+INSERT INTO t1 VALUES (31);
+
+--connection node_2
+INSERT INTO t1 VALUES (32);
+
+--connection node_3
+INSERT INTO t1 VALUES (33);
+
+--connection node_4
+--source include/start_mysqld.inc
+--sleep 5
+--source include/wait_until_connected_again.inc
+
+INSERT INTO t1 VALUES (341);
+
+
+#
+# Check all nodes
+#
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_2
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_3
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_4
+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) = 19 FROM t1;
+
+--connection node_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");
+CALL mtr.add_suppression("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
+
+--connection node_2
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+--connection node_3
+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");
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+--connection node_4
+CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test
new file mode 100644 (file)
index 0000000..3c7988a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt
new file mode 100644 (file)
index 0000000..c31150c
--- /dev/null
@@ -0,0 +1 @@
+--wsrep-new-cluster
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test
new file mode 100644 (file)
index 0000000..6ba8ce7
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test
new file mode 100644 (file)
index 0000000..fe4c358
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/galera_zero_length_column.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_zero_length_column.test
new file mode 100644 (file)
index 0000000..6ae81a8
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/lp1276424.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/lp1276424.test
new file mode 100644 (file)
index 0000000..a37e950
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/lp1347768.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/lp1347768.test
new file mode 100644 (file)
index 0000000..96d4286
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/lp1438990.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/lp1438990.test
new file mode 100644 (file)
index 0000000..5d54c33
--- /dev/null
@@ -0,0 +1,38 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+
+
+DELIMITER |;
+
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+       DECLARE EXIT HANDLER FOR SQLEXCEPTION
+               BEGIN
+                       ROLLBACK TO event_logging;
+                       INSERT t3 VALUES (x);
+               END;
+       SAVEPOINT event_logging;
+
+       INSERT INTO t2 VALUES (x);
+
+       RELEASE SAVEPOINT event_logging;
+END|
+DELIMITER ;|
+
+
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+
+DROP PROCEDURE p1;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/lp959512.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/lp959512.test
new file mode 100644 (file)
index 0000000..bcc0db2
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#110.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#110.test
new file mode 100644 (file)
index 0000000..43520f2
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# codership/mysql-wsrep/110 - Assertion `table_found' failed in unpack_row() with SAVEPOINT, trigger, error handler
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+
+
+DELIMITER |;
+
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+        DECLARE EXIT HANDLER FOR SQLEXCEPTION
+                BEGIN
+                        ROLLBACK TO event_logging;
+                        INSERT t3 VALUES (x);
+                END;
+        SAVEPOINT event_logging;
+
+        INSERT INTO t2 VALUES (x);
+END|
+DELIMITER ;|
+
+
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+SELECT COUNT(*) = 1 FROM t3;
+
+--connection node_2
+
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 1 FROM t2;
+SELECT COUNT(*) = 1 FROM t3;
+
+--connection node_1
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP PROCEDURE p1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#198.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#198.test
new file mode 100644 (file)
index 0000000..3be61c0
--- /dev/null
@@ -0,0 +1,37 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+LOCK TABLE t2 WRITE;
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--send OPTIMIZE TABLE t1,t2;
+
+--connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2b
+--send REPAIR TABLE t1,t2;
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+--connection node_1
+INSERT INTO t2 VALUES (1);
+
+--connection node_2
+UNLOCK TABLES;
+
+--connection node_2a
+--reap
+
+--connection node_2b
+--reap
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt
new file mode 100644 (file)
index 0000000..a00258b
--- /dev/null
@@ -0,0 +1 @@
+--query_cache_type=1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#201.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#201.test
new file mode 100644 (file)
index 0000000..e932754
--- /dev/null
@@ -0,0 +1,33 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_query_cache.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (DEFAULT);
+
+--connection node_2
+--let $qcache_size_orig = `SELECT @@GLOBAL.query_cache_size`
+SET GLOBAL query_cache_size=1355776;
+SET SESSION wsrep_sync_wait = 7;
+
+--disable_query_log
+
+--let $count = 500
+while ($count)
+{
+  --connection node_1
+  INSERT INTO t1 VALUES (DEFAULT);
+  --let $val1 = `SELECT LAST_INSERT_ID()`
+  --connection node_2
+  --let $val2 = `SELECT MAX(id) FROM t1`
+  --let $val3 = `SELECT $val1 != $val2`
+  if ($val3)
+  {
+    --echo $val1 $val2
+    --die wsrep_sync_wait failed
+  }
+  --dec $count
+}
+
+--eval SET GLOBAL query_cache_size = $qcache_size_orig
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#216.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#216.test
new file mode 100644 (file)
index 0000000..6409f33
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# Test that sensitive statements such as those containing plaintext passwords
+# do not leak into the logs, expecially under wsrep_debug=ON
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $wsrep_debug_orig = `SELECT @@wsrep_debug`
+
+SET GLOBAL wsrep_debug = ON;
+
+CREATE USER u1 IDENTIFIED BY 'plaintext_password';
+
+--error ER_CANNOT_USER
+CREATE USER u1 IDENTIFIED BY 'plaintext_password';
+
+# Check that the plaintext password does not appear in the logs
+--exec grep --count plaintext_password $MYSQLTEST_VARDIR/log/mysqld.1.err || true
+--exec grep --count plaintext_password $MYSQLTEST_VARDIR/log/mysqld.2.err || true
+
+# Check that the obfuscated password appears in the logs
+
+# Four times for the first node, in the various wsrep_debug messages
+--exec grep --count 9CAB2BAE176801E82ABA9E55CCCDDBF388E0301D $MYSQLTEST_VARDIR/log/mysqld.1.err
+
+# Once for the second node, in the 'Slave SQL' error
+--exec grep --count 9CAB2BAE176801E82ABA9E55CCCDDBF388E0301D $MYSQLTEST_VARDIR/log/mysqld.2.err
+
+DROP USER u1;
+
+--disable_query_log
+--eval SET GLOBAL wsrep_debug = $wsrep_debug_orig
+--enable_query_log
+
+--connection node_2
+CALL mtr.add_suppression('Operation CREATE USER failed');
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#237.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#237.test
new file mode 100644 (file)
index 0000000..7a65cb5
--- /dev/null
@@ -0,0 +1,31 @@
+# hang because of replicated FLUSH TABLE command
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET DEBUG_SYNC = 'wsrep_before_replication WAIT_FOR continue';
+--send INSERT INTO t values (1);
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: wsrep_before_replication'
+--source include/wait_condition.inc
+
+--connection node_2
+FLUSH TABLES;
+
+
+--connection node_1a
+SELECT SLEEP(1);
+
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+DROP TABLE t;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#247.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#247.test
new file mode 100644 (file)
index 0000000..8bcd586
--- /dev/null
@@ -0,0 +1,23 @@
+#
+# codership/mysql-wsrep/247 MW-246 -
+# DDL with RSU fails if node is desynced upfont
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+SET GLOBAL wsrep_desync=1;
+
+SET wsrep_OSU_method=RSU;
+
+CREATE TABLE t1 (i int primary key);
+
+SHOW VARIABLES LIKE 'wsrep_desync';
+
+SET GLOBAL wsrep_desync=0;
+--sleep 1
+DROP TABLE t1;
+SHOW VARIABLES LIKE 'wsrep_desync';
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#31.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#31.test
new file mode 100644 (file)
index 0000000..b6b6d1e
--- /dev/null
@@ -0,0 +1,39 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES('test');
+CREATE DATABASE db;
+
+--connection node_2
+--let $expected_position_uuid = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_uuid'`
+--let $expected_position_seqno = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--let $expected_position = $expected_position_uuid:$expected_position_seqno
+
+--echo Shutting down server 2 ...
+--source include/shutdown_mysqld.inc
+
+--echo Recovering server 2 ...
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+if ($galera_wsrep_start_position != $expected_position)
+{
+  die(Expected position: $expected_position, found $galera_wsrep_start_position);
+}
+
+--echo Restarting 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
+--source include/galera_wait_ready.inc
+
+--connection node_1
+DROP TABLE t1;
+DROP DATABASE db;
+
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#33.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#33.cnf
new file mode 100644 (file)
index 0000000..f1c3d80
--- /dev/null
@@ -0,0 +1,8 @@
+!include ../galera_2nodes.cnf
+
+[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-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#33.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#33.test
new file mode 100644 (file)
index 0000000..acc7c73
--- /dev/null
@@ -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
+
+--source suite/galera/include/galera_sst_restore.inc
+
+--connection node_2
+# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108
+# Otherwise MTR's check_testcases complains
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#90.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#90.test
new file mode 100644 (file)
index 0000000..5af86fb
--- /dev/null
@@ -0,0 +1,65 @@
+# Crash in galera_to_execute_end when wsrep_OSU_method is changed from RSU to TOI during a DDL
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+
+--connection node_1
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET GLOBAL wsrep_OSU_method = "TOI";
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_OSU_method = "RSU";
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+INSERT INTO t1 VALUES (1,2);
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+INSERT INTO t1 VALUES (3,4);
+
+--connection node_1
+DROP TABLE t1;
+
+SET GLOBAL WSREP_OSU_METHOD = TOI;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/galera_3nodes.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
new file mode 100644 (file)
index 0000000..c04c861
--- /dev/null
@@ -0,0 +1,56 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+default-storage-engine=InnoDB
+binlog-format=row
+wsrep_provider=@ENV.WSREP_PROVIDER
+
+# enforce read-committed characteristics across the cluster
+
+wsrep_causal_reads=ON
+wsrep_sync_wait = 7
+
+# Required for Galera
+innodb_autoinc_lock_mode=2
+
+wsrep_node_address=127.0.0.1
+
+[mysqld.1]
+wsrep_cluster_address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.1.#galera_port'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+
+[mysqld.2]
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+
+[mysqld.3]
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+
+[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-wsrep-5.6/mysql-test/suite/galera_3nodes/my.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/my.cnf
new file mode 100644 (file)
index 0000000..bb25b95
--- /dev/null
@@ -0,0 +1 @@
+!include galera_3nodes.cnf
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result
new file mode 100644 (file)
index 0000000..fd617a0
--- /dev/null
@@ -0,0 +1,20 @@
+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;
+CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
+CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
+CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result
new file mode 100644 (file)
index 0000000..9dc735d
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result
new file mode 100644 (file)
index 0000000..1464222
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_garbd.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_garbd.result
new file mode 100644 (file)
index 0000000..180aade
--- /dev/null
@@ -0,0 +1,17 @@
+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
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result
new file mode 100644 (file)
index 0000000..85000db
--- /dev/null
@@ -0,0 +1,11 @@
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+Killing server ...
+INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
+SELECT COUNT(*) = 20 FROM t1;
+COUNT(*) = 20
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
new file mode 100644 (file)
index 0000000..6c66bf4
--- /dev/null
@@ -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 = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
+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-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result
new file mode 100644 (file)
index 0000000..9a6d40a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_pc_bootstrap.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_pc_bootstrap.result
new file mode 100644 (file)
index 0000000..f5a4cad
--- /dev/null
@@ -0,0 +1,29 @@
+CREATE TABLE t1 (f1 INTEGER);
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+SET SESSION wsrep_sync_wait = 0;
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name  Value
+wsrep_cluster_status   non-Primary
+SET GLOBAL wsrep_provider_options = 'pc.bootstrap=1';
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name  Value
+wsrep_cluster_size     1
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name  Value
+wsrep_cluster_status   Primary
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result
new file mode 100644 (file)
index 0000000..85f923a
--- /dev/null
@@ -0,0 +1,119 @@
+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 = '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 GLOBAL wsrep_provider_options = 'pc.weight=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
+SET GLOBAL wsrep_provider_options = 'pc.weight=1';
+CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
+CALL mtr.add_suppression('overriding reported weight for');
+CALL mtr.add_suppression('WSREP: user message in state LEAVING');
+CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected');
+CALL mtr.add_suppression('overriding reported weight for');
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_slave_options_do.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_slave_options_do.result
new file mode 100644 (file)
index 0000000..7185e92
--- /dev/null
@@ -0,0 +1,28 @@
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO db1.t1 VALUES (1);
+INSERT INTO db2.t2A VALUES (2);
+INSERT INTO db2.t2B VALUES (3);
+SELECT COUNT(*) = 0 FROM db1.t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM db2.t2A;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM db2.t2B;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM db1.t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM db2.t2A;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM db2.t2B;
+COUNT(*) = 1
+1
+DROP SCHEMA db1;
+DROP SCHEMA db2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_slave_options_ignore.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_slave_options_ignore.result
new file mode 100644 (file)
index 0000000..7185e92
--- /dev/null
@@ -0,0 +1,28 @@
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO db1.t1 VALUES (1);
+INSERT INTO db2.t2A VALUES (2);
+INSERT INTO db2.t2B VALUES (3);
+SELECT COUNT(*) = 0 FROM db1.t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM db2.t2A;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM db2.t2B;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 0 FROM db1.t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 1 FROM db2.t2A;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM db2.t2B;
+COUNT(*) = 1
+1
+DROP SCHEMA db1;
+DROP SCHEMA db2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_var_dirty_reads2.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_var_dirty_reads2.result
new file mode 100644 (file)
index 0000000..462d506
--- /dev/null
@@ -0,0 +1,48 @@
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_dirty_reads = 1;
+SELECT f1 FROM t1;
+f1
+1
+USE test;
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+LOCK TABLE t1 WRITE;
+UNLOCK TABLES;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+PREPARE stmt_select FROM 'SELECT f1 FROM t1';
+EXECUTE stmt_select;
+f1
+1
+PREPARE stmt_update FROM 'UPDATE t1 SET f1 = f1 + f1';
+SET GLOBAL wsrep_dirty_reads = 1;
+SET GLOBAL wsrep_sync_wait = 0;
+SET GLOBAL wsrep_dirty_reads = 0;
+SET GLOBAL wsrep_sync_wait = 7;
+SET SESSION wsrep_dirty_reads = 1;
+INSERT INTO t1 SELECT * FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+DELETE FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+UPDATE t1 SET f1 = f1 + 1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+DROP TABLE t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+EXECUTE stmt_update;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SET SESSION wsrep_dirty_reads = 0;
+SELECT * FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
+EXECUTE stmt_select;
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.PROCESSLIST;
+COUNT(*) > 0
+1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test
new file mode 100644 (file)
index 0000000..6d7b4c0
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# 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;
+
+
+# Workaround for galera#204
+
+CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
+
+--connection node_2
+CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
+
+--connection node_3
+CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test
new file mode 100644 (file)
index 0000000..a2ad076
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test
new file mode 100644 (file)
index 0000000..a87f19a
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_garbd.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_garbd.test
new file mode 100644 (file)
index 0000000..a68ba8c
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# 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
+
+--sleep 5
+
+--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
+
+
+# Workaround for galera#101
+
+--connection node_1
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
+
+--connection node_2
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
+
+--connection node_3
+CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test
new file mode 100644 (file)
index 0000000..a6660bd
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# This test uses innobackupex to take a backup on node #2 and then restores that node from backup
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+--connection node_2
+SELECT COUNT(*) = 10 FROM t1;
+
+--exec rm -rf $MYSQL_TMP_DIR/innobackupex_backup
+--exec innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 $MYSQL_TMP_DIR/innobackupex_backup --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp > $MYSQL_TMP_DIR/innobackupex-backup.log
+--exec innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 $MYSQL_TMP_DIR/innobackupex_backup --apply-log --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp > $MYSQL_TMP_DIR/innobackupex-apply.log
+
+--source include/kill_galera.inc
+--sleep 1
+
+--connection node_1
+INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
+
+--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/*
+--exec innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --copy-back $MYSQL_TMP_DIR/innobackupex_backup --port=$NODE_MYPORT_2 --host=127.0.0.1 > $MYSQL_TMP_DIR/innobackupex-restore.log
+
+#
+# Convert the xtrabackup_galera_info into a grastate.dat file
+#
+
+--perl
+        use strict;
+        my $xtrabackup_galera_info_file = $ENV{'MYSQL_TMP_DIR'}.'/innobackupex_backup/xtrabackup_galera_info';
+        open(XTRABACKUP_GALERA_INFO, $xtrabackup_galera_info_file) or die "Can not open $xtrabackup_galera_info_file: $!";
+        my $xtrabackup_galera_info = <XTRABACKUP_GALERA_INFO>;
+        my ($uuid, $seqno) = split(':', $xtrabackup_galera_info);
+
+        my $grastate_dat_file = $ENV{'MYSQLTEST_VARDIR'}.'/mysqld.2/data/grastate.dat';
+        die "grastate.dat already exists" if -e $grastate_dat_file;
+
+        open(GRASTATE_DAT, ">$grastate_dat_file") or die "Can not write to $grastate_dat_file: $!";
+        print GRASTATE_DAT "version: 2.1\n";
+        print GRASTATE_DAT "uuid:    $uuid\n";
+        print GRASTATE_DAT "seqno:   $seqno\n";
+        print GRASTATE_DAT "cert_index:\n";
+        exit(0);
+EOF
+
+--source include/start_mysqld.inc
+--sleep 5
+
+--source include/wait_until_connected_again.inc
+SELECT COUNT(*) = 20 FROM t1;
+
+DROP TABLE t1;
+
+--sleep 10
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf
new file mode 100644 (file)
index 0000000..8211752
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
new file mode 100644 (file)
index 0000000..7d8bbb3
--- /dev/null
@@ -0,0 +1,99 @@
+#
+# 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 ...
+--let $galera_sync_point = ist_sender_send_after_get_buffers
+--source include/galera_set_sync_point.inc
+
+# ... 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
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+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-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test
new file mode 100644 (file)
index 0000000..659df2b
--- /dev/null
@@ -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-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test
new file mode 100644 (file)
index 0000000..6172ffc
--- /dev/null
@@ -0,0 +1,90 @@
+#
+# Test the operation of pc.bootstrap 
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER);
+
+# Force all nodes to become non-primary
+--connection node_1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+
+--sleep 10
+
+# Node #2 should be non-primary
+SET SESSION wsrep_sync_wait = 0;
+SHOW STATUS LIKE 'wsrep_cluster_status';
+
+# Signal node #2 to bootstrap
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'pc.bootstrap=1';
+
+# Wait until node becomes available for queries again
+--source include/wait_until_connected_again.inc
+
+# Node #2 should now be a primary of a 1-node cluster
+
+SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW STATUS LIKE 'wsrep_cluster_status';
+
+# Perform an insert on node #2
+INSERT INTO t1 VALUES (1);
+
+# Reconnect all nodes 
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+--sleep 10
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+
+--connection node_1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.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_3
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+--sleep 10
+--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Check that all nodes have the same view of the database
+
+--connection node_1
+SELECT COUNT(*) FROM t1;
+
+--connection node_2
+SELECT COUNT(*) FROM t1;
+
+--connection node_3
+SELECT COUNT(*) FROM t1;
+
+# Test cleanup
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
new file mode 100644 (file)
index 0000000..6585f19
--- /dev/null
@@ -0,0 +1,123 @@
+#
+# 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
+
+--connection node_1
+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
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.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 = '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';
+
+SET GLOBAL wsrep_provider_options = 'pc.weight=1';
+
+# 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
+
+SET GLOBAL wsrep_provider_options = 'pc.weight=1';
+--let $wait_condition = SELECT @@wsrep_provider_options LIKE '%pc.weight = 1%'
+--source include/wait_condition.inc
+
+CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
+
+--connection node_2
+CALL mtr.add_suppression('overriding reported weight for');
+
+--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');
+CALL mtr.add_suppression('overriding reported weight for');
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.cnf
new file mode 100644 (file)
index 0000000..1ebde61
--- /dev/null
@@ -0,0 +1,7 @@
+!include ../galera_3nodes.cnf
+
+[mysqld.1]
+binlog-do-db=db2
+
+[mysqld.2]
+replicate-wild-do-table=db2.t2B
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_do.test
new file mode 100644 (file)
index 0000000..1437c90
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# This tests checks the operation of binlog-do-db , replicate-wild-do-table
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+
+CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
+
+INSERT INTO db1.t1 VALUES (1);
+INSERT INTO db2.t2A VALUES (2);
+INSERT INTO db2.t2B VALUES (3);
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM db1.t1;
+SELECT COUNT(*) = 0 FROM db2.t2A;
+SELECT COUNT(*) = 1 FROM db2.t2B;
+
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SELECT COUNT(*) = 0 FROM db1.t1;
+SELECT COUNT(*) = 1 FROM db2.t2A;
+SELECT COUNT(*) = 1 FROM db2.t2B;
+
+--connection node_1
+DROP SCHEMA db1;
+DROP SCHEMA db2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.cnf
new file mode 100644 (file)
index 0000000..9b78d47
--- /dev/null
@@ -0,0 +1,7 @@
+!include ../galera_3nodes.cnf
+
+[mysqld.1]
+binlog-ignore-db=db1
+
+[mysqld.2]
+replicate-wild-ignore-table=db2.t2A
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_slave_options_ignore.test
new file mode 100644 (file)
index 0000000..3e8b155
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# This tests checks the operation of binlog-ignore-db , replicate-wild-ignore-table
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+
+CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
+
+INSERT INTO db1.t1 VALUES (1);
+INSERT INTO db2.t2A VALUES (2);
+INSERT INTO db2.t2B VALUES (3);
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM db1.t1;
+SELECT COUNT(*) = 0 FROM db2.t2A;
+SELECT COUNT(*) = 1 FROM db2.t2B;
+
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SELECT COUNT(*) = 0 FROM db1.t1;
+SELECT COUNT(*) = 1 FROM db2.t2A;
+SELECT COUNT(*) = 1 FROM db2.t2B;
+
+--connection node_1
+DROP SCHEMA db1;
+DROP SCHEMA db2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test
new file mode 100644 (file)
index 0000000..56971f1
--- /dev/null
@@ -0,0 +1,108 @@
+#
+# Additional tests for wsrep_dirty_reads
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER);
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--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
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+SET SESSION wsrep_dirty_reads = 1;
+
+# Those statements should succeed
+
+--error 0
+SELECT f1 FROM t1;
+
+--error 0
+USE test;
+
+--error 0
+SHOW CREATE TABLE t1;
+
+--error 0
+LOCK TABLE t1 WRITE;
+
+--error 0
+UNLOCK TABLES;
+
+--error 0
+FLUSH TABLES WITH READ LOCK;
+
+--error 0
+UNLOCK TABLES;
+
+--error 0
+PREPARE stmt_select FROM 'SELECT f1 FROM t1';
+
+--error 0
+EXECUTE stmt_select;
+
+--error 0
+PREPARE stmt_update FROM 'UPDATE t1 SET f1 = f1 + f1';
+
+# Mysqldump should succeed
+
+SET GLOBAL wsrep_dirty_reads = 1;
+SET GLOBAL wsrep_sync_wait = 0;
+--error 0
+--exec $MYSQL_DUMP -u root -S $NODE_MYSOCK_2 test >/dev/null
+SET GLOBAL wsrep_dirty_reads = 0;
+SET GLOBAL wsrep_sync_wait = 7;
+
+# Those statements should fail
+
+SET SESSION wsrep_dirty_reads = 1;
+
+--error ER_UNKNOWN_COM_ERROR
+INSERT INTO t1 SELECT * FROM t1;
+
+--error ER_UNKNOWN_COM_ERROR
+DELETE FROM t1;
+
+--error ER_UNKNOWN_COM_ERROR
+UPDATE t1 SET f1 = f1 + 1;
+
+--error ER_UNKNOWN_COM_ERROR
+DROP TABLE t1;
+
+--error ER_UNKNOWN_COM_ERROR
+EXECUTE stmt_update;
+
+# With wsrep_dirty_reads = 0 , even SELECTS are not allowed
+
+SET SESSION wsrep_dirty_reads = 0;
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT * FROM t1;
+
+--error ER_UNKNOWN_COM_ERROR
+EXECUTE stmt_select;
+
+# But reads from INFORMATION_SCHEMA are allowed
+
+--error 0
+SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Restore cluster
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/include/import.inc b/mysql-wsrep-5.6/mysql-test/suite/innodb/include/import.inc
new file mode 100644 (file)
index 0000000..e8265cb
--- /dev/null
@@ -0,0 +1,40 @@
+# Export Table and Import from saved files .cfg and .ibd
+# Caller should create t1 table definition and populate table
+
+let $MYSQLD_DATADIR = `SELECT @@datadir`;
+
+if(!$source_db) {
+       let $source_db = test;
+}
+
+if(!$dest_db) {
+       let $dest_db = test;
+}
+
+eval FLUSH TABLES $source_db.t1 FOR EXPORT;
+
+--copy_file $MYSQLD_DATADIR/$source_db/t1.cfg $MYSQLD_DATADIR/t1.cfg_back
+--copy_file $MYSQLD_DATADIR/$source_db/t1.ibd $MYSQLD_DATADIR/t1.ibd_back
+
+UNLOCK TABLES;
+
+if($source_db != $dest_db) {
+       eval USE $dest_db;
+       let $create1 = query_get_value(SHOW CREATE TABLE $source_db.t1, Create Table, 1);
+       eval $create1;
+}
+
+eval ALTER TABLE $dest_db.t1 DISCARD TABLESPACE;
+
+--move_file $MYSQLD_DATADIR/t1.cfg_back $MYSQLD_DATADIR/$dest_db/t1.cfg
+--move_file $MYSQLD_DATADIR/t1.ibd_back $MYSQLD_DATADIR/$dest_db/t1.ibd
+
+eval ALTER TABLE $dest_db.t1 IMPORT TABLESPACE;
+
+eval CHECK TABLE $dest_db.t1;
+eval SHOW CREATE TABLE $dest_db.t1;
+eval SELECT * FROM $dest_db.t1;
+
+if($source_db != $dest_db) {
+       eval DROP TABLE $dest_db.t1;
+}
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/alter_rename_existing.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/alter_rename_existing.result
new file mode 100755 (executable)
index 0000000..7eeeef7
--- /dev/null
@@ -0,0 +1,96 @@
+#
+# Show what happens during ALTER TABLE when an existing file
+# exists in the target location.
+#
+# Bug #19218794: IF TABLESPACE EXISTS, CAN'T CREATE TABLE,
+#                BUT CAN ALTER ENGINE=INNODB
+#
+CREATE TABLE t1 (a SERIAL, b CHAR(10)) ENGINE=Memory;
+INSERT INTO t1(b) VALUES('one'), ('two'), ('three');
+#
+# Create a file called MYSQLD_DATADIR/test/t1.ibd
+# Directory listing of test/*.ibd
+#
+t1.ibd
+ALTER TABLE t1 ENGINE = InnoDB;
+ERROR HY000: Error on rename of 'OLD_FILE_NAME' to 'NEW_FILE_NAME' (errno: 184 - Tablespace already exists)
+#
+# Move the file to InnoDB as t2
+#
+ALTER TABLE t1 RENAME TO t2, ENGINE = INNODB;
+SHOW CREATE TABLE t2;
+Table  Create Table
+t2     CREATE TABLE `t2` (
+  `a` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+  `b` char(10) DEFAULT NULL,
+  UNIQUE KEY `a` (`a`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+SELECT * from t2;
+a      b
+1      one
+2      two
+3      three
+ALTER TABLE t2 RENAME TO t1;
+ERROR HY000: Error on rename of 'OLD_FILE_NAME' to 'NEW_FILE_NAME' (errno: 184 - Tablespace already exists)
+#
+# Create another t1, but in the system tablespace.
+#
+SET GLOBAL innodb_file_per_table=OFF;
+CREATE TABLE t1 (a SERIAL, b CHAR(20)) ENGINE=InnoDB;
+INSERT INTO t1(b) VALUES('one'), ('two'), ('three');
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `a` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+  `b` char(20) DEFAULT NULL,
+  UNIQUE KEY `a` (`a`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+SELECT name, space=0 FROM information_schema.innodb_sys_tables WHERE name = 'test/t1';
+name   space=0
+test/t1        1
+#
+# ALTER TABLE from system tablespace to system tablespace
+#
+ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=INPLACE;
+ALTER TABLE t1 ADD COLUMN d INT, ALGORITHM=COPY;
+#
+# Try to move t1 from the system tablespace to a file-per-table
+# while a blocking t1.ibd file exists.
+#
+SET GLOBAL innodb_file_per_table=ON;
+ALTER TABLE t1 ADD COLUMN e1 INT, ALGORITHM=INPLACE;
+ERROR HY000: Tablespace for table 'test/t1' exists. Please DISCARD the tablespace before IMPORT.
+ALTER TABLE t1 ADD COLUMN e2 INT, ALGORITHM=COPY;
+ERROR HY000: Error on rename of 'OLD_FILE_NAME' to 'NEW_FILE_NAME' (errno: 184 - Tablespace already exists)
+#
+# Delete the blocking file called MYSQLD_DATADIR/test/t1.ibd
+# Move t1 to file-per-table using ALGORITHM=INPLACE with no blocking t1.ibd.
+#
+ALTER TABLE t1 ADD COLUMN e INT, ALGORITHM=INPLACE;
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `a` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+  `b` char(20) DEFAULT NULL,
+  `c` int(11) DEFAULT NULL,
+  `d` int(11) DEFAULT NULL,
+  `e` int(11) DEFAULT NULL,
+  UNIQUE KEY `a` (`a`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+SELECT name, space=0 FROM information_schema.innodb_sys_tables WHERE name = 'test/t1';
+name   space=0
+test/t1        0
+DROP TABLE t1;
+#
+# Rename t2.ibd to t1.ibd.
+#
+ALTER TABLE t2 RENAME TO t1;
+SELECT name, space=0 FROM information_schema.innodb_sys_tables WHERE name = 'test/t1';
+name   space=0
+test/t1        0
+SELECT * from t1;
+a      b
+1      one
+2      two
+3      three
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/analyze_table.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/analyze_table.result
new file mode 100644 (file)
index 0000000..a5c2528
--- /dev/null
@@ -0,0 +1,25 @@
+CREATE PROCEDURE populate_t1()
+BEGIN
+DECLARE i int DEFAULT 1;
+START TRANSACTION;
+WHILE (i <= 1000000) DO
+INSERT INTO t1 VALUES (i, i, CONCAT('a', i));
+SET i = i + 1;
+END WHILE;
+COMMIT;
+END|
+CREATE TABLE t1(
+class   INT,
+id      INT,
+title   VARCHAR(100)
+) ENGINE=InnoDB;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1000000
+SET GLOBAL innodb_stats_persistent_sample_pages=2000;
+ANALYZE TABLE t1;
+Table  Op      Msg_type        Msg_text
+test.t1        analyze status  OK
+DROP TABLE t1;
+DROP PROCEDURE populate_t1;
+SET GLOBAL innodb_stats_persistent_sample_pages=default;
index ad358a863298dc31caf71774232207a2295037e0..c09c7d884d15c99fe838687bad5f94cbd5b7b8e1 100644 (file)
@@ -7,3 +7,24 @@ insert into t1 values ('w'), ('w');
 create unique index index_t1 on t1(f1(4));
 ERROR 23000: Duplicate entry 'w' for key 'index_t1'
 drop table t1;
+#
+#BUG#21326304 INNODB ONLINE ATER TABLE ENDS IN CRASH ON DISK FULL
+#
+CREATE TABLE t1(f1 CHAR(255) NOT NULL, f2 CHAR(255) NOT NULL, f3
+CHAR(255) NOT NULL, f4 CHAR(255) NOT NULL, f5 CHAR(255) NOT NULL,f6
+CHAR(255) NOT NULL, f7 CHAR(255) NOT NULL, f8 CHAR(255) NOT NULL,f9
+CHAR(255) NOT NULL, f10 CHAR(255) NOT NULL, f11 CHAR(255) NOT NULL,f12
+CHAR(255) NOT NULL, f13 CHAR(255) NOT NULL, f14 CHAR(255) NOT NULL,f15
+CHAR(255) NOT NULL, f16 CHAR(255) NOT NULL, f17 CHAR(255) NOT NULL,f18
+CHAR(255) NOT NULL)ENGINE=INNODB;
+INSERT INTO t1
+VALUES('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r');
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+SET SESSION debug="+d,disk_is_full";
+ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
+ERROR HY000: The table 't1' is full
+SET SESSION debug="-d,disk_is_full";
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/create_isl_with_direct.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/create_isl_with_direct.result
new file mode 100644 (file)
index 0000000..87544e6
--- /dev/null
@@ -0,0 +1,10 @@
+SHOW VARIABLES LIKE 'innodb_flush_method';
+Variable_name  Value
+innodb_flush_method    O_DIRECT
+CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='MYSQL_TMP_DIR';
+# Contents of tmp/test directory containing .ibd file
+t1.ibd
+# Contents of the 'test' database directory containing .isl and .frm files
+t1.frm
+t1.isl
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/dropdb.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/dropdb.result
new file mode 100644 (file)
index 0000000..dd04596
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE
+#
+create database `b`;
+use `b`;
+create table `#mysql50#q.q` (f1 int primary key) engine=innodb;
+ERROR HY000: Got error 1103 from storage engine
+drop database `b`;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/import.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/import.result
new file mode 100644 (file)
index 0000000..612e764
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Bug#20977779 CANNOT IMPORT TABLES CONTAINING PREFIX INDEXES
+#
+CREATE TABLE t1 (c1 VARCHAR(32), c2 VARCHAR(32), c3 VARCHAR(32),
+PRIMARY KEY (c1, c2, c3))
+ENGINE=InnoDB;
+ALTER TABLE t1 ADD INDEX ind1(c1(5), c2, c3);
+ALTER TABLE t1 ADD INDEX ind2(c3, c1(10), c2);
+ALTER TABLE t1 ADD INDEX ind3(c2, c3, c1(20));
+INSERT INTO t1 VALUES ('Test Data -1', 'Test Data -2', 'Test Data -3');
+# Test with 2ndary index having prefix
+FLUSH TABLES test.t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE test.t1 DISCARD TABLESPACE;
+ALTER TABLE test.t1 IMPORT TABLESPACE;
+CHECK TABLE test.t1;
+Table  Op      Msg_type        Msg_text
+test.t1        check   status  OK
+SHOW CREATE TABLE test.t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `c1` varchar(32) NOT NULL DEFAULT '',
+  `c2` varchar(32) NOT NULL DEFAULT '',
+  `c3` varchar(32) NOT NULL DEFAULT '',
+  PRIMARY KEY (`c1`,`c2`,`c3`),
+  KEY `ind1` (`c1`(5),`c2`,`c3`),
+  KEY `ind2` (`c3`,`c1`(10),`c2`),
+  KEY `ind3` (`c2`,`c3`,`c1`(20))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM test.t1;
+c1     c2      c3
+Test Data -1   Test Data -2    Test Data -3
+# Test with PK & 2ndary index with prefix
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c1(5), c2(10), c3(20));
+FLUSH TABLES test.t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE test.t1 DISCARD TABLESPACE;
+ALTER TABLE test.t1 IMPORT TABLESPACE;
+CHECK TABLE test.t1;
+Table  Op      Msg_type        Msg_text
+test.t1        check   status  OK
+SHOW CREATE TABLE test.t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `c1` varchar(32) NOT NULL DEFAULT '',
+  `c2` varchar(32) NOT NULL DEFAULT '',
+  `c3` varchar(32) NOT NULL DEFAULT '',
+  PRIMARY KEY (`c1`(5),`c2`(10),`c3`(20)),
+  KEY `ind1` (`c1`(5),`c2`,`c3`),
+  KEY `ind2` (`c3`,`c1`(10),`c2`),
+  KEY `ind3` (`c2`,`c3`,`c1`(20))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM test.t1;
+c1     c2      c3
+Test Data -1   Test Data -2    Test Data -3
+DROP TABLE t1;
index 2c9cfe850a93e6be3d7218bbbe350c891f331f0e..229808df1b4db273144a5409b53150dc540f1608 100644 (file)
@@ -24,3 +24,31 @@ t1ć CREATE TABLE `t1ć` (
   CONSTRAINT `t1c2` FOREIGN KEY (`c2`) REFERENCES `①` (`c2`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 DROP TABLE t1ć, ①;
+#
+# Bug #21364096  THE BOGUS DUPLICATE KEY ERROR IN ONLINE DDL
+#                WITH INCORRECT KEY NAME
+create table t1 (id int auto_increment primary key, a int, unique key uk(a))
+engine = innodb;
+insert into t1 select 1, 1;
+insert into t1 select 2, 2;
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
+alter table t1 add b int, ALGORITHM=inplace;
+/* connection con1 */
+SET DEBUG_SYNC = 'now WAIT_FOR s1';
+insert into t1 select NULL, 1;
+ERROR 23000: Duplicate entry '1' for key 'uk'
+SET DEBUG_SYNC = 'now SIGNAL s2';
+/* connection default */
+/* reap */ alter table t1 add b int, ALGORITHM=inplace;
+ERROR 23000: Duplicate entry '1' for key 'uk'
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
+alter table t1 add b int, ALGORITHM=inplace;;
+/* connection con1 */
+set DEBUG_SYNC = 'now WAIT_FOR s1';
+update t1 set a=1 where id=2;
+ERROR 23000: Duplicate entry '1' for key 'uk'
+SET DEBUG_SYNC = 'now SIGNAL s2';
+/* connection default */
+/* reap */ alter table t1 add b int, ALGORITHM=inplace;
+ERROR 23000: Duplicate entry '1' for key 'uk'
+drop table t1;
index d6616915f0181d8b41e96706aa9ae697964f809d..47fc97206c94162933b0b13511ca227c31f4c976 100644 (file)
@@ -662,6 +662,15 @@ ID FOR_COL_NAME    REF_COL_NAME    POS
 DROP TABLE tt, t1o, sys_tables, sys_indexes, sys_foreign;
 CREATE TABLE t (t TEXT, FULLTEXT(t)) ENGINE=InnoDB;
 DROP INDEX t ON t;
+SELECT SUBSTRING(name, LOCATE('_', name) - 3, 5) AS prefix, name
+FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
+WHERE name LIKE '%FTS_%' ORDER BY 1, 2;
+prefix name
+FTS_0  test/FTS_AUX_BEING_DELETED
+FTS_0  test/FTS_AUX_BEING_DELETED_CACHE
+FTS_0  test/FTS_AUX_CONFIG
+FTS_0  test/FTS_AUX_DELETED
+FTS_0  test/FTS_AUX_DELETED_CACHE
 SELECT sc.pos, sc.NAME FROM information_schema.innodb_sys_columns sc
 INNER JOIN information_schema.innodb_sys_tables st
 ON sc.TABLE_ID=st.TABLE_ID
@@ -670,14 +679,20 @@ pos       NAME
 0      t
 1      FTS_DOC_ID
 ALTER TABLE t ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY.
-ALTER TABLE t ROW_FORMAT=REDUNDANT;
+SELECT SUBSTRING(name, LOCATE('_', name) - 3, 5) AS prefix, name
+FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
+WHERE name LIKE '%FTS_%' ORDER BY 1, 2;
+prefix name
+ALTER TABLE t ADD FULLTEXT INDEX(t);
+Warnings:
+Warning        124     InnoDB rebuilding table to add column FTS_DOC_ID
 SELECT sc.pos, sc.NAME FROM information_schema.innodb_sys_columns sc
 INNER JOIN information_schema.innodb_sys_tables st
 ON sc.TABLE_ID=st.TABLE_ID
 WHERE st.NAME='test/t';
 pos    NAME
 0      t
+1      FTS_DOC_ID
 DROP TABLE t;
 #
 # Bug #19465984 INNODB DATA DICTIONARY IS NOT UPDATED WHILE
@@ -775,3 +790,73 @@ CHECK TABLE t1;
 Table  Op      Msg_type        Msg_text
 test.t1        check   status  OK
 DROP TABLE t1, parent;
+#
+#BUG#21514135 SCHEMA MISMATCH ERROR WHEN IMPORTING TABLESPACE AFTER
+#DROPPING AN INDEX
+#
+CREATE DATABASE source_db;
+CREATE DATABASE dest_db;
+CREATE TABLE source_db.t1 (
+id int(11) NOT NULL,
+age int(11) DEFAULT NULL,
+name varchar(20),
+PRIMARY KEY (id),
+KEY index1 (age)
+) ENGINE=InnoDB;
+ALTER TABLE source_db.t1 DROP INDEX index1, ADD INDEX index2(name, age), algorithm=inplace;
+FLUSH TABLES source_db.t1 FOR EXPORT;
+UNLOCK TABLES;
+USE dest_db;
+CREATE TABLE `t1` (
+  `id` int(11) NOT NULL,
+  `age` int(11) DEFAULT NULL,
+  `name` varchar(20) DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `index2` (`name`,`age`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+ALTER TABLE dest_db.t1 DISCARD TABLESPACE;
+ALTER TABLE dest_db.t1 IMPORT TABLESPACE;
+CHECK TABLE dest_db.t1;
+Table  Op      Msg_type        Msg_text
+dest_db.t1     check   status  OK
+SHOW CREATE TABLE dest_db.t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `id` int(11) NOT NULL,
+  `age` int(11) DEFAULT NULL,
+  `name` varchar(20) DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `index2` (`name`,`age`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM dest_db.t1;
+id     age     name
+DROP TABLE dest_db.t1;
+ALTER TABLE source_db.t1 DROP INDEX index2, algorithm=inplace;
+FLUSH TABLES source_db.t1 FOR EXPORT;
+UNLOCK TABLES;
+USE dest_db;
+CREATE TABLE `t1` (
+  `id` int(11) NOT NULL,
+  `age` int(11) DEFAULT NULL,
+  `name` varchar(20) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+ALTER TABLE dest_db.t1 DISCARD TABLESPACE;
+ALTER TABLE dest_db.t1 IMPORT TABLESPACE;
+CHECK TABLE dest_db.t1;
+Table  Op      Msg_type        Msg_text
+dest_db.t1     check   status  OK
+SHOW CREATE TABLE dest_db.t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `id` int(11) NOT NULL,
+  `age` int(11) DEFAULT NULL,
+  `name` varchar(20) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM dest_db.t1;
+id     age     name
+DROP TABLE dest_db.t1;
+DROP TABLE source_db.t1;
+DROP DATABASE source_db;
+DROP DATABASE dest_db;
index 0e0f49b9a192320b53188179016a83c33f4008ee..21acf06948c65a4cf2def4458881e70bb40aef72 100644 (file)
@@ -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
index f0a5636082390272cd53447d6d5ad8e39b272aba..4db96a3b09231416cd20adf54ec3a18916580659 100644 (file)
@@ -37,3 +37,32 @@ DROP TABLE bug13861218;
 set global innodb_file_per_table=1;
 set global innodb_file_format=Antelope;
 set global innodb_file_format_max=Antelope;
+#
+# Bug #21762319        ADDING INDEXES ON EMPTY TABLE IS SLOW
+#      WITH LARGE INNODB_SORT_BUFFER_SIZE.
+call mtr.add_suppression("InnoDB: Cannot create temporary merge file");
+create table t480(a serial)engine=innodb;
+insert into t480
+values(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
+(),(),(),(),(),(),(),();
+insert into t480 select 0 from t480;
+insert into t480 select 0 from t480;
+insert into t480 select 0 from t480;
+insert into t480 select 0 from t480;
+create table t1(f1 int auto_increment not null,
+f2 char(200) not null, f3 char(200) not null,
+f4 char(200) not null,primary key(f1))engine=innodb;
+insert into t1 select NULL,'aaa','bbb','ccc' from t480;
+insert into t1 select NULL,'aaaa','bbbb','cccc' from t480;
+insert into t1 select NULL,'aaaaa','bbbbb','ccccc' from t480;
+insert into t1 select NULL,'aaaaaa','bbbbbb','cccccc' from t480;
+insert into t1 select NULL,'aaaaaaa','bbbbbbb','ccccccc' from t480;
+insert into t1 select NULL,'aaaaaaaa','bbbbbbbb','cccccccc' from t480;
+select count(*) from t1;
+count(*)
+2880
+SET DEBUG = '+d,innobase_tmpfile_creation_failure';
+alter table t1 force, algorithm=inplace;
+ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
+SET DEBUG = '-d,innobase_tmpfile_creation_failure';
+drop table t1, t480;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-lock-inherit-read_commited.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-lock-inherit-read_commited.result
new file mode 100644 (file)
index 0000000..bdd4ffe
--- /dev/null
@@ -0,0 +1,91 @@
+#
+# Bug #21025880        DUPLICATE UK VALUES IN READ-COMMITTED(AGAIN)
+#
+CREATE TABLE t1 (
+a INT NOT NULL,
+b INT NOT NULL,
+PRIMARY KEY(b),
+UNIQUE KEY(a))
+ENGINE=INNODB;
+SET @old_innodb_stats_auto_recalc = @@innodb_stats_auto_recalc;
+SET GLOBAL innodb_stats_auto_recalc = OFF;
+SET GLOBAL innodb_purge_stop_now = ON;
+SET @old_tx_isolation = @@tx_isolation;
+SET GLOBAL tx_isolation = 'READ-COMMITTED';
+SET @old_innodb_lock_wait_timeout = @@innodb_lock_wait_timeout;
+SET GLOBAL innodb_lock_wait_timeout = 1;
+INSERT INTO t1 VALUES (1,1),(2,2);
+DELETE FROM t1;
+SET debug_sync = 'row_ins_sec_index_entry_dup_locks_created SIGNAL
+con1_locks_done WAIT_FOR con1_go';
+SET debug_sync = 'ha_commit_trans_after_acquire_commit_lock SIGNAL
+con1_insert_done WAIT_FOR con1_finish';
+REPLACE INTO t1 VALUES (1,2);
+SET debug_sync = 'now WAIT_FOR con1_locks_done';
+SET debug_sync = 'lock_wait_suspend_thread_enter SIGNAL con2_blocked
+WAIT_FOR con2_go';
+SET debug_sync = 'ha_commit_trans_after_acquire_commit_lock SIGNAL
+con2_insert_done WAIT_FOR con2_finish';
+SET debug_sync = 'ib_after_row_insert SIGNAL con2_insert_done';
+REPLACE INTO t1 VALUES (1,3);
+SET debug_sync = 'now WAIT_FOR con2_blocked';
+SET GLOBAL innodb_purge_run_now=ON;
+SET debug_sync = 'now SIGNAL con2_go WAIT_FOR con2_insert_done';
+SET debug_sync = 'now SIGNAL con1_go WAIT_FOR con1_insert_done';
+SET debug_sync = 'now SIGNAL con1_finish';
+SET debug_sync = 'now SIGNAL con2_finish';
+SELECT * FROM t1;
+a      b
+1      2
+CHECK TABLE t1;
+Table  Op      Msg_type        Msg_text
+test.t1        check   status  OK
+DROP TABLE t1;
+SET GLOBAL innodb_stats_auto_recalc = @old_innodb_stats_auto_recalc;
+SET GLOBAL tx_isolation = @old_tx_isolation;
+SET GLOBAL innodb_lock_wait_timeout = @old_innodb_lock_wait_timeout;
+SET DEBUG_SYNC= 'RESET';
+CREATE TABLE t1 (
+a INT NOT NULL,
+b INT NOT NULL,
+PRIMARY KEY(b),
+UNIQUE KEY(a))
+ENGINE=INNODB;
+SET @old_innodb_stats_auto_recalc = @@innodb_stats_auto_recalc;
+SET GLOBAL innodb_stats_auto_recalc = OFF;
+SET GLOBAL innodb_purge_stop_now = ON;
+SET @old_tx_isolation = @@tx_isolation;
+SET GLOBAL tx_isolation = 'READ-COMMITTED';
+SET @old_innodb_lock_wait_timeout = @@innodb_lock_wait_timeout;
+SET GLOBAL innodb_lock_wait_timeout = 1;
+INSERT INTO t1 VALUES (1,1),(2,2);
+DELETE FROM t1;
+SET debug_sync = 'row_ins_sec_index_entry_dup_locks_created SIGNAL
+con1_locks_done WAIT_FOR con1_go';
+SET debug_sync = 'ha_commit_trans_after_acquire_commit_lock SIGNAL
+con1_insert_done WAIT_FOR con1_finish';
+INSERT INTO t1 values (1,2) ON DUPLICATE KEY UPDATE a=2;
+SET debug_sync = 'now WAIT_FOR con1_locks_done';
+SET debug_sync = 'lock_wait_suspend_thread_enter SIGNAL con2_blocked
+WAIT_FOR con2_go';
+SET debug_sync = 'ha_commit_trans_after_acquire_commit_lock SIGNAL
+con2_insert_done WAIT_FOR con2_finish';
+SET debug_sync = 'ib_after_row_insert SIGNAL con2_insert_done';
+REPLACE INTO t1 VALUES (1,3);
+SET debug_sync = 'now WAIT_FOR con2_blocked';
+SET GLOBAL innodb_purge_run_now=ON;
+SET debug_sync = 'now SIGNAL con2_go WAIT_FOR con2_insert_done';
+SET debug_sync = 'now SIGNAL con1_go WAIT_FOR con1_insert_done';
+SET debug_sync = 'now SIGNAL con1_finish';
+SET debug_sync = 'now SIGNAL con2_finish';
+SELECT * FROM t1;
+a      b
+1      2
+CHECK TABLE t1;
+Table  Op      Msg_type        Msg_text
+test.t1        check   status  OK
+DROP TABLE t1;
+SET GLOBAL innodb_stats_auto_recalc = @old_innodb_stats_auto_recalc;
+SET GLOBAL tx_isolation = @old_tx_isolation;
+SET GLOBAL innodb_lock_wait_timeout = @old_innodb_lock_wait_timeout;
+SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_autoinc_reset.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_autoinc_reset.result
new file mode 100644 (file)
index 0000000..70ab7e8
--- /dev/null
@@ -0,0 +1,13 @@
+CREATE TABLE t1 (
+id    INT AUTO_INCREMENT PRIMARY KEY,
+name  VARCHAR(100)
+) ENGINE=InnoDB AUTO_INCREMENT=99;
+SET GLOBAL debug="+d,innodb_evict_autoinc_table";
+SET GLOBAL innodb_ft_aux_table="test/t1";
+ERROR 42000: Variable 'innodb_ft_aux_table' can't be set to the value of 'test/t1'
+SET GLOBAL debug="-d,innodb_evict_autoinc_table";
+INSERT INTO t1(name) VALUES('mysql');
+SELECT * FROM t1;
+id     name
+99     mysql
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_file_limit_check.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_file_limit_check.result
new file mode 100644 (file)
index 0000000..ce5fac1
--- /dev/null
@@ -0,0 +1,8 @@
+CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit.");
+CREATE TABLE t1 (a INT)ENGINE=INNODB PARTITION BY HASH(a) PARTITIONS 1024;
+SELECT 1 UNION SELECT * FROM t1  UNION SELECT * FROM t1  UNION
+SELECT * FROM t1  UNION SELECT * FROM t1  UNION SELECT * FROM
+t1;
+1
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_force_recovery.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_force_recovery.result
new file mode 100644 (file)
index 0000000..fb36c98
--- /dev/null
@@ -0,0 +1,31 @@
+call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'".*".".*"\' in the cache');
+call mtr.add_suppression('InnoDB: Allocated tablespace [0-9]+, old maximum was [0-9]+');
+create table t1(f1 int not null, f2 int not null, index idx(f2))engine=innodb;
+insert into t1 values(1, 2);
+SET GLOBAL innodb_fast_shutdown = 0;
+# Stop server
+# Restart server.
+select * from t1;
+f1     f2
+1      2
+insert into t1 values(2, 3);
+ERROR HY000: Table 't1' is read only
+alter table t1 add f3 int not null, algorithm=copy;
+ERROR HY000: InnoDB is in read only mode.
+alter table t1 add f3 int not null, algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY.
+drop index idx on t1;
+ERROR HY000: InnoDB is in read only mode.
+update t1 set f1=3 where f2=2;
+ERROR HY000: Table 't1' is read only
+create table t3(f1 int not null)engine=innodb;
+ERROR HY000: InnoDB is in read only mode.
+drop table t3;
+ERROR 42S02: Unknown table 'test.t3'
+rename table t1 to t3;
+ERROR HY000: Error on rename of './test/t1' to './test/t3' (errno: 165 - Table is read only)
+truncate table t1;
+ERROR HY000: Table 't1' is read only
+drop table t1;
+show tables;
+Tables_in_test
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_monitor.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_monitor.result
deleted file mode 100644 (file)
index 68ab1bf..0000000
+++ /dev/null
@@ -1,549 +0,0 @@
-set global innodb_monitor_disable = All;
-select name, status from information_schema.innodb_metrics;
-name   status
-metadata_table_handles_opened  disabled
-metadata_table_handles_closed  disabled
-metadata_table_reference_count disabled
-metadata_mem_pool_size disabled
-lock_deadlocks disabled
-lock_timeouts  disabled
-lock_rec_lock_waits    disabled
-lock_table_lock_waits  disabled
-lock_rec_lock_requests disabled
-lock_rec_lock_created  disabled
-lock_rec_lock_removed  disabled
-lock_rec_locks disabled
-lock_table_lock_created        disabled
-lock_table_lock_removed        disabled
-lock_table_locks       disabled
-lock_row_lock_current_waits    disabled
-lock_row_lock_time     disabled
-lock_row_lock_time_max disabled
-lock_row_lock_waits    disabled
-lock_row_lock_time_avg disabled
-buffer_pool_size       disabled
-buffer_pool_reads      disabled
-buffer_pool_read_requests      disabled
-buffer_pool_write_requests     disabled
-buffer_pool_wait_free  disabled
-buffer_pool_read_ahead disabled
-buffer_pool_read_ahead_evicted disabled
-buffer_pool_pages_total        disabled
-buffer_pool_pages_misc disabled
-buffer_pool_pages_data disabled
-buffer_pool_bytes_data disabled
-buffer_pool_pages_dirty        disabled
-buffer_pool_bytes_dirty        disabled
-buffer_pool_pages_free disabled
-buffer_pages_created   disabled
-buffer_pages_written   disabled
-buffer_pages_read      disabled
-buffer_data_reads      disabled
-buffer_data_written    disabled
-buffer_flush_batch_scanned     disabled
-buffer_flush_batch_num_scan    disabled
-buffer_flush_batch_scanned_per_call    disabled
-buffer_flush_batch_rescan      disabled
-buffer_flush_batch_total_pages disabled
-buffer_flush_batches   disabled
-buffer_flush_batch_pages       disabled
-buffer_flush_neighbor_total_pages      disabled
-buffer_flush_neighbor  disabled
-buffer_flush_neighbor_pages    disabled
-buffer_flush_n_to_flush_requested      disabled
-buffer_flush_avg_page_rate     disabled
-buffer_flush_lsn_avg_rate      disabled
-buffer_flush_pct_for_dirty     disabled
-buffer_flush_pct_for_lsn       disabled
-buffer_flush_sync_waits        disabled
-buffer_flush_adaptive_total_pages      disabled
-buffer_flush_adaptive  disabled
-buffer_flush_adaptive_pages    disabled
-buffer_flush_sync_total_pages  disabled
-buffer_flush_sync      disabled
-buffer_flush_sync_pages        disabled
-buffer_flush_background_total_pages    disabled
-buffer_flush_background        disabled
-buffer_flush_background_pages  disabled
-buffer_LRU_batch_scanned       disabled
-buffer_LRU_batch_num_scan      disabled
-buffer_LRU_batch_scanned_per_call      disabled
-buffer_LRU_batch_total_pages   disabled
-buffer_LRU_batches     disabled
-buffer_LRU_batch_pages disabled
-buffer_LRU_single_flush_scanned        disabled
-buffer_LRU_single_flush_num_scan       disabled
-buffer_LRU_single_flush_scanned_per_call       disabled
-buffer_LRU_single_flush_failure_count  disabled
-buffer_LRU_get_free_search     disabled
-buffer_LRU_search_scanned      disabled
-buffer_LRU_search_num_scan     disabled
-buffer_LRU_search_scanned_per_call     disabled
-buffer_LRU_unzip_search_scanned        disabled
-buffer_LRU_unzip_search_num_scan       disabled
-buffer_LRU_unzip_search_scanned_per_call       disabled
-buffer_page_read_index_leaf    disabled
-buffer_page_read_index_non_leaf        disabled
-buffer_page_read_index_ibuf_leaf       disabled
-buffer_page_read_index_ibuf_non_leaf   disabled
-buffer_page_read_undo_log      disabled
-buffer_page_read_index_inode   disabled
-buffer_page_read_ibuf_free_list        disabled
-buffer_page_read_ibuf_bitmap   disabled
-buffer_page_read_system_page   disabled
-buffer_page_read_trx_system    disabled
-buffer_page_read_fsp_hdr       disabled
-buffer_page_read_xdes  disabled
-buffer_page_read_blob  disabled
-buffer_page_read_zblob disabled
-buffer_page_read_zblob2        disabled
-buffer_page_read_other disabled
-buffer_page_written_index_leaf disabled
-buffer_page_written_index_non_leaf     disabled
-buffer_page_written_index_ibuf_leaf    disabled
-buffer_page_written_index_ibuf_non_leaf        disabled
-buffer_page_written_undo_log   disabled
-buffer_page_written_index_inode        disabled
-buffer_page_written_ibuf_free_list     disabled
-buffer_page_written_ibuf_bitmap        disabled
-buffer_page_written_system_page        disabled
-buffer_page_written_trx_system disabled
-buffer_page_written_fsp_hdr    disabled
-buffer_page_written_xdes       disabled
-buffer_page_written_blob       disabled
-buffer_page_written_zblob      disabled
-buffer_page_written_zblob2     disabled
-buffer_page_written_other      disabled
-os_data_reads  disabled
-os_data_writes disabled
-os_data_fsyncs disabled
-os_pending_reads       disabled
-os_pending_writes      disabled
-os_log_bytes_written   disabled
-os_log_fsyncs  disabled
-os_log_pending_fsyncs  disabled
-os_log_pending_writes  disabled
-trx_rw_commits disabled
-trx_ro_commits disabled
-trx_nl_ro_commits      disabled
-trx_commits_insert_update      disabled
-trx_rollbacks  disabled
-trx_rollbacks_savepoint        disabled
-trx_rollback_active    disabled
-trx_active_transactions        disabled
-trx_rseg_history_len   disabled
-trx_undo_slots_used    disabled
-trx_undo_slots_cached  disabled
-trx_rseg_current_size  disabled
-purge_del_mark_records disabled
-purge_upd_exist_or_extern_records      disabled
-purge_invoked  disabled
-purge_undo_log_pages   disabled
-purge_dml_delay_usec   disabled
-purge_stop_count       disabled
-purge_resume_count     disabled
-log_checkpoints        disabled
-log_lsn_last_flush     disabled
-log_lsn_last_checkpoint        disabled
-log_lsn_current        disabled
-log_lsn_checkpoint_age disabled
-log_lsn_buf_pool_oldest        disabled
-log_max_modified_age_async     disabled
-log_max_modified_age_sync      disabled
-log_pending_log_writes disabled
-log_pending_checkpoint_writes  disabled
-log_num_log_io disabled
-log_waits      disabled
-log_write_requests     disabled
-log_writes     disabled
-compress_pages_compressed      disabled
-compress_pages_decompressed    disabled
-compression_pad_increments     disabled
-compression_pad_decrements     disabled
-index_page_splits      disabled
-index_page_merge_attempts      disabled
-index_page_merge_successful    disabled
-index_page_reorg_attempts      disabled
-index_page_reorg_successful    disabled
-index_page_discards    disabled
-adaptive_hash_searches disabled
-adaptive_hash_searches_btree   disabled
-adaptive_hash_pages_added      disabled
-adaptive_hash_pages_removed    disabled
-adaptive_hash_rows_added       disabled
-adaptive_hash_rows_removed     disabled
-adaptive_hash_rows_deleted_no_hash_entry       disabled
-adaptive_hash_rows_updated     disabled
-file_num_open_files    disabled
-ibuf_merges_insert     disabled
-ibuf_merges_delete_mark        disabled
-ibuf_merges_delete     disabled
-ibuf_merges_discard_insert     disabled
-ibuf_merges_discard_delete_mark        disabled
-ibuf_merges_discard_delete     disabled
-ibuf_merges    disabled
-ibuf_size      disabled
-innodb_master_thread_sleeps    disabled
-innodb_activity_count  disabled
-innodb_master_active_loops     disabled
-innodb_master_idle_loops       disabled
-innodb_background_drop_table_usec      disabled
-innodb_ibuf_merge_usec disabled
-innodb_log_flush_usec  disabled
-innodb_mem_validate_usec       disabled
-innodb_master_purge_usec       disabled
-innodb_dict_lru_usec   disabled
-innodb_checkpoint_usec disabled
-innodb_dblwr_writes    disabled
-innodb_dblwr_pages_written     disabled
-innodb_page_size       disabled
-innodb_rwlock_s_spin_waits     disabled
-innodb_rwlock_x_spin_waits     disabled
-innodb_rwlock_s_spin_rounds    disabled
-innodb_rwlock_x_spin_rounds    disabled
-innodb_rwlock_s_os_waits       disabled
-innodb_rwlock_x_os_waits       disabled
-dml_reads      disabled
-dml_inserts    disabled
-dml_deletes    disabled
-dml_updates    disabled
-ddl_background_drop_indexes    disabled
-ddl_background_drop_tables     disabled
-ddl_online_create_index        disabled
-ddl_pending_alter_table        disabled
-icp_attempts   disabled
-icp_no_match   disabled
-icp_out_of_range       disabled
-icp_match      disabled
-set global innodb_monitor_enable = all;
-select name from information_schema.innodb_metrics where status!='enabled';
-name
-set global innodb_monitor_enable = aaa;
-ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
-set global innodb_monitor_disable = All;
-select name from information_schema.innodb_metrics where status!='disabled';
-name
-set global innodb_monitor_reset_all = all;
-select name from information_schema.innodb_metrics where count!=0;
-name
-set  global innodb_monitor_enable = "%lock%";
-select name from information_schema.innodb_metrics
-where status != IF(name like "%lock%", 'enabled', 'disabled');
-name
-set  global innodb_monitor_disable = "%lock%";
-select name, status from information_schema.innodb_metrics
-where name like "%lock%";
-name   status
-lock_deadlocks disabled
-lock_timeouts  disabled
-lock_rec_lock_waits    disabled
-lock_table_lock_waits  disabled
-lock_rec_lock_requests disabled
-lock_rec_lock_created  disabled
-lock_rec_lock_removed  disabled
-lock_rec_locks disabled
-lock_table_lock_created        disabled
-lock_table_lock_removed        disabled
-lock_table_locks       disabled
-lock_row_lock_current_waits    disabled
-lock_row_lock_time     disabled
-lock_row_lock_time_max disabled
-lock_row_lock_waits    disabled
-lock_row_lock_time_avg disabled
-innodb_rwlock_s_spin_waits     disabled
-innodb_rwlock_x_spin_waits     disabled
-innodb_rwlock_s_spin_rounds    disabled
-innodb_rwlock_x_spin_rounds    disabled
-innodb_rwlock_s_os_waits       disabled
-innodb_rwlock_x_os_waits       disabled
-set global innodb_monitor_enable = "%lock*";
-ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
-set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
-select name from information_schema.innodb_metrics where status!='enabled';
-name
-set global innodb_monitor_disable="%%%%%";
-select name from information_schema.innodb_metrics where status!='disabled';
-name
-set global innodb_monitor_enable="%";
-select name from information_schema.innodb_metrics where status!='enabled';
-name
-set global innodb_monitor_disable="%_%";
-select name from information_schema.innodb_metrics where status!='disabled';
-name
-set global innodb_monitor_enable="log%%%%";
-select name from information_schema.innodb_metrics
-where status != IF(name like "log%", 'enabled', 'disabled');
-name
-set global innodb_monitor_enable="os_%a_fs_ncs";
-set global innodb_monitor_enable="os%pending%";
-select name, status from information_schema.innodb_metrics
-where name like "os%";
-name   status
-os_data_reads  disabled
-os_data_writes disabled
-os_data_fsyncs enabled
-os_pending_reads       enabled
-os_pending_writes      enabled
-os_log_bytes_written   disabled
-os_log_fsyncs  disabled
-os_log_pending_fsyncs  enabled
-os_log_pending_writes  enabled
-set global innodb_monitor_enable="";
-ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
-set global innodb_monitor_enable="_";
-ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_'
-set global innodb_monitor_disable = module_metadata;
-set global innodb_monitor_reset_all = module_metadata;
-set global innodb_monitor_enable = metadata_table_handles_opened;
-create table monitor_test(col int) engine = innodb;
-select * from monitor_test;
-col
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  1       NULL    1       1       NULL    1       enabled
-set global innodb_monitor_reset = metadata_table_handles_opened;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  1       NULL    1       NULL    NULL    0       enabled
-drop table monitor_test;
-create table monitor_test(col int) engine = innodb;
-select * from monitor_test;
-col
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  2       NULL    2       1       NULL    1       enabled
-set global innodb_monitor_reset_all = metadata_table_handles_opened;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  2       NULL    2       1       NULL    1       enabled
-set global innodb_monitor_disable = metadata_table_handles_opened;
-set global innodb_monitor_reset = metadata_table_handles_opened;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  2       NULL    2       NULL    NULL    0       disabled
-drop table monitor_test;
-create table monitor_test(col int) engine = innodb;
-select * from monitor_test;
-col
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  2       NULL    2       NULL    NULL    0       disabled
-set global innodb_monitor_reset_all = metadata_table_handles_opened;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  NULL    NULL    0       NULL    NULL    0       disabled
-set global innodb_monitor_enable = metadata_table_handles_opened;
-drop table monitor_test;
-create table monitor_test(col int) engine = innodb stats_persistent=0;
-select * from monitor_test;
-col
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  1       NULL    1       1       NULL    1       enabled
-set global innodb_monitor_enable = metadata_table_handles_closed;
-create index idx on monitor_test(col);
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_closed";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_closed  1       NULL    1       1       NULL    1       enabled
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "metadata%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  2       NULL    2       2       NULL    2       enabled
-metadata_table_handles_closed  1       NULL    1       1       NULL    1       enabled
-metadata_table_reference_count NULL    NULL    0       NULL    NULL    0       disabled
-metadata_mem_pool_size NULL    NULL    0       NULL    NULL    0       disabled
-set global innodb_monitor_disable = module_metadata;
-set global innodb_monitor_reset = module_metadata;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "metadata%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  2       NULL    2       NULL    NULL    0       disabled
-metadata_table_handles_closed  1       NULL    1       NULL    NULL    0       disabled
-metadata_table_reference_count NULL    NULL    0       NULL    NULL    0       disabled
-metadata_mem_pool_size NULL    NULL    0       NULL    NULL    0       disabled
-set global innodb_monitor_reset_all = module_metadata;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "metadata%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-metadata_table_handles_opened  NULL    NULL    0       NULL    NULL    0       disabled
-metadata_table_handles_closed  NULL    NULL    0       NULL    NULL    0       disabled
-metadata_table_reference_count NULL    NULL    0       NULL    NULL    0       disabled
-metadata_mem_pool_size NULL    NULL    0       NULL    NULL    0       disabled
-set global innodb_monitor_enable = module_trx;
-begin;
-insert into monitor_test values(9);
-commit;
-begin;
-insert into monitor_test values(9);
-rollback;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "trx_rollbacks" or name like "trx_active_transactions";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-trx_rollbacks  1       NULL    1       1       NULL    1       enabled
-trx_active_transactions        1       0       0       1       0       0       enabled
-set global innodb_monitor_disable = module_trx;
-set global innodb_monitor_enable = module_dml;
-insert into monitor_test values(9);
-update monitor_test set col = 10 where col = 9;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-dml_reads      4       NULL    4       4       NULL    4       enabled
-dml_inserts    1       NULL    1       1       NULL    1       enabled
-dml_deletes    0       NULL    0       0       NULL    0       enabled
-dml_updates    2       NULL    2       2       NULL    2       enabled
-delete from monitor_test;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-dml_reads      6       NULL    6       6       NULL    6       enabled
-dml_inserts    1       NULL    1       1       NULL    1       enabled
-dml_deletes    2       NULL    2       2       NULL    2       enabled
-dml_updates    2       NULL    2       2       NULL    2       enabled
-set global innodb_monitor_reset =  module_dml;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-dml_reads      6       NULL    6       0       NULL    0       enabled
-dml_inserts    1       NULL    1       0       NULL    0       enabled
-dml_deletes    2       NULL    2       0       NULL    0       enabled
-dml_updates    2       NULL    2       0       NULL    0       enabled
-insert into monitor_test values(9);
-insert into monitor_test values(1);
-delete from monitor_test;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-dml_reads      8       NULL    8       2       NULL    2       enabled
-dml_inserts    3       NULL    3       2       NULL    2       enabled
-dml_deletes    4       NULL    4       2       NULL    2       enabled
-dml_updates    2       NULL    2       0       NULL    0       enabled
-set global innodb_monitor_reset_all  =  module_dml;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-dml_reads      8       NULL    8       2       NULL    2       enabled
-dml_inserts    3       NULL    3       2       NULL    2       enabled
-dml_deletes    4       NULL    4       2       NULL    2       enabled
-dml_updates    2       NULL    2       0       NULL    0       enabled
-set global innodb_monitor_disable = module_dml;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-dml_reads      8       NULL    8       2       NULL    2       disabled
-dml_inserts    3       NULL    3       2       NULL    2       disabled
-dml_deletes    4       NULL    4       2       NULL    2       disabled
-dml_updates    2       NULL    2       0       NULL    0       disabled
-set global innodb_monitor_reset_all  = module_dml;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-dml_reads      NULL    NULL    0       NULL    NULL    0       disabled
-dml_inserts    NULL    NULL    0       NULL    NULL    0       disabled
-dml_deletes    NULL    NULL    0       NULL    NULL    0       disabled
-dml_updates    NULL    NULL    0       NULL    NULL    0       disabled
-set global innodb_monitor_enable = dml_inserts;
-insert into monitor_test values(9);
-insert into monitor_test values(1);
-delete from monitor_test;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-dml_reads      NULL    NULL    0       NULL    NULL    0       disabled
-dml_inserts    2       NULL    2       2       NULL    2       enabled
-dml_deletes    NULL    NULL    0       NULL    NULL    0       disabled
-dml_updates    NULL    NULL    0       NULL    NULL    0       disabled
-set global innodb_monitor_disable = module_dml;
-drop table monitor_test;
-set global innodb_monitor_enable = file_num_open_files;
-select name, max_count, min_count, count,
-max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "file_num_open_files";
-name   max_count       min_count       count   max_count_reset min_count_reset count_reset     status
-file_num_open_files    #       #       #       #       #       #       enabled
-set global innodb_monitor_disable = file_num_open_files;
-set global innodb_monitor_enable = "icp%";
-create table monitor_test(a char(3), b int, c char(2),
-primary key (a(1), c(1)), key(b)) engine = innodb;
-insert into monitor_test values("13", 2, "aa");
-select a from monitor_test where b < 1 for update;
-a
-select name, count from information_schema.innodb_metrics
-where name like "icp%";
-name   count
-icp_attempts   1
-icp_no_match   0
-icp_out_of_range       1
-icp_match      0
-select a from monitor_test where b < 3 for update;
-a
-13
-select name, count from information_schema.innodb_metrics
-where name like "icp%";
-name   count
-icp_attempts   2
-icp_no_match   0
-icp_out_of_range       1
-icp_match      1
-drop table monitor_test;
-set global innodb_monitor_disable = all;
-set global innodb_monitor_reset_all = all;
-select 1 from `information_schema`.`INNODB_METRICS`
-where case (1) when (1) then (AVG_COUNT_RESET) else (1) end;
-1
-set global innodb_monitor_enable = default;
-set global innodb_monitor_disable = default;
-set global innodb_monitor_reset = default;
-set global innodb_monitor_reset_all = default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/strict_checksum.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/strict_checksum.result
new file mode 100644 (file)
index 0000000..167951a
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Bug #20031570 INNODB_CHECKSUM_ALGORITHM VARIABLE LEADS TO CRASHING
+#
+set global innodb_checksum_algorithm=crc32;
+create table t1(f1 int not null primary key)engine=innodb;
+# Restart the server with --log-error
+set global innodb_checksum_algorithm=strict_innodb;
+set global innodb_limit_optimistic_insert_debug = 2;
+call mtr.add_suppression("\\[Warning\\] InnoDB: innodb_checksum_algorithm is set to .* but the page .* contains a valid checksum .*.");
+select count(*) from t1;
+count(*)
+0
+insert into t1 values(2),(3),(4);
+# Restart the server with --log-error
+set global innodb_checksum_algorithm=strict_none;
+set global innodb_limit_optimistic_insert_debug = 2;
+select count(*) from t1;
+count(*)
+3
+insert into t1 values(5),(6),(7);
+select count(*) from t1;
+count(*)
+6
+drop table t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/tmpdir.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/tmpdir.result
new file mode 100644 (file)
index 0000000..f9475c1
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# Bug #19183565 CREATE DYNAMIC INNODB_TMPDIR VARIABLE TO CONTROL
+#              WHERE INNODB WRITES TEMP FILES
+#
+# If innodb_tmpdir is NULL or "", temporary file will be created in
+# server configuration variable location(--tmpdir)
+create table t1(a int primary key)engine=innodb;
+show session variables like 'innodb_tmpdir';
+Variable_name  Value
+innodb_tmpdir  
+alter table t1 add column b int not null;
+set global innodb_tmpdir=NULL;
+# Connection con1
+show session variables like 'innodb_tmpdir';
+Variable_name  Value
+innodb_tmpdir  
+alter table t1 add key(b);
+drop table t1;
+# innodb_tmpdir with invalid path.
+create table t1(a int primary key)engine=innodb;
+set global innodb_tmpdir='wrong_value';
+ERROR 42000: Variable 'innodb_tmpdir' can't be set to the value of 'wrong_value'
+show warnings;
+Level  Code    Message
+Warning        1210    InnoDB: Path doesn't exist.
+Error  1231    Variable 'innodb_tmpdir' can't be set to the value of 'wrong_value'
+drop table t1;
+# innodb_tmpdir with mysql data directory path.
+create table t1(a text, b text, fulltext(a,b))engine=innodb;
+insert into t1 values('test1', 'test2');
+insert into t1 values('text1', 'text2');
+set global innodb_tmpdir = @@global.datadir;
+ERROR 42000: Variable 'innodb_tmpdir' can't be set to the value of 'MYSQL_DATADIR'
+show warnings;
+Level  Code    Message
+Warning        1210    InnoDB: Path Location should not be same as mysql data directory location.
+Error  1231    DATADIR/data/'
+drop table t1;
+# innodb_tmpdir with valid location.
+create table t1(a text, b text, fulltext(a,b))engine=innodb;
+insert into t1 values('test1', 'test2');
+insert into t1 values('text1', 'text2');
+set @tmpdir = @@global.tmpdir;
+set global innodb_tmpdir = @tmpdir;
+show session variables like 'innodb_tmpdir';
+Variable_name  Value
+innodb_tmpdir  
+# Connection con3
+alter table t1 add fulltext(b);
+set global innodb_tmpdir=NULL;
+drop table t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/xa_recovery.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/xa_recovery.result
new file mode 100644 (file)
index 0000000..84cb37e
--- /dev/null
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+XA START 'x';
+UPDATE t1 set a=2;
+XA END 'x';
+XA PREPARE 'x';
+call mtr.add_suppression("Found 1 prepared XA transactions");
+SELECT * FROM t1 LOCK IN SHARE MODE;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t1;
+a
+2
+XA ROLLBACK 'x';
+SELECT * FROM t1;
+a
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/alter_rename_existing.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/alter_rename_existing.test
new file mode 100755 (executable)
index 0000000..0c8bf48
--- /dev/null
@@ -0,0 +1,93 @@
+--echo #
+--echo # Show what happens during ALTER TABLE when an existing file
+--echo # exists in the target location.
+--echo #
+--echo # Bug #19218794: IF TABLESPACE EXISTS, CAN'T CREATE TABLE,
+--echo #                BUT CAN ALTER ENGINE=INNODB
+--echo #
+
+--source include/have_innodb.inc
+
+--disable_query_log
+LET $MYSQLD_DATADIR = `select @@datadir`;
+SET @old_innodb_file_per_table = @@innodb_file_per_table;
+--enable_query_log
+
+CREATE TABLE t1 (a SERIAL, b CHAR(10)) ENGINE=Memory;
+INSERT INTO t1(b) VALUES('one'), ('two'), ('three');
+
+--echo #
+--echo # Create a file called MYSQLD_DATADIR/test/t1.ibd
+--exec echo "This is not t1.ibd" > $MYSQLD_DATADIR/test/t1.ibd
+
+--echo # Directory listing of test/*.ibd
+--echo #
+--list_files $MYSQLD_DATADIR/test/ *.ibd
+
+--replace_regex  /Error on rename of '.*' to '.*'/Error on rename of 'OLD_FILE_NAME' to 'NEW_FILE_NAME'/
+--error ER_ERROR_ON_RENAME
+ALTER TABLE t1 ENGINE = InnoDB;
+
+--echo #
+--echo # Move the file to InnoDB as t2
+--echo #
+ALTER TABLE t1 RENAME TO t2, ENGINE = INNODB;
+SHOW CREATE TABLE t2;
+SELECT * from t2;
+
+--replace_regex  /Error on rename of '.*' to '.*'/Error on rename of 'OLD_FILE_NAME' to 'NEW_FILE_NAME'/
+--error ER_ERROR_ON_RENAME
+ALTER TABLE t2 RENAME TO t1;
+
+--echo #
+--echo # Create another t1, but in the system tablespace.
+--echo #
+SET GLOBAL innodb_file_per_table=OFF;
+CREATE TABLE t1 (a SERIAL, b CHAR(20)) ENGINE=InnoDB;
+INSERT INTO t1(b) VALUES('one'), ('two'), ('three');
+SHOW CREATE TABLE t1;
+SELECT name, space=0 FROM information_schema.innodb_sys_tables WHERE name = 'test/t1';
+
+--echo #
+--echo # ALTER TABLE from system tablespace to system tablespace
+--echo #
+ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=INPLACE;
+ALTER TABLE t1 ADD COLUMN d INT, ALGORITHM=COPY;
+
+--echo #
+--echo # Try to move t1 from the system tablespace to a file-per-table
+--echo # while a blocking t1.ibd file exists.
+--echo #
+SET GLOBAL innodb_file_per_table=ON;
+--replace_regex /$MYSQLD_DATADIR/MYSQLD_DATADIR/
+--error ER_TABLESPACE_EXISTS
+ALTER TABLE t1 ADD COLUMN e1 INT, ALGORITHM=INPLACE;
+--replace_regex  /Error on rename of '.*' to '.*'/Error on rename of 'OLD_FILE_NAME' to 'NEW_FILE_NAME'/
+--error ER_ERROR_ON_RENAME
+ALTER TABLE t1 ADD COLUMN e2 INT, ALGORITHM=COPY;
+
+--echo #
+--echo # Delete the blocking file called MYSQLD_DATADIR/test/t1.ibd
+--remove_file $MYSQLD_DATADIR/test/t1.ibd
+
+--echo # Move t1 to file-per-table using ALGORITHM=INPLACE with no blocking t1.ibd.
+--echo #
+ALTER TABLE t1 ADD COLUMN e INT, ALGORITHM=INPLACE;
+SHOW CREATE TABLE t1;
+SELECT name, space=0 FROM information_schema.innodb_sys_tables WHERE name = 'test/t1';
+
+DROP TABLE t1;
+
+--echo #
+--echo # Rename t2.ibd to t1.ibd.
+--echo #
+ALTER TABLE t2 RENAME TO t1;
+SELECT name, space=0 FROM information_schema.innodb_sys_tables WHERE name = 'test/t1';
+SELECT * from t1;
+
+DROP TABLE t1;
+
+--disable_query_log
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot rename '.*' to '.*' for space ID .* because the target file exists. Remove the target file and try again");
+SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table;
+--enable_query_log
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/analyze_table.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/analyze_table.test
new file mode 100644 (file)
index 0000000..e9db366
--- /dev/null
@@ -0,0 +1,42 @@
+#
+# BUG#22385442 - INNODB: DIFFICULT TO FIND FREE BLOCKS IN THE BUFFER POOL
+#
+
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+DELIMITER |;
+CREATE PROCEDURE populate_t1()
+BEGIN
+        DECLARE i int DEFAULT 1;
+
+        START TRANSACTION;
+        WHILE (i <= 1000000) DO
+                INSERT INTO t1 VALUES (i, i, CONCAT('a', i));
+                SET i = i + 1;
+        END WHILE;
+        COMMIT;
+END|
+DELIMITER ;|
+
+CREATE TABLE t1(
+        class   INT,
+        id      INT,
+        title   VARCHAR(100)
+) ENGINE=InnoDB;
+
+-- disable_query_log
+CALL populate_t1();
+-- enable_query_log
+
+SELECT COUNT(*) FROM t1;
+
+SET GLOBAL innodb_stats_persistent_sample_pages=2000;
+
+ANALYZE TABLE t1;
+
+DROP TABLE t1;
+
+DROP PROCEDURE populate_t1;
+
+SET GLOBAL innodb_stats_persistent_sample_pages=default;
index e1e5b856aca67769fe634845c2bcb64889efe3e7..dcdf062de29a64aebe0b47aebc2a88872f6a6cd0 100644 (file)
@@ -1,4 +1,6 @@
+--source include/have_debug.inc
 --source include/have_innodb.inc
+--source include/have_innodb_16k.inc 
 
 --echo #
 --echo # Bug #18010711 UNIQUE PREFIX INDEX ON BINARY COLUMN: FAILING
@@ -9,3 +11,31 @@ insert into t1 values ('w'), ('w');
 --error ER_DUP_ENTRY
 create unique index index_t1 on t1(f1(4));
 drop table t1;
+
+--echo #
+--echo #BUG#21326304 INNODB ONLINE ATER TABLE ENDS IN CRASH ON DISK FULL
+--echo #
+CREATE TABLE t1(f1 CHAR(255) NOT NULL, f2 CHAR(255) NOT NULL, f3
+CHAR(255) NOT NULL, f4 CHAR(255) NOT NULL, f5 CHAR(255) NOT NULL,f6
+CHAR(255) NOT NULL, f7 CHAR(255) NOT NULL, f8 CHAR(255) NOT NULL,f9
+CHAR(255) NOT NULL, f10 CHAR(255) NOT NULL, f11 CHAR(255) NOT NULL,f12
+CHAR(255) NOT NULL, f13 CHAR(255) NOT NULL, f14 CHAR(255) NOT NULL,f15
+CHAR(255) NOT NULL, f16 CHAR(255) NOT NULL, f17 CHAR(255) NOT NULL,f18
+CHAR(255) NOT NULL)ENGINE=INNODB;
+
+INSERT INTO t1
+VALUES('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r');
+
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+
+SET SESSION debug="+d,disk_is_full";
+
+--error ER_RECORD_FILE_FULL
+ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
+
+SET SESSION debug="-d,disk_is_full";
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/create_isl_with_direct-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/create_isl_with_direct-master.opt
new file mode 100644 (file)
index 0000000..8f80f02
--- /dev/null
@@ -0,0 +1 @@
+--innodb_flush_method=O_DIRECT
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/create_isl_with_direct.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/create_isl_with_direct.test
new file mode 100644 (file)
index 0000000..6ad0cbc
--- /dev/null
@@ -0,0 +1,27 @@
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/not_windows.inc
+
+--disable_query_log
+CALL mtr.add_suppression("\\[Warning\\] InnoDB: Failed to set O_DIRECT on file ./ibdata1: OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662.");
+
+# The below mtr suppression to avoid failure in solaris platform.
+CALL mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to set DIRECTIO_ON on file.*");
+--enable_query_log
+
+SHOW VARIABLES LIKE 'innodb_flush_method';
+
+let MYSQLD_DATADIR=`SELECT @@datadir`;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+
+#  Create a table with explicit data directory option.
+EVAL CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='$MYSQL_TMP_DIR';
+
+--echo # Contents of tmp/test directory containing .ibd file
+--list_files $MYSQL_TMP_DIR/test
+
+--echo # Contents of the 'test' database directory containing .isl and .frm files
+--list_files $MYSQLD_DATADIR/test
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/dropdb.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/dropdb.test
new file mode 100644 (file)
index 0000000..066fc17
--- /dev/null
@@ -0,0 +1,11 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE
+--echo #
+
+create database `b`;
+use `b`;
+--error ER_GET_ERRNO
+create table `#mysql50#q.q` (f1 int primary key) engine=innodb;
+drop database `b`;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/galera.skip b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/galera.skip
new file mode 100644 (file)
index 0000000..d7bfe0c
--- /dev/null
@@ -0,0 +1,45 @@
+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
+innodb-lock-inherit-read_commited :  Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT
+innodb-index-debug : Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/import.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/import.test
new file mode 100644 (file)
index 0000000..2f682db
--- /dev/null
@@ -0,0 +1,25 @@
+# Test "ALTER TABLE ... IMPORT TABLESPACE" in InnoDB
+--source include/have_innodb.inc
+
+--echo #
+--echo # Bug#20977779 CANNOT IMPORT TABLES CONTAINING PREFIX INDEXES
+--echo #
+
+CREATE TABLE t1 (c1 VARCHAR(32), c2 VARCHAR(32), c3 VARCHAR(32),
+PRIMARY KEY (c1, c2, c3))
+ENGINE=InnoDB;
+
+ALTER TABLE t1 ADD INDEX ind1(c1(5), c2, c3);
+ALTER TABLE t1 ADD INDEX ind2(c3, c1(10), c2);
+ALTER TABLE t1 ADD INDEX ind3(c2, c3, c1(20));
+
+INSERT INTO t1 VALUES ('Test Data -1', 'Test Data -2', 'Test Data -3');
+
+--echo # Test with 2ndary index having prefix
+--source suite/innodb/include/import.inc
+
+--echo # Test with PK & 2ndary index with prefix
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c1(5), c2(10), c3(20));
+--source suite/innodb/include/import.inc
+
+DROP TABLE t1;
index 48cef81df7ee250bf27deebe5737d4b7f4c435b8..5ab32ed14dabb1ec414dc905624921baf4514dac 100644 (file)
@@ -1,5 +1,8 @@
 --source include/have_innodb.inc
 --source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+--source include/count_sessions.inc
 
 SET NAMES utf8;
 
@@ -26,3 +29,49 @@ SET DEBUG = '-d,ib_rename_column_error';
 SHOW CREATE TABLE t1ć;
 
 DROP TABLE t1ć, ①;
+
+--echo #
+--echo # Bug #21364096  THE BOGUS DUPLICATE KEY ERROR IN ONLINE DDL
+--echo #                WITH INCORRECT KEY NAME
+
+create table t1 (id int auto_increment primary key, a int, unique key uk(a))
+engine = innodb;
+insert into t1 select 1, 1;
+insert into t1 select 2, 2;
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
+--send alter table t1 add b int, ALGORITHM=inplace
+
+--echo /* connection con1 */
+connect (con1,localhost,root,,);
+SET DEBUG_SYNC = 'now WAIT_FOR s1';
+--error ER_DUP_ENTRY
+insert into t1 select NULL, 1;
+SET DEBUG_SYNC = 'now SIGNAL s2';
+
+--echo /* connection default */
+connection default;
+--echo /* reap */ alter table t1 add b int, ALGORITHM=inplace;
+--error ER_DUP_ENTRY
+--reap
+
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
+--send alter table t1 add b int, ALGORITHM=inplace;
+
+--echo /* connection con1 */
+connection con1;
+set DEBUG_SYNC = 'now WAIT_FOR s1';
+--error ER_DUP_ENTRY
+update t1 set a=1 where id=2;
+SET DEBUG_SYNC = 'now SIGNAL s2';
+disconnect con1;
+
+--echo /* connection default */
+connection default;
+--echo /* reap */ alter table t1 add b int, ALGORITHM=inplace;
+--error ER_DUP_ENTRY
+--reap
+
+drop table t1;
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
index 9abc448b02e900ff31b44e6522b6e75599441b5c..ca1252fb4e475a76329bfd6f92b674f710889ee0 100644 (file)
@@ -379,14 +379,25 @@ DROP TABLE tt, t1o, sys_tables, sys_indexes, sys_foreign;
 CREATE TABLE t (t TEXT, FULLTEXT(t)) ENGINE=InnoDB;
 DROP INDEX t ON t;
 
+LET $regexp=/FTS_([0-9a-f_]+)([A-Z_]+)/FTS_AUX_\2/;
+--replace_regex $regexp
+SELECT SUBSTRING(name, LOCATE('_', name) - 3, 5) AS prefix, name
+FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
+WHERE name LIKE '%FTS_%' ORDER BY 1, 2;
+
 SELECT sc.pos, sc.NAME FROM information_schema.innodb_sys_columns sc
 INNER JOIN information_schema.innodb_sys_tables st
 ON sc.TABLE_ID=st.TABLE_ID
 WHERE st.NAME='test/t';
 
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
 ALTER TABLE t ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE;
-ALTER TABLE t ROW_FORMAT=REDUNDANT;
+
+--replace_regex $regexp
+SELECT SUBSTRING(name, LOCATE('_', name) - 3, 5) AS prefix, name
+FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
+WHERE name LIKE '%FTS_%' ORDER BY 1, 2;
+
+ALTER TABLE t ADD FULLTEXT INDEX(t);
 
 SELECT sc.pos, sc.NAME FROM information_schema.innodb_sys_columns sc
 INNER JOIN information_schema.innodb_sys_tables st
@@ -438,3 +449,36 @@ SHOW CREATE TABLE t1;
 CHECK TABLE t1;
 
 DROP TABLE t1, parent;
+
+--echo #
+--echo #BUG#21514135 SCHEMA MISMATCH ERROR WHEN IMPORTING TABLESPACE AFTER
+--echo #DROPPING AN INDEX
+--echo #
+let $source_db = source_db;
+let $dest_db = dest_db;
+
+eval CREATE DATABASE $source_db;
+eval CREATE DATABASE $dest_db;
+
+eval CREATE TABLE $source_db.t1 (
+   id int(11) NOT NULL,
+   age int(11) DEFAULT NULL,
+   name varchar(20),
+   PRIMARY KEY (id),
+   KEY index1 (age)
+   ) ENGINE=InnoDB;
+
+eval ALTER TABLE $source_db.t1 DROP INDEX index1, ADD INDEX index2(name, age), algorithm=inplace;
+
+--source suite/innodb/include/import.inc
+
+eval ALTER TABLE $source_db.t1 DROP INDEX index2, algorithm=inplace;
+
+--source suite/innodb/include/import.inc
+
+eval DROP TABLE $source_db.t1;
+eval DROP DATABASE $source_db;
+eval DROP DATABASE $dest_db;
+
+
+
index 3d9f5916d8cc08a5af0f1d300218470186f99f7d..7cc8065bc87959e53b0bbe7d285343a968f37a27 100644 (file)
@@ -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-wsrep-5.6/mysql-test/suite/innodb/t/innodb-index-debug-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-index-debug-master.opt
new file mode 100644 (file)
index 0000000..778b444
--- /dev/null
@@ -0,0 +1 @@
+--innodb-sort-buffer-size=64k
index 7d8ebd3edc31c1a9fbd7998cf16974b1b3a98dde..8969dc69aa4c9bef401c2c0980fa59ba68277af8 100644 (file)
@@ -48,3 +48,36 @@ DROP TABLE bug13861218;
 eval set global innodb_file_per_table=$per_table;
 eval set global innodb_file_format=$format;
 eval set global innodb_file_format_max=$format;
+
+--echo #
+--echo # Bug #21762319 ADDING INDEXES ON EMPTY TABLE IS SLOW
+--echo #       WITH LARGE INNODB_SORT_BUFFER_SIZE.
+
+call mtr.add_suppression("InnoDB: Cannot create temporary merge file");
+
+# Table with large data which is greater than sort buffer
+
+create table t480(a serial)engine=innodb;
+insert into t480
+values(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
+(),(),(),(),(),(),(),();
+insert into t480 select 0 from t480;
+insert into t480 select 0 from t480;
+insert into t480 select 0 from t480;
+insert into t480 select 0 from t480;
+create table t1(f1 int auto_increment not null,
+               f2 char(200) not null, f3 char(200) not null,
+               f4 char(200) not null,primary key(f1))engine=innodb;
+insert into t1 select NULL,'aaa','bbb','ccc' from t480;
+insert into t1 select NULL,'aaaa','bbbb','cccc' from t480;
+insert into t1 select NULL,'aaaaa','bbbbb','ccccc' from t480;
+insert into t1 select NULL,'aaaaaa','bbbbbb','cccccc' from t480;
+insert into t1 select NULL,'aaaaaaa','bbbbbbb','ccccccc' from t480;
+insert into t1 select NULL,'aaaaaaaa','bbbbbbbb','cccccccc' from t480;
+select count(*) from t1;
+
+SET DEBUG = '+d,innobase_tmpfile_creation_failure';
+--error ER_OUT_OF_RESOURCES
+alter table t1 force, algorithm=inplace;
+SET DEBUG = '-d,innobase_tmpfile_creation_failure';
+drop table t1, t480;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-lock-inherit-read_commited.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-lock-inherit-read_commited.test
new file mode 100644 (file)
index 0000000..c0bc389
--- /dev/null
@@ -0,0 +1,115 @@
+--echo #
+--echo # Bug #21025880 DUPLICATE UK VALUES IN READ-COMMITTED(AGAIN)
+--echo #
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+let i=0;
+
+while ($i <=1 )
+{
+
+CREATE TABLE t1 (
+       a INT NOT NULL,
+       b INT NOT NULL,
+       PRIMARY KEY(b),
+       UNIQUE KEY(a))
+ENGINE=INNODB;
+
+SET @old_innodb_stats_auto_recalc = @@innodb_stats_auto_recalc;
+SET GLOBAL innodb_stats_auto_recalc = OFF;
+
+# Block purge
+SET GLOBAL innodb_purge_stop_now = ON;
+
+SET @old_tx_isolation = @@tx_isolation;
+SET GLOBAL tx_isolation = 'READ-COMMITTED';
+
+SET @old_innodb_lock_wait_timeout = @@innodb_lock_wait_timeout;
+SET GLOBAL innodb_lock_wait_timeout = 1;
+
+--connect(con1,localhost,root,,)
+--connect(con2,localhost,root,,)
+
+--connection con1
+
+# Create and delete-mark an index record
+
+INSERT INTO t1 VALUES (1,1),(2,2);
+DELETE FROM t1;
+
+SET debug_sync = 'row_ins_sec_index_entry_dup_locks_created SIGNAL
+con1_locks_done WAIT_FOR con1_go';
+SET debug_sync = 'ha_commit_trans_after_acquire_commit_lock SIGNAL
+con1_insert_done WAIT_FOR con1_finish';
+--send
+
+if ($i == 0)
+{
+REPLACE INTO t1 VALUES (1,2);
+}
+
+if ( $i == 1)
+{
+INSERT INTO t1 values (1,2) ON DUPLICATE KEY UPDATE a=2;
+}
+--connection con2
+
+SET debug_sync = 'now WAIT_FOR con1_locks_done';
+
+SET debug_sync = 'lock_wait_suspend_thread_enter SIGNAL con2_blocked
+WAIT_FOR con2_go';
+SET debug_sync = 'ha_commit_trans_after_acquire_commit_lock SIGNAL
+con2_insert_done WAIT_FOR con2_finish';
+SET debug_sync = 'ib_after_row_insert SIGNAL con2_insert_done';
+
+--send
+REPLACE INTO t1 VALUES (1,3);
+
+--connection default
+SET debug_sync = 'now WAIT_FOR con2_blocked';
+
+SET GLOBAL innodb_purge_run_now=ON;
+
+# Wait for purge to delete the delete-marked record
+let $wait_condition=
+    SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+    WHERE VARIABLE_NAME='INNODB_PURGE_TRX_ID_AGE' AND VARIABLE_VALUE=2;
+--source include/wait_condition.inc
+
+SET debug_sync = 'now SIGNAL con2_go WAIT_FOR con2_insert_done';
+SET debug_sync = 'now SIGNAL con1_go WAIT_FOR con1_insert_done';
+
+SET debug_sync = 'now SIGNAL con1_finish';
+SET debug_sync = 'now SIGNAL con2_finish';
+
+--connection con1
+--reap
+
+--connection con2
+--error 0,ER_LOCK_WAIT_TIMEOUT
+--reap
+
+--connection default
+
+--disconnect con1
+--disconnect con2
+
+SELECT * FROM t1;
+CHECK TABLE t1;
+
+DROP TABLE t1;
+
+SET GLOBAL innodb_stats_auto_recalc = @old_innodb_stats_auto_recalc;
+SET GLOBAL tx_isolation = @old_tx_isolation;
+SET GLOBAL innodb_lock_wait_timeout = @old_innodb_lock_wait_timeout;
+
+# Clean up resources used in this test case.
+--disable_warnings
+SET DEBUG_SYNC= 'RESET';
+--enable_warnings
+
+--inc $i
+}
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_autoinc_reset.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_autoinc_reset.test
new file mode 100644 (file)
index 0000000..b5411e9
--- /dev/null
@@ -0,0 +1,25 @@
+#
+# BUG#21454472 AUTO-INCREMENT SEQUENCE GETS RESET
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+CREATE TABLE t1 (
+  id    INT AUTO_INCREMENT PRIMARY KEY,
+  name  VARCHAR(100)
+) ENGINE=InnoDB AUTO_INCREMENT=99;
+
+SET GLOBAL debug="+d,innodb_evict_autoinc_table";
+
+# Evict t1 from dictionary cache
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_ft_aux_table="test/t1";
+
+SET GLOBAL debug="-d,innodb_evict_autoinc_table";
+
+INSERT INTO t1(name) VALUES('mysql');
+
+SELECT * FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60229-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60229-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
index 8dcf15157d694974005a8dd332b3df6029d3dd02..aee0b96a94290ce1a8d363b58193f3af2279384a 100644 (file)
@@ -2,6 +2,10 @@
 # Bug #13083023 - 60229: BROKEN COMPATIBILITY: ERROR WHILE CREATE TABLE
 # WITH FOREIGN KEY CONSTRAINT.
 
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 -- source include/have_innodb.inc
 
 CREATE TABLE PERSON (
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_file_limit_check-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_file_limit_check-master.opt
new file mode 100644 (file)
index 0000000..e5636da
--- /dev/null
@@ -0,0 +1 @@
+--no-console --log-error=$MYSQLTEST_VARDIR/tmp/innodb_file_limit.err
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_file_limit_check.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_file_limit_check.test
new file mode 100644 (file)
index 0000000..af24bd5
--- /dev/null
@@ -0,0 +1,31 @@
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+--source include/big_test.inc
+
+CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit.");
+
+CREATE TABLE t1 (a INT)ENGINE=INNODB PARTITION BY HASH(a) PARTITIONS 1024;
+
+let $innodb_file_limit= `SELECT @@open_files_limit`;
+inc $innodb_file_limit;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+--enable_reconnect
+
+--exec echo "restart: --innodb_open_files=$innodb_file_limit --no-console --log-error=$MYSQLTEST_VARDIR/tmp/innodb_file_limit.err" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/innodb_file_limit.err;
+let SEARCH_PATTERN= innodb_open_files should not be greater than the open_files_limit.;
+--source include/search_pattern_in_file.inc
+
+SELECT 1 UNION SELECT * FROM t1  UNION SELECT * FROM t1  UNION
+SELECT * FROM t1  UNION SELECT * FROM t1  UNION SELECT * FROM
+t1;
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_force_recovery.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_force_recovery.test
new file mode 100644 (file)
index 0000000..0feeafd
--- /dev/null
@@ -0,0 +1,73 @@
+# Not supported in embedded
+--source include/not_embedded.inc
+
+# This test case needs InnoDB.
+-- source include/have_innodb.inc
+
+call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'".*".".*"\' in the cache');
+call mtr.add_suppression('InnoDB: Allocated tablespace [0-9]+, old maximum was [0-9]+');
+
+create table t1(f1 int not null, f2 int not null, index idx(f2))engine=innodb;
+insert into t1 values(1, 2);
+
+SET GLOBAL innodb_fast_shutdown = 0;
+
+# Restart the server in force recovery mode
+--echo # Stop server
+
+# Write file to make mysql-test-run.pl wait for the server to stop
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Request shutdown
+-- send_shutdown
+
+# Call script that will poll the server waiting for it to disapear
+-- source include/wait_until_disconnected.inc
+
+--echo # Restart server.
+
+# Write file to make mysql-test-run.pl start up the server again, ensure
+# that no background threads are started, so that we can check that it
+# shuts down properly.
+--exec echo "restart:--innodb-force-recovery=4" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Turn on reconnect
+--enable_reconnect
+
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
+
+# Turn off reconnect again
+--disable_reconnect
+
+select * from t1;
+
+--error ER_OPEN_AS_READONLY
+insert into t1 values(2, 3);
+
+--error ER_INNODB_READ_ONLY
+alter table t1 add f3 int not null, algorithm=copy;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t1 add f3 int not null, algorithm=inplace;
+
+--error ER_INNODB_READ_ONLY
+drop index idx on t1;
+
+--error ER_OPEN_AS_READONLY
+update t1 set f1=3 where f2=2;
+
+--error ER_INNODB_READ_ONLY
+create table t3(f1 int not null)engine=innodb;
+
+--error ER_BAD_TABLE_ERROR
+drop table t3;
+
+--error ER_ERROR_ON_RENAME
+rename table t1 to t3;
+
+--error ER_OPEN_AS_READONLY
+truncate table t1;
+
+drop table t1;
+show tables;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_monitor.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_monitor.test
deleted file mode 100644 (file)
index 864e0ca..0000000
+++ /dev/null
@@ -1,387 +0,0 @@
-# This is the test for Metrics Monitor Table feature.
-# Test the metrics monitor system's control system
-# and counter accuracy.
-
---source include/have_innodb.inc
-
-set global innodb_monitor_disable = All;
-
-# Test turn on/off the monitor counter  with "all" option
-# By default, they will be off
-select name, status from information_schema.innodb_metrics;
-
-# Turn on all monitor counters
-set global innodb_monitor_enable = all;
-
-# status should all change to "enabled"
-select name from information_schema.innodb_metrics where status!='enabled';
-
-# Test wrong argument to the global configure option
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_monitor_enable = aaa;
-
-# We require a valid monitor counter/module name. There is no default
-# counter name or module. A warning will be printed asking user to
-# specify a valid counter name.
-#--disable_warnings
-#set global innodb_monitor_enable = default;
-#--enable_warnings
-
-# Turn off all monitor counters, option name should be case
-# insensitive
-set global innodb_monitor_disable = All;
-
-# status should all change to "disabled"
-select name from information_schema.innodb_metrics where status!='disabled';
-
-# Reset all counter values
-set global innodb_monitor_reset_all = all;
-
-# count should all change to 0
-select name from information_schema.innodb_metrics where count!=0;
-
-# Test wildcard match, turn on all counters contain string "lock"
-set  global innodb_monitor_enable = "%lock%";
-
-# All lock related counter should be enabled
-select name from information_schema.innodb_metrics
-where status != IF(name like "%lock%", 'enabled', 'disabled');
-
-# Disable them
-set  global innodb_monitor_disable = "%lock%";
-
-# All lock related counter should be disabled
-select name, status from information_schema.innodb_metrics
-where name like "%lock%";
-
-# No match for "%lock*"
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_monitor_enable = "%lock*";
-
-# All counters will be turned on with wildcard match string with all "%"
-set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
-
-select name from information_schema.innodb_metrics where status!='enabled';
-
-# Turn off all counters
-set global innodb_monitor_disable="%%%%%";
-
-select name from information_schema.innodb_metrics where status!='disabled';
-
-# One more round testing. All counters will be turned on with
-# single wildcard character "%"
-set global innodb_monitor_enable="%";
-
-select name from information_schema.innodb_metrics where status!='enabled';
-
-# Turn off all the counters with "%_%"
-set global innodb_monitor_disable="%_%";
-
-select name from information_schema.innodb_metrics where status!='disabled';
-
-# Turn on all counters start with "log"
-set global innodb_monitor_enable="log%%%%";
-
-select name from information_schema.innodb_metrics
-where status != IF(name like "log%", 'enabled', 'disabled');
-
-# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
-# is single character wildcard match word
-set global innodb_monitor_enable="os_%a_fs_ncs";
-
-# Turn on counters whose name contains "os" and "pending" with
-# wildcard match "os%pending%"
-set global innodb_monitor_enable="os%pending%";
-
-select name, status from information_schema.innodb_metrics
-where name like "os%";
-
-# Empty string is an invalid option
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_monitor_enable="";
-
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_monitor_enable="_";
-
-# Reset counters only in "module_metadata" module
-set global innodb_monitor_disable = module_metadata;
-
-set global innodb_monitor_reset_all = module_metadata;
-
-# Only turn on "table_open" counter
-set global innodb_monitor_enable = metadata_table_handles_opened;
-
-# Create a new table to test "metadata_table_handles_opened" counter
-create table monitor_test(col int) engine = innodb;
-
-# This will open the monitor_test table
-select * from monitor_test;
-
-# "metadata_table_handles_opened" should increment by 1
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-
-# Reset the counter value while counter is still on (started)
-# This will reset value "count_reset" but not
-# "count"
-set global innodb_monitor_reset = metadata_table_handles_opened;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-
-# re-create table again to increment "metadata_table_handles_opened" again
-drop table monitor_test;
-
-# Create a new table to test "metadata_table_handles_opened" counter
-create table monitor_test(col int) engine = innodb;
-
-select * from monitor_test;
-
-# "metadata_table_handles_opened" should increment
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-
-# Cannot reset all monitor value while the counter is on
-set global innodb_monitor_reset_all = metadata_table_handles_opened;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-
-# Turn off the counter "metadata_table_handles_opened"
-set global innodb_monitor_disable = metadata_table_handles_opened;
-
-# Reset the counter value while counter is off (disabled)
-set global innodb_monitor_reset = metadata_table_handles_opened;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-
-# re-create table again. Since monitor is off, "metadata_table_handles_opened"
-# should not be incremented
-drop table monitor_test;
-
-# Create a new table to test "metadata_table_handles_opened" counter
-create table monitor_test(col int) engine = innodb;
-
-# "metadata_table_handles_opened" should increment
-select * from monitor_test;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-
-# Reset all the counters, include those counter *_since_start
-set global innodb_monitor_reset_all = metadata_table_handles_opened;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-
-# Turn on "table_open" counter again
-set global innodb_monitor_enable = metadata_table_handles_opened;
-
-# Test metadata_table_handles_opened again to see if it is working correctly
-# after above round of turning on/off/reset
-drop table monitor_test;
-
-# Create a new table to test "metadata_table_handles_opened" counter
-create table monitor_test(col int) engine = innodb stats_persistent=0;
-
-select * from monitor_test;
-
-# "metadata_table_handles_opened" should increment
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_opened";
-
-# Test counter "metadata_table_handles_closed",
-# create index will close the old handle
-set global innodb_monitor_enable = metadata_table_handles_closed;
-
-create index idx on monitor_test(col);
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name = "metadata_table_handles_closed";
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "metadata%";
-
-# Reset counters only in "module_metadata" module
-set global innodb_monitor_disable = module_metadata;
-
-set global innodb_monitor_reset = module_metadata;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "metadata%";
-
-set global innodb_monitor_reset_all = module_metadata;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "metadata%";
-
-# Test Transaction Module
-set global innodb_monitor_enable = module_trx;
-
-begin;
-insert into monitor_test values(9);
-commit;
-
-begin;
-insert into monitor_test values(9);
-rollback;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "trx_rollbacks" or name like "trx_active_transactions";
-
-set global innodb_monitor_disable = module_trx;
-
-# Test DML Module
-set global innodb_monitor_enable = module_dml;
-
-insert into monitor_test values(9);
-
-update monitor_test set col = 10 where col = 9;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-
-delete from monitor_test;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-       from information_schema.innodb_metrics
-       where name like "dml%";
-
-# test reset counter while the counter is on
-set global innodb_monitor_reset =  module_dml;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-
-# insert/delete some rows after the reset
-insert into monitor_test values(9);
-insert into monitor_test values(1);
-
-delete from monitor_test;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-
-# We do not allow reset_all while the counter is on, nothing
-# should be reset here
-set global innodb_monitor_reset_all  =  module_dml;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-
-# Turn off the counter
-set global innodb_monitor_disable = module_dml;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-
-# Reset all counter values
-set global innodb_monitor_reset_all  = module_dml;
-
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-
-# Open individual counter "dml_inserts"
-set global innodb_monitor_enable = dml_inserts;
-
-insert into monitor_test values(9);
-insert into monitor_test values(1);
-
-delete from monitor_test;
-
-# Only counter "dml_inserts" should be updated
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "dml%";
-
-set global innodb_monitor_disable = module_dml;
-
-drop table monitor_test;
-
-set global innodb_monitor_enable = file_num_open_files;
-
-# Counters are unpredictable when innodb-file-per-table is on
---replace_column 2 # 3 # 4 # 5 # 6 # 7 #
-select name, max_count, min_count, count,
-       max_count_reset, min_count_reset, count_reset, status
-from information_schema.innodb_metrics
-where name like "file_num_open_files";
-
-set global innodb_monitor_disable = file_num_open_files;
-
-# Test ICP module counters
-set global innodb_monitor_enable = "icp%";
-
-create table monitor_test(a char(3), b int, c char(2),
-primary key (a(1), c(1)), key(b)) engine = innodb;
-
-insert into monitor_test values("13", 2, "aa");
-
-select a from monitor_test where b < 1 for update;
-
-# should have icp_attempts = 1 and icp_out_of_range = 1
-select name, count from information_schema.innodb_metrics
-where name like "icp%";
-
-# should have icp_attempts = 2 and icp_match = 1
-select a from monitor_test where b < 3 for update;
-
-select name, count from information_schema.innodb_metrics
-where name like "icp%";
-
-drop table monitor_test;
-
-set global innodb_monitor_disable = all;
-set global innodb_monitor_reset_all = all;
-
-# Test for bug #13966091
-select 1 from `information_schema`.`INNODB_METRICS`
-where case (1) when (1) then (AVG_COUNT_RESET) else (1) end;
-
--- disable_warnings
-set global innodb_monitor_enable = default;
-set global innodb_monitor_disable = default;
-set global innodb_monitor_reset = default;
-set global innodb_monitor_reset_all = default;
--- enable_warnings
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/strict_checksum.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/strict_checksum.test
new file mode 100644 (file)
index 0000000..6e3217d
--- /dev/null
@@ -0,0 +1,68 @@
+--echo #
+--echo # Bug #20031570 INNODB_CHECKSUM_ALGORITHM VARIABLE LEADS TO CRASHING
+--echo #
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+# Embedded mode doesn't support restart
+--source include/not_embedded.inc
+
+set global innodb_checksum_algorithm=crc32;
+
+# Table is created with crc32 checksum algorithm.
+# First few pages have crc32 checksum algorithm
+
+create table t1(f1 int not null primary key)engine=innodb;
+
+# Restart the server to load the table t1 again.
+let SEARCH_FILE = $MYSQLTEST_VARDIR/log/my_restart.err;
+--source include/shutdown_mysqld.inc
+
+--echo # Restart the server with --log-error
+--exec echo "restart:--log-error=$MYSQLTEST_VARDIR/log/my_restart.err" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+set global innodb_checksum_algorithm=strict_innodb;
+set global innodb_limit_optimistic_insert_debug = 2;
+
+call mtr.add_suppression("\\[Warning\\] InnoDB: innodb_checksum_algorithm is set to .* but the page .* contains a valid checksum .*.");
+
+# Load the table t1 content with crc32 checksum pages.
+select count(*) from t1;
+
+let SEARCH_PATTERN=\\[Warning\\] InnoDB: innodb_checksum_algorithm is set to "strict_innodb" but the page \\[page id: space=\d+, page number=\d+\\] contains a valid checksum .*. Accepting the page as valid. Change innodb_checksum_algorithm to .* to silently accept such pages or rewrite all pages so that they contain .* checksum.;
+
+--source include/search_pattern_in_file.inc
+
+# Write the records in new pages with innodb checksum format.
+insert into t1 values(2),(3),(4);
+
+# Restart the server to load the table t1 again.
+--source include/shutdown_mysqld.inc
+let SEARCH_FILE = $MYSQLTEST_VARDIR/log/my_restart.err;
+
+--echo # Restart the server with --log-error
+--exec echo "restart:--log-error=$SEARCH_FILE" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+set global innodb_checksum_algorithm=strict_none;
+set global innodb_limit_optimistic_insert_debug = 2;
+
+# Load the table t1 content with crc32, innodb checksum pages.
+select count(*) from t1;
+
+let SEARCH_PATTERN=\\[Warning\\] InnoDB: innodb_checksum_algorithm is set to "strict_none" but the page \\[page id: space=\d+, page number=\d+\\] contains a valid checksum .*. Accepting the page as valid. Change innodb_checksum_algorithm to .* to silently accept such pages or rewrite all pages so that they contain .* checksum.;
+
+--source include/search_pattern_in_file.inc
+
+# Write the records in new pages with none checksum format.
+insert into t1 values(5),(6),(7);
+
+# Restart the server to load the table t1 again.
+--source include/restart_mysqld.inc
+
+# Load the table t1 content with crc32, innodb, none checksum pages.
+select count(*) from t1;
+drop table t1;
+--remove_file $SEARCH_FILE
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/tmpdir.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/tmpdir.test
new file mode 100644 (file)
index 0000000..9677a61
--- /dev/null
@@ -0,0 +1,63 @@
+--source include/have_innodb.inc
+--source include/count_sessions.inc
+
+--echo #
+--echo # Bug #19183565 CREATE DYNAMIC INNODB_TMPDIR VARIABLE TO CONTROL
+--echo #               WHERE INNODB WRITES TEMP FILES
+--echo #
+
+--echo # If innodb_tmpdir is NULL or "", temporary file will be created in
+--echo # server configuration variable location(--tmpdir)
+
+create table t1(a int primary key)engine=innodb;
+show session variables like 'innodb_tmpdir';
+alter table t1 add column b int not null;
+set global innodb_tmpdir=NULL;
+--echo # Connection con1
+connect (con1,localhost,root);
+show session variables like 'innodb_tmpdir';
+alter table t1 add key(b);
+connection default;
+disconnect con1;
+drop table t1;
+
+--echo # innodb_tmpdir with invalid path.
+
+create table t1(a int primary key)engine=innodb;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_tmpdir='wrong_value';
+show warnings;
+drop table t1;
+
+
+--echo # innodb_tmpdir with mysql data directory path.
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+create table t1(a text, b text, fulltext(a,b))engine=innodb;
+insert into t1 values('test1', 'test2');
+insert into t1 values('text1', 'text2');
+--replace_result $MYSQLD_DATADIR MYSQL_DATADIR
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_tmpdir = @@global.datadir;
+--replace_regex /.*mysqld.1/DATADIR/
+show warnings;
+drop table t1;
+
+--echo # innodb_tmpdir with valid location.
+let $MYSQL_TMP_DIR= `select @@tmpdir`;
+create table t1(a text, b text, fulltext(a,b))engine=innodb;
+insert into t1 values('test1', 'test2');
+insert into t1 values('text1', 'text2');
+set @tmpdir = @@global.tmpdir;
+set global innodb_tmpdir = @tmpdir;
+show session variables like 'innodb_tmpdir';
+--echo # Connection con3
+connect (con3,localhost,root);
+# Following alter using innodb_tmpdir as a path to create temporary files
+alter table t1 add fulltext(b);
+disconnect con3;
+connection default;
+set global innodb_tmpdir=NULL;
+drop table t1;
+
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/xa_recovery.test
new file mode 100644 (file)
index 0000000..62683a2
--- /dev/null
@@ -0,0 +1,43 @@
+--source include/have_innodb.inc
+# Embedded server does not support restarting.
+--source include/not_embedded.inc
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+connect (con1,localhost,root);
+XA START 'x'; UPDATE t1 set a=2; XA END 'x'; XA PREPARE 'x';
+connection default;
+
+call mtr.add_suppression("Found 1 prepared XA transactions");
+
+# Kill and restart the server.
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server 0
+-- source include/wait_until_disconnected.inc
+
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+-- disable_reconnect
+
+disconnect con1;
+connect (con1,localhost,root);
+--send SELECT * FROM t1 LOCK IN SHARE MODE
+
+connection default;
+let $wait_condition=
+  select count(*) = 1 from information_schema.processlist
+  where state = 'Sending data' and
+        info = 'SELECT * FROM t1 LOCK IN SHARE MODE';
+--source include/wait_condition.inc
+
+--source include/restart_mysqld.inc
+
+disconnect con1;
+
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t1;
+XA ROLLBACK 'x';
+SELECT * FROM t1;
+
+DROP TABLE t1;
index 73c127d5879a9bd548564282eeeead641cec549f..993fb8f1c19bc4ddae1ff92403c8fddbd94a162a 100644 (file)
@@ -146,6 +146,7 @@ ERROR HY000: The table does not have FULLTEXT index to support this query
 SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5');
 ERROR HY000: The table does not have FULLTEXT index to support this query
 ALTER TABLE t1 ADD FULLTEXT(b);
+ERROR HY000: Index corrupt: Fulltext index 'AB' is corrupt. you should drop this index first.
 # Restart the server
 SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2');
 ERROR HY000: The table does not have FULLTEXT index to support this query
index fc1be3e23b7e28f6f87ee15bd9df76fbbf35f6ee..7a4401ade013f19a44c581aef79ab96c4ca3c5a2 100644 (file)
@@ -147,6 +147,7 @@ ERROR HY000: The table does not have FULLTEXT index to support this query
 SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5');
 ERROR HY000: The table does not have FULLTEXT index to support this query
 ALTER TABLE t1 ADD FULLTEXT(b);
+ERROR HY000: Index corrupt: Fulltext index 'AB' is corrupt. you should drop this index first.
 # Restart the server
 SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2');
 ERROR HY000: The table does not have FULLTEXT index to support this query
index 568146f9288a699dd7d71ee2ee8eef12444ceb68..b75b0e52006bd09751be4853f7f447b9487f58d0 100644 (file)
@@ -498,7 +498,7 @@ MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
 DROP TABLE t1;
 CREATE TABLE t1(a TEXT) ENGINE = InnoDB;
 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)) ENGINE = InnoDB;
 INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd');
index b7ccf54cc3af9a46b4e423687c98a325cc483ebc..345a4c965a29f6f5145c7e283f8405ce434c78bf 100644 (file)
@@ -118,6 +118,9 @@ SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abcd' IN BOOLEAN MODE);
 ERROR HY000: Can't find FULLTEXT index matching the column list
 DROP TABLE t1;
 create table t1 (a varchar(10), key(a), fulltext (a)) ENGINE = InnoDB;
+analyze table t1;
+Table  Op      Msg_type        Msg_text
+test.t1        analyze status  OK
 insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
 select * from t1 where a like "abc%";
 a
@@ -186,3 +189,115 @@ b
 2
 DROP TABLE t1,t2;
 End of 5.1 tests
+# Bug #19950568 WRONG RELEVANCE RANKING FOR INNODB FULL TEXT
+#               SEARCHES UNDER CERTAIN CONDITIONS
+#
+CREATE TABLE t1 (
+id int(11) NOT NULL AUTO_INCREMENT,
+first_name VARCHAR(50) NOT NULL,
+last_name VARCHAR(50) NOT NULL,
+PRIMARY KEY (id),
+UNIQUE KEY idx_1 (first_name, last_name),
+FULLTEXT KEY `idx_2` (first_name)
+) ENGINE=InnoDB;
+INSERT INTO t1 (id, first_name, last_name) VALUES
+(1, 'Bart', 'Simpson'),
+(2, 'Homer', 'Simpson'),
+(3, 'Marge', 'Simpson'),
+(4, 'Lisa', 'Simpson'),
+(5, 'Maggie', 'Simpson'),
+(6, 'Ned', 'Flanders'),
+(7, 'Nelson', 'Muntz');
+ANALYZE TABLE t1;
+Table  Op      Msg_type        Msg_text
+test.t1        analyze status  OK
+EXPLAIN SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1;
+id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
+1      SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    7       NULL
+SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1;
+id     first_name      last_name       score
+1      Bart    Simpson 0
+2      Homer   Simpson 0.7141907215118408
+3      Marge   Simpson 0
+4      Lisa    Simpson 0
+5      Maggie  Simpson 0
+6      Ned     Flanders        0
+7      Nelson  Muntz   0
+EXPLAIN SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1 ORDER BY id;
+id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
+1      SIMPLE  t1      index   NULL    PRIMARY 4       NULL    7       NULL
+SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1 ORDER BY id;
+id     first_name      last_name       score
+1      Bart    Simpson 0
+2      Homer   Simpson 0.7141907215118408
+3      Marge   Simpson 0
+4      Lisa    Simpson 0
+5      Maggie  Simpson 0
+6      Ned     Flanders        0
+7      Nelson  Muntz   0
+DROP TABLE t1;
+CREATE TABLE t1 (
+FTS_DOC_ID  BIGINT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+id int(11) NOT NULL ,
+first_name VARCHAR(50) NOT NULL,
+last_name VARCHAR(50) NOT NULL,
+PRIMARY KEY (ID),
+UNIQUE KEY (FTS_DOC_ID),
+UNIQUE KEY idx_1 (first_name, last_name),
+FULLTEXT KEY `idx_2` (first_name)
+) ENGINE=InnoDB;
+INSERT INTO t1 (id, first_name, last_name) VALUES
+(1, 'Bart', 'Simpson'),
+(2, 'Homer', 'Simpson'),
+(3, 'Marge', 'Simpson'),
+(4, 'Lisa', 'Simpson'),
+(5, 'Maggie', 'Simpson'),
+(6, 'Ned', 'Flanders'),
+(7, 'Nelson', 'Muntz');
+ANALYZE TABLE t1;
+Table  Op      Msg_type        Msg_text
+test.t1        analyze status  OK
+EXPLAIN SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1;
+id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
+1      SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    7       NULL
+SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1;
+id     first_name      last_name       score
+1      Bart    Simpson 0
+2      Homer   Simpson 0.7141907215118408
+3      Marge   Simpson 0
+4      Lisa    Simpson 0
+5      Maggie  Simpson 0
+6      Ned     Flanders        0
+7      Nelson  Muntz   0
+EXPLAIN SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1 ORDER BY fts_doc_id;
+id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
+1      SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    7       Using filesort
+SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1 ORDER BY fts_doc_id;
+id     first_name      last_name       score
+1      Bart    Simpson 0
+2      Homer   Simpson 0.7141907215118408
+3      Marge   Simpson 0
+4      Lisa    Simpson 0
+5      Maggie  Simpson 0
+6      Ned     Flanders        0
+7      Nelson  Muntz   0
+DROP TABLE t1;
+# Adding test case for Bug#20261601
+CREATE TABLE t1(a INT PRIMARY KEY)ENGINE=INNODB;
+INSERT INTO t1 VALUES(1),(2);
+SELECT (SELECT MATCH(`a`)AGAINST('1') FROM t1) FROM t1;
+ERROR HY000: Can't find FULLTEXT index matching the column list
+SELECT 1, a IN (SELECT a FROM t1) FROM t1;
+1      a IN (SELECT a FROM t1)
+1      1
+1      1
+DROP TABLE t1;
+# End of test for Bug#19950568 and Bug#20261601
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/phrase.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/phrase.result
new file mode 100644 (file)
index 0000000..efcbaea
--- /dev/null
@@ -0,0 +1,84 @@
+CREATE TABLE articles (
+id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+body TEXT,
+FULLTEXT (title,body)
+) ENGINE=InnoDB;
+INSERT INTO articles (title,body) VALUES
+(NULL, 'mysql good database'),
+(NULL, ' mysql good database'),
+('', 'mysql good database'),
+('', ' mysql good database'),
+(' ', 'mysql good database'),
+('mysql', 'good database'),
+('mysql ', 'good database'),
+('mysql', ' good database'),
+('mysql good database', ''),
+('mysql good database', NULL);
+SET GLOBAL innodb_ft_aux_table="test/articles";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+WORD   FIRST_DOC_ID    LAST_DOC_ID     DOC_COUNT       DOC_ID  POSITION
+database       1       10      10      1       11
+database       1       10      10      2       12
+database       1       10      10      3       11
+database       1       10      10      4       12
+database       1       10      10      5       13
+database       1       10      10      6       11
+database       1       10      10      7       12
+database       1       10      10      8       12
+database       1       10      10      9       11
+database       1       10      10      10      11
+good   1       10      10      1       6
+good   1       10      10      2       7
+good   1       10      10      3       6
+good   1       10      10      4       7
+good   1       10      10      5       8
+good   1       10      10      6       6
+good   1       10      10      7       7
+good   1       10      10      8       7
+good   1       10      10      9       6
+good   1       10      10      10      6
+mysql  1       10      10      1       0
+mysql  1       10      10      2       1
+mysql  1       10      10      3       0
+mysql  1       10      10      4       1
+mysql  1       10      10      5       2
+mysql  1       10      10      6       0
+mysql  1       10      10      7       0
+mysql  1       10      10      8       0
+mysql  1       10      10      9       0
+mysql  1       10      10      10      0
+SET GLOBAL innodb_ft_aux_table=default;
+SELECT * FROM articles;
+id     title   body
+1      NULL    mysql good database
+2      NULL     mysql good database
+3              mysql good database
+4               mysql good database
+5              mysql good database
+6      mysql   good database
+7      mysql   good database
+8      mysql    good database
+9      mysql good database     
+10     mysql good database     NULL
+SELECT * FROM articles WHERE MATCH(title, body)
+AGAINST('"mysql good database"' IN BOOLEAN MODE);
+id     title   body
+1      NULL    mysql good database
+2      NULL     mysql good database
+3              mysql good database
+4               mysql good database
+5              mysql good database
+9      mysql good database     
+10     mysql good database     NULL
+SELECT * FROM articles WHERE MATCH(title, body)
+AGAINST('("mysql good database")' IN BOOLEAN MODE);
+id     title   body
+1      NULL    mysql good database
+2      NULL     mysql good database
+3              mysql good database
+4               mysql good database
+5              mysql good database
+9      mysql good database     
+10     mysql good database     NULL
+DROP TABLE articles;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/sync.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/sync.result
new file mode 100644 (file)
index 0000000..e350d12
--- /dev/null
@@ -0,0 +1,102 @@
+# Case 1: Test select and insert(row in both disk and cache)
+CREATE TABLE t1 (
+FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+FULLTEXT(title)
+) ENGINE = InnoDB;
+INSERT INTO t1(title) VALUES('mysql');
+INSERT INTO t1(title) VALUES('database');
+SET SESSION debug="+d,fts_instrument_sync_debug";
+SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR selected';
+INSERT INTO t1(title) VALUES('mysql database');
+SET DEBUG_SYNC= 'now WAIT_FOR written';
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+WORD   FIRST_DOC_ID    LAST_DOC_ID     DOC_COUNT       DOC_ID  POSITION
+database       2       3       2       2       0
+database       2       3       2       3       6
+mysql  1       3       2       1       0
+mysql  1       3       2       3       0
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+WORD   FIRST_DOC_ID    LAST_DOC_ID     DOC_COUNT       DOC_ID  POSITION
+SET GLOBAL innodb_ft_aux_table=default;
+SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+FTS_DOC_ID     title
+1      mysql
+2      database
+SET DEBUG_SYNC= 'now SIGNAL selected';
+/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+SET SESSION debug="-d,fts_instrument_sync_debug";
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+WORD   FIRST_DOC_ID    LAST_DOC_ID     DOC_COUNT       DOC_ID  POSITION
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+WORD   FIRST_DOC_ID    LAST_DOC_ID     DOC_COUNT       DOC_ID  POSITION
+database       2       3       2       2       0
+database       2       3       2       3       6
+mysql  1       3       2       1       0
+mysql  1       3       2       3       0
+SET GLOBAL innodb_ft_aux_table=default;
+SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+FTS_DOC_ID     title
+3      mysql database
+1      mysql
+2      database
+DROP TABLE t1;
+# Case 2: Test insert and insert(sync)
+CREATE TABLE t1 (
+FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+FULLTEXT(title)
+) ENGINE = InnoDB;
+INSERT INTO t1(title) VALUES('mysql');
+INSERT INTO t1(title) VALUES('database');
+SET SESSION debug="+d,fts_instrument_sync_debug";
+SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR inserted';
+INSERT INTO t1(title) VALUES('mysql database');
+SET DEBUG_SYNC= 'now WAIT_FOR written';
+INSERT INTO t1(title) VALUES('mysql database');
+SET DEBUG_SYNC= 'now SIGNAL inserted';
+/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+SET SESSION debug="-d,fts_instrument_sync_debug";
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+WORD   FIRST_DOC_ID    LAST_DOC_ID     DOC_COUNT       DOC_ID  POSITION
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+WORD   FIRST_DOC_ID    LAST_DOC_ID     DOC_COUNT       DOC_ID  POSITION
+database       2       3       2       2       0
+database       2       3       2       3       6
+database       4       4       1       4       6
+mysql  1       4       3       1       0
+mysql  1       4       3       3       0
+mysql  1       4       3       4       0
+SET GLOBAL innodb_ft_aux_table=default;
+SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+FTS_DOC_ID     title
+3      mysql database
+4      mysql database
+1      mysql
+2      database
+DROP TABLE t1;
+# Case 3: Test insert crash recovery
+CREATE TABLE t1 (
+FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+FULLTEXT(title)
+) ENGINE = InnoDB;
+INSERT INTO t1(title) VALUES('database');
+SET SESSION debug="+d,fts_instrument_sync_debug,fts_write_node_crash";
+INSERT INTO t1(title) VALUES('mysql');
+ERROR HY000: Lost connection to MySQL server during query
+After restart
+SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database');
+FTS_DOC_ID     title
+1      database
+SET SESSION debug="+d,fts_instrument_sync_debug";
+INSERT INTO t1(title) VALUES('mysql');
+SET SESSION debug="-d,fts_instrument_sync_debug";
+SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database');
+FTS_DOC_ID     title
+1      database
+2      mysql
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/sync_block.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/sync_block.result
new file mode 100644 (file)
index 0000000..c834ea4
--- /dev/null
@@ -0,0 +1,67 @@
+SET @old_log_output = @@global.log_output;
+SET @old_slow_query_log = @@global.slow_query_log;
+SET @old_general_log = @@global.general_log;
+SET @old_long_query_time = @@global.long_query_time;
+SET @old_binlog_order_commits = @@global.binlog_order_commits;
+SET GLOBAL log_output = 'TABLE';
+SET GLOBAL general_log = 1;
+SET GLOBAL slow_query_log = 1;
+SET GLOBAL long_query_time = 1;
+SET GLOBAL binlog_order_commits = 1;
+# Case 1: Sync blocks DML(insert) on the same table.
+CREATE TABLE t1 (
+FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+FULLTEXT(title)
+) ENGINE = InnoDB;
+SET GLOBAL debug="+d,fts_instrument_sync_debug,fts_instrument_sync_sleep";
+SET DEBUG_SYNC= 'fts_sync_begin SIGNAL begin WAIT_FOR continue';
+INSERT INTO t1(title) VALUES('mysql database');
+SET DEBUG_SYNC= 'now WAIT_FOR begin';
+SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+SET DEBUG_SYNC= 'now SIGNAL continue';
+/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+/* conneciton con2 */ SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+FTS_DOC_ID     title
+# make con1 & con2 show up in mysql.slow_log
+SELECT SLEEP(2);
+SLEEP(2)
+0
+# slow log results should only contain INSERT INTO t1.
+SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
+sql_text
+INSERT INTO t1(title) VALUES('mysql database')
+SET GLOBAL debug="-d,fts_instrument_sync_debug,fts_instrument_sync_sleep";
+TRUNCATE TABLE mysql.slow_log;
+DROP TABLE t1;
+# Case 2: Sync blocks DML(insert) on other tables.
+CREATE TABLE t1 (
+FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+FULLTEXT(title)
+) ENGINE = InnoDB;
+CREATE TABLE t2(id INT);
+SET GLOBAL debug="+d,fts_instrument_sync_request,fts_instrument_sync_sleep";
+SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL begin WAIT_FOR continue';
+INSERT INTO t1(title) VALUES('mysql database');
+SET DEBUG_SYNC= 'now WAIT_FOR begin';
+INSERT INTO t2 VALUES(1);
+SET DEBUG_SYNC= 'now SIGNAL continue';
+/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+/* conneciton con2 */ INSERT INTO t2 VALUES(1);
+# make con1 & con2 show up in mysql.slow_log
+SELECT SLEEP(2);
+SLEEP(2)
+0
+# slow log results should be empty here.
+SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
+sql_text
+SET GLOBAL debug="-d,fts_instrument_sync_request,fts_instrument_sync_sleep";
+TRUNCATE TABLE mysql.slow_log;
+DROP TABLE t1,t2;
+# Restore slow log settings.
+SET GLOBAL log_output = @old_log_output;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+SET GLOBAL long_query_time = @old_long_query_time;
+SET GLOBAL binlog_order_commits = @old_binlog_order_commits;
index 0d5220d4a1a4a39ffcfbfa223a1d5030e76f6e4a..55acbce34f3d715099a2ef2aac8eac47611a9de2 100644 (file)
@@ -111,6 +111,7 @@ SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2');
 --error ER_TABLE_HAS_NO_FT
 SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5');
 
+--error ER_INNODB_INDEX_CORRUPT
 ALTER TABLE t1 ADD FULLTEXT(b);
 
 --echo # Restart the server
index 2f580d7e9eb64e5e5207576fcd092ac89f721850..c016b537808a9d61921a9169561685d53a726a82 100644 (file)
@@ -107,6 +107,7 @@ SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2');
 --error ER_TABLE_HAS_NO_FT
 SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5');
 
+--error ER_INNODB_INDEX_CORRUPT
 ALTER TABLE t1 ADD FULLTEXT(b);
 
 --echo # Restart the server
index f4e4fadaefe6d30e223e0db27ccf290a98dfd21a..30d3673439acf9b1dd87e74426e696e1580ae9e5 100644 (file)
@@ -146,6 +146,7 @@ DROP TABLE t1;
 # Some other simple tests with the current character set
 #
 create table t1 (a varchar(10), key(a), fulltext (a)) ENGINE = InnoDB;
+analyze table t1;
 insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
 select * from t1 where a like "abc%";
 select * from t1 where a like "test%";
@@ -208,6 +209,89 @@ SELECT * FROM t2 UNION SELECT * FROM t2
 
 DROP TABLE t1,t2;
 
-
 --echo End of 5.1 tests
 
+--echo # Bug #19950568 WRONG RELEVANCE RANKING FOR INNODB FULL TEXT
+--echo #               SEARCHES UNDER CERTAIN CONDITIONS
+--echo #
+
+CREATE TABLE t1 (
+  id int(11) NOT NULL AUTO_INCREMENT,
+  first_name VARCHAR(50) NOT NULL,
+  last_name VARCHAR(50) NOT NULL,
+  PRIMARY KEY (id),
+  UNIQUE KEY idx_1 (first_name, last_name),
+  FULLTEXT KEY `idx_2` (first_name)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (id, first_name, last_name) VALUES
+(1, 'Bart', 'Simpson'),
+(2, 'Homer', 'Simpson'),
+(3, 'Marge', 'Simpson'),
+(4, 'Lisa', 'Simpson'),
+(5, 'Maggie', 'Simpson'),
+(6, 'Ned', 'Flanders'),
+(7, 'Nelson', 'Muntz');
+
+ANALYZE TABLE t1;
+
+let $query= SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1;
+
+eval EXPLAIN $query;
+eval $query;
+
+let $query=SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1 ORDER BY id;
+
+eval EXPLAIN $query;
+eval $query;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+  FTS_DOC_ID  BIGINT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+  id int(11) NOT NULL ,
+  first_name VARCHAR(50) NOT NULL,
+  last_name VARCHAR(50) NOT NULL,
+  PRIMARY KEY (ID),
+  UNIQUE KEY (FTS_DOC_ID),
+  UNIQUE KEY idx_1 (first_name, last_name),
+  FULLTEXT KEY `idx_2` (first_name)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (id, first_name, last_name) VALUES
+(1, 'Bart', 'Simpson'),
+(2, 'Homer', 'Simpson'),
+(3, 'Marge', 'Simpson'),
+(4, 'Lisa', 'Simpson'),
+(5, 'Maggie', 'Simpson'),
+(6, 'Ned', 'Flanders'),
+(7, 'Nelson', 'Muntz');
+
+ANALYZE TABLE t1;
+
+let $query=SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+ BOOLEAN MODE) AS score FROM t1;
+
+eval EXPLAIN $query;
+eval $query;
+
+let $query=SELECT id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN
+BOOLEAN MODE) AS score FROM t1 ORDER BY fts_doc_id;
+
+eval EXPLAIN $query;
+eval $query;
+
+DROP TABLE t1;
+
+--echo # Adding test case for Bug#20261601
+
+CREATE TABLE t1(a INT PRIMARY KEY)ENGINE=INNODB;
+INSERT INTO t1 VALUES(1),(2);
+--error ER_FT_MATCHING_KEY_NOT_FOUND
+SELECT (SELECT MATCH(`a`)AGAINST('1') FROM t1) FROM t1;
+SELECT 1, a IN (SELECT a FROM t1) FROM t1;
+DROP TABLE t1;
+
+--echo # End of test for Bug#19950568 and Bug#20261601
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/phrase.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/phrase.test
new file mode 100644 (file)
index 0000000..d805271
--- /dev/null
@@ -0,0 +1,39 @@
+-- source include/have_innodb.inc
+
+#
+# BUG#20465273 - FULLTEXT SEARCH BEHAVIOUR WITH MYISAM VS. INNODB (WRONG RESULT WITH INNODB)
+#
+
+CREATE TABLE articles (
+       id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+       title VARCHAR(200),
+       body TEXT,
+       FULLTEXT (title,body)
+) ENGINE=InnoDB;
+
+INSERT INTO articles (title,body) VALUES
+       (NULL, 'mysql good database'),
+       (NULL, ' mysql good database'),
+       ('', 'mysql good database'),
+       ('', ' mysql good database'),
+       (' ', 'mysql good database'),
+       ('mysql', 'good database'),
+       ('mysql ', 'good database'),
+       ('mysql', ' good database'),
+       ('mysql good database', ''),
+       ('mysql good database', NULL);
+       
+
+SET GLOBAL innodb_ft_aux_table="test/articles";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+SET GLOBAL innodb_ft_aux_table=default;
+
+SELECT * FROM articles;
+
+SELECT * FROM articles WHERE MATCH(title, body)
+       AGAINST('"mysql good database"' IN BOOLEAN MODE);
+
+SELECT * FROM articles WHERE MATCH(title, body)
+       AGAINST('("mysql good database")' IN BOOLEAN MODE);
+
+DROP TABLE articles;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/sync.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/sync.test
new file mode 100644 (file)
index 0000000..5b8d05a
--- /dev/null
@@ -0,0 +1,142 @@
+#
+# BUG#22516559 MYSQL INSTANCE STALLS WHEN SYNCING FTS INDEX
+#
+
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source include/not_valgrind.inc
+--source include/not_embedded.inc
+--source include/not_crashrep.inc
+--source include/count_sessions.inc
+
+connect (con1,localhost,root,,);
+connection default;
+
+--echo # Case 1: Test select and insert(row in both disk and cache)
+CREATE TABLE t1 (
+        FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+        title VARCHAR(200),
+        FULLTEXT(title)
+) ENGINE = InnoDB;
+
+INSERT INTO t1(title) VALUES('mysql');
+INSERT INTO t1(title) VALUES('database');
+
+connection con1;
+
+SET SESSION debug="+d,fts_instrument_sync_debug";
+
+SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR selected';
+
+send INSERT INTO t1(title) VALUES('mysql database');
+
+connection default;
+
+SET DEBUG_SYNC= 'now WAIT_FOR written';
+
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+SET GLOBAL innodb_ft_aux_table=default;
+
+SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+
+SET DEBUG_SYNC= 'now SIGNAL selected';
+
+connection con1;
+--echo /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+--reap
+
+SET SESSION debug="-d,fts_instrument_sync_debug";
+
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+SET GLOBAL innodb_ft_aux_table=default;
+
+SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+
+connection default;
+
+DROP TABLE t1;
+
+--echo # Case 2: Test insert and insert(sync)
+CREATE TABLE t1 (
+        FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+        title VARCHAR(200),
+        FULLTEXT(title)
+) ENGINE = InnoDB;
+
+INSERT INTO t1(title) VALUES('mysql');
+INSERT INTO t1(title) VALUES('database');
+
+connection con1;
+
+SET SESSION debug="+d,fts_instrument_sync_debug";
+
+SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR inserted';
+
+send INSERT INTO t1(title) VALUES('mysql database');
+
+connection default;
+
+SET DEBUG_SYNC= 'now WAIT_FOR written';
+
+INSERT INTO t1(title) VALUES('mysql database');
+
+SET DEBUG_SYNC= 'now SIGNAL inserted';
+
+connection con1;
+--echo /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+--reap
+
+SET SESSION debug="-d,fts_instrument_sync_debug";
+
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+SET GLOBAL innodb_ft_aux_table=default;
+
+SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+
+connection default;
+disconnect con1;
+
+DROP TABLE t1;
+
+--echo # Case 3: Test insert crash recovery
+--let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+
+connect (con1,localhost,root,,);
+
+CREATE TABLE t1 (
+        FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+        title VARCHAR(200),
+        FULLTEXT(title)
+) ENGINE = InnoDB;
+
+INSERT INTO t1(title) VALUES('database');
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+SET SESSION debug="+d,fts_instrument_sync_debug,fts_write_node_crash";
+
+--error 2013
+INSERT INTO t1(title) VALUES('mysql');
+
+--source include/start_mysqld.inc
+
+-- echo After restart
+SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database');
+
+SET SESSION debug="+d,fts_instrument_sync_debug";
+
+INSERT INTO t1(title) VALUES('mysql');
+
+SET SESSION debug="-d,fts_instrument_sync_debug";
+
+SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database');
+
+DROP TABLE t1;
+
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/sync_block.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/sync_block.test
new file mode 100644 (file)
index 0000000..adfcb70
--- /dev/null
@@ -0,0 +1,125 @@
+#
+# BUG#22516559 MYSQL INSTANCE STALLS WHEN SYNCING FTS INDEX
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_log_bin.inc
+--source include/count_sessions.inc
+
+SET @old_log_output = @@global.log_output;
+SET @old_slow_query_log = @@global.slow_query_log;
+SET @old_general_log = @@global.general_log;
+SET @old_long_query_time = @@global.long_query_time;
+SET @old_binlog_order_commits = @@global.binlog_order_commits;
+
+SET GLOBAL log_output = 'TABLE';
+SET GLOBAL general_log = 1;
+SET GLOBAL slow_query_log = 1;
+SET GLOBAL long_query_time = 1;
+SET GLOBAL binlog_order_commits = 1;
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connection default;
+
+--echo # Case 1: Sync blocks DML(insert) on the same table.
+CREATE TABLE t1 (
+        FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+        title VARCHAR(200),
+        FULLTEXT(title)
+) ENGINE = InnoDB;
+
+connection con1;
+
+SET GLOBAL debug="+d,fts_instrument_sync_debug,fts_instrument_sync_sleep";
+
+SET DEBUG_SYNC= 'fts_sync_begin SIGNAL begin WAIT_FOR continue';
+
+send INSERT INTO t1(title) VALUES('mysql database');
+
+connection con2;
+
+SET DEBUG_SYNC= 'now WAIT_FOR begin';
+
+send SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+
+connection default;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+connection con1;
+--echo /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+--reap
+
+connection con2;
+--echo /* conneciton con2 */ SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+--reap
+
+connection default;
+-- echo # make con1 & con2 show up in mysql.slow_log
+SELECT SLEEP(2);
+-- echo # slow log results should only contain INSERT INTO t1.
+SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
+
+SET GLOBAL debug="-d,fts_instrument_sync_debug,fts_instrument_sync_sleep";
+TRUNCATE TABLE mysql.slow_log;
+
+DROP TABLE t1;
+
+--echo # Case 2: Sync blocks DML(insert) on other tables.
+CREATE TABLE t1 (
+        FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+        title VARCHAR(200),
+        FULLTEXT(title)
+) ENGINE = InnoDB;
+
+CREATE TABLE t2(id INT);
+
+connection con1;
+
+SET GLOBAL debug="+d,fts_instrument_sync_request,fts_instrument_sync_sleep";
+
+SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL begin WAIT_FOR continue';
+
+send INSERT INTO t1(title) VALUES('mysql database');
+
+connection con2;
+
+SET DEBUG_SYNC= 'now WAIT_FOR begin';
+
+send INSERT INTO t2 VALUES(1);
+
+connection default;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+connection con1;
+--echo /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+--reap
+
+connection con2;
+--echo /* conneciton con2 */ INSERT INTO t2 VALUES(1);
+--reap
+
+connection default;
+-- echo # make con1 & con2 show up in mysql.slow_log
+SELECT SLEEP(2);
+-- echo # slow log results should be empty here.
+SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
+
+SET GLOBAL debug="-d,fts_instrument_sync_request,fts_instrument_sync_sleep";
+TRUNCATE TABLE mysql.slow_log;
+
+DROP TABLE t1,t2;
+
+disconnect con1;
+disconnect con2;
+
+--source include/wait_until_count_sessions.inc
+
+-- echo # Restore slow log settings.
+SET GLOBAL log_output = @old_log_output;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+SET GLOBAL long_query_time = @old_long_query_time;
+SET GLOBAL binlog_order_commits = @old_binlog_order_commits;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/include/innodb_stress.inc b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/include/innodb_stress.inc
new file mode 100644 (file)
index 0000000..54367f5
--- /dev/null
@@ -0,0 +1,183 @@
+# Populate a table with 1000 records. Allow the replica to sync with the master.
+# Run concurrent threads that run OLTP transactions on master.
+# Kill the master database server at random points.
+# Check the table against the replica.
+# Reinvoke the threads.
+
+
+--connection master
+#--let $innodb_index_cluster_optimization_save_master = `SELECT @@innodb_prefix_index_cluster_optimization`
+
+--connection slave
+#--let $innodb_index_cluster_optimization_save_slave = `SELECT @@innodb_prefix_index_cluster_optimization`
+
+# create the directory for temporary log files.
+--exec mkdir -p $MYSQL_TMP_DIR/load_generator
+
+if ($fake_changes)
+{
+  --exec mkdir -p $MYSQL_TMP_DIR/load_generator_slave
+}
+
+--connection master
+
+# since this test generates lot of errors in log, suppress checking errors
+call mtr.add_suppression(".*");
+
+--sync_slave_with_master
+
+--connection master
+--let $pid_file = `SELECT @@pid_file`
+--let $crash_num = 0
+--let $master_host = 127.0.0.1
+--let $table = test
+--let $user = root
+--let $checksum = 0
+--let $secondary_index_checks = 0
+
+if ($do_checksum)
+{
+    # populate the table and store its checksum before any load.
+    let $exec =
+python $MYSQL_BASEDIR/mysql-test/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after
+$num_records 0 0 $user $master_host $MASTER_MYPORT
+$table 0 $max_rows $MYSQL_TMP_DIR/load_generator 0 0 0;
+    exec $exec;
+    let $checksum=query_get_value(CHECKSUM TABLE t1, Checksum, 1);
+    # Master needs to be restarted to start with an empty buffer pool so
+    # that logical read ahead gets used.
+    let rpl_server_number = 1;
+    source include/rpl_restart_server.inc;
+    connection slave;
+    # Start slave to avoid I/O thread retry errors
+    disable_warnings;
+    source include/start_slave.inc;
+    enable_warnings;
+    let $num_records = 0;
+}
+
+while ($num_crashes)
+{
+  connection master;
+  exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+  if ($crash_num)
+  {
+    let $num_records = 0; # do not populate the table except for the first run.
+  }
+
+  if ($use_blob)
+  {
+    let $exec =
+python $MYSQL_BASEDIR/mysql-test/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after
+$num_records  $num_workers $num_transactions $user $master_host $MASTER_MYPORT
+$table 1 $max_rows $MYSQL_TMP_DIR/load_generator 0 $checksum $secondary_index_checks;
+  }
+  if (!$use_blob)
+  {
+    let $exec =
+python $MYSQL_BASEDIR/mysql-test/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after
+$num_records  $num_workers $num_transactions $user $master_host $MASTER_MYPORT
+$table 0 $max_rows $MYSQL_TMP_DIR/load_generator 0 $checksum $secondary_index_checks;
+  }
+
+  exec $exec;
+
+  if ($do_crash)
+  {
+    --echo Wait for reconnect
+    enable_reconnect;
+    # Call script that will poll the server waiting for it to be back online again
+    source include/wait_until_connected_again.inc;
+    connection slave;
+    source include/wait_until_connected_again.inc;
+    connection master;
+  }
+
+  --echo Checksum master
+  let $master_checksum = query_get_value(CHECKSUM TABLE t1, Checksum, 1);
+
+  # if sync_slave_with_master had a configurable timeout this would not be needed
+  let $slave_sync_timeout = 7200;
+  --source include/wait_for_slave_to_sync_with_master.inc
+
+  connection slave;
+  if ($fake_changes)
+  {
+    --echo applying fake updates to the slave
+    let $slave_pid_file = `SELECT @@pid_file`;
+    let $slave_exec =
+python $MYSQL_BASEDIR/mysql-test/suite/innodb_stress/t/load_generator.py $slave_pid_file $kill_db_after
+0  $num_workers $num_transactions $user $master_host $SLAVE_MYPORT
+$table 0 $max_rows $MYSQL_TMP_DIR/load_generator_slave 1 $checksum $secondary_index_checks;
+    exec $slave_exec;
+  }
+  --echo Checksum slave
+  let $slave_checksum=query_get_value(CHECKSUM TABLE t1, Checksum, 1);
+  let $not_same = `SELECT $master_checksum-$slave_checksum`;
+  if ($not_same)
+  {
+    let $msg =
+The checksums of table t1 for master and slave do not match for $crash_num th
+crash. This may happen if there is a corrupt recovery log or a bug in crash
+recovery. You can take a look at the logs in $MYSQL_TMP_DIR/load_generator to see the
+queries issued before the crash.;
+    echo $msg;
+
+    connection master;
+    eval select * into outfile '$MYSQLTEST_VARDIR/tmp/master_all' from t1 order by id;
+    eval select id into outfile '$MYSQLTEST_VARDIR/tmp/master_id' from t1 order by id;
+    show master status;
+
+    connection slave;
+    eval select * into outfile '$MYSQLTEST_VARDIR/tmp/slave_all' from t1 order by id;
+    eval select id into outfile '$MYSQLTEST_VARDIR/tmp/slave_id' from t1 order by id;
+    show slave status;
+
+    die;
+  }
+  dec $num_crashes;
+  inc $crash_num;
+}
+
+# final cleanup
+--connection master
+
+let $primary=`select count(*) from t1 use index (primary)`;
+let $secondary=`select count(*) from t1 use index (msg_i)`;
+if ($primary != $secondary)
+{
+  --echo Secondary index inconsistent!  $primary != $secondary
+  --die
+}
+
+DROP TABLE t1;
+
+# if sync_slave_with_master had a configurable timeout this would not be needed
+let $slave_sync_timeout = 7200;
+--source include/wait_for_slave_to_sync_with_master.inc
+
+--connection slave
+--source include/stop_slave.inc
+# For stress tests sometimes the replication thread can not connect to master
+# temporarily. This is either because the master crashed and it is recovering
+# or the master is too busy and could not service the slave's requests.
+# mtr's internal check requires that there be no errors in slave status.
+# restarting replication clears the errors.
+--source include/start_slave.inc
+--source include/stop_slave.inc
+
+connection master;
+
+# --exec rm -rf $MYSQL_TMP_DIR/load_generator
+
+--connection slave
+# Restore the value of variable on slave
+--disable_query_log
+#eval SET GLOBAL innodb_prefix_index_cluster_optimization = $innodb_index_cluster_optimization_save_slave;
+--enable_query_log
+
+--connection master
+# Restore the value of variable on master
+--disable_query_log
+#eval SET GLOBAL innodb_prefix_index_cluster_optimization = $innodb_index_cluster_optimization_save_master;
+--enable_query_log
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress.result
new file mode 100644 (file)
index 0000000..7f58cda
--- /dev/null
@@ -0,0 +1,28 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_blob.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_blob.result
new file mode 100644 (file)
index 0000000..7b12956
--- /dev/null
@@ -0,0 +1,28 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_blob_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_blob_nocompress.result
new file mode 100644 (file)
index 0000000..c026988
--- /dev/null
@@ -0,0 +1,26 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash.result
new file mode 100644 (file)
index 0000000..fee24ed
--- /dev/null
@@ -0,0 +1,34 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash_blob.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash_blob.result
new file mode 100644 (file)
index 0000000..1bd91a8
--- /dev/null
@@ -0,0 +1,34 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash_blob_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash_blob_nocompress.result
new file mode 100644 (file)
index 0000000..08d7ff8
--- /dev/null
@@ -0,0 +1,32 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_crash_nocompress.result
new file mode 100644 (file)
index 0000000..038863f
--- /dev/null
@@ -0,0 +1,32 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format = Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_bigstress_nocompress.result
new file mode 100644 (file)
index 0000000..3b45951
--- /dev/null
@@ -0,0 +1,26 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress.result
new file mode 100644 (file)
index 0000000..7f58cda
--- /dev/null
@@ -0,0 +1,28 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_blob.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_blob.result
new file mode 100644 (file)
index 0000000..7b12956
--- /dev/null
@@ -0,0 +1,28 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_blob_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_blob_nocompress.result
new file mode 100644 (file)
index 0000000..c026988
--- /dev/null
@@ -0,0 +1,26 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash.result
new file mode 100644 (file)
index 0000000..fee24ed
--- /dev/null
@@ -0,0 +1,34 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash_blob.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash_blob.result
new file mode 100644 (file)
index 0000000..1bd91a8
--- /dev/null
@@ -0,0 +1,34 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash_blob_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash_blob_nocompress.result
new file mode 100644 (file)
index 0000000..08d7ff8
--- /dev/null
@@ -0,0 +1,32 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_crash_nocompress.result
new file mode 100644 (file)
index 0000000..a2faeac
--- /dev/null
@@ -0,0 +1,32 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_hugestress_nocompress.result
new file mode 100644 (file)
index 0000000..3b45951
--- /dev/null
@@ -0,0 +1,26 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress.result
new file mode 100644 (file)
index 0000000..7f58cda
--- /dev/null
@@ -0,0 +1,28 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_blob.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_blob.result
new file mode 100644 (file)
index 0000000..7b12956
--- /dev/null
@@ -0,0 +1,28 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_blob_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_blob_nocompress.result
new file mode 100644 (file)
index 0000000..c026988
--- /dev/null
@@ -0,0 +1,26 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash.result
new file mode 100644 (file)
index 0000000..3faf4da
--- /dev/null
@@ -0,0 +1,29 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash_blob.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash_blob.result
new file mode 100644 (file)
index 0000000..29f8c70
--- /dev/null
@@ -0,0 +1,29 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash_blob_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash_blob_nocompress.result
new file mode 100644 (file)
index 0000000..d43e028
--- /dev/null
@@ -0,0 +1,27 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg longtext,
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_crash_nocompress.result
new file mode 100644 (file)
index 0000000..73fd21d
--- /dev/null
@@ -0,0 +1,27 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Wait for reconnect
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_nocompress.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/r/innodb_stress_nocompress.result
new file mode 100644 (file)
index 0000000..3b45951
--- /dev/null
@@ -0,0 +1,26 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+msg_prefix VARCHAR(255),
+msg VARCHAR(255),
+msg_length int,
+msg_checksum varchar(128),
+KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+call mtr.add_suppression(".*");
+Checksum master
+stop slave;
+start slave;
+Checksum slave
+DROP TABLE t1;
+stop slave;
+start slave;
+include/stop_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/Readme b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/Readme
new file mode 100644 (file)
index 0000000..bb2786f
--- /dev/null
@@ -0,0 +1,5 @@
+The hugestress* testcase takes lot of time , hence run with the following options
+
+./mtr  --suite=innodb_stress --force --big-test --testcase-timeout=5000 --suite-timeout=500 innodb_hugestress*.test
+
+For remaining testcases , no need to pass any options while running.
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress.test
new file mode 100644 (file)
index 0000000..1388238
--- /dev/null
@@ -0,0 +1,41 @@
+# stress tests: blobs=no, crash=no, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `select @@basedir`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=0;
+let $do_crash=0;
+let $do_compress=1;
+
+--let $num_crashes = 1
+--let $num_workers = 10
+--let $num_transactions = 5000
+--let $kill_db_after = 0
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob.test
new file mode 100644 (file)
index 0000000..9e4dbd9
--- /dev/null
@@ -0,0 +1,41 @@
+# stress tests: blobs=yes, crash=no, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=1;
+let $do_compress=1;
+let $do_crash=0;
+
+--let $num_crashes = 1
+--let $num_workers = 10
+--let $num_transactions = 2000
+--let $kill_db_after = 0
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob_nocompress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_blob_nocompress.test
new file mode 100644 (file)
index 0000000..1311c01
--- /dev/null
@@ -0,0 +1,40 @@
+# stress tests: blobs=yes, crash=no, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=1;
+let $do_crash=0;
+let $do_compress=0;
+
+--let $num_crashes = 1
+--let $num_workers = 10
+--let $num_transactions = 2000
+--let $kill_db_after = 0
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash.test
new file mode 100644 (file)
index 0000000..43cbcc1
--- /dev/null
@@ -0,0 +1,41 @@
+# stress tests: blobs=no, crash=yes, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=0;
+let $do_crash=1;
+let $do_compress=1;
+
+--let $num_crashes = 2
+--let $num_workers = 20
+--let $num_transactions = 0
+--let $kill_db_after = 90
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob.test
new file mode 100644 (file)
index 0000000..f3a07d6
--- /dev/null
@@ -0,0 +1,41 @@
+# stress tests: blobs=yes, crash=yes, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=1;
+let $do_crash=1;
+let $do_compress=1;
+
+--let $num_crashes = 2
+--let $num_workers = 20
+--let $num_transactions = 0
+--let $kill_db_after = 90
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob_nocompress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_blob_nocompress.test
new file mode 100644 (file)
index 0000000..6f7089b
--- /dev/null
@@ -0,0 +1,39 @@
+# stress tests: blobs=yes, crash=yes, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=1;
+let $do_crash=1;
+let $do_compress=0;
+
+--let $num_crashes = 2
+--let $num_workers = 20
+--let $num_transactions = 0
+--let $kill_db_after = 90
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_nocompress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_crash_nocompress.test
new file mode 100644 (file)
index 0000000..54b0cce
--- /dev/null
@@ -0,0 +1,40 @@
+# stress tests: blobs=no, crash=yes, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=0;
+let $do_crash=1;
+let $do_compress=0;
+
+--let $num_crashes = 2
+--let $num_workers = 20
+--let $num_transactions = 0
+--let $kill_db_after = 90
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format = Default;
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_nocompress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_bigstress_nocompress.test
new file mode 100644 (file)
index 0000000..85d6ea5
--- /dev/null
@@ -0,0 +1,39 @@
+# stress tests: blobs=no, crash=no, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `select @@basedir`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=0;
+let $do_crash=0;
+let $do_compress=0;
+
+--let $num_crashes = 1
+--let $num_workers = 10
+--let $num_transactions = 2000
+--let $kill_db_after = 0
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress.test
new file mode 100644 (file)
index 0000000..d8b121b
--- /dev/null
@@ -0,0 +1,44 @@
+# stress tests: blobs=no, crash=no, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+# Too heavy for testing in debug mode
+--source include/have_nodebug.inc
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=0;
+let $do_crash=0;
+let $do_compress=1;
+
+--let $num_crashes = 1
+--let $num_workers = 20
+--let $num_transactions = 50000
+--let $kill_db_after = 0
+--let $num_records = 10000
+--let $max_rows = 200000
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob.test
new file mode 100644 (file)
index 0000000..5a69613
--- /dev/null
@@ -0,0 +1,44 @@
+# stress tests: blobs=yes, crash=no, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+# Too heavy for testing in debug mode
+--source include/have_nodebug.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=1;
+let $do_compress=1;
+let $do_crash=0;
+
+--let $num_crashes = 1
+--let $num_workers = 20
+--let $num_transactions = 10000
+--let $kill_db_after = 0
+--let $num_records = 10000
+--let $max_rows = 200000
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob_nocompress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_blob_nocompress.test
new file mode 100644 (file)
index 0000000..c8ea48a
--- /dev/null
@@ -0,0 +1,42 @@
+# stress tests: blobs=yes, crash=no, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+# Too heavy for testing in debug mode
+--source include/have_nodebug.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=1;
+let $do_crash=0;
+let $do_compress=0;
+
+--let $num_crashes = 1
+--let $num_workers = 20
+--let $num_transactions = 10000
+--let $kill_db_after = 0
+--let $num_records = 10000
+--let $max_rows = 200000
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash.test
new file mode 100644 (file)
index 0000000..d746f28
--- /dev/null
@@ -0,0 +1,41 @@
+# stress tests: blobs=no, crash=yes, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=0;
+let $do_crash=1;
+let $do_compress=1;
+
+--let $num_crashes = 2
+--let $num_workers = 20
+--let $num_transactions = 0
+--let $kill_db_after = 600
+--let $num_records = 10000
+--let $max_rows = 200000
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob.test
new file mode 100644 (file)
index 0000000..4c0accf
--- /dev/null
@@ -0,0 +1,41 @@
+# stress tests: blobs=yes, crash=yes, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=1;
+let $do_crash=1;
+let $do_compress=1;
+
+--let $num_crashes = 2
+--let $num_workers = 20
+--let $num_transactions = 0
+--let $kill_db_after = 600
+--let $num_records = 10000
+--let $max_rows = 200000
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob_nocompress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_blob_nocompress.test
new file mode 100644 (file)
index 0000000..c0bd383
--- /dev/null
@@ -0,0 +1,39 @@
+# stress tests: blobs=yes, crash=yes, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=1;
+let $do_crash=1;
+let $do_compress=0;
+
+--let $num_crashes = 2
+--let $num_workers = 20
+--let $num_transactions = 0
+--let $kill_db_after = 600
+--let $num_records = 10000
+--let $max_rows = 200000
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_nocompress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_crash_nocompress.test
new file mode 100644 (file)
index 0000000..c846f86
--- /dev/null
@@ -0,0 +1,39 @@
+# stress tests: blobs=no, crash=yes, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=0;
+let $do_crash=1;
+let $do_compress=0;
+
+--let $num_crashes = 2
+--let $num_workers = 20
+--let $num_transactions = 0
+--let $kill_db_after = 600
+--let $num_records = 10000
+--let $max_rows = 200000
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_nocompress-master.opt
new file mode 100644 (file)
index 0000000..a46d8a0
--- /dev/null
@@ -0,0 +1,6 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
+--innodb_buffer_pool_size=512M
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..5c2c726
--- /dev/null
@@ -0,0 +1,3 @@
+--innodb_flush_log_at_trx_commit=2
+--innodb_buffer_pool_size=512M
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_hugestress_nocompress.test
new file mode 100644 (file)
index 0000000..93aaa25
--- /dev/null
@@ -0,0 +1,42 @@
+# stress tests: blobs=no, crash=no, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/big_test.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+# Too heavy for testing in debug mode
+--source include/have_nodebug.inc
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=0;
+let $do_crash=0;
+let $do_compress=0;
+
+--let $num_crashes = 1
+--let $num_workers = 20
+--let $num_transactions = 20000
+--let $kill_db_after = 0
+--let $num_records = 10000
+--let $max_rows = 200000
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress-master.opt
new file mode 100644 (file)
index 0000000..5a390a0
--- /dev/null
@@ -0,0 +1,5 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress-slave.opt
new file mode 100644 (file)
index 0000000..18f9927
--- /dev/null
@@ -0,0 +1,2 @@
+--innodb_flush_log_at_trx_commit=2
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress.test
new file mode 100644 (file)
index 0000000..91828dc
--- /dev/null
@@ -0,0 +1,40 @@
+# stress tests: blobs=no, crash=no, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=0;
+let $do_crash=0;
+let $do_compress=1;
+
+--let $num_crashes = 1
+--let $num_workers = 2
+--let $num_transactions = 10
+--let $kill_db_after = 0
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob-master.opt
new file mode 100644 (file)
index 0000000..5a390a0
--- /dev/null
@@ -0,0 +1,5 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob-slave.opt
new file mode 100644 (file)
index 0000000..18f9927
--- /dev/null
@@ -0,0 +1,2 @@
+--innodb_flush_log_at_trx_commit=2
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob.test
new file mode 100644 (file)
index 0000000..ebebac5
--- /dev/null
@@ -0,0 +1,40 @@
+# stress tests: blobs=yes, crash=no, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=1;
+let $do_compress=1;
+let $do_crash=0;
+
+--let $num_crashes = 1
+--let $num_workers = 2
+--let $num_transactions = 10
+--let $kill_db_after = 0
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob_nocompress-master.opt
new file mode 100644 (file)
index 0000000..5a390a0
--- /dev/null
@@ -0,0 +1,5 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..18f9927
--- /dev/null
@@ -0,0 +1,2 @@
+--innodb_flush_log_at_trx_commit=2
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_blob_nocompress.test
new file mode 100644 (file)
index 0000000..7ebaa31
--- /dev/null
@@ -0,0 +1,39 @@
+# stress tests: blobs=yes, crash=no, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=1;
+let $do_crash=0;
+let $do_compress=0;
+
+--let $num_crashes = 1
+--let $num_workers = 2
+--let $num_transactions = 10
+--let $kill_db_after = 0
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash-master.opt
new file mode 100644 (file)
index 0000000..5a390a0
--- /dev/null
@@ -0,0 +1,5 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash-slave.opt
new file mode 100644 (file)
index 0000000..18f9927
--- /dev/null
@@ -0,0 +1,2 @@
+--innodb_flush_log_at_trx_commit=2
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash.test
new file mode 100644 (file)
index 0000000..d78023c
--- /dev/null
@@ -0,0 +1,43 @@
+# stress tests: blobs=no, crash=yes, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=0;
+let $do_crash=1;
+let $do_compress=1;
+
+--let $num_crashes = 1
+--let $num_workers = 2
+--let $num_transactions = 0
+--let $kill_db_after = 10
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob-master.opt
new file mode 100644 (file)
index 0000000..5a390a0
--- /dev/null
@@ -0,0 +1,5 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob-slave.opt
new file mode 100644 (file)
index 0000000..18f9927
--- /dev/null
@@ -0,0 +1,2 @@
+--innodb_flush_log_at_trx_commit=2
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob.test
new file mode 100644 (file)
index 0000000..ebe289c
--- /dev/null
@@ -0,0 +1,43 @@
+# stress tests: blobs=yes, crash=yes, compress=yes
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB
+ROW_FORMAT=COMPRESSED
+KEY_BLOCK_SIZE=1;
+
+let $use_blob=1;
+let $do_crash=1;
+let $do_compress=1;
+
+--let $num_crashes = 1
+--let $num_workers = 2
+--let $num_transactions = 0
+--let $kill_db_after = 10
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob_nocompress-master.opt
new file mode 100644 (file)
index 0000000..5a390a0
--- /dev/null
@@ -0,0 +1,5 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..18f9927
--- /dev/null
@@ -0,0 +1,2 @@
+--innodb_flush_log_at_trx_commit=2
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_blob_nocompress.test
new file mode 100644 (file)
index 0000000..019a193
--- /dev/null
@@ -0,0 +1,41 @@
+# stress tests: blobs=yes, crash=yes, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg longtext,
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=1;
+let $do_crash=1;
+let $do_compress=0;
+
+--let $num_crashes = 1
+--let $num_workers = 2
+--let $num_transactions = 0
+--let $kill_db_after = 10
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_nocompress-master.opt
new file mode 100644 (file)
index 0000000..5a390a0
--- /dev/null
@@ -0,0 +1,5 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..18f9927
--- /dev/null
@@ -0,0 +1,2 @@
+--innodb_flush_log_at_trx_commit=2
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_crash_nocompress.test
new file mode 100644 (file)
index 0000000..a6e51d5
--- /dev/null
@@ -0,0 +1,41 @@
+# stress tests: blobs=no, crash=yes, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=0;
+let $do_crash=1;
+let $do_compress=0;
+
+--let $num_crashes = 1
+--let $num_workers = 2
+--let $num_transactions = 0
+--let $kill_db_after = 10
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_nocompress-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_nocompress-master.opt
new file mode 100644 (file)
index 0000000..5a390a0
--- /dev/null
@@ -0,0 +1,5 @@
+--binlog-do-db=test
+--innodb-file-per-table
+--sync_binlog=10
+--innodb_flush_log_at_trx_commit=2
+--force-restart
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_nocompress-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_nocompress-slave.opt
new file mode 100644 (file)
index 0000000..18f9927
--- /dev/null
@@ -0,0 +1,2 @@
+--innodb_flush_log_at_trx_commit=2
+--log_slave_updates=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_nocompress.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/innodb_stress_nocompress.test
new file mode 100644 (file)
index 0000000..3730d27
--- /dev/null
@@ -0,0 +1,38 @@
+# stress tests: blobs=no, crash=no, compress=no
+
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+let $MYSQL_BASEDIR = `SELECT @@BASEDIR`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# create the actual table
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY,
+                msg_prefix VARCHAR(255),
+                msg VARCHAR(255),
+                msg_length int,
+                msg_checksum varchar(128),
+                KEY msg_i(msg_prefix))
+ENGINE=INNODB;
+
+let $use_blob=0;
+let $do_crash=0;
+let $do_compress=0;
+
+--let $num_crashes = 1
+--let $num_workers = 2
+--let $num_transactions = 10
+--let $kill_db_after = 0
+--let $num_records = 1000
+--let $max_rows = 4096
+
+--source suite/innodb_stress/include/innodb_stress.inc
+
+SET GLOBAL innodb_file_format=Default;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/load_generator.py b/mysql-wsrep-5.6/mysql-test/suite/innodb_stress/t/load_generator.py
new file mode 100644 (file)
index 0000000..2bce34b
--- /dev/null
@@ -0,0 +1,435 @@
+import cStringIO
+import hashlib
+import MySQLdb
+import os
+import random
+import signal
+import sys
+import threading
+import time
+import string
+
+CHARS = string.letters + string.digits
+
+def sha1(x):
+  return hashlib.sha1(str(x)).hexdigest()
+
+# Should be deterministic given an idx
+def get_msg(do_blob, idx):
+  random.seed(idx);
+  if do_blob:
+    blob_length = random.randint(1, 24000)
+  else:
+    blob_length = random.randint(1, 255)
+
+  if random.randint(1, 2) == 1:
+    # blob that cannot be compressed (well, compresses to 85% of original size)
+    return ''.join([random.choice(CHARS) for x in xrange(blob_length)])
+  else:
+    # blob that can be compressed
+    return random.choice(CHARS) * blob_length
+
+class PopulateWorker(threading.Thread):
+  global LG_TMP_DIR
+  def __init__(self, con, start_id, end_id, i):
+    threading.Thread.__init__(self)
+    self.con = con
+    con.autocommit(False)
+    self.log = open('/%s/populate-%d.log' % (LG_TMP_DIR, i), 'a')
+    self.num = i
+    self.start_id = start_id
+    self.end_id = end_id
+    self.exception = None
+    self.start_time = time.time()
+    self.start()
+
+  def run(self):
+    try:
+      self.runme()
+      print >> self.log, "ok"
+    except Exception, e:
+      self.exception = e
+      try:
+        cursor = self.con.cursor()
+        cursor.execute("INSERT INTO errors VALUES('%s')" % e)
+      except MySQLdb.Error, e2:
+        print >> self.log, "caught while inserting error (%s)" % e2
+      print >> self.log, "caught (%s)" % e
+    finally:
+      self.finish()
+
+  def finish(self):
+    print >> self.log, "total time: %.2f s" % (time.time() - self.start_time)
+    self.log.close()
+    self.con.commit()
+    self.con.close()
+
+  def runme(self):
+    print >> self.log, "populate thread-%d started" % self.num
+    cur = self.con.cursor()
+    stmt = None
+    for i in xrange(self.start_id, self.end_id):
+      msg = get_msg(do_blob, i)
+      stmt = """
+INSERT INTO t1(id,msg_prefix,msg,msg_length,msg_checksum) VALUES (%d,'%s','%s',%d,'%s')
+""" % (i+1, msg[0:255], msg, len(msg), sha1(msg))
+      cur.execute(stmt)
+      if i % 100 == 0:
+        self.con.commit()
+
+def populate_table(con, num_records_before, do_blob, log):
+  con.autocommit(False)
+  cur = con.cursor()
+  stmt = None
+  workers = []
+  N = num_records_before / 10
+  start_id = 0
+  for i in xrange(10):
+     w = PopulateWorker(MySQLdb.connect(user=user, host=host, port=port, db=db),
+                        start_id, start_id + N, i)
+     start_id += N
+     workers.append(w)
+
+  for i in xrange(start_id, num_records_before):
+      msg = get_msg(do_blob, i)
+      # print >> log, "length is %d, complen is %d" % (len(msg), len(zlib.compress(msg, 6)))
+      stmt = """
+INSERT INTO t1(id,msg_prefix,msg,msg_length,msg_checksum) VALUES (%d,'%s','%s',%d,'%s')
+""" % (i+1, msg[0:255], msg, len(msg), sha1(msg))
+      cur.execute(stmt)
+
+  con.commit()
+  for w in workers:
+    w.join()
+    if w.exception:
+      print >>log, "populater thead %d threw an exception" % w.num
+      return False
+  return True
+
+def get_update(msg, idx):
+  return """
+UPDATE t1 SET msg_prefix='%s',msg='%s',msg_length=%d,msg_checksum='%s' WHERE id=%d""" % (
+msg[0:255], msg, len(msg), sha1(msg), idx)
+
+def get_insert_on_dup(msg, idx):
+  return """
+INSERT INTO t1 (msg_prefix,msg,msg_length,msg_checksum,id) VALUES ('%s','%s',%d,'%s',%d)
+ON DUPLICATE KEY UPDATE
+msg_prefix=VALUES(msg_prefix),
+msg=VALUES(msg),
+msg_length=VALUES(msg_length),
+msg_checksum=VALUES(msg_checksum),
+id=VALUES(id)""" % (
+msg[0:255], msg, len(msg), sha1(msg), idx)
+
+def get_insert(msg, idx):
+  return """
+INSERT INTO t1 (msg_prefix,msg,msg_length,msg_checksum,id) VALUES ('%s','%s',%d,'%s',%d)""" % (
+msg[0:255], msg, len(msg), sha1(msg), idx)
+
+def get_insert_null(msg):
+  return """
+INSERT INTO t1 (msg_prefix,msg,msg_length,msg_checksum,id) VALUES ('%s','%s',%d,'%s',NULL)""" % (
+msg[0:255], msg, len(msg), sha1(msg))
+
+class ChecksumWorker(threading.Thread):
+  global LG_TMP_DIR
+  def __init__(self, con, checksum):
+    threading.Thread.__init__(self)
+    self.con = con
+    con.autocommit(False)
+    self.log = open('/%s/worker-checksum.log' % LG_TMP_DIR, 'a')
+    self.checksum = checksum
+    print >> self.log, "given checksum=%d" % checksum
+    self.start()
+
+  def run(self):
+    try:
+      self.runme()
+      print >> self.log, "ok"
+    except Exception, e:
+      try:
+        cursor = self.con.cursor()
+        cursor.execute("INSERT INTO errors VALUES('%s')" % e)
+        con.commit()
+      except MySQLdb.Error, e2:
+        print >> self.log, "caught while inserting error (%s)" % e2
+
+      print >> self.log, "caught (%s)" % e
+    finally:
+      self.finish()
+
+  def finish(self):
+    print >> self.log, "total time: %.2f s" % (time.time() - self.start_time)
+    self.log.close()
+    self.con.close()
+
+  def runme(self):
+    print >> self.log, "checksum thread started"
+    self.start_time = time.time()
+    cur = self.con.cursor()
+    cur.execute("SET SESSION innodb_lra_size=16")
+    cur.execute("CHECKSUM TABLE t1")
+    checksum = cur.fetchone()[1]
+    self.con.commit()
+    if checksum != self.checksum:
+      print >> self.log, "checksums do not match. given checksum=%d, calculated checksum=%d" % (self.checksum, checksum)
+      self.checksum = checksum
+    else:
+      print >> self.log, "checksums match! (both are %d)" % checksum
+
+
+class Worker(threading.Thread):
+  global LG_TMP_DIR
+
+  def __init__(self, num_xactions, xid, con, server_pid, do_blob, max_id, fake_changes, secondary_checks):
+    threading.Thread.__init__(self)
+    self.do_blob = do_blob
+    self.xid = xid
+    con.autocommit(False)
+    self.con = con
+    self.num_xactions = num_xactions
+    cur = self.con.cursor()
+    self.rand = random.Random()
+    self.rand.seed(xid * server_pid)
+    self.loop_num = 0
+    self.max_id = max_id
+
+    self.num_primary_select = 0
+    self.num_secondary_select = 0
+    self.num_secondary_only_select = 0
+    self.num_inserts = 0
+    self.num_deletes = 0
+    self.num_updates = 0
+    self.time_spent = 0
+    self.log = open('/%s/worker%02d.log' % (LG_TMP_DIR, self.xid), 'a')
+    if fake_changes:
+        cur.execute("SET innodb_fake_changes=1")
+    self.secondary_checks = secondary_checks
+    self.start()
+
+  def finish(self):
+    print >> self.log, "loop_num:%d, total time: %.2f s" % (
+        self.loop_num, time.time() - self.start_time + self.time_spent)
+    print >> self.log, "num_primary_select=%d,num_secondary_select=%d,num_secondary_only_select=%d" %\
+      (self.num_primary_select, self.num_secondary_select, self.num_secondary_only_select)
+    print >> self.log, "num_inserts=%d,num_updates=%d,num_deletes=%d,time_spent=%d" %\
+      (self.num_inserts, self.num_updates, self.num_deletes, self.time_spent)
+    self.log.close()
+
+  def validate_msg(self, msg_prefix, msg, msg_length, msg_checksum, idx):
+
+    prefix_match = msg_prefix == msg[0:255]
+
+    checksum = sha1(msg)
+    checksum_match = checksum == msg_checksum
+
+    len_match = len(msg) == msg_length
+
+    if not prefix_match or not checksum_match or not len_match:
+      errmsg = "id(%d), length(%s,%d,%d), checksum(%s,%s,%s) prefix(%s,%s,%s)" % (
+          idx,
+          len_match, len(msg), msg_length,
+          checksum_match, checksum, msg_checksum,
+          prefix_match, msg_prefix, msg[0:255])
+      print >> self.log, errmsg
+
+      cursor = self.con.cursor()
+      cursor.execute("INSERT INTO errors VALUES('%s')" % errmsg)
+      cursor.execute("COMMIT")
+      raise Exception('validate_msg failed')
+    else:
+      print >> self.log, "Validated for length(%d) and id(%d)" % (msg_length, idx)
+
+  # Check to see if the idx is in the first column of res_array
+  def check_exists(self, res_array, idx):
+    for res in res_array:
+      if res[0] == idx:
+        return True
+    return False
+
+  def run(self):
+    try:
+      self.runme()
+      print >> self.log, "ok, with do_blob %s" % self.do_blob
+    except Exception, e:
+
+      try:
+        cursor = self.con.cursor()
+        cursor.execute("INSERT INTO errors VALUES('%s')" % e)
+        cursor.execute("COMMIT")
+      except MySQLdb.Error, e2:
+        print >> self.log, "caught while inserting error (%s)" % e2
+
+      print >> self.log, "caught (%s)" % e
+    finally:
+      self.finish()
+
+  def runme(self):
+    self.start_time = time.time()
+    cur = self.con.cursor()
+    print >> self.log, "thread %d started, run from %d to %d" % (
+        self.xid, self.loop_num, self.num_xactions)
+
+    while not self.num_xactions or (self.loop_num < self.num_xactions):
+      idx = self.rand.randint(0, self.max_id)
+      insert_or_update = self.rand.randint(0, 3)
+      self.loop_num += 1
+
+      # Randomly toggle innodb_prefix_index_cluster_optimization 5% of the time
+      if self.rand.randint(0, 20) == 0:
+        cur.execute("SET GLOBAL innodb_prefix_index_cluster_optimization=1-@@innodb_prefix_index_cluster_optimization")
+
+      try:
+        stmt = None
+
+        msg = get_msg(self.do_blob, idx)
+
+        # Query primary key 70%, secondary key lookup 20%, secondary key only 10%
+        r = self.rand.randint(1, 10)
+        if r <= 7:
+          cur.execute("SELECT msg_prefix,msg,msg_length,msg_checksum FROM t1 WHERE id=%d" % idx)
+          res = cur.fetchone()
+          self.num_primary_select += 1
+        elif r <= 9:
+          cur.execute("SELECT msg_prefix,msg,msg_length,msg_checksum FROM t1 WHERE msg_prefix='%s'" % msg[0:255])
+          res = cur.fetchone()
+          self.num_secondary_select += 1
+        # Query only the secondary index
+        else:
+          cur.execute("SELECT id, msg_prefix FROM t1 WHERE msg_prefix='%s'" % msg[0:255])
+          res = cur.fetchall()
+          self.num_secondary_only_select += 1
+          # have to continue to next iteration since we arn't fetching other data
+          continue
+        if res:
+          self.validate_msg(res[0], res[1], res[2], res[3], idx)
+
+        insert_with_index = False
+        if insert_or_update:
+          if res:
+            if self.rand.randint(0, 1):
+              stmt = get_update(msg, idx)
+            else:
+              stmt = get_insert_on_dup(msg, idx)
+              insert_with_index = True
+            self.num_updates += 1
+          else:
+            r = self.rand.randint(0, 2)
+            if r == 0:
+              stmt = get_insert(msg, idx)
+              insert_with_index = True
+            elif r == 1:
+              stmt = get_insert_on_dup(msg, idx)
+              insert_with_index = True
+            else:
+              stmt = get_insert_null(msg)
+            self.num_inserts += 1
+        else:
+          stmt = "DELETE FROM t1 WHERE id=%d" % idx
+          self.num_deletes += 1
+
+        query_result = cur.execute(stmt)
+
+        # 10% probability of checking to see the key exists in secondary index
+        if self.secondary_checks and self.rand.randint(1, 10) == 1:
+          cur.execute("SELECT id, msg_prefix FROM t1 WHERE msg_prefix='%s'" % msg[0:255])
+          res_array = cur.fetchall()
+          if insert_or_update:
+            if insert_with_index:
+              if not self.check_exists(res_array, idx):
+                print >> self.log, "Error: Inserted row doesn't exist in secondary index"
+                raise Exception("Error: Inserted row doesn't exist in secondary index")
+          else:
+            if self.check_exists(res_array, idx):
+              print >> self.log, "Error: Deleted row still exists in secondary index"
+              raise Exception("Error: Deleted row still exists in secondary index")
+
+
+        if (self.loop_num % 100) == 0:
+          print >> self.log, "Thread %d loop_num %d: result %d: %s" % (self.xid,
+                                                            self.loop_num, query_result,
+                                                            stmt)
+
+        # 30% commit, 10% rollback, 60% don't end the trx
+        r = self.rand.randint(1,10)
+        if r < 4:
+          self.con.commit()
+        elif r == 4:
+          self.con.rollback()
+
+      except MySQLdb.Error, e:
+        if e.args[0] == 2006:  # server is killed
+          print >> self.log, "mysqld down, transaction %d" % self.xid
+          return
+        else:
+          print >> self.log, "mysql error for stmt(%s) %s" % (stmt, e)
+
+    try:
+      self.con.commit()
+    except Exception, e:
+      print >> self.log, "commit error %s" % e
+
+if  __name__ == '__main__':
+  global LG_TMP_DIR
+
+  pid_file = sys.argv[1]
+  kill_db_after = int(sys.argv[2])
+  num_records_before = int(sys.argv[3])
+  num_workers = int(sys.argv[4])
+  num_xactions_per_worker = int(sys.argv[5])
+  user = sys.argv[6]
+  host = sys.argv[7]
+  port = int(sys.argv[8])
+  db = sys.argv[9]
+  do_blob = int(sys.argv[10])
+  max_id = int(sys.argv[11])
+  LG_TMP_DIR = sys.argv[12]
+  fake_changes = int(sys.argv[13])
+  checksum = int(sys.argv[14])
+  secondary_checks = int(sys.argv[15])
+
+  checksum_worker = None
+  workers = []
+  server_pid = int(open(pid_file).read())
+  log = open('/%s/main.log' % LG_TMP_DIR, 'a')
+
+#  print  "kill_db_after = ",kill_db_after," num_records_before = ", \
+#num_records_before, " num_workers= ",num_workers, "num_xactions_per_worker =",\
+#num_xactions_per_worker, "user = ",user, "host =", host,"port = ",port,\
+#" db = ", db, " server_pid = ", server_pid
+
+  if num_records_before:
+    print >> log, "populate table do_blob is %d" % do_blob
+    con = MySQLdb.connect(user=user, host=host, port=port, db=db)
+    if not populate_table(con, num_records_before, do_blob, log):
+      sys.exit(1)
+    con.close()
+
+  if checksum:
+    print >> log, "start the checksum thread"
+    checksum_worker = ChecksumWorker(MySQLdb.connect(user=user, host=host, port=port, db=db), checksum)
+    workers.append(checksum_worker)
+
+  print >> log, "start %d threads" % num_workers
+  for i in xrange(num_workers):
+    worker = Worker(num_xactions_per_worker, i,
+                    MySQLdb.connect(user=user, host=host, port=port, db=db),
+                    server_pid, do_blob, max_id, fake_changes, secondary_checks)
+    workers.append(worker)
+
+  if kill_db_after:
+    print >> log, "kill mysqld"
+    time.sleep(kill_db_after)
+    os.kill(server_pid, signal.SIGKILL)
+
+  print >> log, "wait for threads"
+  for w in workers:
+    w.join()
+
+  if checksum_worker and checksum_worker.checksum != checksum:
+    print >> log, "checksums do not match. given checksum=%d, calculated checksum=%d" % (checksum, checksum_worker.checksum)
+    sys.exit(1)
+
+  print >> log, "all threads done"
+
index 96f1ad7747a84300b526d01693fd26877d402e6d..ed7f3e105e9af040931f093baa9b152ae969fbcc 100644 (file)
@@ -317,7 +317,7 @@ INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'),
 CREATE TABLE t1(a int, b blob, c text, d text NOT NULL)
 ENGINE=innodb DEFAULT CHARSET=utf8 STATS_PERSISTENT=0;
 INSERT INTO t1
-SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3;
+SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d;
 DROP TABLE t2, t3;
 SELECT COUNT(*) FROM t1 WHERE a=44;
 COUNT(*)
index 6a25caa5077eb0c029f9d574322fea4efcddaa33..6ef1705fcf869f741244ff221d7e96cfc59a7a39 100644 (file)
@@ -267,7 +267,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
 AND table_name='tab5' AND database_name='test'
 AND index_name like 'idx%' ;
 compress_stat  1
-The size of the tab5.ibd file: 2097152
+The size of the tab5.ibd file: 5242880
 # fetch the compressed page and check the stats
 ===============
 Fetch Records
@@ -293,7 +293,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
 AND table_name='tab5' AND database_name='test'
 AND index_name like 'idx%' ;
 compress_stat  1
-The size of the tab5.ibd file: 2097152
+The size of the tab5.ibd file: 5242880
 # fetch the compressed same page once again and check the stats
 # the stat figures should be same as above query
 ===============
@@ -320,7 +320,7 @@ AND compress_ops BETWEEN @inl_val AND 1000
 AND table_name='tab5' AND database_name='test'
 AND index_name like 'idx%' ;
 compress_stat  1
-The size of the tab5.ibd file: 2097152
+The size of the tab5.ibd file: 5242880
 # Restarting server
 # set the flag on (default off)
 SET GLOBAL innodb_cmp_per_index_enabled=ON;
index d2b729af1eb64a346326334b663b29ec05432ba3..d66849af68a43f46480669939571d5a5da0cd286 100644 (file)
@@ -322,7 +322,7 @@ CREATE TABLE t1(a int, b blob, c text, d text NOT NULL)
 ENGINE=innodb DEFAULT CHARSET=utf8 STATS_PERSISTENT=0;
 
 INSERT INTO t1
-SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3;
+SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d;
 DROP TABLE t2, t3;
 SELECT COUNT(*) FROM t1 WHERE a=44;
 SELECT a,
diff --git a/mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_sjis-master.opt b/mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_sjis-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
index e1f22f6fe27051eed6aa4a8e1b9b984c2bbe0c1a..1060f83ec06baae6095d834bd0f97778b8942c29 100644 (file)
@@ -1,3 +1,7 @@
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 --source include/have_sjis.inc
 --source include/have_innodb.inc
 --character_set sjis
diff --git a/mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt b/mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
index a3d7c47705d2dd857d93785480eaf4a4580ab118..321f895214894a83438ff7e81e40049c4b459a96 100644 (file)
@@ -1,3 +1,7 @@
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 --source include/have_ucs2.inc
 --source include/have_innodb.inc
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_ujis-master.opt b/mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_ujis-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
index 17e41e0691ef0409055f6b747b20942d37753e26..10e8ad55a3c876c9ed64254590047ad47fee5377 100644 (file)
@@ -1,3 +1,7 @@
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 --source include/have_ujis.inc
 --source include/have_innodb.inc
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_utf8-master.opt b/mysql-wsrep-5.6/mysql-test/suite/jp/t/jp_enum_utf8-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
index ff5978da69c66c035b7f0755d08209a28d00cd38..f67939bd02bd6624274aeadccbf67b9897b9eeb1 100644 (file)
@@ -1,3 +1,7 @@
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 --source include/have_utf8.inc
 --source include/have_innodb.inc
 --disable_warnings
index 921711e9812be46d7631e7b8af773d265d934832..6b40094355c35ee1c7c02d12f08677528db6d96a 100644 (file)
@@ -1,5 +1,5 @@
 drop table if exists t1;
-create table `t1` (`c1` tinyint unsigned not null, key `c1` (`c1`)) 
+create table `t1` (`c1` tinyint unsigned not null, key `c1` (`c1`))
 engine=myisam default charset=utf8;
 alter table `t1` disable keys;
 insert into t1 values (1),(2),(3),(4);
index 61f0b34d904a45ca6ccb823b0f6ccc574a666b68..9a3f75b53725975734ce2f31817a17fa051b9bda 100644 (file)
@@ -1,6 +1,12 @@
-# The test for bug#27029 requires about 8 hours and 20 minutes on my
-# fastest machine.  This test requires at least 60 GB of disk space.
+# Warning: The current test has problematic properties at runtime
+# - non debug build ~ 3h
+# - debug build     ~ 8h
+# - space consumption in minimum 60 GB on disk
+#
+#   Therefore we skip in case '--big-test' is not assigned.
 --source include/big_test.inc
+#   Hence we skip on debug builds.
+--source include/have_nodebug.inc
 
 #
 # Bug#27029 alter table ... enable keys crashes mysqld on large table
@@ -9,7 +15,7 @@
 drop table if exists t1;
 --enable_warnings
 
-create table `t1` (`c1` tinyint unsigned not null, key `c1` (`c1`)) 
+create table `t1` (`c1` tinyint unsigned not null, key `c1` (`c1`))
 engine=myisam default charset=utf8;
 alter table `t1` disable keys;
 insert into t1 values (1),(2),(3),(4);
diff --git a/mysql-wsrep-5.6/mysql-test/suite/ndb/r/ndb_restore_discover.result b/mysql-wsrep-5.6/mysql-test/suite/ndb/r/ndb_restore_discover.result
new file mode 100644 (file)
index 0000000..de10af8
--- /dev/null
@@ -0,0 +1,33 @@
+#
+# 18075170 - sql node restart required to avoid deadlock after
+#            restore
+#
+CREATE TABLE t1 (id INT) ENGINE=NDBCluster;
+CREATE TABLE t2 (id INT) ENGINE=NDBCluster;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+DROP TABLE t1;
+DROP TABLE t2;
+SET autocommit = 0;
+SELECT * FROM t1;
+id
+1
+SELECT * FROM t2;
+id
+1
+ROLLBACK;
+SET autocommit = 1;
+drop table t1;
+drop table t2;
+SET autocommit = 0;
+SELECT * FROM t1;
+id
+1
+SELECT * FROM t2;
+id
+1
+ALTER TABLE t1 ADD val INT;
+ROLLBACK;
+SET autocommit = 1;
+drop table t1;
+drop table t2;
index 708648fb4852bc72943abe350086d22c74894ec2..af71f2452efd810a86cb82490d4ff41ccba88a81 100644 (file)
@@ -1,6 +1,6 @@
---source ndb_mgm.inc
-
---echo Restarting all nodes "no start"
---exec $_mgm_cmd -e "ALL RESTART -n" > /dev/null
-
---source ndb_wait_nostart.inc
+--source ndb_mgm.inc\r
+\r
+--echo Restarting all nodes "no start"\r
+--exec $_mgm_cmd -e "ALL RESTART -n" > /dev/null\r
+\r
+--source ndb_wait_nostart.inc\r
index 74687a33b0350d61471366f967add0270f9634bd..1265ece02ff07087a9dd0da6130d340e9e0eeb65 100644 (file)
@@ -1,6 +1,6 @@
---source ndb_mgm.inc
-
---echo Starting all nodes
---exec $_mgm_cmd -e "ALL START"  > /dev/null
-
---source ndb_wait_started.inc
+--source ndb_mgm.inc\r
+\r
+--echo Starting all nodes\r
+--exec $_mgm_cmd -e "ALL START"  > /dev/null\r
+\r
+--source ndb_wait_started.inc\r
diff --git a/mysql-wsrep-5.6/mysql-test/suite/ndb/t/ndb_restore_discover.test b/mysql-wsrep-5.6/mysql-test/suite/ndb/t/ndb_restore_discover.test
new file mode 100644 (file)
index 0000000..ffb7a45
--- /dev/null
@@ -0,0 +1,70 @@
+-- source include/have_ndb.inc
+-- source include/count_sessions.inc
+
+--echo #
+--echo # 18075170 - sql node restart required to avoid deadlock after
+--echo #            restore
+--echo #
+# Test Auto Discover option within a transaction and make sure the transaction
+# is not broken.
+CREATE TABLE t1 (id INT) ENGINE=NDBCluster;
+CREATE TABLE t2 (id INT) ENGINE=NDBCluster;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+-- source include/ndb_backup.inc
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+-- source include/ndb_restore_master.inc
+
+SET autocommit = 0;
+SELECT * FROM t1;
+
+# Without fix below select was resulting in DEADLOCK error. With fix select
+# should succeed.
+SELECT * FROM t2;
+ROLLBACK;
+SET autocommit = 1;
+
+drop table t1;
+drop table t2;
+
+#
+# Checking lock preservation in transaction
+#
+# Using existing backup to create the scenario. Tables are deleted as part of
+# above test cleanup. Thus restoring the backup will bring the system to
+# required state.
+-- source include/ndb_restore_master.inc
+
+SET autocommit = 0;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connect(con2, localhost, root);
+--SEND ALTER TABLE t1 ADD val INT
+
+connection default;
+# Alter from con2 will be in waiting state as there is a lock on t1 from
+# default connection due to active transaction. We check for this condition
+# then releasing the lock by rollbacking active transaction.
+let $wait_condition=
+  SELECT count(*) = 1 FROM information_schema.processlist WHERE state
+  LIKE "Waiting%" AND info = "ALTER TABLE t1 ADD val INT";
+--source include/wait_condition.inc
+ROLLBACK;
+SET autocommit = 1;
+
+connection con2;
+--REAP
+
+disconnect con2;
+connection default;
+drop table t1;
+drop table t2;
+
+# Wait till all disconnects are completed
+-- source include/wait_until_count_sessions.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/ndb_binlog/t/ndb_binlog_restore-master.opt b/mysql-wsrep-5.6/mysql-test/suite/ndb_binlog/t/ndb_binlog_restore-master.opt
deleted file mode 100644 (file)
index a267c56..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
---lower_case_table_names=0
-
index a6212bbbbe0315d0ef5ae5a8a36fdb83ae14a2c7..cda7e6c4962f8e1a4fa37335ff0c00ede991ef05 100644 (file)
@@ -1,3 +1,7 @@
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 -- source include/have_ndb.inc
 -- source include/have_binlog_format_mixed_or_row.inc
 
index 3f04c6161d301fc7953f1e41e6e1f98da7aff39f..93eb883cc5d0607de28cafbfc96a917027329707 100644 (file)
@@ -3442,8 +3442,8 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                           "index": "cola",
                           "index_scan_cost": 11.231,
                           "cumulated_index_scan_cost": 11.231,
-                          "disk_sweep_cost": 309.15,
-                          "cumulated_total_cost": 320.38,
+                          "disk_sweep_cost": 278.58,
+                          "cumulated_total_cost": 289.81,
                           "usable": true,
                           "matching_rows_now": 533,
                           "isect_covering_with_this_index": false,
@@ -3453,8 +3453,8 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                           "index": "colb",
                           "index_scan_cost": 11.231,
                           "cumulated_index_scan_cost": 22.462,
-                          "disk_sweep_cost": 30.898,
-                          "cumulated_total_cost": 53.359,
+                          "disk_sweep_cost": 28.152,
+                          "cumulated_total_cost": 50.613,
                           "usable": true,
                           "matching_rows_now": 32.639,
                           "isect_covering_with_this_index": false,
@@ -3466,7 +3466,7 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                         "cause": "no_clustered_pk_index"
                       } /* clustered_pk */,
                       "rows": 32,
-                      "cost": 53.359,
+                      "cost": 50.613,
                       "covering": false,
                       "chosen": true
                     } /* analyzing_roworder_intersect */
@@ -3475,7 +3475,7 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                     "range_access_plan": {
                       "type": "index_roworder_intersect",
                       "rows": 32,
-                      "cost": 53.359,
+                      "cost": 50.613,
                       "covering": false,
                       "clustered_pk_scan": false,
                       "intersect_of": [
@@ -3498,7 +3498,7 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                       ] /* intersect_of */
                     } /* range_access_plan */,
                     "rows_for_plan": 32,
-                    "cost_for_plan": 53.359,
+                    "cost_for_plan": 50.613,
                     "chosen": true
                   } /* chosen_range_access_summary */
                 } /* range_analysis */
@@ -3530,12 +3530,12 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'    {
                     {
                       "access_type": "range",
                       "rows": 24,
-                      "cost": 59.759,
+                      "cost": 57.013,
                       "chosen": true
                     }
                   ] /* considered_access_paths */
                 } /* best_access_path */,
-                "cost_for_plan": 59.759,
+                "cost_for_plan": 57.013,
                 "rows_for_plan": 24,
                 "chosen": true
               }
@@ -5519,8 +5519,8 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND i2 = 1  AND v = 'a' AND pk < 3  {
                           "index": "v_idx",
                           "index_scan_cost": 1,
                           "cumulated_index_scan_cost": 1,
-                          "disk_sweep_cost": 1,
-                          "cumulated_total_cost": 2,
+                          "disk_sweep_cost": 0.9031,
+                          "cumulated_total_cost": 1.9031,
                           "usable": true,
                           "matching_rows_now": 1,
                           "isect_covering_with_this_index": false,
index 3f04c6161d301fc7953f1e41e6e1f98da7aff39f..93eb883cc5d0607de28cafbfc96a917027329707 100644 (file)
@@ -3442,8 +3442,8 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                           "index": "cola",
                           "index_scan_cost": 11.231,
                           "cumulated_index_scan_cost": 11.231,
-                          "disk_sweep_cost": 309.15,
-                          "cumulated_total_cost": 320.38,
+                          "disk_sweep_cost": 278.58,
+                          "cumulated_total_cost": 289.81,
                           "usable": true,
                           "matching_rows_now": 533,
                           "isect_covering_with_this_index": false,
@@ -3453,8 +3453,8 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                           "index": "colb",
                           "index_scan_cost": 11.231,
                           "cumulated_index_scan_cost": 22.462,
-                          "disk_sweep_cost": 30.898,
-                          "cumulated_total_cost": 53.359,
+                          "disk_sweep_cost": 28.152,
+                          "cumulated_total_cost": 50.613,
                           "usable": true,
                           "matching_rows_now": 32.639,
                           "isect_covering_with_this_index": false,
@@ -3466,7 +3466,7 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                         "cause": "no_clustered_pk_index"
                       } /* clustered_pk */,
                       "rows": 32,
-                      "cost": 53.359,
+                      "cost": 50.613,
                       "covering": false,
                       "chosen": true
                     } /* analyzing_roworder_intersect */
@@ -3475,7 +3475,7 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                     "range_access_plan": {
                       "type": "index_roworder_intersect",
                       "rows": 32,
-                      "cost": 53.359,
+                      "cost": 50.613,
                       "covering": false,
                       "clustered_pk_scan": false,
                       "intersect_of": [
@@ -3498,7 +3498,7 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'      {
                       ] /* intersect_of */
                     } /* range_access_plan */,
                     "rows_for_plan": 32,
-                    "cost_for_plan": 53.359,
+                    "cost_for_plan": 50.613,
                     "chosen": true
                   } /* chosen_range_access_summary */
                 } /* range_analysis */
@@ -3530,12 +3530,12 @@ EXPLAIN SELECT * FROM t1 WHERE cola = 'foo' AND colb = 'bar'    {
                     {
                       "access_type": "range",
                       "rows": 24,
-                      "cost": 59.759,
+                      "cost": 57.013,
                       "chosen": true
                     }
                   ] /* considered_access_paths */
                 } /* best_access_path */,
-                "cost_for_plan": 59.759,
+                "cost_for_plan": 57.013,
                 "rows_for_plan": 24,
                 "chosen": true
               }
@@ -5519,8 +5519,8 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND i2 = 1  AND v = 'a' AND pk < 3  {
                           "index": "v_idx",
                           "index_scan_cost": 1,
                           "cumulated_index_scan_cost": 1,
-                          "disk_sweep_cost": 1,
-                          "cumulated_total_cost": 2,
+                          "disk_sweep_cost": 0.9031,
+                          "cumulated_total_cost": 1.9031,
                           "usable": true,
                           "matching_rows_now": 1,
                           "isect_covering_with_this_index": false,
diff --git a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/t/disabled.def b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/t/disabled.def
new file mode 100644 (file)
index 0000000..3ed40b8
--- /dev/null
@@ -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
index e4dacbc663c0c628d11aa44d9206e11d4c548aeb..e5d22d4034a9c3a70b95dbeb6504f3db2918f701 100644 (file)
@@ -7560,7 +7560,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8019,7 +8020,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8489,7 +8491,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8960,7 +8963,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9425,7 +9429,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9896,7 +9901,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10372,7 +10378,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10846,7 +10853,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11310,7 +11318,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11769,7 +11778,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12239,7 +12249,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12710,7 +12721,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13175,7 +13187,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13646,7 +13659,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14122,7 +14136,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14596,7 +14611,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -26313,7 +26329,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -26772,7 +26789,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27242,7 +27260,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27713,7 +27732,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28178,7 +28198,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28649,7 +28670,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29125,7 +29147,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29599,7 +29622,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30063,7 +30087,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30522,7 +30547,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30992,7 +31018,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31463,7 +31490,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31928,7 +31956,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32399,7 +32428,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32875,7 +32905,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33349,7 +33380,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -45082,7 +45114,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -45541,7 +45574,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46011,7 +46045,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46482,7 +46517,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46947,7 +46983,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47418,7 +47455,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47894,7 +47932,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48368,7 +48407,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48832,7 +48872,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49291,7 +49332,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49761,7 +49803,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50232,7 +50275,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50697,7 +50741,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51168,7 +51213,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51644,7 +51690,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52118,7 +52165,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -75368,7 +75416,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -75827,7 +75876,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76297,7 +76347,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76768,7 +76819,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -77233,7 +77285,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -77704,7 +77757,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78180,7 +78234,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78654,7 +78709,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79118,7 +79174,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79577,7 +79634,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80047,7 +80105,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80518,7 +80577,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80983,7 +81043,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81454,7 +81515,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81930,7 +81992,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82404,7 +82467,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
index 8aba07874aad00855298c27d3cf947f81e4ed225..8c1741edd3247c2ca1bb966147120035c56920c1 100644 (file)
@@ -7856,7 +7856,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8324,7 +8325,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8809,7 +8811,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9301,7 +9304,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9783,7 +9787,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10275,7 +10280,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10772,7 +10778,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11267,7 +11274,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11754,7 +11762,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12222,7 +12231,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12707,7 +12717,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13199,7 +13210,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13681,7 +13693,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14173,7 +14186,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14670,7 +14684,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -15165,7 +15180,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27349,7 +27365,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27817,7 +27834,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28302,7 +28320,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28794,7 +28813,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29276,7 +29296,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29768,7 +29789,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30265,7 +30287,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30760,7 +30783,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31247,7 +31271,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31715,7 +31740,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32200,7 +32226,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32692,7 +32719,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33174,7 +33202,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33666,7 +33695,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -34163,7 +34193,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -34658,7 +34689,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46842,7 +46874,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47310,7 +47343,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47795,7 +47829,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48287,7 +48322,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48769,7 +48805,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49261,7 +49298,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49758,7 +49796,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50253,7 +50292,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50740,7 +50780,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51208,7 +51249,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51693,7 +51735,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52185,7 +52228,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52667,7 +52711,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -53159,7 +53204,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -53656,7 +53702,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -54151,7 +54198,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78304,7 +78352,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78772,7 +78821,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79257,7 +79307,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79749,7 +79800,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80231,7 +80283,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80723,7 +80776,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81220,7 +81274,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81715,7 +81770,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82202,7 +82258,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82670,7 +82727,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -83155,7 +83213,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -83647,7 +83706,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -84129,7 +84189,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -84621,7 +84682,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -85118,7 +85180,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -85613,7 +85676,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
 ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
 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
 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
 SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
 WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
index 77b91f19e8fd68410ddf327734b4013ab35f9839..7193a6c99a11e5423064cd0f9d47bf315291cbbd 100644 (file)
@@ -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
index 5c293238db1cda55a624cca8acf30b6355e034ca..75dbc1bd1263d8589624e71215b7a711c1212d0a 100644 (file)
@@ -221,6 +221,7 @@ DROP TABLE t1;
 #            ADD PARTITION and LOCK TABLE
 CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
 ENGINE = InnoDB PARTITION BY HASH(i) PARTITIONS 2;
+INSERT INTO t1 VALUES (2, 2), (3, 3), (4, 4), (5, 5);
 SET lock_wait_timeout = 2;
 #Connection 1 locks the table
 LOCK TABLE t1 READ;
@@ -231,6 +232,19 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
 # Second attempt: says that partition already exists
 ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# Check that we only can select, not insert/update/delete.
+INSERT INTO t1 VALUES (NULL, 6), (NULL, 7), (10, 10), (11, 11);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+UPDATE t1 SET i = 5 WHERE f = 2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+DELETE FROM t1 WHERE i = 10;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1;
+i      f
+2      2
+3      3
+4      4
+5      5
 # Connection 1 unlocks the table and locks it again:
 UNLOCK TABLES;
 LOCK TABLE t1 READ;
@@ -283,3 +297,22 @@ t4
 SELECT * FROM t3;
 ERROR 42S02: Table 'test.t3' doesn't exist
 DROP TABLE t4;
+# Test WRITE LOCK.
+CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
+ENGINE = InnoDB PARTITION BY HASH(i) PARTITIONS 2;
+INSERT INTO t1 VALUES (3, 3), (4, 4);
+SET lock_wait_timeout = 2;
+#Connection 1 locks the table
+LOCK TABLE t1 WRITE;
+# Check that we still can SELECT, but not insert/update/delete.
+# Check that we only can select, not insert/update/delete.
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (10, 10), (11, 11);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+UPDATE t1 SET i = 5 WHERE f = 2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+DELETE FROM t1 WHERE i = 10;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+UNLOCK TABLES;
+DROP TABLE t1;
index 4f569605f5f31993472de57ae879e06206dfe278..a87d658cfb6e00caf2113a7029dc939d3e33c1ff 100644 (file)
@@ -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
index 1fc9ac7fafc867d47b6aecec7c584406c539432c..1561587d999998c76caeb6e7b81e4c8fac945cbb 100644 (file)
@@ -83,6 +83,7 @@ DROP TABLE t1;
 --connect (con1,localhost,root,,)
 CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
         ENGINE = InnoDB PARTITION BY HASH(i) PARTITIONS 2;
+INSERT INTO t1 VALUES (2, 2), (3, 3), (4, 4), (5, 5);
 
 --connect (con2,localhost,root,,)
 SET lock_wait_timeout = 2;
@@ -99,6 +100,15 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
 --echo # Second attempt: says that partition already exists
 --error ER_LOCK_WAIT_TIMEOUT
 ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
+--echo # Check that we only can select, not insert/update/delete.
+--error ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t1 VALUES (NULL, 6), (NULL, 7), (10, 10), (11, 11);
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET i = 5 WHERE f = 2;
+--error ER_LOCK_WAIT_TIMEOUT
+DELETE FROM t1 WHERE i = 10;
+--sorted_result
+SELECT * FROM t1;
 
 --connection con1
 --echo # Connection 1 unlocks the table and locks it again:
@@ -205,3 +215,37 @@ DROP TABLE t4;
 --disconnect con1
 --connection default
 # End of Test #3
+
+--echo # Test WRITE LOCK.
+--connect (con1,localhost,root,,)
+CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
+        ENGINE = InnoDB PARTITION BY HASH(i) PARTITIONS 2;
+INSERT INTO t1 VALUES (3, 3), (4, 4);
+
+--connect (con2,localhost,root,,)
+SET lock_wait_timeout = 2;
+
+--connection con1
+--echo #Connection 1 locks the table
+LOCK TABLE t1 WRITE;
+
+--connection con2
+--echo # Check that we still can SELECT, but not insert/update/delete.
+--echo # Check that we only can select, not insert/update/delete.
+--error ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (10, 10), (11, 11);
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET i = 5 WHERE f = 2;
+--error ER_LOCK_WAIT_TIMEOUT
+DELETE FROM t1 WHERE i = 10;
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1;
+
+--connection con1
+UNLOCK TABLES;
+
+--connection con2
+DROP TABLE t1;
+
+--disconnect con1
+--connection default
index da57b6dd38811993f629341b585277833e868a7f..a661d43d063c8b1459ee69a2d99a630127bc0bd9 100644 (file)
@@ -48,7 +48,7 @@
 
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 --source ../include/wait_for_pfs_thread_count.inc
 
 --disable_query_log
index ed463f58d04663289c3c68a283779c8ab22a5936..6efab880d32fd30852e82b763f495e8f0d46c8c9 100644 (file)
@@ -1,5 +1,5 @@
 # Making sure not to run when ps-protocol is set.
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 
 --echo ####################################
 --echo # SETUP
index 769ba5f8607ddc1b74eed73dcd70305b15c49348..ec35e60d463aa40d13670015fd35021cf57c09ee 100644 (file)
@@ -62,7 +62,7 @@
 
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 --source ../include/wait_for_pfs_thread_count.inc
 
 --disable_query_log
index 4c3451ce8b5ab4d76e41dbb36fd360a148811d0d..3bb4db2276fc363715ac6c5338122253b1a1472c 100644 (file)
@@ -4,13 +4,21 @@ show variables like "table_open_cache";
 show variables like "max_connections";
 # open_files_limit depends on OS configuration (ulimit -n)
 #show variables like "open_files_limit";
-show variables like "%performance_schema%";
+show variables where
+    `Variable_name` != "performance_schema_max_statement_classes" and
+    `Variable_name` like "performance_schema%";
 show status like "%performance_schema%";
 
 # Each test script should provide a different test.cnf file,
 # with different settings.
 # This output will show the sizes computed automatically.
 # Note that this output is very dependent on the platform.
+# The output of SHOW ENGINE PERFORMANCE_SCHEMA STATUS
+# is very dependent on the platform,
+# so it is not printed here to ensure stability of the .results files.
+# To troubleshoot the performance schema memory consumption at different
+# configuration settings, comment the following line.
+# Debug only:
 
-show engine performance_schema status;
+show engine performance_schema status;
 
index ba81c37d5df98e6dab5ab0bb41ba4de8e9e4fa26..96c610459867736395ab9ce44fffb7ffa90c0426 100644 (file)
@@ -126,7 +126,7 @@ if($is_connect)
       # Connect is visible.
       # We hope that sleep 1 is long enough so that PERFORMANCE_SCHEMA
       # can remove this row before we collect the after action state.
-      let $wait_timeou= 5;
+      let $wait_timeout= 5;
       let $wait_condition=
       SELECT COUNT(*) = 0
       $part;
index 3558e43652e4a848735f8acbc10f00d3bdcd3eb4..639b1df8c02bd1e1af0e76df95c0f113f1a9dd0a 100644 (file)
@@ -24,7 +24,7 @@
 
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 
 --disable_query_log
 
index d15c3d48ded7adf37837de827dcea4704e506893..41dcfd8ecb52272a85d22c53a76bc1a1d878333c 100644 (file)
@@ -68,7 +68,9 @@ select * from performance_schema.users;
 --enable_result_log
 
 # This has a stable output, printing the result:
-show variables like "performance_schema%";
+show variables where
+    `Variable_name` != "performance_schema_max_statement_classes" and
+    `Variable_name` like "performance_schema%";
 
 # This has an unrepeatable output, it does depends too much on
 # - the platform hardware (sizeof structures, padding)
index 242768ead9ecdd8e62fde7fe8e1604008f980b3a..f42ebe1fc768e87e3f9c7d6226b198c9041355d0 100644 (file)
@@ -29,7 +29,9 @@ truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
 
 # Check the configuration is ok
-show variables like "performance_schema%";
+show variables where
+    `Variable_name` != "performance_schema_max_statement_classes" and
+    `Variable_name` like "performance_schema%";
 show status like "performance_schema%";
 
 echo "================== Step 1 ==================";
index 8efdc8d2f2484447ad54235b1a86c0f86868ce28..522cdb9346d59efa5ab6a43679d8832848795f11 100644 (file)
@@ -67,7 +67,7 @@
 
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 --source ../include/wait_for_pfs_thread_count.inc
 
 --disable_query_log
diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/digest_null_literal.result b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/digest_null_literal.result
new file mode 100644 (file)
index 0000000..a595c3f
--- /dev/null
@@ -0,0 +1,27 @@
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+NULL
+NULL
+NULL
+NULL
+NULL   NULL
+NULL   NULL
+NULL   NULL    NULL    1       2       3       NULL    NULL
+NULL   NULL    NULL    1       2       3       NULL    NULL
+1 IS NULL
+0
+2 IS NOT NULL
+1
+1 IS NULL      2 IS NULL       3 IS NOT NULL   4 IS NOT NULL
+0      0       1       1
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
+FROM performance_schema.events_statements_summary_by_digest;
+SCHEMA_NAME    DIGEST_TEXT     COUNT_STAR
+test   TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest`     1
+test   SELECT ?        1
+test   SELECT ? FROM DUAL      1
+test   SELECT ?, ...   2
+test   SELECT ? IS NULL        1
+test   SELECT ? IS NOT NULL    1
+test   SELECT ? IS NULL , ? IS NULL , ? IS NOT NULL , ? IS NOT NULL    1
+test   CREATE TABLE `foo` ( `a` INTEGER DEFAULT ? , `b` INTEGER NOT NULL DEFAULT ? , `c` INTEGER NOT NULL )    1
+test   DROP TABLE `foo`        1
index 1d1fe10e73e1766ce25e16d1e946d5b0afa0f3f1..fc83be75a0dcdc52238e6e5394d023e9d211090c 100644 (file)
@@ -113,7 +113,7 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARN
 SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
 SCHEMA_NAME    DIGEST  DIGEST_TEXT     COUNT_STAR      SUM_ROWS_AFFECTED       SUM_WARNINGS    SUM_ERRORS
 NULL   NULL    NULL    55      32      1       2
-statements_digest      e4a84a547a18a89f4708509a720def58        TRUNCATE TABLE performance_schema . events_statements_summary_by_digest         1       0       0       0
+statements_digest      01cfd3c48ebe150803a02f0b32ab4f7b        TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest`     1       0       0       0
 SHOW VARIABLES LIKE "performance_schema_digests_size";
 Variable_name  Value
 performance_schema_digests_size        2
index b3de51ee007e4b929c911fd0fb667ea8fdbc34b1..361c2689affa38d9732c8f1a8116b6ff71a3639b 100644 (file)
@@ -34,8 +34,10 @@ 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_connection_count      YES     YES
 wait/synch/cond/sql/COND_flush_thread_cache    YES     YES
 wait/synch/cond/sql/COND_manager       YES     YES
 wait/synch/cond/sql/COND_queue_state   YES     YES
@@ -45,7 +47,6 @@ wait/synch/cond/sql/COND_thread_count YES     YES
 wait/synch/cond/sql/Delayed_insert::cond       YES     YES
 wait/synch/cond/sql/Delayed_insert::cond_client        YES     YES
 wait/synch/cond/sql/Event_scheduler::COND_state        YES     YES
-wait/synch/cond/sql/Gtid_state YES     YES
 select * from performance_schema.setup_instruments
 where name='Wait';
 select * from performance_schema.setup_instruments
index d71bcf81ea7397f0c765926158e5a42f97bd3bff..f7ff43822617224d8c44194a5da16263afe59f7e 100644 (file)
@@ -20,11 +20,13 @@ lock tables performance_schema.setup_instruments write;
 connection default;
 select event_name,
 left(source, locate(":", source)) as short_source,
-timer_end, timer_wait, operation
+if(timer_end IS NULL, NULL, "SET") as timer_end,
+if(timer_wait IS NULL, NULL, "SET") as timer_wait,
+operation
 from performance_schema.events_waits_current
 where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";
 event_name     short_source    timer_end       timer_wait      operation
-wait/synch/cond/sql/MDL_context::COND_wait_status      mdl.cc: NULL    NULL    timed_wait
+wait/synch/cond/sql/MDL_context::COND_wait_status      mdl.cc: SET     SET     timed_wait
 unlock tables;
 update performance_schema.setup_instruments set enabled='NO';
 update performance_schema.setup_instruments set enabled='YES';
index fd8f93c129f351840d254ab95360503499768967..24ab21848b0aea089f2601b430fb3444d566fc8a 100644 (file)
@@ -92,3 +92,29 @@ object_schema        object_name     index_name      count_fetch     count_insert    count_update    count
 test   t_60905 i       2       0       0       1
 test   t_60905 NULL    5       5       0       1
 DROP TABLE t_60905;
+use test;
+truncate performance_schema.events_statements_history;
+truncate performance_schema.events_statements_history_long;
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+
+select mysql_errno, returned_sqlstate, message_text, errors, warnings
+from performance_schema.events_statements_history where errors > 0;
+mysql_errno    returned_sqlstate       message_text    errors  warnings
+1146   42S02   Table 'test.t1' doesn't exist   1       0
+
+select mysql_errno, returned_sqlstate, message_text, errors, warnings from 
+performance_schema.events_statements_history_long where errors > 0;
+mysql_errno    returned_sqlstate       message_text    errors  warnings
+1146   42S02   Table 'test.t1' doesn't exist   1       0
+use performance_schema;
+truncate performance_schema.events_statements_history;
+select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' AS A;
+A
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+select _utf8mb4 'ваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81Ñ' as B;
+B
+ваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81Ñ
+select count(*) from events_statements_history where sql_text like "%...";
+count(*)
+2
index e8fd6fcc19b27242a4de15f774186a811867f0e8..012d75e2e5f8a0ccb91725590a7058eba3908ecf 100644 (file)
@@ -92,7 +92,9 @@ close pfs_cursor;
 signal sqlstate '01000' set message_text='Done', mysql_errno=12000;
 end
 $
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -106,6 +108,7 @@ performance_schema_events_waits_history_size        10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -116,7 +119,6 @@ performance_schema_max_rwlock_instances     5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
@@ -125,31 +127,6 @@ performance_schema_session_connect_attrs_size      2048
 performance_schema_setup_actors_size   100
 performance_schema_setup_objects_size  100
 performance_schema_users_size  100
-show status like "performance_schema%";
-Variable_name  Value
-Performance_schema_accounts_lost       0
-Performance_schema_cond_classes_lost   0
-Performance_schema_cond_instances_lost 0
-Performance_schema_digest_lost 0
-Performance_schema_file_classes_lost   0
-Performance_schema_file_handles_lost   0
-Performance_schema_file_instances_lost 0
-Performance_schema_hosts_lost  0
-Performance_schema_locker_lost 0
-Performance_schema_mutex_classes_lost  0
-Performance_schema_mutex_instances_lost        0
-Performance_schema_rwlock_classes_lost 0
-Performance_schema_rwlock_instances_lost       0
-Performance_schema_session_connect_attrs_lost  0
-Performance_schema_socket_classes_lost 0
-Performance_schema_socket_instances_lost       0
-Performance_schema_stage_classes_lost  0
-Performance_schema_statement_classes_lost      0
-Performance_schema_table_handles_lost  0
-Performance_schema_table_instances_lost        0
-Performance_schema_thread_classes_lost 0
-Performance_schema_thread_instances_lost       0
-Performance_schema_users_lost  0
 call check_instrument("wait/synch/mutex/");
 instr_name     is_wait is_stage        is_statement
 wait/synch/mutex/      1       0       0
index ffba8643d7965021d3bab793a61ba5fc24addbf6..eee29e1d8e24cdca495195db41c891d6c3c38665 100644 (file)
@@ -22,7 +22,9 @@ flush privileges;
 insert into test.marker set a = 1;
 insert into test.marker set a = 1;
 insert into test.marker set a = 1;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -36,6 +38,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -46,7 +49,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 8786cd055ca7c0f97644f5f9acc743e65f4bb79f..837c2573a7224bd3a1a906b5a6a1b9cde600c630 100644 (file)
@@ -38,7 +38,7 @@ spins
 NULL
 select * from performance_schema.setup_timers where name='wait';
 NAME   TIMER_NAME
-wait   CYCLE
+wait   {CYCLE_OR_NANOSECOND}
 show status like "Qcache_queries_in_cache";
 Variable_name  Value
 Qcache_queries_in_cache        1
@@ -53,7 +53,7 @@ spins
 NULL
 select * from performance_schema.setup_timers where name='wait';
 NAME   TIMER_NAME
-wait   CYCLE
+wait   {CYCLE_OR_NANOSECOND}
 show status like "Qcache_queries_in_cache";
 Variable_name  Value
 Qcache_queries_in_cache        1
index c7727791eb74067a4b3a62ca6e3c48ed4a62a2a7..5573370ede1a4de499ba2002035702622824cf74 100644 (file)
@@ -40,7 +40,7 @@ select digest, digest_text, count_star
 from performance_schema.events_statements_summary_by_digest
 where digest_text like "%in_%_digest%";
 digest digest_text     count_star
-8d588d616712c7d8dfabf22ce262662b       SELECT ? AS in_master_digest    1
+83fd516ccb1407eac535df09e5dd1e50       SELECT ? AS `in_master_digest`  1
 insert into test.marker values (2);
 **** On Slave ****
 select * from test.marker;
@@ -67,7 +67,7 @@ select digest, digest_text, count_star
 from performance_schema.events_statements_summary_by_digest
 where digest_text like "%in_%_digest%";
 digest digest_text     count_star
-02e25175edc3b2834b9b41d58f5a8a6a       SELECT ? AS in_slave_digest     1
+073b595f4ca8178745392f361ef8a531       SELECT ? AS `in_slave_digest`   1
 **** On Master ****
 delete from performance_schema.setup_objects
 where object_schema='master';
index dd8d349b989227e380f8c406309e1687e34367de..5bb7665cd67fec65c7489fe7d88abe7532d22623 100644 (file)
@@ -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
@@ -101,20 +101,20 @@ drop database marker2_db;
 select thread_id, event_id, rpad(event_name, 28, ' ') event_name, rpad(current_schema, 10, ' ') current_schema, rpad(digest_text, 72, ' ') digest_text, sql_text from performance_schema.events_statements_history_long
 where sql_text like '%marker%' order by event_id;
 thread_id      event_id        event_name      current_schema  digest_text     sql_text
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         test            CREATE SCHEMA marker1_db                                                        create database marker1_db
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         test            CREATE SCHEMA marker2_db                                                        create database marker2_db
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE marker1_db . table1 ( s1 INTEGER ) ENGINE = innodb                 create table marker1_db.table1 (s1 int) engine=innodb
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE marker2_db . table1 ( s1 INTEGER ) ENGINE = innodb                 create table marker2_db.table1 (s1 int) engine=innodb
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE marker2_db . table2 ( s1 INTEGER ) ENGINE = innodb                 create table marker2_db.table2 (s1 int) engine=innodb
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker1_db . table1 VALUES (?) /* , ... */                          insert into marker1_db.table1 values (1), (2), (3)
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker2_db . table1 VALUES (?) /* , ... */                          insert into marker2_db.table1 values (1), (2), (3)
-[THREAD_ID]    [EVENT_ID]      statement/sql/alter_table       test            ALTER TABLE marker1_db . table1 ADD COLUMN ( s2 VARCHARACTER (?) )              alter table marker1_db.table1 add column (s2 varchar(32))
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker1_db . table1 VALUES (...) /* , ... */                        insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six')
-[THREAD_ID]    [EVENT_ID]      statement/sql/update            test            UPDATE marker1_db . table1 SET s1 = s1 + ?                                      update marker1_db.table1 set s1 = s1 + 1
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker1_db . table1 VALUES (...) /* , ... */                        insert into marker1_db.table1 values (7, 'seven'), (8, 'eight'), (9, 'nine')
-[THREAD_ID]    [EVENT_ID]      statement/sql/delete            test            DELETE FROM marker1_db . table1 WHERE s1 > ?                                    delete from marker1_db.table1 where s1 > 4
-[THREAD_ID]    [EVENT_ID]      statement/sql/drop_table        test            DROP TABLE marker2_db . table1                                                  drop table marker2_db.table1
-[THREAD_ID]    [EVENT_ID]      statement/sql/drop_db           test            DROP SCHEMA marker2_db                                                          drop database marker2_db
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         test            CREATE SCHEMA `marker1_db`                                                      create database marker1_db
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         test            CREATE SCHEMA `marker2_db`                                                      create database marker2_db
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE `marker1_db` . `table1` ( `s1` INTEGER ) ENGINE = `innodb`         create table marker1_db.table1 (s1 int) engine=innodb
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE `marker2_db` . `table1` ( `s1` INTEGER ) ENGINE = `innodb`         create table marker2_db.table1 (s1 int) engine=innodb
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE `marker2_db` . `table2` ( `s1` INTEGER ) ENGINE = `innodb`         create table marker2_db.table2 (s1 int) engine=innodb
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker1_db` . `table1` VALUES (?) /* , ... */                      insert into marker1_db.table1 values (1), (2), (3)
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker2_db` . `table1` VALUES (?) /* , ... */                      insert into marker2_db.table1 values (1), (2), (3)
+[THREAD_ID]    [EVENT_ID]      statement/sql/alter_table       test            ALTER TABLE `marker1_db` . `table1` ADD COLUMN ( `s2` VARCHARACTER (?) )        alter table marker1_db.table1 add column (s2 varchar(32))
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker1_db` . `table1` VALUES (...) /* , ... */                    insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six')
+[THREAD_ID]    [EVENT_ID]      statement/sql/update            test            UPDATE `marker1_db` . `table1` SET `s1` = `s1` + ?                              update marker1_db.table1 set s1 = s1 + 1
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker1_db` . `table1` VALUES (...) /* , ... */                    insert into marker1_db.table1 values (7, 'seven'), (8, 'eight'), (9, 'nine')
+[THREAD_ID]    [EVENT_ID]      statement/sql/delete            test            DELETE FROM `marker1_db` . `table1` WHERE `s1` > ?                              delete from marker1_db.table1 where s1 > 4
+[THREAD_ID]    [EVENT_ID]      statement/sql/drop_table        test            DROP TABLE `marker2_db` . `table1`                                              drop table marker2_db.table1
+[THREAD_ID]    [EVENT_ID]      statement/sql/drop_db           test            DROP SCHEMA `marker2_db`                                                        drop database marker2_db
 
 #
 # STEP 4 - REPLICATE STATEMENT EVENTS ON MASTER TO SLAVE
@@ -141,39 +141,39 @@ where (thread_id=@my_thread_id and digest_text like '%marker%'));
 
 select thread_id, event_id, rpad(event_name, 28, ' ') event_name, rpad(current_schema, 10, ' ') current_schema, rpad(digest_text, 72, ' ') digest_text, sql_text from master_events_statements_history_long order by event_id;
 thread_id      event_id        event_name      current_schema  digest_text     sql_text
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         test            CREATE SCHEMA marker1_db                                                        create database marker1_db
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         test            CREATE SCHEMA marker2_db                                                        create database marker2_db
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE marker1_db . table1 ( s1 INTEGER ) ENGINE = innodb                 create table marker1_db.table1 (s1 int) engine=innodb
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE marker2_db . table1 ( s1 INTEGER ) ENGINE = innodb                 create table marker2_db.table1 (s1 int) engine=innodb
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE marker2_db . table2 ( s1 INTEGER ) ENGINE = innodb                 create table marker2_db.table2 (s1 int) engine=innodb
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker1_db . table1 VALUES (?) /* , ... */                          insert into marker1_db.table1 values (1), (2), (3)
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker2_db . table1 VALUES (?) /* , ... */                          insert into marker2_db.table1 values (1), (2), (3)
-[THREAD_ID]    [EVENT_ID]      statement/sql/alter_table       test            ALTER TABLE marker1_db . table1 ADD COLUMN ( s2 VARCHARACTER (?) )              alter table marker1_db.table1 add column (s2 varchar(32))
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker1_db . table1 VALUES (...) /* , ... */                        insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six')
-[THREAD_ID]    [EVENT_ID]      statement/sql/update            test            UPDATE marker1_db . table1 SET s1 = s1 + ?                                      update marker1_db.table1 set s1 = s1 + 1
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker1_db . table1 VALUES (...) /* , ... */                        insert into marker1_db.table1 values (7, 'seven'), (8, 'eight'), (9, 'nine')
-[THREAD_ID]    [EVENT_ID]      statement/sql/delete            test            DELETE FROM marker1_db . table1 WHERE s1 > ?                                    delete from marker1_db.table1 where s1 > 4
-[THREAD_ID]    [EVENT_ID]      statement/sql/drop_table        test            DROP TABLE marker2_db . table1                                                  drop table marker2_db.table1
-[THREAD_ID]    [EVENT_ID]      statement/sql/drop_db           test            DROP SCHEMA marker2_db                                                          drop database marker2_db
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         test            CREATE SCHEMA `marker1_db`                                                      create database marker1_db
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         test            CREATE SCHEMA `marker2_db`                                                      create database marker2_db
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE `marker1_db` . `table1` ( `s1` INTEGER ) ENGINE = `innodb`         create table marker1_db.table1 (s1 int) engine=innodb
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE `marker2_db` . `table1` ( `s1` INTEGER ) ENGINE = `innodb`         create table marker2_db.table1 (s1 int) engine=innodb
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE `marker2_db` . `table2` ( `s1` INTEGER ) ENGINE = `innodb`         create table marker2_db.table2 (s1 int) engine=innodb
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker1_db` . `table1` VALUES (?) /* , ... */                      insert into marker1_db.table1 values (1), (2), (3)
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker2_db` . `table1` VALUES (?) /* , ... */                      insert into marker2_db.table1 values (1), (2), (3)
+[THREAD_ID]    [EVENT_ID]      statement/sql/alter_table       test            ALTER TABLE `marker1_db` . `table1` ADD COLUMN ( `s2` VARCHARACTER (?) )        alter table marker1_db.table1 add column (s2 varchar(32))
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker1_db` . `table1` VALUES (...) /* , ... */                    insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six')
+[THREAD_ID]    [EVENT_ID]      statement/sql/update            test            UPDATE `marker1_db` . `table1` SET `s1` = `s1` + ?                              update marker1_db.table1 set s1 = s1 + 1
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker1_db` . `table1` VALUES (...) /* , ... */                    insert into marker1_db.table1 values (7, 'seven'), (8, 'eight'), (9, 'nine')
+[THREAD_ID]    [EVENT_ID]      statement/sql/delete            test            DELETE FROM `marker1_db` . `table1` WHERE `s1` > ?                              delete from marker1_db.table1 where s1 > 4
+[THREAD_ID]    [EVENT_ID]      statement/sql/drop_table        test            DROP TABLE `marker2_db` . `table1`                                              drop table marker2_db.table1
+[THREAD_ID]    [EVENT_ID]      statement/sql/drop_db           test            DROP SCHEMA `marker2_db`                                                        drop database marker2_db
 
 *** List statement events on slave
 
 select thread_id, event_id, rpad(event_name, 28, ' ') event_name, rpad(current_schema, 10, ' ') current_schema, rpad(digest_text, 72, ' ') digest_text, sql_text from performance_schema.events_statements_history_long
 where thread_id = @slave_thread_id and sql_text like '%marker%' order by event_id;
 thread_id      event_id        event_name      current_schema  digest_text     sql_text
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         marker1_db      CREATE SCHEMA marker1_db                                                        create database marker1_db
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         marker2_db      CREATE SCHEMA marker2_db                                                        create database marker2_db
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE marker1_db . table1 ( s1 INTEGER ) ENGINE = innodb                 create table marker1_db.table1 (s1 int) engine=innodb
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE marker2_db . table1 ( s1 INTEGER ) ENGINE = innodb                 create table marker2_db.table1 (s1 int) engine=innodb
-[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE marker2_db . table2 ( s1 INTEGER ) ENGINE = innodb                 create table marker2_db.table2 (s1 int) engine=innodb
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker1_db . table1 VALUES (?) /* , ... */                          insert into marker1_db.table1 values (1), (2), (3)
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker2_db . table1 VALUES (?) /* , ... */                          insert into marker2_db.table1 values (1), (2), (3)
-[THREAD_ID]    [EVENT_ID]      statement/sql/alter_table       test            ALTER TABLE marker1_db . table1 ADD COLUMN ( s2 VARCHARACTER (?) )              alter table marker1_db.table1 add column (s2 varchar(32))
-[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO marker1_db . table1 VALUES (...) /* , ... */                        insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six')
-[THREAD_ID]    [EVENT_ID]      statement/sql/update            test            UPDATE marker1_db . table1 SET s1 = s1 + ?                                      update marker1_db.table1 set s1 = s1 + 1
-[THREAD_ID]    [EVENT_ID]      statement/sql/delete            test            DELETE FROM marker1_db . table1 WHERE s1 > ?                                    delete from marker1_db.table1 where s1 > 4
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         marker1_db      CREATE SCHEMA `marker1_db`                                                      create database marker1_db
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_db         marker2_db      CREATE SCHEMA `marker2_db`                                                      create database marker2_db
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE `marker1_db` . `table1` ( `s1` INTEGER ) ENGINE = `innodb`         create table marker1_db.table1 (s1 int) engine=innodb
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE `marker2_db` . `table1` ( `s1` INTEGER ) ENGINE = `innodb`         create table marker2_db.table1 (s1 int) engine=innodb
+[THREAD_ID]    [EVENT_ID]      statement/sql/create_table      test            CREATE TABLE `marker2_db` . `table2` ( `s1` INTEGER ) ENGINE = `innodb`         create table marker2_db.table2 (s1 int) engine=innodb
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker1_db` . `table1` VALUES (?) /* , ... */                      insert into marker1_db.table1 values (1), (2), (3)
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker2_db` . `table1` VALUES (?) /* , ... */                      insert into marker2_db.table1 values (1), (2), (3)
+[THREAD_ID]    [EVENT_ID]      statement/sql/alter_table       test            ALTER TABLE `marker1_db` . `table1` ADD COLUMN ( `s2` VARCHARACTER (?) )        alter table marker1_db.table1 add column (s2 varchar(32))
+[THREAD_ID]    [EVENT_ID]      statement/sql/insert            test            INSERT INTO `marker1_db` . `table1` VALUES (...) /* , ... */                    insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six')
+[THREAD_ID]    [EVENT_ID]      statement/sql/update            test            UPDATE `marker1_db` . `table1` SET `s1` = `s1` + ?                              update marker1_db.table1 set s1 = s1 + 1
+[THREAD_ID]    [EVENT_ID]      statement/sql/delete            test            DELETE FROM `marker1_db` . `table1` WHERE `s1` > ?                              delete from marker1_db.table1 where s1 > 4
 [THREAD_ID]    [EVENT_ID]      statement/sql/drop_table        test            DROP TABLE `marker2_db` . `table1`                                              DROP TABLE `marker2_db`.`table1` /* generated by server */
-[THREAD_ID]    [EVENT_ID]      statement/sql/drop_db           marker2_db      DROP SCHEMA marker2_db                                                          drop database marker2_db
+[THREAD_ID]    [EVENT_ID]      statement/sql/drop_db           marker2_db      DROP SCHEMA `marker2_db`                                                        drop database marker2_db
 
 *** Compare master and slave events
 
@@ -193,7 +193,6 @@ where t1.thread_id = @slave_thread_id and
 sql_text like '%marker%' and
 not exists (select * from master_events_statements_history_long t2 where t2.digest = t1.digest);
 thread_id      event_id        event_name      digest  digest_text     sql_text
-[THREAD_ID]    [EVENT_ID]      statement/sql/drop_table        [DIGEST]        DROP TABLE `marker2_db` . `table1`      DROP TABLE `marker2_db`.`table1` /* generated by server */
 
 #
 # STEP 6 - DISABLE REPLICATED STATEMENT EVENTS ON SLAVE
index ef7f7069c19c43426013220b500863d14de4800a..1ca202e821f579697592bfe6054faeb920b3e39c 100644 (file)
@@ -7,7 +7,9 @@ table_open_cache        2000
 show variables like "max_connections";
 Variable_name  Value
 max_connections        151
-show variables like "%performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -21,6 +23,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  3504
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  7693
@@ -31,7 +34,6 @@ performance_schema_max_rwlock_instances       9102
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        322
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   4000
 performance_schema_max_table_instances 12500
 performance_schema_max_thread_classes  50
@@ -65,160 +67,3 @@ Performance_schema_table_instances_lost     0
 Performance_schema_thread_classes_lost 0
 Performance_schema_thread_instances_lost       0
 Performance_schema_users_lost  0
-show engine performance_schema status;
-Type   Name    Status
-performance_schema     events_waits_current.row_size   184
-performance_schema     events_waits_current.row_count  2412
-performance_schema     events_waits_history.row_size   184
-performance_schema     events_waits_history.row_count  4020
-performance_schema     events_waits_history.memory     739680
-performance_schema     events_waits_history_long.row_size      184
-performance_schema     events_waits_history_long.row_count     10000
-performance_schema     events_waits_history_long.memory        1840000
-performance_schema     (pfs_mutex_class).row_size      256
-performance_schema     (pfs_mutex_class).row_count     200
-performance_schema     (pfs_mutex_class).memory        51200
-performance_schema     (pfs_rwlock_class).row_size     320
-performance_schema     (pfs_rwlock_class).row_count    40
-performance_schema     (pfs_rwlock_class).memory       12800
-performance_schema     (pfs_cond_class).row_size       256
-performance_schema     (pfs_cond_class).row_count      80
-performance_schema     (pfs_cond_class).memory 20480
-performance_schema     (pfs_thread_class).row_size     192
-performance_schema     (pfs_thread_class).row_count    50
-performance_schema     (pfs_thread_class).memory       9600
-performance_schema     (pfs_file_class).row_size       320
-performance_schema     (pfs_file_class).row_count      50
-performance_schema     (pfs_file_class).memory 16000
-performance_schema     mutex_instances.row_size        128
-performance_schema     mutex_instances.row_count       15906
-performance_schema     mutex_instances.memory  2035968
-performance_schema     rwlock_instances.row_size       192
-performance_schema     rwlock_instances.row_count      9102
-performance_schema     rwlock_instances.memory 1747584
-performance_schema     cond_instances.row_size 128
-performance_schema     cond_instances.row_count        3504
-performance_schema     cond_instances.memory   448512
-performance_schema     threads.row_size        2816
-performance_schema     threads.row_count       402
-performance_schema     threads.memory  1132032
-performance_schema     file_instances.row_size 704
-performance_schema     file_instances.row_count        7693
-performance_schema     file_instances.memory   5415872
-performance_schema     (pfs_file_handle).row_size      8
-performance_schema     (pfs_file_handle).row_count     32768
-performance_schema     (pfs_file_handle).memory        262144
-performance_schema     events_waits_summary_by_thread_by_event_name.row_size   32
-performance_schema     events_waits_summary_by_thread_by_event_name.row_count  153966
-performance_schema     events_waits_summary_by_thread_by_event_name.memory     4926912
-performance_schema     (pfs_table_share).row_size      22208
-performance_schema     (pfs_table_share).row_count     12500
-performance_schema     (pfs_table_share).memory        277600000
-performance_schema     (pfs_table).row_size    9280
-performance_schema     (pfs_table).row_count   4000
-performance_schema     (pfs_table).memory      37120000
-performance_schema     setup_actors.row_size   256
-performance_schema     setup_actors.row_count  100
-performance_schema     setup_actors.memory     25600
-performance_schema     setup_objects.row_size  448
-performance_schema     setup_objects.row_count 100
-performance_schema     setup_objects.memory    44800
-performance_schema     (pfs_account).row_size  256
-performance_schema     (pfs_account).row_count 100
-performance_schema     (pfs_account).memory    25600
-performance_schema     events_waits_summary_by_account_by_event_name.row_size  32
-performance_schema     events_waits_summary_by_account_by_event_name.row_count 38300
-performance_schema     events_waits_summary_by_account_by_event_name.memory    1225600
-performance_schema     events_waits_summary_by_user_by_event_name.row_size     32
-performance_schema     events_waits_summary_by_user_by_event_name.row_count    38300
-performance_schema     events_waits_summary_by_user_by_event_name.memory       1225600
-performance_schema     events_waits_summary_by_host_by_event_name.row_size     32
-performance_schema     events_waits_summary_by_host_by_event_name.row_count    38300
-performance_schema     events_waits_summary_by_host_by_event_name.memory       1225600
-performance_schema     (pfs_user).row_size     128
-performance_schema     (pfs_user).row_count    100
-performance_schema     (pfs_user).memory       12800
-performance_schema     (pfs_host).row_size     128
-performance_schema     (pfs_host).row_count    100
-performance_schema     (pfs_host).memory       12800
-performance_schema     (pfs_stage_class).row_size      256
-performance_schema     (pfs_stage_class).row_count     150
-performance_schema     (pfs_stage_class).memory        38400
-performance_schema     events_stages_history.row_size  88
-performance_schema     events_stages_history.row_count 4020
-performance_schema     events_stages_history.memory    353760
-performance_schema     events_stages_history_long.row_size     88
-performance_schema     events_stages_history_long.row_count    10000
-performance_schema     events_stages_history_long.memory       880000
-performance_schema     events_stages_summary_by_thread_by_event_name.row_size  32
-performance_schema     events_stages_summary_by_thread_by_event_name.row_count 60300
-performance_schema     events_stages_summary_by_thread_by_event_name.memory    1929600
-performance_schema     events_stages_summary_global_by_event_name.row_size     32
-performance_schema     events_stages_summary_global_by_event_name.row_count    150
-performance_schema     events_stages_summary_global_by_event_name.memory       4800
-performance_schema     events_stages_summary_by_account_by_event_name.row_size 32
-performance_schema     events_stages_summary_by_account_by_event_name.row_count        15000
-performance_schema     events_stages_summary_by_account_by_event_name.memory   480000
-performance_schema     events_stages_summary_by_user_by_event_name.row_size    32
-performance_schema     events_stages_summary_by_user_by_event_name.row_count   15000
-performance_schema     events_stages_summary_by_user_by_event_name.memory      480000
-performance_schema     events_stages_summary_by_host_by_event_name.row_size    32
-performance_schema     events_stages_summary_by_host_by_event_name.row_count   15000
-performance_schema     events_stages_summary_by_host_by_event_name.memory      480000
-performance_schema     (pfs_statement_class).row_size  192
-performance_schema     (pfs_statement_class).row_count 168
-performance_schema     (pfs_statement_class).memory    32256
-performance_schema     events_statements_history.row_size      3024
-performance_schema     events_statements_history.row_count     4020
-performance_schema     events_statements_history.memory        12156480
-performance_schema     events_statements_history_long.row_size 3024
-performance_schema     events_statements_history_long.row_count        10000
-performance_schema     events_statements_history_long.memory   30240000
-performance_schema     events_statements_summary_by_thread_by_event_name.row_size      184
-performance_schema     events_statements_summary_by_thread_by_event_name.row_count     67536
-performance_schema     events_statements_summary_by_thread_by_event_name.memory        12426624
-performance_schema     events_statements_summary_global_by_event_name.row_size 184
-performance_schema     events_statements_summary_global_by_event_name.row_count        168
-performance_schema     events_statements_summary_global_by_event_name.memory   30912
-performance_schema     events_statements_summary_by_account_by_event_name.row_size     184
-performance_schema     events_statements_summary_by_account_by_event_name.row_count    16800
-performance_schema     events_statements_summary_by_account_by_event_name.memory       3091200
-performance_schema     events_statements_summary_by_user_by_event_name.row_size        184
-performance_schema     events_statements_summary_by_user_by_event_name.row_count       16800
-performance_schema     events_statements_summary_by_user_by_event_name.memory  3091200
-performance_schema     events_statements_summary_by_host_by_event_name.row_size        184
-performance_schema     events_statements_summary_by_host_by_event_name.row_count       16800
-performance_schema     events_statements_summary_by_host_by_event_name.memory  3091200
-performance_schema     events_statements_current.row_size      3024
-performance_schema     events_statements_current.row_count     402
-performance_schema     events_statements_current.memory        1215648
-performance_schema     (pfs_socket_class).row_size     320
-performance_schema     (pfs_socket_class).row_count    10
-performance_schema     (pfs_socket_class).memory       3200
-performance_schema     socket_instances.row_size       320
-performance_schema     socket_instances.row_count      322
-performance_schema     socket_instances.memory 103040
-performance_schema     events_statements_summary_by_digest.row_size    1472
-performance_schema     events_statements_summary_by_digest.row_count   10000
-performance_schema     events_statements_summary_by_digest.memory      14720000
-performance_schema     session_connect_attrs.row_size  402
-performance_schema     session_connect_attrs.row_count 512
-performance_schema     session_connect_attrs.memory    205824
-performance_schema     (account_hash).count    2
-performance_schema     (account_hash).size     100
-performance_schema     (digest_hash).count     0
-performance_schema     (digest_hash).size      10000
-performance_schema     (filename_hash).count   0
-performance_schema     (filename_hash).size    7693
-performance_schema     (host_hash).count       2
-performance_schema     (host_hash).size        100
-performance_schema     (setup_actor_hash).count        1
-performance_schema     (setup_actor_hash).size 100
-performance_schema     (setup_object_hash).count       4
-performance_schema     (setup_object_hash).size        100
-performance_schema     (table_share_hash).count        80
-performance_schema     (table_share_hash).size 12500
-performance_schema     (user_hash).count       2
-performance_schema     (user_hash).size        100
-performance_schema     host_cache.size 336
-performance_schema     performance_schema.memory       422231328
index 4d63c9707827aab3a5fb614ac9b06532f7927dc9..b633d5fce8db6c7d8039fb0a77cab6956c1a99a2 100644 (file)
@@ -7,7 +7,9 @@ table_open_cache        400
 show variables like "max_connections";
 Variable_name  Value
 max_connections        200
-show variables like "%performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -21,6 +23,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  10900
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  23385
@@ -31,7 +34,6 @@ performance_schema_max_rwlock_instances       30800
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        420
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   800
 performance_schema_max_table_instances 12500
 performance_schema_max_thread_classes  50
@@ -65,160 +67,3 @@ Performance_schema_table_instances_lost     0
 Performance_schema_thread_classes_lost 0
 Performance_schema_thread_instances_lost       0
 Performance_schema_users_lost  0
-show engine performance_schema status;
-Type   Name    Status
-performance_schema     events_waits_current.row_size   184
-performance_schema     events_waits_current.row_count  3000
-performance_schema     events_waits_history.row_size   184
-performance_schema     events_waits_history.row_count  5000
-performance_schema     events_waits_history.memory     920000
-performance_schema     events_waits_history_long.row_size      184
-performance_schema     events_waits_history_long.row_count     10000
-performance_schema     events_waits_history_long.memory        1840000
-performance_schema     (pfs_mutex_class).row_size      256
-performance_schema     (pfs_mutex_class).row_count     200
-performance_schema     (pfs_mutex_class).memory        51200
-performance_schema     (pfs_rwlock_class).row_size     320
-performance_schema     (pfs_rwlock_class).row_count    40
-performance_schema     (pfs_rwlock_class).memory       12800
-performance_schema     (pfs_cond_class).row_size       256
-performance_schema     (pfs_cond_class).row_count      80
-performance_schema     (pfs_cond_class).memory 20480
-performance_schema     (pfs_thread_class).row_size     192
-performance_schema     (pfs_thread_class).row_count    50
-performance_schema     (pfs_thread_class).memory       9600
-performance_schema     (pfs_file_class).row_size       320
-performance_schema     (pfs_file_class).row_count      50
-performance_schema     (pfs_file_class).memory 16000
-performance_schema     mutex_instances.row_size        128
-performance_schema     mutex_instances.row_count       52200
-performance_schema     mutex_instances.memory  6681600
-performance_schema     rwlock_instances.row_size       192
-performance_schema     rwlock_instances.row_count      30800
-performance_schema     rwlock_instances.memory 5913600
-performance_schema     cond_instances.row_size 128
-performance_schema     cond_instances.row_count        10900
-performance_schema     cond_instances.memory   1395200
-performance_schema     threads.row_size        2816
-performance_schema     threads.row_count       500
-performance_schema     threads.memory  1408000
-performance_schema     file_instances.row_size 704
-performance_schema     file_instances.row_count        23385
-performance_schema     file_instances.memory   16463040
-performance_schema     (pfs_file_handle).row_size      8
-performance_schema     (pfs_file_handle).row_count     32768
-performance_schema     (pfs_file_handle).memory        262144
-performance_schema     events_waits_summary_by_thread_by_event_name.row_size   32
-performance_schema     events_waits_summary_by_thread_by_event_name.row_count  191500
-performance_schema     events_waits_summary_by_thread_by_event_name.memory     6128000
-performance_schema     (pfs_table_share).row_size      22208
-performance_schema     (pfs_table_share).row_count     12500
-performance_schema     (pfs_table_share).memory        277600000
-performance_schema     (pfs_table).row_size    9280
-performance_schema     (pfs_table).row_count   800
-performance_schema     (pfs_table).memory      7424000
-performance_schema     setup_actors.row_size   256
-performance_schema     setup_actors.row_count  100
-performance_schema     setup_actors.memory     25600
-performance_schema     setup_objects.row_size  448
-performance_schema     setup_objects.row_count 100
-performance_schema     setup_objects.memory    44800
-performance_schema     (pfs_account).row_size  256
-performance_schema     (pfs_account).row_count 100
-performance_schema     (pfs_account).memory    25600
-performance_schema     events_waits_summary_by_account_by_event_name.row_size  32
-performance_schema     events_waits_summary_by_account_by_event_name.row_count 38300
-performance_schema     events_waits_summary_by_account_by_event_name.memory    1225600
-performance_schema     events_waits_summary_by_user_by_event_name.row_size     32
-performance_schema     events_waits_summary_by_user_by_event_name.row_count    38300
-performance_schema     events_waits_summary_by_user_by_event_name.memory       1225600
-performance_schema     events_waits_summary_by_host_by_event_name.row_size     32
-performance_schema     events_waits_summary_by_host_by_event_name.row_count    38300
-performance_schema     events_waits_summary_by_host_by_event_name.memory       1225600
-performance_schema     (pfs_user).row_size     128
-performance_schema     (pfs_user).row_count    100
-performance_schema     (pfs_user).memory       12800
-performance_schema     (pfs_host).row_size     128
-performance_schema     (pfs_host).row_count    100
-performance_schema     (pfs_host).memory       12800
-performance_schema     (pfs_stage_class).row_size      256
-performance_schema     (pfs_stage_class).row_count     150
-performance_schema     (pfs_stage_class).memory        38400
-performance_schema     events_stages_history.row_size  88
-performance_schema     events_stages_history.row_count 5000
-performance_schema     events_stages_history.memory    440000
-performance_schema     events_stages_history_long.row_size     88
-performance_schema     events_stages_history_long.row_count    10000
-performance_schema     events_stages_history_long.memory       880000
-performance_schema     events_stages_summary_by_thread_by_event_name.row_size  32
-performance_schema     events_stages_summary_by_thread_by_event_name.row_count 75000
-performance_schema     events_stages_summary_by_thread_by_event_name.memory    2400000
-performance_schema     events_stages_summary_global_by_event_name.row_size     32
-performance_schema     events_stages_summary_global_by_event_name.row_count    150
-performance_schema     events_stages_summary_global_by_event_name.memory       4800
-performance_schema     events_stages_summary_by_account_by_event_name.row_size 32
-performance_schema     events_stages_summary_by_account_by_event_name.row_count        15000
-performance_schema     events_stages_summary_by_account_by_event_name.memory   480000
-performance_schema     events_stages_summary_by_user_by_event_name.row_size    32
-performance_schema     events_stages_summary_by_user_by_event_name.row_count   15000
-performance_schema     events_stages_summary_by_user_by_event_name.memory      480000
-performance_schema     events_stages_summary_by_host_by_event_name.row_size    32
-performance_schema     events_stages_summary_by_host_by_event_name.row_count   15000
-performance_schema     events_stages_summary_by_host_by_event_name.memory      480000
-performance_schema     (pfs_statement_class).row_size  192
-performance_schema     (pfs_statement_class).row_count 168
-performance_schema     (pfs_statement_class).memory    32256
-performance_schema     events_statements_history.row_size      3024
-performance_schema     events_statements_history.row_count     5000
-performance_schema     events_statements_history.memory        15120000
-performance_schema     events_statements_history_long.row_size 3024
-performance_schema     events_statements_history_long.row_count        10000
-performance_schema     events_statements_history_long.memory   30240000
-performance_schema     events_statements_summary_by_thread_by_event_name.row_size      184
-performance_schema     events_statements_summary_by_thread_by_event_name.row_count     84000
-performance_schema     events_statements_summary_by_thread_by_event_name.memory        15456000
-performance_schema     events_statements_summary_global_by_event_name.row_size 184
-performance_schema     events_statements_summary_global_by_event_name.row_count        168
-performance_schema     events_statements_summary_global_by_event_name.memory   30912
-performance_schema     events_statements_summary_by_account_by_event_name.row_size     184
-performance_schema     events_statements_summary_by_account_by_event_name.row_count    16800
-performance_schema     events_statements_summary_by_account_by_event_name.memory       3091200
-performance_schema     events_statements_summary_by_user_by_event_name.row_size        184
-performance_schema     events_statements_summary_by_user_by_event_name.row_count       16800
-performance_schema     events_statements_summary_by_user_by_event_name.memory  3091200
-performance_schema     events_statements_summary_by_host_by_event_name.row_size        184
-performance_schema     events_statements_summary_by_host_by_event_name.row_count       16800
-performance_schema     events_statements_summary_by_host_by_event_name.memory  3091200
-performance_schema     events_statements_current.row_size      3024
-performance_schema     events_statements_current.row_count     500
-performance_schema     events_statements_current.memory        1512000
-performance_schema     (pfs_socket_class).row_size     320
-performance_schema     (pfs_socket_class).row_count    10
-performance_schema     (pfs_socket_class).memory       3200
-performance_schema     socket_instances.row_size       320
-performance_schema     socket_instances.row_count      420
-performance_schema     socket_instances.memory 134400
-performance_schema     events_statements_summary_by_digest.row_size    1472
-performance_schema     events_statements_summary_by_digest.row_count   10000
-performance_schema     events_statements_summary_by_digest.memory      14720000
-performance_schema     session_connect_attrs.row_size  500
-performance_schema     session_connect_attrs.row_count 512
-performance_schema     session_connect_attrs.memory    256000
-performance_schema     (account_hash).count    2
-performance_schema     (account_hash).size     100
-performance_schema     (digest_hash).count     0
-performance_schema     (digest_hash).size      10000
-performance_schema     (filename_hash).count   0
-performance_schema     (filename_hash).size    23385
-performance_schema     (host_hash).count       2
-performance_schema     (host_hash).size        100
-performance_schema     (setup_actor_hash).count        1
-performance_schema     (setup_actor_hash).size 100
-performance_schema     (setup_object_hash).count       4
-performance_schema     (setup_object_hash).size        100
-performance_schema     (table_share_hash).count        80
-performance_schema     (table_share_hash).size 12500
-performance_schema     (user_hash).count       2
-performance_schema     (user_hash).size        100
-performance_schema     host_cache.size 336
-performance_schema     performance_schema.memory       421925632
index d5aab2c2df3f87e37b0bcb425cec08d0d46f9b05..a698f55aa0787a260703bb7f4a4a95aad13eb20e 100644 (file)
@@ -7,7 +7,9 @@ table_open_cache        100
 show variables like "max_connections";
 Variable_name  Value
 max_connections        50
-show variables like "%performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       10
@@ -21,6 +23,7 @@ performance_schema_events_waits_history_size  5
 performance_schema_hosts_size  20
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  612
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  1556
@@ -31,7 +34,6 @@ performance_schema_max_rwlock_instances       1612
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        67
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   112
 performance_schema_max_table_instances 445
 performance_schema_max_thread_classes  50
@@ -65,160 +67,4 @@ Performance_schema_table_instances_lost     0
 Performance_schema_thread_classes_lost 0
 Performance_schema_thread_instances_lost       0
 Performance_schema_users_lost  0
-show engine performance_schema status;
-Type   Name    Status
-performance_schema     events_waits_current.row_size   184
-performance_schema     events_waits_current.row_count  672
-performance_schema     events_waits_history.row_size   184
-performance_schema     events_waits_history.row_count  560
-performance_schema     events_waits_history.memory     103040
-performance_schema     events_waits_history_long.row_size      184
-performance_schema     events_waits_history_long.row_count     100
-performance_schema     events_waits_history_long.memory        18400
-performance_schema     (pfs_mutex_class).row_size      256
-performance_schema     (pfs_mutex_class).row_count     200
-performance_schema     (pfs_mutex_class).memory        51200
-performance_schema     (pfs_rwlock_class).row_size     320
-performance_schema     (pfs_rwlock_class).row_count    40
-performance_schema     (pfs_rwlock_class).memory       12800
-performance_schema     (pfs_cond_class).row_size       256
-performance_schema     (pfs_cond_class).row_count      80
-performance_schema     (pfs_cond_class).memory 20480
-performance_schema     (pfs_thread_class).row_size     192
-performance_schema     (pfs_thread_class).row_count    50
-performance_schema     (pfs_thread_class).memory       9600
-performance_schema     (pfs_file_class).row_size       320
-performance_schema     (pfs_file_class).row_count      50
-performance_schema     (pfs_file_class).memory 16000
-performance_schema     mutex_instances.row_size        128
-performance_schema     mutex_instances.row_count       2945
-performance_schema     mutex_instances.memory  376960
-performance_schema     rwlock_instances.row_size       192
-performance_schema     rwlock_instances.row_count      1612
-performance_schema     rwlock_instances.memory 309504
-performance_schema     cond_instances.row_size 128
-performance_schema     cond_instances.row_count        612
-performance_schema     cond_instances.memory   78336
-performance_schema     threads.row_size        2816
-performance_schema     threads.row_count       112
-performance_schema     threads.memory  315392
-performance_schema     file_instances.row_size 704
-performance_schema     file_instances.row_count        1556
-performance_schema     file_instances.memory   1095424
-performance_schema     (pfs_file_handle).row_size      8
-performance_schema     (pfs_file_handle).row_count     32768
-performance_schema     (pfs_file_handle).memory        262144
-performance_schema     events_waits_summary_by_thread_by_event_name.row_size   32
-performance_schema     events_waits_summary_by_thread_by_event_name.row_count  42896
-performance_schema     events_waits_summary_by_thread_by_event_name.memory     1372672
-performance_schema     (pfs_table_share).row_size      22208
-performance_schema     (pfs_table_share).row_count     445
-performance_schema     (pfs_table_share).memory        9882560
-performance_schema     (pfs_table).row_size    9280
-performance_schema     (pfs_table).row_count   112
-performance_schema     (pfs_table).memory      1039360
-performance_schema     setup_actors.row_size   256
-performance_schema     setup_actors.row_count  100
-performance_schema     setup_actors.memory     25600
-performance_schema     setup_objects.row_size  448
-performance_schema     setup_objects.row_count 100
-performance_schema     setup_objects.memory    44800
-performance_schema     (pfs_account).row_size  256
-performance_schema     (pfs_account).row_count 10
-performance_schema     (pfs_account).memory    2560
-performance_schema     events_waits_summary_by_account_by_event_name.row_size  32
-performance_schema     events_waits_summary_by_account_by_event_name.row_count 3830
-performance_schema     events_waits_summary_by_account_by_event_name.memory    122560
-performance_schema     events_waits_summary_by_user_by_event_name.row_size     32
-performance_schema     events_waits_summary_by_user_by_event_name.row_count    1915
-performance_schema     events_waits_summary_by_user_by_event_name.memory       61280
-performance_schema     events_waits_summary_by_host_by_event_name.row_size     32
-performance_schema     events_waits_summary_by_host_by_event_name.row_count    7660
-performance_schema     events_waits_summary_by_host_by_event_name.memory       245120
-performance_schema     (pfs_user).row_size     128
-performance_schema     (pfs_user).row_count    5
-performance_schema     (pfs_user).memory       640
-performance_schema     (pfs_host).row_size     128
-performance_schema     (pfs_host).row_count    20
-performance_schema     (pfs_host).memory       2560
-performance_schema     (pfs_stage_class).row_size      256
-performance_schema     (pfs_stage_class).row_count     150
-performance_schema     (pfs_stage_class).memory        38400
-performance_schema     events_stages_history.row_size  88
-performance_schema     events_stages_history.row_count 560
-performance_schema     events_stages_history.memory    49280
-performance_schema     events_stages_history_long.row_size     88
-performance_schema     events_stages_history_long.row_count    100
-performance_schema     events_stages_history_long.memory       8800
-performance_schema     events_stages_summary_by_thread_by_event_name.row_size  32
-performance_schema     events_stages_summary_by_thread_by_event_name.row_count 16800
-performance_schema     events_stages_summary_by_thread_by_event_name.memory    537600
-performance_schema     events_stages_summary_global_by_event_name.row_size     32
-performance_schema     events_stages_summary_global_by_event_name.row_count    150
-performance_schema     events_stages_summary_global_by_event_name.memory       4800
-performance_schema     events_stages_summary_by_account_by_event_name.row_size 32
-performance_schema     events_stages_summary_by_account_by_event_name.row_count        1500
-performance_schema     events_stages_summary_by_account_by_event_name.memory   48000
-performance_schema     events_stages_summary_by_user_by_event_name.row_size    32
-performance_schema     events_stages_summary_by_user_by_event_name.row_count   750
-performance_schema     events_stages_summary_by_user_by_event_name.memory      24000
-performance_schema     events_stages_summary_by_host_by_event_name.row_size    32
-performance_schema     events_stages_summary_by_host_by_event_name.row_count   3000
-performance_schema     events_stages_summary_by_host_by_event_name.memory      96000
-performance_schema     (pfs_statement_class).row_size  192
-performance_schema     (pfs_statement_class).row_count 168
-performance_schema     (pfs_statement_class).memory    32256
-performance_schema     events_statements_history.row_size      3024
-performance_schema     events_statements_history.row_count     560
-performance_schema     events_statements_history.memory        1693440
-performance_schema     events_statements_history_long.row_size 3024
-performance_schema     events_statements_history_long.row_count        100
-performance_schema     events_statements_history_long.memory   302400
-performance_schema     events_statements_summary_by_thread_by_event_name.row_size      184
-performance_schema     events_statements_summary_by_thread_by_event_name.row_count     18816
-performance_schema     events_statements_summary_by_thread_by_event_name.memory        3462144
-performance_schema     events_statements_summary_global_by_event_name.row_size 184
-performance_schema     events_statements_summary_global_by_event_name.row_count        168
-performance_schema     events_statements_summary_global_by_event_name.memory   30912
-performance_schema     events_statements_summary_by_account_by_event_name.row_size     184
-performance_schema     events_statements_summary_by_account_by_event_name.row_count    1680
-performance_schema     events_statements_summary_by_account_by_event_name.memory       309120
-performance_schema     events_statements_summary_by_user_by_event_name.row_size        184
-performance_schema     events_statements_summary_by_user_by_event_name.row_count       840
-performance_schema     events_statements_summary_by_user_by_event_name.memory  154560
-performance_schema     events_statements_summary_by_host_by_event_name.row_size        184
-performance_schema     events_statements_summary_by_host_by_event_name.row_count       3360
-performance_schema     events_statements_summary_by_host_by_event_name.memory  618240
-performance_schema     events_statements_current.row_size      3024
-performance_schema     events_statements_current.row_count     112
-performance_schema     events_statements_current.memory        338688
-performance_schema     (pfs_socket_class).row_size     320
-performance_schema     (pfs_socket_class).row_count    10
-performance_schema     (pfs_socket_class).memory       3200
-performance_schema     socket_instances.row_size       320
-performance_schema     socket_instances.row_count      67
-performance_schema     socket_instances.memory 21440
-performance_schema     events_statements_summary_by_digest.row_size    1472
-performance_schema     events_statements_summary_by_digest.row_count   1000
-performance_schema     events_statements_summary_by_digest.memory      1472000
-performance_schema     session_connect_attrs.row_size  112
-performance_schema     session_connect_attrs.row_count 512
-performance_schema     session_connect_attrs.memory    57344
-performance_schema     (account_hash).count    2
-performance_schema     (account_hash).size     10
-performance_schema     (digest_hash).count     0
-performance_schema     (digest_hash).size      1000
-performance_schema     (filename_hash).count   0
-performance_schema     (filename_hash).size    1556
-performance_schema     (host_hash).count       2
-performance_schema     (host_hash).size        20
-performance_schema     (setup_actor_hash).count        1
-performance_schema     (setup_actor_hash).size 100
-performance_schema     (setup_object_hash).count       4
-performance_schema     (setup_object_hash).size        100
-performance_schema     (table_share_hash).count        80
-performance_schema     (table_share_hash).size 445
-performance_schema     (user_hash).count       2
-performance_schema     (user_hash).size        5
-performance_schema     host_cache.size 336
-performance_schema     performance_schema.memory       24771616
+CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit.");
index c2e7a4df4bf8e613edaad008473801dbb5423d1b..2eda017467ab6737fc4fcb57ed39fa1c567e21e5 100644 (file)
@@ -7,7 +7,9 @@ table_open_cache        401
 show variables like "max_connections";
 Variable_name  Value
 max_connections        152
-show variables like "%performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -21,6 +23,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1079
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  1754
@@ -31,7 +34,6 @@ performance_schema_max_rwlock_instances       2222
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        232
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   573
 performance_schema_max_table_instances 556
 performance_schema_max_thread_classes  50
@@ -65,160 +67,3 @@ Performance_schema_table_instances_lost     0
 Performance_schema_thread_classes_lost 0
 Performance_schema_thread_instances_lost       0
 Performance_schema_users_lost  0
-show engine performance_schema status;
-Type   Name    Status
-performance_schema     events_waits_current.row_size   184
-performance_schema     events_waits_current.row_count  1734
-performance_schema     events_waits_history.row_size   184
-performance_schema     events_waits_history.row_count  2890
-performance_schema     events_waits_history.memory     531760
-performance_schema     events_waits_history_long.row_size      184
-performance_schema     events_waits_history_long.row_count     1000
-performance_schema     events_waits_history_long.memory        184000
-performance_schema     (pfs_mutex_class).row_size      256
-performance_schema     (pfs_mutex_class).row_count     200
-performance_schema     (pfs_mutex_class).memory        51200
-performance_schema     (pfs_rwlock_class).row_size     320
-performance_schema     (pfs_rwlock_class).row_count    40
-performance_schema     (pfs_rwlock_class).memory       12800
-performance_schema     (pfs_cond_class).row_size       256
-performance_schema     (pfs_cond_class).row_count      80
-performance_schema     (pfs_cond_class).memory 20480
-performance_schema     (pfs_thread_class).row_size     192
-performance_schema     (pfs_thread_class).row_count    50
-performance_schema     (pfs_thread_class).memory       9600
-performance_schema     (pfs_file_class).row_size       320
-performance_schema     (pfs_file_class).row_count      50
-performance_schema     (pfs_file_class).memory 16000
-performance_schema     mutex_instances.row_size        128
-performance_schema     mutex_instances.row_count       4230
-performance_schema     mutex_instances.memory  541440
-performance_schema     rwlock_instances.row_size       192
-performance_schema     rwlock_instances.row_count      2222
-performance_schema     rwlock_instances.memory 426624
-performance_schema     cond_instances.row_size 128
-performance_schema     cond_instances.row_count        1079
-performance_schema     cond_instances.memory   138112
-performance_schema     threads.row_size        2816
-performance_schema     threads.row_count       289
-performance_schema     threads.memory  813824
-performance_schema     file_instances.row_size 704
-performance_schema     file_instances.row_count        1754
-performance_schema     file_instances.memory   1234816
-performance_schema     (pfs_file_handle).row_size      8
-performance_schema     (pfs_file_handle).row_count     32768
-performance_schema     (pfs_file_handle).memory        262144
-performance_schema     events_waits_summary_by_thread_by_event_name.row_size   32
-performance_schema     events_waits_summary_by_thread_by_event_name.row_count  110687
-performance_schema     events_waits_summary_by_thread_by_event_name.memory     3541984
-performance_schema     (pfs_table_share).row_size      22208
-performance_schema     (pfs_table_share).row_count     556
-performance_schema     (pfs_table_share).memory        12347648
-performance_schema     (pfs_table).row_size    9280
-performance_schema     (pfs_table).row_count   573
-performance_schema     (pfs_table).memory      5317440
-performance_schema     setup_actors.row_size   256
-performance_schema     setup_actors.row_count  100
-performance_schema     setup_actors.memory     25600
-performance_schema     setup_objects.row_size  448
-performance_schema     setup_objects.row_count 100
-performance_schema     setup_objects.memory    44800
-performance_schema     (pfs_account).row_size  256
-performance_schema     (pfs_account).row_count 100
-performance_schema     (pfs_account).memory    25600
-performance_schema     events_waits_summary_by_account_by_event_name.row_size  32
-performance_schema     events_waits_summary_by_account_by_event_name.row_count 38300
-performance_schema     events_waits_summary_by_account_by_event_name.memory    1225600
-performance_schema     events_waits_summary_by_user_by_event_name.row_size     32
-performance_schema     events_waits_summary_by_user_by_event_name.row_count    38300
-performance_schema     events_waits_summary_by_user_by_event_name.memory       1225600
-performance_schema     events_waits_summary_by_host_by_event_name.row_size     32
-performance_schema     events_waits_summary_by_host_by_event_name.row_count    38300
-performance_schema     events_waits_summary_by_host_by_event_name.memory       1225600
-performance_schema     (pfs_user).row_size     128
-performance_schema     (pfs_user).row_count    100
-performance_schema     (pfs_user).memory       12800
-performance_schema     (pfs_host).row_size     128
-performance_schema     (pfs_host).row_count    100
-performance_schema     (pfs_host).memory       12800
-performance_schema     (pfs_stage_class).row_size      256
-performance_schema     (pfs_stage_class).row_count     150
-performance_schema     (pfs_stage_class).memory        38400
-performance_schema     events_stages_history.row_size  88
-performance_schema     events_stages_history.row_count 2890
-performance_schema     events_stages_history.memory    254320
-performance_schema     events_stages_history_long.row_size     88
-performance_schema     events_stages_history_long.row_count    1000
-performance_schema     events_stages_history_long.memory       88000
-performance_schema     events_stages_summary_by_thread_by_event_name.row_size  32
-performance_schema     events_stages_summary_by_thread_by_event_name.row_count 43350
-performance_schema     events_stages_summary_by_thread_by_event_name.memory    1387200
-performance_schema     events_stages_summary_global_by_event_name.row_size     32
-performance_schema     events_stages_summary_global_by_event_name.row_count    150
-performance_schema     events_stages_summary_global_by_event_name.memory       4800
-performance_schema     events_stages_summary_by_account_by_event_name.row_size 32
-performance_schema     events_stages_summary_by_account_by_event_name.row_count        15000
-performance_schema     events_stages_summary_by_account_by_event_name.memory   480000
-performance_schema     events_stages_summary_by_user_by_event_name.row_size    32
-performance_schema     events_stages_summary_by_user_by_event_name.row_count   15000
-performance_schema     events_stages_summary_by_user_by_event_name.memory      480000
-performance_schema     events_stages_summary_by_host_by_event_name.row_size    32
-performance_schema     events_stages_summary_by_host_by_event_name.row_count   15000
-performance_schema     events_stages_summary_by_host_by_event_name.memory      480000
-performance_schema     (pfs_statement_class).row_size  192
-performance_schema     (pfs_statement_class).row_count 168
-performance_schema     (pfs_statement_class).memory    32256
-performance_schema     events_statements_history.row_size      3024
-performance_schema     events_statements_history.row_count     2890
-performance_schema     events_statements_history.memory        8739360
-performance_schema     events_statements_history_long.row_size 3024
-performance_schema     events_statements_history_long.row_count        1000
-performance_schema     events_statements_history_long.memory   3024000
-performance_schema     events_statements_summary_by_thread_by_event_name.row_size      184
-performance_schema     events_statements_summary_by_thread_by_event_name.row_count     48552
-performance_schema     events_statements_summary_by_thread_by_event_name.memory        8933568
-performance_schema     events_statements_summary_global_by_event_name.row_size 184
-performance_schema     events_statements_summary_global_by_event_name.row_count        168
-performance_schema     events_statements_summary_global_by_event_name.memory   30912
-performance_schema     events_statements_summary_by_account_by_event_name.row_size     184
-performance_schema     events_statements_summary_by_account_by_event_name.row_count    16800
-performance_schema     events_statements_summary_by_account_by_event_name.memory       3091200
-performance_schema     events_statements_summary_by_user_by_event_name.row_size        184
-performance_schema     events_statements_summary_by_user_by_event_name.row_count       16800
-performance_schema     events_statements_summary_by_user_by_event_name.memory  3091200
-performance_schema     events_statements_summary_by_host_by_event_name.row_size        184
-performance_schema     events_statements_summary_by_host_by_event_name.row_count       16800
-performance_schema     events_statements_summary_by_host_by_event_name.memory  3091200
-performance_schema     events_statements_current.row_size      3024
-performance_schema     events_statements_current.row_count     289
-performance_schema     events_statements_current.memory        873936
-performance_schema     (pfs_socket_class).row_size     320
-performance_schema     (pfs_socket_class).row_count    10
-performance_schema     (pfs_socket_class).memory       3200
-performance_schema     socket_instances.row_size       320
-performance_schema     socket_instances.row_count      232
-performance_schema     socket_instances.memory 74240
-performance_schema     events_statements_summary_by_digest.row_size    1472
-performance_schema     events_statements_summary_by_digest.row_count   5000
-performance_schema     events_statements_summary_by_digest.memory      7360000
-performance_schema     session_connect_attrs.row_size  289
-performance_schema     session_connect_attrs.row_count 512
-performance_schema     session_connect_attrs.memory    147968
-performance_schema     (account_hash).count    2
-performance_schema     (account_hash).size     100
-performance_schema     (digest_hash).count     0
-performance_schema     (digest_hash).size      5000
-performance_schema     (filename_hash).count   0
-performance_schema     (filename_hash).size    1754
-performance_schema     (host_hash).count       2
-performance_schema     (host_hash).size        100
-performance_schema     (setup_actor_hash).count        1
-performance_schema     (setup_actor_hash).size 100
-performance_schema     (setup_object_hash).count       4
-performance_schema     (setup_object_hash).size        100
-performance_schema     (table_share_hash).count        80
-performance_schema     (table_share_hash).size 556
-performance_schema     (user_hash).count       2
-performance_schema     (user_hash).size        100
-performance_schema     host_cache.size 336
-performance_schema     performance_schema.memory       70954032
index 0d95a8c0f1b2924a2b2d7c3d7ddaa5833e95d8f2..b4ca7b1b9be01a35f4b0b4986a3865fd02d26269 100644 (file)
@@ -1,4 +1,6 @@
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     OFF
 performance_schema_accounts_size       -1
@@ -12,6 +14,7 @@ performance_schema_events_waits_history_size  -1
 performance_schema_hosts_size  -1
 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
@@ -22,7 +25,6 @@ performance_schema_max_rwlock_instances       -1
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        -1
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   -1
 performance_schema_max_table_instances -1
 performance_schema_max_thread_classes  50
index 9f22ca75162c0026a285201262af0d8249afb2e0..382824458a034adbeb182314294bb69ee76b5dd8 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index d73d7920cd74cdc0602b394daf30c0ef24c04560..6fae8be810f6f219ba6c1c70dd403b34df64a4c8 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index af5fbb00d1515336d44dbb203abebef0ba36c67e..ff9c6f93268cd799e82d7430f16eade5aefd8498 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 92f50e0a699e408ab9312f8528d4b543c8d10fcc..38e1f59cd39cf8c82d1391eb5318e2c7b5c71c9f 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index ac5d03945c2a0fd6a36f9c10e6cffb21382702e7..a270b4a63203460cffc91f4562ae7d1761ec6fbe 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_low_digest.result b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_low_digest.result
new file mode 100644 (file)
index 0000000..d7eccb1
--- /dev/null
@@ -0,0 +1,12 @@
+USE performance_schema;
+truncate table events_statements_history_long;
+SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1;
+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
+74
+####################################
+# QUERYING PS STATEMENT DIGEST
+####################################
+SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
+event_name     digest  digest_text     sql_text
+statement/sql/truncate 23e0e19c4baa66c6be30e70f75e52178        TRUNCATE TABLE  truncate table events_statements_history_long
+statement/sql/select   6695eca04b8387c092d89fa88d767328        SELECT ? + ? +  SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
index d45e9a7791076e25779bf83fa2de6c1b88e140c0..05d67d88a8b0d4bfb76a1963513958e08aee6f6b 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       0
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index fb7eb60c915352591e2c8fcda6366a4a7bc0c570..574c8d4173b58b3e1a42f9b7b92ac935e0a6d6a2 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    0
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 3fa4ed1a43df2ce5d2c3b22e9383a012dbbe2fe6..ea5c7a691257080714aead54cbacb7f571334ca8 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  0
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 6079cb7fbdfe7a3ff302bd726d31d26ce2f247f6..0f93054bfd4ad5c35bf669a428b397b13d2f763d 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    0
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 786c8a6cb96e383356b28a670505c87dad419187..71004d68f5e88f7bda4d436f373be27975d570bb 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  0
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 26b736922fe04ca7e8dc458a12fd69c1a2da5656..329f74a4fffc38e40036d2ac5eda13c2c7d78b70 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  0
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 77210f4253f115295ce8a70ed5e3759034ccb08c..cda2719cc37ca7103b62ac03fd2fce82a206e922 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index ca2ce3114c9b9ee5a9cdf6d8a966d81b3201bd1b..0ea5fe445216bd5562338a3e76568a4776479fb1 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 252c6c7f0aa0e0230a1ea19b8cd5aac8b7f877b4..29a17e6a3ac4c59623a44ab56d24000683329a4b 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index e7655a314ea48fb109091ae47be210673b6898c2..8b214077f371696ea5c2b52c6843650c995a9592 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       0
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 48c0574912fcf73328306039990a4e30f99ce7be..3a0588d616de2bd5d592b7d113d2985d2840f9d6 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index aecc8fa1bd0c411b7dfca6c1cd3a2ad74f01e7d8..89763379b99ed63fa097b5d1e22d640c9d18f790 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index d247a9b148d063ec3b6822b759122ca12a0c5495..0b14c6caf15478cd948a13302abdceaed895209d 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  0
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 6682121bd992e4494a08e48ef25e091f34ce9ea1..599e09f6c99a7f0d652830a3e04c69db7342edf2 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        0
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 41275012bfa700c38f5c145cbe853c6f88a19a67..1d53efc500cdd05e62336e095c8d02b1daa32992 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   0
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 0e367945cfccc6783ac1dbf737dbd2a6cbafd792..370ec61ff6704ad563bea79734b5639afd473243 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index aa3de1ab7cd171b3f89cefd45ee7fe50a374b381..d8018e0ba44b239a9603cef4e90704ac4fe8d700 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 78fe9223ef45d610e2760ad0d3dc45f9519a28cc..a617e7edb0a4d6f2ff6cb2a3105e490f30bdabac 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       0
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index d890992ac830fea1c3d6d799f02606e878abff85..8d196aa9a4a1a2ad051d410b5cb47b666bbbc545 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 62b3290d7ed4633baf2ebc7e097f1498ad4454e7..360e8db910bf390305fa39a4bde2389d8fcf6198 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 0e5837c9eaf5a54d7e1486d083eebdec9e4c8c3b..01b7233582e35316a973c8172134a5853183833d 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   0
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 72347f1416094ca7013eedd60cd4a243f029124d..5608c324321faee9b2459746b32f6c509e033c10 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 0
 performance_schema_max_thread_classes  50
index e5dd500c316bcb7dca879fa90b446fa5d2c686ca..b1a7758a9d891802170d9f1eae100caec1475688 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  0
index d36c2b30441e48a1ebd5c1a487a301a116661b15..ad0353589ad40b164b02a9fd6919d4900bdf3a00 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 89efe84d9387403cc00168d48d6d430bdf9d5f5d..2e1c097e28b0c2ffb1668ace84cfe05996b71c97 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 81e999bc0ee8bbe7227bfdbd21b003cf65ee12e9..a3a9cbeee11b0e5496a14a050322dfd941a25159 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  0
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index bca3594c2253a88eefc3ce68181b86d0491f8802..e5465aa6bbbb6311a03e75246785b9bd6e95faf5 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 4e6994d670e4ce1c66ada4f579696a5277d3c9dc..d28eed31e7d49f4c28417d7a4cb14f4d2390f979 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       0
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  0
 performance_schema_hosts_size  0
 performance_schema_max_cond_classes    0
 performance_schema_max_cond_instances  0
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    0
 performance_schema_max_file_handles    0
 performance_schema_max_file_instances  0
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       0
 performance_schema_max_socket_classes  0
 performance_schema_max_socket_instances        0
 performance_schema_max_stage_classes   0
-performance_schema_max_statement_classes       0
 performance_schema_max_table_handles   0
 performance_schema_max_table_instances 0
 performance_schema_max_thread_classes  0
@@ -118,6 +120,7 @@ performance_schema_events_waits_history_size        0
 performance_schema_hosts_size  0
 performance_schema_max_cond_classes    0
 performance_schema_max_cond_instances  0
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    0
 performance_schema_max_file_handles    0
 performance_schema_max_file_instances  0
index f5249dc203963c3b4af585605c893c3c01defcd7..a5f552b4bbf4181dcca5c9199135dd97a06f7722 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     OFF
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index ac5d03945c2a0fd6a36f9c10e6cffb21382702e7..a270b4a63203460cffc91f4562ae7d1761ec6fbe 100644 (file)
@@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table;
 select * from performance_schema.table_lock_waits_summary_by_table;
 select * from performance_schema.threads;
 select * from performance_schema.users;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -83,6 +85,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -93,7 +96,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 699add920d2fd3ca12507e74c279f475a90c73fe..2c053942f1975bf0dc9091d272b9f510d53664b5 100644 (file)
@@ -112,43 +112,41 @@ DROP TRIGGER trg;
 SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
 SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
 SCHEMA_NAME    DIGEST  DIGEST_TEXT     COUNT_STAR      SUM_ROWS_AFFECTED       SUM_WARNINGS    SUM_ERRORS
-statements_digest      e4a84a547a18a89f4708509a720def58        TRUNCATE TABLE performance_schema . events_statements_summary_by_digest         1       0       0       0
-statements_digest      ab105aea9c15b3842ad161d18349f9c4        SELECT ? FROM t1        1       0       0       0
-statements_digest      835083efbaa5d8c29d01d558abb8216b        SELECT ? FROM `t1`      1       0       0       0
-statements_digest      6ff375c6f4b283de91711a78bd91b953        SELECT ?, ... FROM t1   2       0       0       0
-statements_digest      4879fbad051c94ff76e6ad29effa4903        SELECT ? FROM t2        1       0       0       0
-statements_digest      b1ea4bca7c91ebd647b6b81e80a2ef94        SELECT ?, ... FROM t2   2       0       0       0
-statements_digest      14d463345df747d42a036019a5988a9b        INSERT INTO t1 VALUES (?)       1       1       0       0
-statements_digest      ff2d8aa1fd516f5e25b0faf7b1c80b04        INSERT INTO t2 VALUES (?)       1       1       0       0
-statements_digest      430116339c3a5bf0a1aa9a96e9cfd354        INSERT INTO t3 VALUES (...)     4       4       0       0
-statements_digest      01467137a1045e85119538ea248d52dd        INSERT INTO t4 VALUES (...)     1       1       0       0
-statements_digest      b201a20a2a534d2789750270b7f90fab        INSERT INTO t5 VALUES (...)     1       1       0       0
-statements_digest      b1a5f24770580f243ad6704590165d90        INSERT INTO t1 VALUES (?) /* , ... */   2       7       0       0
-statements_digest      bbbf619ec8ca4ec4a4da28a71eb12a2f        INSERT INTO t3 VALUES (...) /* , ... */         1       3       0       0
-statements_digest      de7bdb298875f4ef826383e3fce53ef9        INSERT INTO t5 VALUES (...) /* , ... */         1       3       0       0
-statements_digest      f79cdc2ddca01e9ea89782b3548b01e3        INSERT INTO t1 VALUES ( NULL )  1       1       0       0
-statements_digest      cd4a3e419e2eaed79f66a705ff002910        INSERT INTO t6 VALUES (...)     5       5       0       0
+statements_digest      01cfd3c48ebe150803a02f0b32ab4f7b        TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest`     1       0       0       0
+statements_digest      4a958a8b2138b7ae3b65a0edde877dca        SELECT ? FROM `t1`      2       0       0       0
+statements_digest      1f346cc75586f18fdded6e2f518e7d25        SELECT ?, ... FROM `t1`         2       0       0       0
+statements_digest      9ed289e97245aee8872bd79573ff71dc        SELECT ? FROM `t2`      1       0       0       0
+statements_digest      ec5d6ae42b4292cce44168c701fde301        SELECT ?, ... FROM `t2`         2       0       0       0
+statements_digest      c689b670f102bc028f36273ed00244de        INSERT INTO `t1` VALUES (?)     2       2       0       0
+statements_digest      baf2d67435fc5a66f517bd655c9154a3        INSERT INTO `t2` VALUES (?)     1       1       0       0
+statements_digest      cba557f7a643fac3a34563f74c57f040        INSERT INTO `t3` VALUES (...)   4       4       0       0
+statements_digest      26f967699697844ef6757a283c0432e0        INSERT INTO `t4` VALUES (...)   1       1       0       0
+statements_digest      1565e5ec0755d0d212e84567fdb86500        INSERT INTO `t5` VALUES (...)   1       1       0       0
+statements_digest      931de69cfc4123c9f5ebeb8da2e6fb0e        INSERT INTO `t1` VALUES (?) /* , ... */         2       7       0       0
+statements_digest      81d8a0e0212bb8e02ad8f5e84d8c819a        INSERT INTO `t3` VALUES (...) /* , ... */       1       3       0       0
+statements_digest      793ba1cc016c6e3c45c63023531955ad        INSERT INTO `t5` VALUES (...) /* , ... */       1       3       0       0
+statements_digest      d44b7d3c3f03b5b9605c9cffb537b083        INSERT INTO `t6` VALUES (...)   5       5       0       0
 statements_digest      f2d57cea9e78e7b37c4509c0564dd1cc        SELECT ? + ?    3       0       0       0
 statements_digest      02396199eed2345830efcf00e51107ee        SELECT ?        1       0       0       0
-statements_digest      7c5b403e11cb8fa41954f8b81d47fb44        CREATE SCHEMA statements_digest_temp    2       2       0       0
-statements_digest      d5c2a9eedc964698407667a633301e69        DROP SCHEMA statements_digest_temp      2       0       0       0
-statements_digest      add5619cd2761d01c66b68b50a4c0476        SELECT ? FROM no_such_table     1       0       0       1
-statements_digest      f59e7a7dbcdc342b7ea72ae24e5ef081        CREATE TABLE dup_table ( c CHARACTER (?) )      2       0       0       1
-statements_digest      b42311b2b180ba680ebb286f671982f1        DROP TABLE dup_table    1       0       0       0
-statements_digest      8af43d157243ebdc9dcb1a9502acdd24        INSERT INTO t11 VALUES (?)      1       1       1       0
+statements_digest      d02f821e8ce0a27519c833324368696d        CREATE SCHEMA `statements_digest_temp`  2       2       0       0
+statements_digest      5ea9da83763ff4b01e34c408d865568f        DROP SCHEMA `statements_digest_temp`    2       0       0       0
+statements_digest      ac9dfca3fe35b0d4c43a6bf62a3489b5        SELECT ? FROM `no_such_table`   1       0       0       1
+statements_digest      9fd65056536a8d74ea107b68849cfd27        CREATE TABLE `dup_table` ( `c` CHARACTER (?) )  2       0       0       1
+statements_digest      f259e984954d6d77a9f94230726e1c0f        DROP TABLE `dup_table`  1       0       0       0
+statements_digest      17c0f9e5abf747e425ae24b66d44cf01        INSERT INTO `t11` VALUES (?)    1       1       1       0
 statements_digest      cee5b131782212e0ba1cd76ba28485c4        SHOW WARNINGS   1       0       0       0
-statements_digest      438623439c3a1702203d6190795127ad        PREPARE stmt FROM ?     1       0       0       0
-statements_digest      e53b71815168ad954fd921a6ae1860c9        EXECUTE stmt    2       0       0       0
-statements_digest      3bccf5096186ceaf50c11c3deb4e21cf        DEALLOCATE PREPARE stmt         1       0       0       0
-statements_digest      e20f8d5cb15105439af39592b79c0edd        CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END   1       0       0       0
-statements_digest      10298a45c9f7114e4985de53ca99bda7        CALL p1 ( )     2       0       0       0
-statements_digest      efc046c5d04acb8afa61326f759ad380        DROP PROCEDURE p1       1       0       0       0
-statements_digest      8eaf9e776b79f24f2b8fae8efb92d8a4        CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b       1       0       0       0
-statements_digest      b364c71d8c904eb9e95df4d0ca258c00        SELECT func (...)       2       0       0       0
-statements_digest      88e7ac9784e4561d12fadccde6ea704a        DROP FUNCTION func      1       0       0       0
-statements_digest      15deeaae5594a691cf21abd4439ee5e6        CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ?       1       0       0       0
-statements_digest      074e38814943a6dce874784d21fea89d        INSERT INTO t12 VALUES (?)      2       2       0       0
-statements_digest      2b5b02ba54b27638d5d8dbe917ff432d        DROP TRIGGER trg        1       0       0       0
+statements_digest      44d441f36c0487f8b32b6cb1e37f7c3f        PREPARE `stmt` FROM ?   1       0       0       0
+statements_digest      73bf0dc38bbbc571613bdb78e85ddb18        EXECUTE `stmt`  2       0       0       0
+statements_digest      8a87274dfc2961861326c1591f0df4bc        DEALLOCATE PREPARE `stmt`       1       0       0       0
+statements_digest      639ff9b1728335f463d2ed4134c7ec26        CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END       1       0       0       0
+statements_digest      627bb08bd333aa83cb4bbad88ab6e6b8        CALL `p1` ( )   2       0       0       0
+statements_digest      949464b6c55462d9d7ad3f0a7608db10        DROP PROCEDURE `p1`     1       0       0       0
+statements_digest      bfc5c562a60a60857a026a17434e77bb        CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b`       1       0       0       0
+statements_digest      cf6fe4a8895dabaf9c30615b49bce6db        SELECT `func` (...)     2       0       0       0
+statements_digest      4b2d4d67e2faa0b938156e60e1f2023b        DROP FUNCTION `func`    1       0       0       0
+statements_digest      b859e51c90bdd984a1226ecf25fd80de        CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ?    1       0       0       0
+statements_digest      cb2f065274b3e03693cb7d5396d4d978        INSERT INTO `t12` VALUES (?)    2       2       0       0
+statements_digest      903b51b5db2d5393542a7fc2614049fd        DROP TRIGGER `trg`      1       0       0       0
 ####################################
 # CLEANUP
 ####################################
index 3f5b730510b90bb653cfe557b70cca1a1b5f2151..dcc8f43f27b366f845fa9929c489f49b0afe1d82 100644 (file)
@@ -125,43 +125,41 @@ DROP TRIGGER trg;
 ####################################
 SELECT schema_name, digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
 schema_name    digest  digest_text     count_star
-statements_digest      e4a84a547a18a89f4708509a720def58        TRUNCATE TABLE performance_schema . events_statements_summary_by_digest         1
-statements_digest      ab105aea9c15b3842ad161d18349f9c4        SELECT ? FROM t1        1
-statements_digest      835083efbaa5d8c29d01d558abb8216b        SELECT ? FROM `t1`      1
-statements_digest      6ff375c6f4b283de91711a78bd91b953        SELECT ?, ... FROM t1   2
-statements_digest      4879fbad051c94ff76e6ad29effa4903        SELECT ? FROM t2        1
-statements_digest      b1ea4bca7c91ebd647b6b81e80a2ef94        SELECT ?, ... FROM t2   2
-statements_digest      14d463345df747d42a036019a5988a9b        INSERT INTO t1 VALUES (?)       1
-statements_digest      ff2d8aa1fd516f5e25b0faf7b1c80b04        INSERT INTO t2 VALUES (?)       1
-statements_digest      430116339c3a5bf0a1aa9a96e9cfd354        INSERT INTO t3 VALUES (...)     4
-statements_digest      01467137a1045e85119538ea248d52dd        INSERT INTO t4 VALUES (...)     1
-statements_digest      b201a20a2a534d2789750270b7f90fab        INSERT INTO t5 VALUES (...)     1
-statements_digest      b1a5f24770580f243ad6704590165d90        INSERT INTO t1 VALUES (?) /* , ... */   2
-statements_digest      bbbf619ec8ca4ec4a4da28a71eb12a2f        INSERT INTO t3 VALUES (...) /* , ... */         1
-statements_digest      de7bdb298875f4ef826383e3fce53ef9        INSERT INTO t5 VALUES (...) /* , ... */         1
-statements_digest      f79cdc2ddca01e9ea89782b3548b01e3        INSERT INTO t1 VALUES ( NULL )  1
-statements_digest      cd4a3e419e2eaed79f66a705ff002910        INSERT INTO t6 VALUES (...)     5
+statements_digest      01cfd3c48ebe150803a02f0b32ab4f7b        TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest`     1
+statements_digest      4a958a8b2138b7ae3b65a0edde877dca        SELECT ? FROM `t1`      2
+statements_digest      1f346cc75586f18fdded6e2f518e7d25        SELECT ?, ... FROM `t1`         2
+statements_digest      9ed289e97245aee8872bd79573ff71dc        SELECT ? FROM `t2`      1
+statements_digest      ec5d6ae42b4292cce44168c701fde301        SELECT ?, ... FROM `t2`         2
+statements_digest      c689b670f102bc028f36273ed00244de        INSERT INTO `t1` VALUES (?)     2
+statements_digest      baf2d67435fc5a66f517bd655c9154a3        INSERT INTO `t2` VALUES (?)     1
+statements_digest      cba557f7a643fac3a34563f74c57f040        INSERT INTO `t3` VALUES (...)   4
+statements_digest      26f967699697844ef6757a283c0432e0        INSERT INTO `t4` VALUES (...)   1
+statements_digest      1565e5ec0755d0d212e84567fdb86500        INSERT INTO `t5` VALUES (...)   1
+statements_digest      931de69cfc4123c9f5ebeb8da2e6fb0e        INSERT INTO `t1` VALUES (?) /* , ... */         2
+statements_digest      81d8a0e0212bb8e02ad8f5e84d8c819a        INSERT INTO `t3` VALUES (...) /* , ... */       1
+statements_digest      793ba1cc016c6e3c45c63023531955ad        INSERT INTO `t5` VALUES (...) /* , ... */       1
+statements_digest      d44b7d3c3f03b5b9605c9cffb537b083        INSERT INTO `t6` VALUES (...)   5
 statements_digest      f2d57cea9e78e7b37c4509c0564dd1cc        SELECT ? + ?    3
 statements_digest      02396199eed2345830efcf00e51107ee        SELECT ?        1
-statements_digest      7c5b403e11cb8fa41954f8b81d47fb44        CREATE SCHEMA statements_digest_temp    2
-statements_digest      d5c2a9eedc964698407667a633301e69        DROP SCHEMA statements_digest_temp      2
-statements_digest      add5619cd2761d01c66b68b50a4c0476        SELECT ? FROM no_such_table     1
-statements_digest      f59e7a7dbcdc342b7ea72ae24e5ef081        CREATE TABLE dup_table ( c CHARACTER (?) )      2
-statements_digest      b42311b2b180ba680ebb286f671982f1        DROP TABLE dup_table    1
-statements_digest      8af43d157243ebdc9dcb1a9502acdd24        INSERT INTO t11 VALUES (?)      1
+statements_digest      d02f821e8ce0a27519c833324368696d        CREATE SCHEMA `statements_digest_temp`  2
+statements_digest      5ea9da83763ff4b01e34c408d865568f        DROP SCHEMA `statements_digest_temp`    2
+statements_digest      ac9dfca3fe35b0d4c43a6bf62a3489b5        SELECT ? FROM `no_such_table`   1
+statements_digest      9fd65056536a8d74ea107b68849cfd27        CREATE TABLE `dup_table` ( `c` CHARACTER (?) )  2
+statements_digest      f259e984954d6d77a9f94230726e1c0f        DROP TABLE `dup_table`  1
+statements_digest      17c0f9e5abf747e425ae24b66d44cf01        INSERT INTO `t11` VALUES (?)    1
 statements_digest      cee5b131782212e0ba1cd76ba28485c4        SHOW WARNINGS   1
-statements_digest      438623439c3a1702203d6190795127ad        PREPARE stmt FROM ?     1
-statements_digest      e53b71815168ad954fd921a6ae1860c9        EXECUTE stmt    2
-statements_digest      3bccf5096186ceaf50c11c3deb4e21cf        DEALLOCATE PREPARE stmt         1
-statements_digest      e20f8d5cb15105439af39592b79c0edd        CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END   1
-statements_digest      10298a45c9f7114e4985de53ca99bda7        CALL p1 ( )     2
-statements_digest      efc046c5d04acb8afa61326f759ad380        DROP PROCEDURE p1       1
-statements_digest      8eaf9e776b79f24f2b8fae8efb92d8a4        CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b       1
-statements_digest      b364c71d8c904eb9e95df4d0ca258c00        SELECT func (...)       2
-statements_digest      88e7ac9784e4561d12fadccde6ea704a        DROP FUNCTION func      1
-statements_digest      15deeaae5594a691cf21abd4439ee5e6        CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ?       1
-statements_digest      074e38814943a6dce874784d21fea89d        INSERT INTO t12 VALUES (?)      2
-statements_digest      2b5b02ba54b27638d5d8dbe917ff432d        DROP TRIGGER trg        1
+statements_digest      44d441f36c0487f8b32b6cb1e37f7c3f        PREPARE `stmt` FROM ?   1
+statements_digest      73bf0dc38bbbc571613bdb78e85ddb18        EXECUTE `stmt`  2
+statements_digest      8a87274dfc2961861326c1591f0df4bc        DEALLOCATE PREPARE `stmt`       1
+statements_digest      639ff9b1728335f463d2ed4134c7ec26        CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END       1
+statements_digest      627bb08bd333aa83cb4bbad88ab6e6b8        CALL `p1` ( )   2
+statements_digest      949464b6c55462d9d7ad3f0a7608db10        DROP PROCEDURE `p1`     1
+statements_digest      bfc5c562a60a60857a026a17434e77bb        CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b`       1
+statements_digest      cf6fe4a8895dabaf9c30615b49bce6db        SELECT `func` (...)     2
+statements_digest      4b2d4d67e2faa0b938156e60e1f2023b        DROP FUNCTION `func`    1
+statements_digest      b859e51c90bdd984a1226ecf25fd80de        CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ?    1
+statements_digest      cb2f065274b3e03693cb7d5396d4d978        INSERT INTO `t12` VALUES (?)    2
+statements_digest      903b51b5db2d5393542a7fc2614049fd        DROP TRIGGER `trg`      1
 SELECT digest, digest_text FROM performance_schema.events_statements_current;
 digest digest_text
 ####################################
index 9dee9dd481b6b9c95e711e79d8490cfcca33bbfc..f125b8262f9032cbe63cb73835bde64025780106 100644 (file)
@@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
 ####################################
 SELECT schema_name, digest, digest_text, count_star FROM events_statements_summary_by_digest;
 schema_name    digest  digest_text     count_star
-performance_schema     e8d937c7ecf79e105de0f9e364fa5edb        TRUNCATE TABLE events_statements_summary_by_digest      1
-performance_schema     5d9a2f95653d8ca9d9cea3eefff7e361        SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ...  1
+performance_schema     d12faab4b919fcc50abb18a009fb6b0b        TRUNCATE TABLE `events_statements_summary_by_digest`    1
+performance_schema     5d9a2f95653d8ca9d9cea3eefff7e361        SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ?    1
index e59a03324dd8daa42791635b4923f031eca65b17..b56a331e486f8e903f3a7fd8ae8b73bd82ef9303 100644 (file)
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -53,6 +55,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -63,7 +66,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index bb1fc975cd95e0b26677c91e9e82caec03598989..93d71b8742c2d4e10ae1c42c33098861e40f86c1 100644 (file)
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -52,6 +54,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -62,7 +65,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index ae067698e2dbeacb03246a16874bd5a3c9ac26ae..bcbdd53ba1170e6e437eff5db9e62bcd7b54a9cc 100644 (file)
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -53,6 +55,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -63,7 +66,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 333d3844867c899f87b87015b27aa680a6cc220f..99dd3d817f2250a1d1e0d8f236da246693dc5f25 100644 (file)
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -52,6 +54,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -62,7 +65,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 61af4a203c9fabcf5f833d845c832233a6c48973..fd1d65210898b43bc0f1d01753a2946a516b68d2 100644 (file)
@@ -37,7 +37,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -51,6 +53,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -61,7 +64,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index ba109d45783eabfd1a3a4678a113b639457bbb11..3a4b7bed85d2636c8b3bbece37247d64a534c4cc 100644 (file)
@@ -36,7 +36,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -50,6 +52,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -60,7 +63,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index f19d737061df479ba2a4072d8bc4aec5e5fcd67d..1e0885de07c56609f5acb67521257ec35d8b7a11 100644 (file)
@@ -37,7 +37,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -51,6 +53,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -61,7 +64,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 05c4be28be355fae060ed206dd5ee708fe736263..539874152941bb39d33a549b0af5ec6c35f2b06e 100644 (file)
@@ -36,7 +36,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -50,6 +52,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -60,7 +63,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 50935c7afbec43ecb1bb0004757b77839e1a78b4..029a5d538610476905e9e04e41e7b7c7259ca2ca 100644 (file)
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -52,6 +54,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -62,7 +65,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 83345b6edda849422f70ecfd9d684f622edb7488..671c01f80bc9d5de977976e8496b89892509dfe1 100644 (file)
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -53,6 +55,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -63,7 +66,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index b53f0696f5699a40e6e2378ab7ead3a939f4f44b..6f357cfa1d1a79d0b7d471a350b9aae90808d2a4 100644 (file)
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -52,6 +54,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -62,7 +65,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 3b8f6326031baf9953c71cd622d40228d940db8b..2732634010d3231516ff59af07092b322ea618ec 100644 (file)
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -53,6 +55,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -63,7 +66,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 023ff3760c7cc6497e176ab9ef4b24cc7c179491..e19a4f2f3ed20e2b32725fb2b05b95f43d62fc0d 100644 (file)
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -52,6 +54,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -62,7 +65,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index df42b39c7268dea5b3b5ce7ff9de7227d1dd9849..88bf5b164aaf6b09bb1bc490fbf2bd495bc1846c 100644 (file)
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -55,6 +57,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -65,7 +68,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 30b48d592531e7f6a64e681b7a3228610fa041fa..e58aa6895093d1172c55025a8659dc5ac292c82f 100644 (file)
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -54,6 +56,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -64,7 +67,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 4804265562cbdcd40afcd9dec872f353de55f316..72df9aaf0a34324e8ece884bfafcd247a0651d46 100644 (file)
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -55,6 +57,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -65,7 +68,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 086957fa25e14eee5104dce53e32e9f3690da17d..3eb75359eede589276861b659b7eeaa06e07308f 100644 (file)
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -54,6 +56,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -64,7 +67,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 08356e894daecb506d5ffdcc0d1e7d68cc4f2b53..7af6f77dda84467fc6dd5cd561b4c684ac04b700 100644 (file)
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -53,6 +55,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -63,7 +66,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index e60acb62ff778147ecacdb28bad7b942a2fed75e..2eef23de28eca854b63cbb2255e77a91f2f5463b 100644 (file)
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -52,6 +54,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -62,7 +65,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 5593fd8ec85f6fd119860922d4ca31c0c8825f07..e0f321133b79248676bf06193b85b288a30f235a 100644 (file)
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -53,6 +55,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -63,7 +66,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 0fd700c86ac270d79162d0baf12167a2702b1454..51c9c3dfece0706ab7e4277b29541425e8f00d88 100644 (file)
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -52,6 +54,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -62,7 +65,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index c4c98c1143fdf04ec60724670a5cd3890464c99f..035e67abf45c2c049d2272834c78f64938a0b423 100644 (file)
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -55,6 +57,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -65,7 +68,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 3563e7bb366428c734fd788cddb69307cb1ca54d..8bb532b048161be052444dd6c814f138c2bbe119 100644 (file)
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -54,6 +56,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -64,7 +67,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 0cf5970111d78b3905257814d5b8ca5ee1bdd78a..a3d58d2dcc413dc5b4506815c96c123810a8a407 100644 (file)
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -55,6 +57,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -65,7 +68,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index c94d2192f22ae7f355ba0b6c54445696e7cc6108..c372ac3f3ea1f4f0c7c2db6366a73e09a69f9f7b 100644 (file)
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -54,6 +56,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -64,7 +67,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 84074f4d0ce8c17f9e4b19d9fec924797fca5e8b..f2c7937458366d101cbc04c6669cb7fcad77ea4d 100644 (file)
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -55,6 +57,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -65,7 +68,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 413b70c17bdb1e0f46b6f774ff9a6b4cee7647fc..66a917412a9098b633e57eac569038304624e895 100644 (file)
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -54,6 +56,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -64,7 +67,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index dfa300a09ed6d486a19ab5d268616bd86007d3d2..3b6326fd2df9eff1ca75c7468e0a846e4e3ef83d 100644 (file)
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -55,6 +57,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -65,7 +68,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index b4ca5202558af77891b622dc6482d3bb2b83e6b3..85e1bbeb33279c1c6062db88faf448b9f455e0d7 100644 (file)
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -54,6 +56,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -64,7 +67,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 50aeea5363a482edda89789bf7e5e1b24ffe2d72..725770f2b3c27648b849712037b53f8bc0027f55 100644 (file)
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -53,6 +55,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -63,7 +66,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index eeea805e941f89d6d2368fe94e992f0fc119cc4f..d92ec0a1997840b4f529e286b619dc2605838ff5 100644 (file)
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -52,6 +54,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -62,7 +65,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index ce9e0aeff852ec68bddcb8c247ca54e7e6b07c6e..b03a26f46944c85fe7446435588309d34af8cb01 100644 (file)
@@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -53,6 +55,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -63,7 +66,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 2ecd7d56411d95de6c94b42685d7ce764a0ac294..ca62861bedb2a94d7af34eb724fb2188a6618c81 100644 (file)
@@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -52,6 +54,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -62,7 +65,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 372ed695675a39b13fceaf9fff55e241d885f213..7c1bbd2ddb0bd23d02e1d9963c9cb68e64b0ed8d 100644 (file)
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -55,6 +57,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -65,7 +68,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 3f1e78a46da66d73650532f07f6835796f42a9a2..302563786d2f2ad399dc43ea5e0f3d40891c5cbf 100644 (file)
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -54,6 +56,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -64,7 +67,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index d88e8f4d49ae3a35c423239442cc1ebdb188abf7..390a35234215193bdeef6e90a147c77b2f71d8ca 100644 (file)
@@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -55,6 +57,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -65,7 +68,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
index 7b90426f3f8521eb90b9d23a0f42998b84b45e60..123075896aaace47939642c941b331d679d3db33 100644 (file)
@@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name;
 truncate performance_schema.events_waits_summary_by_host_by_event_name;
 truncate performance_schema.events_waits_summary_global_by_event_name;
 truncate performance_schema.events_waits_history_long;
-show variables like "performance_schema%";
+show variables where
+`Variable_name` != "performance_schema_max_statement_classes" and
+`Variable_name` like "performance_schema%";
 Variable_name  Value
 performance_schema     ON
 performance_schema_accounts_size       100
@@ -54,6 +56,7 @@ performance_schema_events_waits_history_size  10
 performance_schema_hosts_size  100
 performance_schema_max_cond_classes    80
 performance_schema_max_cond_instances  1000
+performance_schema_max_digest_length   1024
 performance_schema_max_file_classes    50
 performance_schema_max_file_handles    32768
 performance_schema_max_file_instances  10000
@@ -64,7 +67,6 @@ performance_schema_max_rwlock_instances       5000
 performance_schema_max_socket_classes  10
 performance_schema_max_socket_instances        1000
 performance_schema_max_stage_classes   150
-performance_schema_max_statement_classes       168
 performance_schema_max_table_handles   1000
 performance_schema_max_table_instances 500
 performance_schema_max_thread_classes  50
diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_name.result b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/table_name.result
new file mode 100644 (file)
index 0000000..d6369ff
--- /dev/null
@@ -0,0 +1,156 @@
+
+#
+# TEST 1: Normal tables prefixed with "#sql" and "sql".
+#
+USE test;
+CREATE TABLE `#sql_1` (a int, b text);
+INSERT INTO `#sql_1` VALUES(1,'one');
+
+CREATE TABLE `sql_1` (a int, b text);
+INSERT INTO `sql_1` VALUES(1,'one');
+
+# Verify that the tables are treated as normal tables .
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+TABLE  test    #sql_1
+TABLE  test    sql_1
+
+# Drop the tables, verify that the table objects are removed.
+
+DROP TABLE `#sql_1`;
+DROP TABLE `sql_1`;
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+
+#
+# TEST 2: Temporary tables, no special prefix.
+#
+CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM;
+INSERT INTO sql_temp2_myisam VALUES(1,'one');
+
+CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB;
+INSERT INTO sql_temp2_innodb VALUES(1,'one');
+
+# Confirm that the temporary tables are ignored.
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+
+# Drop the tables, verify that the table objects are not created.
+
+DROP TABLE sql_temp2_myisam;
+DROP TABLE sql_temp2_innodb;
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+
+#
+# TEST 3: Temporary tables with the "#sql" prefix.
+#
+CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM;
+CHECK TABLE `#sql_temp3_myisam`;
+Table  Op      Msg_type        Msg_text
+test.#sql_temp3_myisam check   status  OK
+INSERT INTO `#sql_temp3_myisam` VALUES(1,'one');
+
+CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB;
+CHECK TABLE `#sql_temp3_innodb`;
+Table  Op      Msg_type        Msg_text
+test.#sql_temp3_innodb check   status  OK
+INSERT INTO `#sql_temp3_innodb` VALUES(1,'one');
+
+# Confirm that the temporary tables are ignored.
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+
+# Drop the temporary tables.
+
+DROP TABLE `#sql_temp3_myisam`;
+DROP TABLE `#sql_temp3_innodb`;
+
+# Confirm that the temporary tables are still ignored.
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+
+#
+# TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary
+#         when they are truncated.
+#
+CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
+INSERT INTO `sql_temp4_myisam` VALUES(1,'one');
+
+CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
+INSERT INTO `#sql_temp4_myisam` VALUES(1,'one');
+
+# Confirm that the MyISAM temporary tables are ignored.
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+
+# Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary.
+
+TRUNCATE TABLE `sql_temp4_myisam`;
+TRUNCATE TABLE `#sql_temp4_myisam`;
+
+# Confirm that the recreated MyISAM tables are still regarded as temporary and ignored.
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+
+# Drop the recreated MyISAM tables;
+
+DROP TABLE `sql_temp4_myisam`;
+DROP TABLE `#sql_temp4_myisam`;
+
+# Confirm that the recreated temporary tables are still ignored.
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+
+#
+# TEST 5: Generate temporary tables with ALTER MyISAM table.
+#
+USE test;
+CREATE TABLE t1 (a int) ENGINE=MYISAM;
+INSERT INTO t1 VALUES (1), (2), (3);
+ALTER TABLE t1 ADD COLUMN (b int);
+
+# Confirm that the recreated temporary tables are still ignored.
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
+
+# Drop the MyISAM table
+
+DROP TABLE t1;
+
+# Confirm that no tables remain;
+
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+object_type    object_schema   object_name
index 4da857f83fc8a0860d6bfd3f0177024133e24631..6ab0b0641b08e25c9cebcf7a80ee69be7583bbd8 100644 (file)
@@ -13,7 +13,7 @@ processlist_user      NULL
 processlist_host       NULL
 processlist_db NULL
 processlist_command    NULL
-processlist_info       INTERNAL DDL LOG RECOVER IN PROGRESS
+processlist_info       NULL
 unified_parent_thread_id       NULL
 role   NULL
 instrumented   YES
index 40fcc026fad6658ccceb317d17b37b9ad22062c6..44347886a964bb9c3734f237c852d10422302ab1 100644 (file)
@@ -39,9 +39,9 @@ ERROR 42S02: Table 'test.expect_unchanged' doesn't exist
 SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
 FROM performance_schema.events_statements_summary_by_digest;
 SCHEMA_NAME    DIGEST_TEXT     COUNT_STAR
-test   TRUNCATE TABLE performance_schema . events_statements_summary_by_digest         1
-test   SELECT ? FROM expect_unary      5
-test   SELECT ? + ? FROM expect_binary         2
-test   SELECT ? - ? FROM expect_binary         2
-test   INSERT INTO expect_full_reduce VALUES (...)     27
-test   SELECT a - b , a + b , - a , - b , + a , + b FROM expect_unchanged      1
+test   TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest`     1
+test   SELECT ? FROM `expect_unary`    5
+test   SELECT ? + ? FROM `expect_binary`       2
+test   SELECT ? - ? FROM `expect_binary`       2
+test   INSERT INTO `expect_full_reduce` VALUES (...)   27
+test   SELECT `a` - `b` , `a` + `b` , - `a` , - `b` , + `a` , + `b` FROM `expect_unchanged`    1
index 5f17b5ae9e134fbfc2bec54ee70fc3ef52b4ce6a..db6acf65c73c153a5a1f5c1af6a266bddc404143 100644 (file)
@@ -52,7 +52,7 @@ insert into marker set a = 1;
 optimize table test.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
 insert into marker set a = 1;
 select * from test.v1;
 a      b
diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/digest_null_literal.test b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/digest_null_literal.test
new file mode 100644 (file)
index 0000000..91f1eec
--- /dev/null
@@ -0,0 +1,32 @@
+# ----------------------------------------------------
+# Tests for the performance schema statement Digests.
+# ----------------------------------------------------
+
+# Test case to show behavior of statements digest when
+# parsing a NULL literal
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/no_protocol.inc
+
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+
+--disable_query_log
+
+select NULL;
+select NULL FROM DUAL;
+select NULL, NULL;
+select NULL, NULL, NULL, 1, 2, 3, NULL, NULL;
+
+select 1 IS NULL;
+select 2 IS NOT NULL;
+select 1 IS NULL, 2 IS NULL, 3 IS NOT NULL, 4 IS NOT NULL;
+
+create table foo (a int DEFAULT NULL, b int NOT NULL DEFAULT 1, c int NOT NULL);
+drop table foo;
+
+--enable_query_log
+
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
+  FROM performance_schema.events_statements_summary_by_digest;
+
index 888298bbb09e2eebe1471f7dde7bdc4bff6f2b9e..1a6d6b5dd522d52fa87c5c568214a9b3d80f24f1 100644 (file)
@@ -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
index 8a4f11ba51f8f29ac3d373c43eccc5bc91954a18..b679b7ab04869be434204be4b5181867bd6bb093 100644 (file)
@@ -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
index f73b8785cb217cf090e6f8e602598fe1aa9b5fd9..1ab6005f7e2596c9fb6bfcffd95970da61c2cfdc 100644 (file)
@@ -56,7 +56,9 @@ let $wait_condition= select 1 from performance_schema.events_waits_current where
 # Observe the blocked thread in the performance schema :)
 select event_name,
   left(source, locate(":", source)) as short_source,
-  timer_end, timer_wait, operation
+  if(timer_end IS NULL, NULL, "SET") as timer_end,
+  if(timer_wait IS NULL, NULL, "SET") as timer_wait,
+  operation
   from performance_schema.events_waits_current
   where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";
 
index b7e714a6271f4c01c79fb5b893c8093d7045cca8..b5af044a1f6ebf413c6eea2a152b7cbc3d53c605 100644 (file)
@@ -3,6 +3,7 @@
 
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
+--source include/no_protocol.inc
 
 #
 # Bug#12790483 OBJECTS_SUMMARY_GLOBAL_BY_TYPE AND RENAME TABLE
@@ -168,3 +169,40 @@ SELECT object_schema,
 
 DROP TABLE t_60905;
 
+
+#
+# Bug#11929832 - EVENTS_STATEMENTS_HISTORY HAS ERRORS=0 WHEN THERE ARE ERRORS
+#
+# Verify that SQL errors are properly counted.
+
+use test;
+truncate performance_schema.events_statements_history;
+truncate performance_schema.events_statements_history_long;
+
+--error ER_NO_SUCH_TABLE
+select * from t1;
+
+--echo 
+select mysql_errno, returned_sqlstate, message_text, errors, warnings
+  from performance_schema.events_statements_history where errors > 0;
+  
+--echo
+select mysql_errno, returned_sqlstate, message_text, errors, warnings from 
+  performance_schema.events_statements_history_long where errors > 0;
+
+#
+# Bug#20519832 - TRUNCATED SQL_TEXT values are not suffixed with '...'
+#
+# Verify that truncated SQL statements are suffixed with '...'
+
+use performance_schema;
+truncate performance_schema.events_statements_history;
+
+# Should truncate at 1024 bytes (1024 characters)
+select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' AS A;
+
+# Should truncate at 1024 bytes (487 characters)
+
+select _utf8mb4 'ваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81ÑваÑ\81Ñ' as B;
+
+select count(*) from events_statements_history where sql_text like "%...";
index 4535e0e04f75cce08ebf337f23ae8ecd6ad0b9f7..ea55284c8049061e8d4f3294addc79332de94ac4 100644 (file)
@@ -5,7 +5,7 @@
 # On windows, the socket instrumentation collects an extra "opt"
 # event, which changes the test output.
 --source include/not_windows.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 --source ../include/wait_for_pfs_thread_count.inc
 --source include/have_QC_Disabled.inc
 
index 0856e266386cbba3f51b15d95e08721811061a10..4069aac4bbdb955a936dc9b52b9f6218a8dfa3dc 100644 (file)
@@ -122,8 +122,9 @@ $
 delimiter ;$
 
 # Check the configuration is ok
-show variables like "performance_schema%";
-show status like "performance_schema%";
+show variables where
+    `Variable_name` != "performance_schema_max_statement_classes" and
+    `Variable_name` like "performance_schema%";
 
 call check_instrument("wait/synch/mutex/");
 call check_instrument("wait/synch/rwlock/");
index 8b4cc1a3d62d1507d9a67b30a0533f9597832e4a..68079fb5959d379d614e822f1764ca439adce056 100644 (file)
@@ -36,7 +36,9 @@ insert into test.marker set a = 1;
 # This will not, the ACL cache is already loaded
 insert into test.marker set a = 1;
 insert into test.marker set a = 1;
-show variables like "performance_schema%";
+show variables where
+    `Variable_name` != "performance_schema_max_statement_classes" and
+    `Variable_name` like "performance_schema%";
 show status like "performance_schema%";
 # Stop recording events + pull results
 let $schema_to_dump= "test", "mysql";
index 60d4a648222ebc5e303b69624b3c9a0e41e8ce8a..802e574f89b8866c7809680a4ddda44ecb0ede6d 100644 (file)
@@ -34,6 +34,7 @@ show status like "Qcache_hits";
 
 select spins from performance_schema.events_waits_current order by event_name limit 1;
 
+--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND}
 select * from performance_schema.setup_timers where name='wait';
 
 show status like "Qcache_queries_in_cache";
@@ -42,6 +43,7 @@ show status like "Qcache_hits";
 
 select spins from performance_schema.events_waits_current order by event_name limit 1;
 
+--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND}
 select * from performance_schema.setup_timers where name='wait';
 
 show status like "Qcache_queries_in_cache";
index cdee1be64759d14494332dea08b036834b17e9cd..3258425124ae3a9e2fe41f52fdfa332f6b006ea8 100644 (file)
@@ -1,6 +1,6 @@
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 
 -- source include/master-slave.inc
 
index 8e719610ba914219cf85d25093c252d0c8cc23f9..f6b1236e1840736773bc2237a6a90724c5e70460 100644 (file)
@@ -3,7 +3,7 @@
 #
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 --source include/have_binlog_format_mixed.inc
 --source include/master-slave.inc
 
@@ -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
index 4d02d41aecdb77adfcf229d9dd2a733e59a37b1d..56446fd6973ca1fef790d8fe7d6aceaa9e7ca9aa 100644 (file)
@@ -7,3 +7,4 @@
 
 --source ../include/sizing_auto.inc
 
+CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit.");
index 83b49572cb48f57b8dac3037b60008d14ac5208e..32729918bd1aadf0c19ee88800bc56dbfb3724e9 100644 (file)
@@ -2,5 +2,7 @@
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
 
-show variables like "performance_schema%";
+show variables where
+    `Variable_name` != "performance_schema_max_statement_classes" and
+    `Variable_name` like "performance_schema%";
 show status like "performance_schema%";
index 1c317cedcf57e2c3849311ce0bd9a4d300de521d..095ff30d4f1a43a4f4849e0d023ed5f62f181e21 100644 (file)
@@ -26,7 +26,7 @@
 # happens per SQL statement within our MTR tests. And there is a significant
 # difference between standard statement execution and execution via
 # prepared statement.
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 
 # Set this to enable debugging output
 let $my_socket_debug= 0;
index cad6d5cf998bb7f56efc807e49c5b63115b836c3..b523b2fe22424c528f4c2d89748afa516b1765dc 100644 (file)
@@ -36,7 +36,7 @@
 # happens per SQL statement within our MTR tests. And there is a significant
 # difference between standard statement execution and execution via
 # prepared statement.
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 
 
 #===================================
index c7ca254d5bb1f8c88d673747d4b4c0be84165d03..5b02dccc9e6d9472a75c734be3c4b5d407ac2984 100644 (file)
@@ -38,7 +38,7 @@
 # happens per SQL statement within our MTR tests. And there is a significant
 # difference between standard statement execution and execution via
 # prepared statement.
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 
 
 #===================================
diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_low_digest-master.opt b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_low_digest-master.opt
new file mode 100644 (file)
index 0000000..fc5065f
--- /dev/null
@@ -0,0 +1 @@
+--max_digest_length=10
diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_low_digest.test b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_low_digest.test
new file mode 100644 (file)
index 0000000..6f06def
--- /dev/null
@@ -0,0 +1,21 @@
+# -----------------------------------------------------------------------
+# Tests for the performance schema statement Digests.
+# -----------------------------------------------------------------------
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/no_protocol.inc
+
+USE performance_schema;
+truncate table events_statements_history_long;
+
+# -----------------------------------------------------------------------
+# Test to show how the digest behaves with low value of 
+#  - performance_schema_max_digest_length
+# -----------------------------------------------------------------------
+SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1;
+
+--echo ####################################
+--echo # QUERYING PS STATEMENT DIGEST
+--echo ####################################
+SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
index 3969383a6fbd4ce41c460362eff920808118b94c..b7ba18ef2cb5065656963551cdd345b29b23e4d6 100644 (file)
@@ -4,7 +4,7 @@
 
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 
 USE performance_schema;
 truncate table events_statements_summary_by_digest;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/table_name.test b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/table_name.test
new file mode 100644 (file)
index 0000000..00df678
--- /dev/null
@@ -0,0 +1,164 @@
+#
+# Performance Schema
+#
+# Verify that the Performance Schema correctly identifies normal and temporary
+# tables with non-standard names.
+
+# The server uses the table name prefix "#sql" for temporary and intermediate
+# tables, however user-defined tables having the "#sql" prefix are also permitted.
+# Independent of the table name, temporary or intermediate tables always have the
+# "#sql" prefix in the filename. (For non-temporary tables starting with "#",
+# the "#" is encoded to @0023 in the filename.)
+#
+# Given the ambiguity with temporary table names, the Performance Schema identifies
+# temporary tables tables either by the table category or by the filename.
+#
+--source include/have_perfschema.inc
+--source include/not_embedded.inc
+
+--echo
+--echo #
+--echo # TEST 1: Normal tables prefixed with "#sql" and "sql".
+--echo #
+USE test;
+CREATE TABLE `#sql_1` (a int, b text);
+# INSERT forces path through get_table_share()
+INSERT INTO `#sql_1` VALUES(1,'one');
+--echo
+CREATE TABLE `sql_1` (a int, b text);
+INSERT INTO `sql_1` VALUES(1,'one');
+--echo
+--echo # Verify that the tables are treated as normal tables .
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+--echo
+--echo # Drop the tables, verify that the table objects are removed.
+--echo
+DROP TABLE `#sql_1`;
+DROP TABLE `sql_1`;
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+
+--echo
+--echo #
+--echo # TEST 2: Temporary tables, no special prefix.
+--echo #
+CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM;
+INSERT INTO sql_temp2_myisam VALUES(1,'one');
+--echo
+CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB;
+INSERT INTO sql_temp2_innodb VALUES(1,'one');
+--echo
+--echo # Confirm that the temporary tables are ignored.
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+--echo
+--echo # Drop the tables, verify that the table objects are not created.
+--echo
+DROP TABLE sql_temp2_myisam;
+DROP TABLE sql_temp2_innodb;
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+
+--echo
+--echo #
+--echo # TEST 3: Temporary tables with the "#sql" prefix.
+--echo #
+CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM;
+CHECK TABLE `#sql_temp3_myisam`;
+INSERT INTO `#sql_temp3_myisam` VALUES(1,'one');
+--echo
+CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB;
+CHECK TABLE `#sql_temp3_innodb`;
+INSERT INTO `#sql_temp3_innodb` VALUES(1,'one');
+--echo
+--echo # Confirm that the temporary tables are ignored.
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+--echo
+--echo # Drop the temporary tables.
+--echo
+DROP TABLE `#sql_temp3_myisam`;
+DROP TABLE `#sql_temp3_innodb`;
+--echo
+--echo # Confirm that the temporary tables are still ignored.
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+
+--echo
+--echo #
+--echo # TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary
+--echo #         when they are truncated.
+--echo #
+CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
+INSERT INTO `sql_temp4_myisam` VALUES(1,'one');
+--echo
+CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
+INSERT INTO `#sql_temp4_myisam` VALUES(1,'one');
+--echo
+--echo # Confirm that the MyISAM temporary tables are ignored.
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+--echo
+--echo # Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary.
+--echo
+TRUNCATE TABLE `sql_temp4_myisam`;
+TRUNCATE TABLE `#sql_temp4_myisam`;
+--echo
+--echo # Confirm that the recreated MyISAM tables are still regarded as temporary and ignored.
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+--echo
+--echo # Drop the recreated MyISAM tables;
+--echo
+DROP TABLE `sql_temp4_myisam`;
+DROP TABLE `#sql_temp4_myisam`;
+--echo
+--echo # Confirm that the recreated temporary tables are still ignored.
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+
+--echo
+--echo #
+--echo # TEST 5: Generate temporary tables with ALTER MyISAM table.
+--echo #
+USE test;
+CREATE TABLE t1 (a int) ENGINE=MYISAM;
+INSERT INTO t1 VALUES (1), (2), (3);
+# Force a path throug mysql_alter_table() and ha_create_table().
+ALTER TABLE t1 ADD COLUMN (b int);
+--echo
+--echo # Confirm that the recreated temporary tables are still ignored.
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
+--echo
+--echo # Drop the MyISAM table
+--echo
+DROP TABLE t1;
+
+--echo
+--echo # Confirm that no tables remain;
+--echo
+SELECT object_type, object_schema, object_name
+FROM performance_schema.objects_summary_global_by_type
+WHERE object_schema="test";
index c4583484f36fb20bce3bba531197e729b9fb8529..d8daea70d3869b2db2e43e5003506da7ac80b6f4 100644 (file)
@@ -7,7 +7,7 @@
 
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
---source ../include/no_protocol.inc
+--source include/no_protocol.inc
 
 TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result
new file mode 100644 (file)
index 0000000..1bc802a
--- /dev/null
@@ -0,0 +1,28 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+BEGIN
+ROLLBACK TO event_logging;
+INSERT t3 VALUES (x);
+END;
+SAVEPOINT event_logging;
+INSERT INTO t2 VALUES (x);
+RELEASE SAVEPOINT event_logging;
+END|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_apply_binlog_with_anonymous_gtid.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_apply_binlog_with_anonymous_gtid.result
new file mode 100644 (file)
index 0000000..7e8b48e
--- /dev/null
@@ -0,0 +1,30 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+#
+# Stop slave threads and clear slave datadir.
+#
+include/stop_slave.inc
+RESET SLAVE;
+[connection master]
+CREATE TABLE t1 (c1 INT);
+[connection slave]
+#
+# Copy the binlog with Anonymous_GTID log events and
+# relay log index to slave datadir.
+#
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+#
+# Make sure that the binlog with Anonymous_GTID log events
+# is applied completely.
+#
+include/assert.inc [Table t2 must contain 1]
+DROP TABLE t2;
+[connection master]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_apply_binlog_with_anonymous_gtid_when_gtid_mode_on.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_apply_binlog_with_anonymous_gtid_when_gtid_mode_on.result
new file mode 100644 (file)
index 0000000..6a938f5
--- /dev/null
@@ -0,0 +1,30 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+#
+# Stop slave threads and clear slave datadir.
+#
+include/stop_slave.inc
+RESET SLAVE;
+#
+# Copy the binlog with Anonymous_GTID log events and
+# relay log index to slave datadir.
+#
+#
+# Process the binlog with Anonymous_GTID log events.
+#
+START SLAVE;
+#
+# Wait for SQL thread error.
+#
+call mtr.add_suppression("Slave.* @@SESSION.GTID_NEXT cannot be set to ANONYMOUS when @@GLOBAL.GTID_MODE = ON.");
+include/wait_for_slave_sql_error.inc [errno=1782]
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+[connection master]
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_apply_binlog_with_gtid_when_gtid_mode_off.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_apply_binlog_with_gtid_when_gtid_mode_off.result
new file mode 100644 (file)
index 0000000..1c1a222
--- /dev/null
@@ -0,0 +1,30 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+#
+# Stop slave threads and clear slave datadir.
+#
+include/stop_slave.inc
+RESET SLAVE;
+#
+# Copy the binlog with Anonymous_GTID log events and
+# relay log index to slave datadir.
+#
+#
+# Process the binlog with Anonymous_GTID log events.
+#
+START SLAVE;
+#
+# Wait for SQL thread error.
+#
+call mtr.add_suppression("Slave.* @@SESSION.GTID_NEXT cannot be set to UUID:NUMBER when @@GLOBAL.GTID_MODE = OFF.");
+include/wait_for_slave_sql_error.inc [errno=1781]
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+[connection master]
+include/rpl_end.inc
index 0d858cf439f85da8bed20480b378f3c0b108ca95..283d24454cdefbc7ac7a2f4e0c49f5c4804c5fb3 100644 (file)
@@ -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-wsrep-5.6/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result
new file mode 100644 (file)
index 0000000..fcad4cf
--- /dev/null
@@ -0,0 +1,32 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+Test case 1:- table name with one character latin name.
+SET @s:=CONCAT("CREATE TABLE `",REPEAT(CHAR(131),1),"` (a INT)");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("INSERT INTO `",REPEAT(CHAR(131),1),"` VALUES (1)");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("DROP TABLE `",REPEAT(CHAR(131),1), "`");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+Test case 2:- table name and database names with one character latin name.
+SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),1),"`");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("CREATE TABLE `",REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1),"` (a INT)");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("INSERT INTO `",REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1),"` VALUES (1)");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("DROP TABLE `",REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1), "`");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),1),"`");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_avoid_temporal_upgrade.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_avoid_temporal_upgrade.result
new file mode 100644 (file)
index 0000000..5cfb815
--- /dev/null
@@ -0,0 +1,170 @@
+#
+# BUG#18985760 - "FAST" ALTER TABLE CHANGE ON ENUM COLUMN
+#                 TRIGGERS FULL TABLE REBUILD.
+# Test case below ensures that the columns with old temporal
+# format are not upgraded on the slave since the global variable
+# 'avoid_temporal_upgrade' is enabled on the slave.
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+# Copy the table containing the old Mysql-5.5 temporal format
+# to the master and slave.
+# Enable the 'avoid_temporal_column' global variable on slave.
+STOP SLAVE;
+SET @@global.avoid_temporal_upgrade= ON;
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+START SLAVE;
+# ALTER TABLE on the master.
+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 ADD COLUMN fld1 INT;
+Warnings:
+Note   1880    TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format.
+INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
+# Since the global variable 'avoid_temporal_upgrade' is disabled on 
+# the master, the temporal columns of old format are 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 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     80A28A  998714A28A      7468F975
+00:00:00       2000-01-01 01:01:01     2001-01-21 18:11:01     800000  9964421041      3A6AFC05
+01:01:10       2020-01-01 01:01:01     1980-11-21 18:06:01     80104A  99A5421041      147BF1D9
+NULL   2000-01-01 01:01:01     2015-11-21 17:11:01     NULL    9964421041      56507B75
+00:00:00       NULL    2011-11-21 17:11:01     800000  NULL    4ECA5BF5
+22:22:22       2011-11-21 22:22:22     2011-11-21 22:22:22     816596  998AAB6596      4ECAA4EE
+include/sync_slave_sql_with_master.inc
+# Since 'avoid_temporal_upgrade' is enabled on the slave,
+# the old temporal will not be upgraded on the slave.
+SET @saved_show_old_temporals= @@session.show_old_temporals;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+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
+22:22:22       2011-11-21 22:22:22     2011-11-21 22:22:22     83640E  0000124A7C3C8A4E        4ECAA4EE
+SET SESSION show_old_temporals= ON;
+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 /* 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,
+  `fld1` int(11) DEFAULT NULL
+) ENGINE=MyISAM 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 */
+int(11)
+SET @@session.show_old_temporals= @saved_show_old_temporals;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+#Cleanup
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+# Testcase to ensure that the temporal columns of old format
+# are upgraded on the slave since 'avoid_temporal_column'
+# global variable is not enabled on the slave.
+# Copy the table containing the old Mysql-5.5 temporal format
+# to the master and slave.
+# Disable the 'avoid_temporal_column' global variable on slave.
+STOP SLAVE;
+SET @@global.avoid_temporal_upgrade= 0;
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+START SLAVE;
+# ALTER TABLE on the master.
+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 ADD COLUMN fld1 INT;
+Warnings:
+Note   1880    TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format.
+INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
+# Since the default value of 'avoid_temporal_upgrade' is FALSE,
+# the old temporal will be upgraded on the master.
+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     80A28A  998714A28A      7468F975
+00:00:00       2000-01-01 01:01:01     2001-01-21 18:11:01     800000  9964421041      3A6AFC05
+01:01:10       2020-01-01 01:01:01     1980-11-21 18:06:01     80104A  99A5421041      147BF1D9
+NULL   2000-01-01 01:01:01     2015-11-21 17:11:01     NULL    9964421041      56507B75
+00:00:00       NULL    2011-11-21 17:11:01     800000  NULL    4ECA5BF5
+22:22:22       2011-11-21 22:22:22     2011-11-21 22:22:22     816596  998AAB6596      4ECAA4EE
+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,
+  `fld1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+COLUMN_TYPE
+time
+timestamp
+datetime
+int(11)
+include/sync_slave_sql_with_master.inc
+# Since the default value of 'avoid_temporal_upgrade' is FALSE,
+# the old temporal will be upgraded on the slave.
+SET @saved_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.
+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     80A28A  998714A28A      7468F975
+00:00:00       2000-01-01 01:01:01     2001-01-21 18:11:01     800000  9964421041      3A6AFC05
+01:01:10       2020-01-01 01:01:01     1980-11-21 18:06:01     80104A  99A5421041      147BF1D9
+NULL   2000-01-01 01:01:01     2015-11-21 17:11:01     NULL    9964421041      56507B75
+00:00:00       NULL    2011-11-21 17:11:01     800000  NULL    4ECA5BF5
+22:22:22       2011-11-21 22:22:22     2011-11-21 22:22:22     816596  998AAB6596      4ECAA4EE
+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,
+  `fld1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+COLUMN_TYPE
+time
+timestamp
+datetime
+int(11)
+SET @@session.show_old_temporals= @saved_show_old_temporals;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+# cleanup
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
index f82a55e7139e8e36d2662c037fd4a2fe025ea7e8..f01ce011630170d30dab289122067a8ea659d06d 100644 (file)
@@ -23,9 +23,8 @@ FLUSH LOGS;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
 # assert: must show one binlog
-show binary logs;
-Log_name       File_size
-master-bin.000001      #
+master-bin.000001
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 ###################### TEST #3
 CREATE TABLE t1 (a INT);
@@ -53,6 +52,7 @@ SELECT count(*) FROM t2;
 count(*)
 1
 DELETE FROM t2;
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 ###################### TEST #5
 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2;
@@ -80,6 +80,7 @@ count(*)
 3
 SET AUTOCOMMIT= 1;
 DELETE FROM t2;
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 ###################### TEST #7
 SELECT count(*) FROM t4;
@@ -92,11 +93,8 @@ ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 SELECT count(*) FROM t4;
 count(*)
 1
-### check that the incident event is written to the current log
-include/show_binlog_events.inc
-Log_name       Pos     Event_type      Server_id       End_log_pos     Info
-master-bin.000001      #       Query   #       #       BEGIN
 DELETE FROM t4;
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 ###################### TEST #8
 SET @xxx = REPEAT('xxx', 1000);
@@ -113,9 +111,11 @@ count(*)
 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
+include/rpl_restart_server.inc [server_number=1]
 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
+include/rpl_restart_server.inc [server_number=1]
 set @aaa = repeat('aaa',1000);
 set @bbb = repeat('bbb',1000);
 set @ccc = repeat('ccc',1000);
@@ -133,9 +133,16 @@ count(*)
 SELECT count(*) FROM t2;
 count(*)
 6
+include/rpl_restart_server.inc [server_number=1]
+SET @xxx = REPEAT('xxx', 1000);
+SET @yyy = REPEAT('yyy', 1000);
 DELETE FROM t4 WHERE a IN (@xxx, @yyy) OR 1;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
+include/rpl_restart_server.inc [server_number=1]
+set @aaa = repeat('aaa',1000);
+set @bbb = repeat('bbb',1000);
+set @ccc = repeat('ccc',1000);
 DELETE FROM t2 WHERE a IN (@aaa, @bbb, @ccc) OR 1;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
@@ -173,6 +180,7 @@ SET SQL_LOG_BIN=1;
 ###################### TEST #10
 call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
 call mtr.add_suppression("Could not open .*");
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 SHOW WARNINGS;
 Level  Code    Message
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_binlog_failed_drop_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_binlog_failed_drop_table.result
new file mode 100644 (file)
index 0000000..6387a80
--- /dev/null
@@ -0,0 +1,23 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE DATABASE `db1`;
+USE `db1`;
+CREATE TABLE `t1` (`ID` bigint(20) primary key) ENGINE=InnoDB;
+CREATE TABLE `t2` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `DIVISION_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `FK_TABLE1_DIVISION_1` (`DIVISION_ID`), CONSTRAINT `FK_TABLE1_DIVISION_1` FOREIGN KEY (`DIVISION_ID`) REFERENCES `t1` (`ID`) ON DELETE CASCADE ) ENGINE=InnoDB;
+CREATE TABLE `t3` (`ID` bigint(20) primary key) ENGINE=InnoDB;
+DROP TABLE IF EXISTS `db1`.`t1`;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+include/assert.inc [Drop with single table should not be written to the binary log if the query execution fails]
+DROP TABLE `t3`, `t1`, `t2`;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `db1`; DROP TABLE `t3`,`t1`,`t2` /* generated by server */
+include/sync_slave_sql_with_master.inc
+Cleanup
+[connection master]
+DROP DATABASE `db1`;
+include/rpl_end.inc
index 00347e0a241231d5c8417e0786f99984006cb12b..0971cf5ee0dbdc3e48584012ec1e20b3c134c6dd 100644 (file)
@@ -14,6 +14,7 @@ Note  ####    Storing MySQL user name or password information in the master info rep
 start slave;
 include/wait_for_slave_sql_error.inc [errno=1593]
 Last_SQL_Error = 'Failed during slave thread initialization'
+include/wait_for_slave_io_to_stop.inc
 SET GLOBAL debug="";
 RESET SLAVE;
 include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_crc_check.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_crc_check.result
new file mode 100644 (file)
index 0000000..283f29a
--- /dev/null
@@ -0,0 +1,18 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+include/stop_slave_sql.inc
+[connection master]
+CREATE TABLE t1 (c1 INT);
+#
+# Start slave applier thread to verify that
+# their is no event crc check failure.
+#
+[connection slave]
+include/start_slave_sql.inc
+[connection master]
+DROP TABLE t1;
+include/rpl_end.inc
index 95eeef8f898f1ffba8353975b37d34149835f7cc..e46f60adddd66d77ed6cc8c5ebe651ad386c717d 100644 (file)
@@ -9,6 +9,7 @@ use db1;
 CREATE TABLE a(id INT);
 CREATE VIEW v AS SELECT * FROM a;
 CREATE TABLE table_father(id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20)) ENGINE=INNODB;
+include/sync_slave_sql_with_master.inc
 use db2;
 CREATE TABLE table_child(id INT PRIMARY KEY, info VARCHAR(20), father_id INT) ENGINE=INNODB;
 ALTER TABLE table_child ADD CONSTRAINT aaa FOREIGN KEY (father_id) REFERENCES db1.table_father(id);
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_temp_tbl_with_rewrite_db.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_temp_tbl_with_rewrite_db.result
new file mode 100644 (file)
index 0000000..df3b551
--- /dev/null
@@ -0,0 +1,43 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+CREATE DATABASE new_test;
+[connection master]
+use test;
+CREATE TEMPORARY TABLE t1(id int);
+include/sync_slave_sql_with_master.inc
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+slave-bin.000001       #       Query   #       #       CREATE DATABASE new_test
+slave-bin.000001       #       Query   #       #       use `new_test`; CREATE TEMPORARY TABLE t1(id int)
+SHOW STATUS LIKE 'Slave_open_temp_tables';
+Variable_name  Value
+Slave_open_temp_tables 1
+[connection master]
+use test;
+DROP TEMPORARY TABLE IF EXISTS t1;
+include/sync_slave_sql_with_master.inc
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+slave-bin.000001       #       Query   #       #       CREATE DATABASE new_test
+slave-bin.000001       #       Query   #       #       use `new_test`; CREATE TEMPORARY TABLE t1(id int)
+slave-bin.000001       #       Query   #       #       use `new_test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+SHOW STATUS LIKE 'Slave_open_temp_tables';
+Variable_name  Value
+Slave_open_temp_tables 0
+[connection master]
+use test;
+CREATE TEMPORARY TABLE t1(id int);
+include/sync_slave_sql_with_master.inc
+SHOW STATUS LIKE 'Slave_open_temp_tables';
+Variable_name  Value
+Slave_open_temp_tables 1
+[connection slave]
+SHOW STATUS LIKE 'Slave_open_temp_tables';
+Variable_name  Value
+Slave_open_temp_tables 0
+DROP DATABASE new_test;
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_dump_thread_kill.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_dump_thread_kill.result
new file mode 100644 (file)
index 0000000..f707fb9
--- /dev/null
@@ -0,0 +1,19 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t1(i INT) engine=innodb;
+INSERT INTO t1 VALUES (1);
+FLUSH LOGS;
+SET GLOBAL DEBUG='+d,simulate_dump_thread_kill';
+SET GLOBAL DEBUG='+d,simulate_no_master_reconnect';
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_stop.inc
+SET GLOBAL DEBUG='-d,simulate_dump_thread_kill';
+SET GLOBAL DEBUG='-d,simulate_no_master_reconnect';
+include/start_slave.inc
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1,slave:t1]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_empty_multi_update.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_empty_multi_update.result
new file mode 100644 (file)
index 0000000..a4336d3
--- /dev/null
@@ -0,0 +1,38 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+include/gtid_utils.inc
+[connection master]
+include/rpl_reset.inc
+CREATE TABLE t1(c1 int) ENGINE=InnoDB;
+CREATE TABLE t2(c1 int) ENGINE=InnoDB;
+include/sync_slave_sql_with_master.inc
+[connection master]
+START TRANSACTION;
+UPDATE t1,t2 SET t1.c1 = 0;
+SAVEPOINT sp1;
+UPDATE t1,t2 SET t1.c1 = 0;
+SAVEPOINT sp2;
+COMMIT;
+include/sync_slave_sql_with_master.inc
+include/assert.inc [The correct count of transactions is expected on the slave]
+[connection master]
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+include/sync_slave_sql_with_master.inc
+[connection master]
+START TRANSACTION;
+UPDATE t1,t2 SET t1.c1 = 0;
+COMMIT;
+include/sync_slave_sql_with_master.inc
+include/assert.inc [The correct count of transactions is expected on the slave]
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+include/sync_slave_sql_with_master.inc
+include/gtid_utils_end.inc
+[connection master]
+include/rpl_end.inc
index 65db3acc9eaa53dbe95724b0c55f95f00e9cbcbb..ba67705c29c8459bf49a199c5394623c6e7d9691 100644 (file)
@@ -169,4 +169,34 @@ DROP EVENT event44331_2;
 DROP EVENT event44331_3;
 DROP EVENT event44331_4;
 include/sync_slave_sql_with_master.inc
+CREATE EVENT event1 ON SCHEDULE EVERY 100 SECOND STARTS '2000-01-01 00:00:00'
+ON COMPLETION PRESERVE ENABLE DO
+BEGIN
+SET @dummy = 100;
+END\\
+CREATE PROCEDURE proc1()
+BEGIN
+DECLARE dummy INT UNSIGNED;
+SET dummy = 100;
+ALTER EVENT EVENT1 ON SCHEDULE EVERY dummy SECOND
+STARTS '2000-01-01 00:00:00' ENABLE;
+END \\
+CALL proc1();
+include/sync_slave_sql_with_master.inc
+DROP EVENT event1;
+DROP PROCEDURE proc1;
+call mtr.add_suppression("Unsafe statement written to the binary log");
+set @secs=100;
+CREATE EVENT EVENT_WITH_SYSDATE_AND_VARIABLES
+ON SCHEDULE EVERY @secs MINUTE STARTS sysdate()
+ON COMPLETION PRESERVE
+DO BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+SELECT CONCAT('SAMPLE MSG');
+END |
+ALTER EVENT EVENT_WITH_SYSDATE_AND_VARIABLES
+ON SCHEDULE
+EVERY @secs HOUR
+STARTS sysdate() |
+DROP EVENT EVENT_WITH_SYSDATE_AND_VARIABLES |
 include/rpl_end.inc
index 4449b33aff7082fb5af4b75cfb97e8660fb4da2b..0039a453353a8f28fee8c41b114b4a22275019f2 100644 (file)
@@ -5,11 +5,16 @@ Note  ####    Storing MySQL user name or password information in the master info rep
 [connection master]
 CREATE TABLE t2 (c1 INT) ENGINE=InnoDB;
 include/sync_slave_sql_with_master.inc
+[connection master]
 INSERT INTO test.t2 VALUES (100);
 INSERT INTO test.t2 VALUES (200);
 INSERT INTO test.t2 VALUES (300);
+include/sync_slave_sql_with_master.inc
+SET @@GLOBAL.DEBUG= '+d,simulate_error_throttle_expiry';
+[connection master]
 DROP TABLE t2;
 include/sync_slave_sql_with_master.inc
+SET @@GLOBAL.DEBUG= '$debug_saved';
 Matching lines are:
 --TIME-- [Warning] Slave SQL: Could not execute Query event. Detailed error: Slave SQL thread ignored the query because of replicate-*-table rules; Error log throttle is enabled. This error will not be displayed for next 60 secs. It will be suppressed, Error_code: 1237
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gap_in_retrieved_gtid_set.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gap_in_retrieved_gtid_set.result
new file mode 100644 (file)
index 0000000..e5fa5c7
--- /dev/null
@@ -0,0 +1,56 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+"Test case 1"
+CREATE TABLE t1(f1 INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+include/sync_slave_sql_with_master.inc
+SET @debug_save=@@GLOBAL.debug;
+SET GLOBAL debug="d,flush_after_reading_gtid_event";
+[connection master]
+INSERT INTO t1 VALUES(1);
+include/sync_slave_sql_with_master.inc
+SET @@GLOBAL.debug=@debug_save;
+[connection master]
+INSERT INTO t1 VALUES(1);
+include/sync_slave_sql_with_master.inc
+include/stop_slave.inc
+include/rpl_restart_server.inc [server_number=2]
+[connection slave]
+include/start_slave.inc
+[connection master]
+INSERT INTO t1 VALUES(1);
+include/sync_slave_sql_with_master.inc
+include/wait_for_slave_param.inc [Retrieved_Gtid_Set]
+[connection master]
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_reset.inc
+"Test case 2"
+[connection master]
+CREATE TABLE t1(f1 INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+include/sync_slave_sql_with_master.inc
+call mtr.add_suppression('Relay log write failure: could not queue event from master');
+SET @debug_save=@@GLOBAL.debug;
+SET GLOBAL debug="d,set_append_buffer_error";
+[connection master]
+INSERT INTO t1 VALUES(1);
+[connection slave]
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET @@GLOBAL.debug=@debug_save;
+include/stop_slave_sql.inc
+include/wait_for_slave_param.inc [Retrieved_Gtid_Set]
+include/start_slave.inc
+[connection master]
+INSERT INTO t1 VALUES(1);
+include/sync_slave_sql_with_master.inc
+[connection master]
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
index 70a6ac3ec35e8ef66194dde95aa6e2a4a7b0ea0e..6f6ce5c2dbc8712228b44a03dfc58c76ee42e97f 100644 (file)
@@ -12,24 +12,12 @@ include/sync_slave_sql_with_master.inc
 # Build connections to master server
 # Stress test that execute massive queries on every connection
 include/sync_slave_sql_with_master.inc
-# Enable diff_table test
-# Test tables with InnoDB engine when enableing diff_table
+# Disable diff_table test
+# Test tables with InnoDB engine when disabling diff_table
 # and simulating flush error
 include/sync_slave_sql_with_master.inc
 # Build connections to master server
 # Stress test that execute massive queries on every connection
 include/sync_slave_sql_with_master.inc
-# Test if the results are consistent on master and slave
-include/diff_tables.inc [master:t1, slave:t1]
-include/diff_tables.inc [master:t2, slave:t2]
-include/diff_tables.inc [master:t3, slave:t3]
-include/diff_tables.inc [master:t4, slave:t4]
-include/diff_tables.inc [master:t5, slave:t5]
-include/diff_tables.inc [master:t6, slave:t6]
-include/diff_tables.inc [master:t7, slave:t7]
-include/diff_tables.inc [master:t8, slave:t8]
-include/diff_tables.inc [master:t9, slave:t9]
-include/diff_tables.inc [master:t10, slave:t10]
-include/sync_slave_sql_with_master.inc
 SET @@GLOBAL.MAX_BINLOG_SIZE= @max_binlog_size_save;
 include/rpl_end.inc
index a3cda67a3b61d55092db48876e966519b27569da..f01ce011630170d30dab289122067a8ea659d06d 100644 (file)
@@ -23,9 +23,8 @@ FLUSH LOGS;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
 # assert: must show one binlog
-show binary logs;
-Log_name       File_size
-master-bin.000001      #
+master-bin.000001
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 ###################### TEST #3
 CREATE TABLE t1 (a INT);
@@ -53,6 +52,7 @@ SELECT count(*) FROM t2;
 count(*)
 1
 DELETE FROM t2;
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 ###################### TEST #5
 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2;
@@ -80,6 +80,7 @@ count(*)
 3
 SET AUTOCOMMIT= 1;
 DELETE FROM t2;
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 ###################### TEST #7
 SELECT count(*) FROM t4;
@@ -92,10 +93,8 @@ ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 SELECT count(*) FROM t4;
 count(*)
 1
-### check that the incident event is written to the current log
-include/show_binlog_events.inc
-Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 DELETE FROM t4;
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 ###################### TEST #8
 SET @xxx = REPEAT('xxx', 1000);
@@ -112,9 +111,11 @@ count(*)
 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
+include/rpl_restart_server.inc [server_number=1]
 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
+include/rpl_restart_server.inc [server_number=1]
 set @aaa = repeat('aaa',1000);
 set @bbb = repeat('bbb',1000);
 set @ccc = repeat('ccc',1000);
@@ -132,9 +133,16 @@ count(*)
 SELECT count(*) FROM t2;
 count(*)
 6
+include/rpl_restart_server.inc [server_number=1]
+SET @xxx = REPEAT('xxx', 1000);
+SET @yyy = REPEAT('yyy', 1000);
 DELETE FROM t4 WHERE a IN (@xxx, @yyy) OR 1;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
+include/rpl_restart_server.inc [server_number=1]
+set @aaa = repeat('aaa',1000);
+set @bbb = repeat('bbb',1000);
+set @ccc = repeat('ccc',1000);
 DELETE FROM t2 WHERE a IN (@aaa, @bbb, @ccc) OR 1;
 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
 
@@ -172,6 +180,7 @@ SET SQL_LOG_BIN=1;
 ###################### TEST #10
 call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
 call mtr.add_suppression("Could not open .*");
+include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 SHOW WARNINGS;
 Level  Code    Message
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_empty_group.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_empty_group.result
deleted file mode 100644 (file)
index 20c67a4..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-include/master-slave.inc
-Warnings:
-Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
-Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
-[connection master]
-SET @save.binlog_format= @@global.binlog_format;
-SET @@global.binlog_format= row;
-include/restart_slave.inc
-SET @save.binlog_format= @@session.binlog_format;
-SET @@session.binlog_format= statement;
-CREATE TABLE t1(id INTEGER) ENGINE= Innodb /* group one */;
-UPDATE t1 SET id= 1 WHERE id = 0          /* group two */;
-CREATE TABLE t_ignore(id INTEGER) ENGINE= Innodb /* group three */;
-must be *three* groups logged, where the two last empty:
-include/show_binlog_events.inc
-Log_name       Pos     Event_type      Server_id       End_log_pos     Info
-slave-bin.000001       #       Previous_gtids  #       #       
-slave-bin.000001       #       Gtid    #       #       SET @@SESSION.GTID_NEXT= 'Gtid_set'
-slave-bin.000001       #       Query   #       #       use `test`; CREATE TABLE t1(id INTEGER) ENGINE= Innodb /* group one */
-slave-bin.000001       #       Gtid    #       #       SET @@SESSION.GTID_NEXT= 'Gtid_set'
-slave-bin.000001       #       Query   #       #       BEGIN
-slave-bin.000001       #       Query   #       #       COMMIT
-slave-bin.000001       #       Gtid    #       #       SET @@SESSION.GTID_NEXT= 'Gtid_set'
-slave-bin.000001       #       Query   #       #       BEGIN
-slave-bin.000001       #       Query   #       #       COMMIT
-FLUSH LOGS;
-DROP TABLE t2;
-ERROR 42S02: Unknown table 'test.t2'
-INSERT INTO t1 VALUES (1, 1);
-ERROR 21S01: Column count doesn't match value count at row 1
-BEGIN;
-INSERT INTO t1 VALUES (2);
-ROLLBACK;
-*** must be empty log ***
-include/show_binlog_events.inc
-Log_name       Pos     Event_type      Server_id       End_log_pos     Info
-master-bin.000002      #       Previous_gtids  #       #       Gtid_set
-DROP TABLE t1;
-DROP TABLE t_ignore;
-SET @@global.binlog_format= @save.binlog_format;
-include/rpl_end.inc
index e7474f489aaf3c4364efed1aa99fcd01e2a4233c..9dcab2f6641fdc3f42b3ebf383bd6768897ddc5f 100644 (file)
@@ -17,6 +17,10 @@ SET GTID_MODE = UPGRADE_STEP_1;
 ERROR HY000: Variable 'gtid_mode' is a read only variable
 SET GTID_MODE = UPGRADE_STEP_2;
 ERROR HY000: Variable 'gtid_mode' is a read only variable
+SET GTID_MODE = OFF_PERMISSIVE;
+ERROR HY000: Variable 'gtid_mode' is a read only variable
+SET GTID_MODE = ON_PERMISSIVE;
+ERROR HY000: Variable 'gtid_mode' is a read only variable
 SET GTID_MODE = ON;
 ERROR HY000: Variable 'gtid_mode' is a read only variable
 ---- GTID_NEXT must be ANONYMOUS or AUTOMATIC ----
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode_off_new_master.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode_off_new_master.result
new file mode 100644 (file)
index 0000000..0562f90
--- /dev/null
@@ -0,0 +1,25 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CALL mtr.add_suppression('Slave I/O: The master uses an unknown GTID_MODE');
+CALL mtr.add_suppression('The slave IO thread stops because the master has an unknown');
+SET @save_debug= @@GLOBAL.DEBUG;
+include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_gtid_mode_off_permissive';
+include/start_slave.inc
+include/assert_grep.inc [Receiver thread should report that off_permissive is unknown]
+include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_gtid_mode_off_something';
+include/start_slave.inc
+include/assert_grep.inc [Receiver thread should report that off_something is unknown]
+include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_unknown_gtid_mode';
+START SLAVE;
+include/wait_for_slave_io_error.inc [errno=1593]
+SET @@GLOBAL.DEBUG= @save_debug;
+include/stop_slave_sql.inc
+RESET SLAVE;
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode_on_new_master.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode_on_new_master.result
new file mode 100644 (file)
index 0000000..c9a6eed
--- /dev/null
@@ -0,0 +1,25 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CALL mtr.add_suppression('Slave I/O: The master uses an unknown GTID_MODE');
+CALL mtr.add_suppression('The slave IO thread stops because the master has an unknown');
+SET @save_debug= @@GLOBAL.DEBUG;
+include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_gtid_mode_on_permissive';
+include/start_slave.inc
+include/assert_grep.inc [Receiver thread should report that on_permissive is unknown]
+include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_gtid_mode_on_something';
+include/start_slave.inc
+include/assert_grep.inc [Receiver thread should report that on_something is unknown]
+include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_unknown_gtid_mode';
+START SLAVE;
+include/wait_for_slave_io_error.inc [errno=1593]
+SET @@GLOBAL.DEBUG= @save_debug;
+include/stop_slave_sql.inc
+RESET SLAVE;
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off.result
new file mode 100644 (file)
index 0000000..d4c824c
--- /dev/null
@@ -0,0 +1,151 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+CALL mtr.add_suppression("Recovery from master pos*");
+CALL mtr.add_suppression("Slave SQL: .*Duplicate entry .1.*");
+CALL mtr.add_suppression("Slave SQL: ... The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.");
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_AUTO_POSITION=0;
+SET @@global.slave_parallel_workers=4;
+SET @@global.relay_log_info_repository='TABLE';
+SET @@global.master_info_repository='TABLE';
+include/start_slave.inc
+[connection master]
+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;
+include/sync_slave_sql_with_master.inc
+STOP SLAVE SQL_THREAD;
+SET GLOBAL DEBUG='d,flush_after_reading_user_var_event';
+BEGIN;
+INSERT INTO d1.t1 VALUES (1);
+INSERT INTO d2.t1 VALUES (2);
+INSERT INTO d3.t1 VALUES (3);
+[connection master]
+INSERT INTO d1.t1 VALUES (4);
+INSERT INTO d2.t1 VALUES (5);
+INSERT INTO d3.t1 VALUES (6);
+INSERT INTO d4.t1 VALUES (7);
+[connection master1]
+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);
+[connection master]
+BEGIN;
+INSERT INTO d4.t1 VALUES (8);
+[connection master1]
+COMMIT;
+[connection slave1]
+SET DEBUG_SYNC='now WAIT_FOR Reached';
+FLUSH LOGS;
+# Let IO thread continue splitting has been done now.
+SET DEBUG_SYNC= 'now SIGNAL signal.flush_complete_continue';
+[connection master]
+COMMIT;
+INSERT INTO d4.t1 VALUES (9);
+include/sync_slave_io_with_master.inc
+[connection slave1]
+START SLAVE SQL_THREAD;
+[connection slave]
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
+DELETE FROM d1.t1 where a=1;
+DELETE FROM d2.t1 where a=2;
+DELETE FROM d3.t1 where a=3;
+include/rpl_restart_server.inc [server_number=2 gtids=on parameters: --skip_slave_start=FALSE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+[connection master]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:d4.t1, slave:d4.t1]
+include/diff_tables.inc [master:d3.t1, slave:d3.t1]
+include/diff_tables.inc [master:d2.t1, slave:d2.t1]
+include/diff_tables.inc [master:d1.t1, slave:d1.t1]
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
+DROP DATABASE d3;
+DROP DATABASE d4;
+include/sync_slave_sql_with_master.inc
+include/rpl_reset.inc
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_AUTO_POSITION=1;
+SET @@global.slave_parallel_workers=4;
+SET @@global.relay_log_info_repository='TABLE';
+SET @@global.master_info_repository='TABLE';
+include/start_slave.inc
+[connection master]
+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;
+include/sync_slave_sql_with_master.inc
+STOP SLAVE SQL_THREAD;
+SET GLOBAL DEBUG='d,flush_after_reading_user_var_event';
+BEGIN;
+INSERT INTO d1.t1 VALUES (1);
+INSERT INTO d2.t1 VALUES (2);
+INSERT INTO d3.t1 VALUES (3);
+[connection master]
+INSERT INTO d1.t1 VALUES (4);
+INSERT INTO d2.t1 VALUES (5);
+INSERT INTO d3.t1 VALUES (6);
+INSERT INTO d4.t1 VALUES (7);
+[connection master1]
+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);
+[connection master]
+BEGIN;
+INSERT INTO d4.t1 VALUES (8);
+[connection master1]
+COMMIT;
+[connection slave1]
+SET DEBUG_SYNC='now WAIT_FOR Reached';
+FLUSH LOGS;
+# Let IO thread continue splitting has been done now.
+SET DEBUG_SYNC= 'now SIGNAL signal.flush_complete_continue';
+[connection master]
+COMMIT;
+INSERT INTO d4.t1 VALUES (9);
+include/sync_slave_io_with_master.inc
+[connection slave1]
+START SLAVE SQL_THREAD;
+[connection slave]
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
+DELETE FROM d1.t1 where a=1;
+DELETE FROM d2.t1 where a=2;
+DELETE FROM d3.t1 where a=3;
+include/rpl_restart_server.inc [server_number=2 gtids=on parameters: --skip_slave_start=FALSE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+[connection master]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:d4.t1, slave:d4.t1]
+include/diff_tables.inc [master:d3.t1, slave:d3.t1]
+include/diff_tables.inc [master:d2.t1, slave:d2.t1]
+include/diff_tables.inc [master:d1.t1, slave:d1.t1]
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
+DROP DATABASE d3;
+DROP DATABASE d4;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_replay_relaylog.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_replay_relaylog.result
new file mode 100644 (file)
index 0000000..b5ea7e8
--- /dev/null
@@ -0,0 +1,28 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t1(i INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+include/sync_slave_sql_with_master.inc
+SET @save_debug=@@global.debug;
+SET GLOBAL DEBUG='d,stop_io_after_reading_gtid_log_event';
+[connection master]
+INSERT INTO t1 VALUES (2);
+[connection slave]
+include/wait_for_slave_io_to_stop.inc
+include/assert.inc [Slave MASTER_AUTO_POSITION should be enabled for this test]
+SET GLOBAL DEBUG= @save_debug;
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+DROP TABLE t1;
+RESET MASTER;
+include/assert.inc [Check that there is one tuple in the table]
+DROP TABLE t1;
+RESET MASTER;
+include/assert.inc [Check that there are two tuples in the table]
+[connection master]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_temp_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_temp_table.result
new file mode 100644 (file)
index 0000000..d234e72
--- /dev/null
@@ -0,0 +1,1220 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE trans_table1 (i INT) ENGINE=INNODB;
+INSERT INTO trans_table1 VALUES (1);
+CREATE TABLE trans_table2 (i INT) ENGINE=INNODB;
+INSERT INTO trans_table2 VALUES (1);
+CREATE TABLE non_trans_table1 (i INT) ENGINE=MYISAM;
+INSERT INTO non_trans_table1 VALUES (1);
+CREATE TABLE non_trans_table2 (i INT) ENGINE=MYISAM;
+INSERT INTO non_trans_table2 VALUES (1);
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+RETURN 0;
+END;
+SELECT func1();
+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.
+START TRANSACTION;
+SELECT func1();
+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;
+INSERT INTO trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM trans_table2 WHERE i=func1();
+Got one of the listed errors
+INSERT INTO non_trans_table2 VALUES (func1());
+Got one of the listed errors
+UPDATE non_trans_table2 SET i=func1();
+Got one of the listed errors
+DELETE FROM non_trans_table2 WHERE i=func1();
+Got one of the listed errors
+DROP FUNCTION func1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+INSERT INTO trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+UPDATE trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+DELETE FROM trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER INSERT ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+INSERT INTO non_trans_table2 VALUES (10);
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER UPDATE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+UPDATE non_trans_table2 SET i=12;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+BEFORE DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+CREATE TRIGGER trigger1
+AFTER DELETE ON non_trans_table2 FOR EACH ROW
+BEGIN
+CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+END;
+DELETE FROM non_trans_table2;
+Got one of the listed errors
+DROP TRIGGER trigger1;
+include/diff_tables.inc [master:trans_table1, slave:trans_table1]
+include/diff_tables.inc [master:trans_table2, slave:trans_table2]
+include/diff_tables.inc [master:non_trans_table1, slave:non_trans_table1]
+include/diff_tables.inc [master:non_trans_table2, slave:non_trans_table2]
+DROP TABLE trans_table1, trans_table2;
+DROP TABLE non_trans_table1, non_trans_table2;
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_transaction_split_across_relay_logs.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_transaction_split_across_relay_logs.result
new file mode 100644 (file)
index 0000000..b66dd60
--- /dev/null
@@ -0,0 +1,28 @@
+include/rpl_init.inc [topology=1->2->3]
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection server_1]
+CREATE TABLE t1 (i VARCHAR(8192)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(repeat('a',8192)), (repeat('b', 8192));
+[connection server_2]
+SET @saved_debug=@@GLOBAL.debug;
+SET GLOBAL debug="d,stop_io_after_reading_write_rows_log_event";
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_stop.inc
+SET GLOBAL debug=@saved_debug;
+START SLAVE;
+[connection server_3]
+START SLAVE;
+[connection server_1]
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1, server_2:t1, server_3:t1]
+[connection server_2]
+include/assert.inc [SQL thread position should be updated to after the split transaction]
+include/assert.inc [SQL thread file should be updated to after the split transaction]
+[connection server_1]
+DROP TABLE t1;
+include/rpl_end.inc
index b12129aa51a084ec48ebcaab2e1d1fc423bf87c0..d48d6ccc71a0fa810a96abf26318bee30fb76308 100644 (file)
@@ -60,6 +60,10 @@ include/sync_slave_sql_with_master.inc
 CREATE DATABASE d2;
 source include/kill_query.inc;
 include/rpl_diff.inc
+ALTER DATABASE d1
+DEFAULT CHARACTER SET = 'utf8';
+source include/kill_query.inc;
+include/rpl_diff.inc
 DROP DATABASE d1;
 source include/kill_query.inc;
 include/rpl_diff.inc
@@ -87,6 +91,9 @@ include/rpl_diff.inc
 DROP FUNCTION f1;
 source include/kill_query.inc;
 include/rpl_diff.inc
+DROP FUNCTION IF EXISTS f2;
+source include/kill_query.inc;
+include/rpl_diff.inc
 CREATE PROCEDURE p2 (OUT rows INT)
 BEGIN
 SELECT COUNT(*) INTO rows FROM t2;
@@ -100,6 +107,9 @@ include/rpl_diff.inc
 DROP PROCEDURE p1;
 source include/kill_query.inc;
 include/rpl_diff.inc
+DROP PROCEDURE IF EXISTS p2;
+source include/kill_query.inc;
+include/rpl_diff.inc
 CREATE TABLE t2 (b int);
 source include/kill_query.inc;
 include/rpl_diff.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_low_slave_net_time_out.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_low_slave_net_time_out.result
new file mode 100644 (file)
index 0000000..3dcdbbd
--- /dev/null
@@ -0,0 +1,28 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=5;
+SET @save_old_slave_net_timeout=@@global.slave_net_timeout;
+SET @@global.slave_net_timeout=10;
+include/start_slave.inc
+SET @save_debug=@@global.debug;
+SET GLOBAL DEBUG='+d,inject_2sec_sleep_when_skipping_an_event';
+CREATE TABLE t1(i INT) engine=innodb;
+INSERT INTO t1 VALUES (1);
+include/sync_slave_sql_with_master.inc
+include/stop_slave.inc
+include/stop_dump_threads.inc
+SET GLOBAL DEBUG='+d,hold_dump_thread_inside_inner_loop';
+DROP TABLE t1;
+include/start_slave.inc
+SET DEBUG_SYNC='now WAIT_FOR signal_inside_inner_loop';
+include/stop_slave.inc
+SET GLOBAL DEBUG='-d,hold_dump_thread_inside_inner_loop';
+include/start_slave.inc
+SET DEBUG_SYNC='now signal signal_continue';
+include/sync_slave_sql_with_master.inc
+SET GLOBAL DEBUG=@save_debug;
+SET @@global.slave_net_timeout=@save_old_slave_net_timeout;
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_missing_data_on_slave.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_missing_data_on_slave.result
new file mode 100644 (file)
index 0000000..422184c
--- /dev/null
@@ -0,0 +1,21 @@
+include/rpl_init.inc [topology=1->2->3]
+Server 1
+CREATE TABLE `t1` (
+`id` bigint unsigned NOT NULL auto_increment,
+`val` varchar(255),
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 (val) VALUES (REPEAT('a', 255));
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+Syncing all three servers
+include/rpl_sync.inc
+Verifying 't1' table contents on all three servers through diff tables.
+include/diff_tables.inc [server_1:t1, server_2:t1, server_3:t1]
+DROP TABLE t1;
+include/rpl_sync.inc
+include/rpl_end.inc
index 528acd5c7262e4b90b1ad00f5eb240f4fa7f54e1..78b488228664b2f0d30185f9cc4e6a3931026bb0 100644 (file)
@@ -91,7 +91,7 @@ Note  1051    Unknown table 'test.tt_xx_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-TXe-Temp';
@@ -110,7 +110,7 @@ Note        1051    Unknown table 'test.tt_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-NXe-Temp';
@@ -129,7 +129,7 @@ Note        1051    Unknown table 'test.tt_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-TN-Temp';
@@ -281,7 +281,7 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -304,8 +304,8 @@ master-bin.000001   #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -358,7 +358,7 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -381,8 +381,8 @@ master-bin.000001   #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -440,7 +440,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
@@ -462,13 +462,13 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
@@ -783,7 +783,7 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -809,8 +809,8 @@ master-bin.000001   #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -870,7 +870,7 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -896,8 +896,8 @@ master-bin.000001   #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -956,7 +956,7 @@ Warning     #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -978,13 +978,13 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
index bf4789c347ce3631a9f6bf0ad86656e3516b32cc..a53be8c94c4e25f51bdd1797d5fa224db52ee4f3 100644 (file)
@@ -490,7 +490,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`new_tt_xx` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
 
index cef2b2e72d087d3ac0c0005ad0e024e7662bf230..0e133d1798ebdec9f4ef6ee44a48a87b3d9505d7 100644 (file)
@@ -12423,12 +12423,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_11;
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T Sn T CT Rn R]
@@ -12489,12 +12489,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T CT T R]
@@ -12541,12 +12541,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_13;
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B tN CT T R]
@@ -12599,12 +12599,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_14;
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B CT T R]
@@ -12645,12 +12645,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_15;
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B N CT T R]
@@ -12703,12 +12703,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_16;
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_stop_slave.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_stop_slave.result
new file mode 100644 (file)
index 0000000..c5d5549
--- /dev/null
@@ -0,0 +1,61 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+#### I. Initialize ####
+[connection slave]
+include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+set @@global.innodb_lock_wait_timeout=5 + 1000;
+include/start_slave.inc
+[connection master]
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+#### II. Prepare test scenario ####
+include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local');
+INSERT INTO d1.t VALUES (3, 'Slave local');
+[connection master]
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3');
+INSERT INTO d2.t VALUES (3, 'T4');
+INSERT INTO d1.t VALUES (2, 'T5');
+INSERT INTO d1.t VALUES (3, 'T6');
+INSERT INTO d2.t VALUES (4, 'T7');
+INSERT INTO d2.t VALUES (5, 'T8');
+INSERT INTO d1.t VALUES (4, 'T9');
+[connection slave1]
+# Now d1.t has two rows and d2.t has one row.
+# Now coordinator has read the entire relay log and populated workers' queues.
+SELECT * FROM d2.t;
+a      name
+1      T2
+SELECT * FROM d1.t;
+a      name
+1      T1
+2      T5
+#### Verify that STOP SLAVE stops at gap less state ####
+STOP SLAVE;
+[connection slave]
+# Now coordinator is waiting for the worker to consume its queue.
+ROLLBACK;
+include/wait_for_slave_sql_to_stop.inc
+# III. Now all slave threads have stopped. Verify that worker completed its queue:
+# d2 should contain Т2, Т3, Т4.
+include/assert.inc [Rows until T3 in d2.t must be replicated now]
+# d1 should contain Т1, Т5, T6.
+include/assert.inc [Rows until 2 in d1.t must be replicated now]
+include/start_slave.inc
+[connection slave1]
+[connection slave]
+SET @@global.innodb_lock_wait_timeout= @save.innodb_lock_wait_timeout;
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
index cd79be24d57cc02ed8485fbacfb476dc94c23d73..e7d5687ffef82d655a05ce545eb2c21079c18a28 100644 (file)
@@ -12795,12 +12795,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_11;
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T Sn T CT Rn R]
@@ -12861,12 +12861,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T CT T R]
@@ -12913,12 +12913,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_13;
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B tN CT T R]
@@ -12971,12 +12971,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_14;
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B CT T R]
@@ -13017,12 +13017,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_15;
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B N CT T R]
@@ -13075,12 +13075,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_16;
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
index 4be4cf9baba6523c61ec63241dc26b802e36c9ef..f65f32b440d2639d1322a473348f636a380ec0ec 100644 (file)
@@ -14631,12 +14631,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_11;
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T Sn T CT Rn R]
@@ -14681,12 +14681,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T CT T R]
@@ -14721,12 +14721,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_13;
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B tN CT T R]
@@ -14772,12 +14772,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_14;
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B CT T R]
@@ -14808,12 +14808,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_15;
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B N CT T R]
@@ -14859,12 +14859,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_16;
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
index a3fb50394faa4e3c2f769c4abf7e895db49850b4..e2daa6fe9d25c24a96c52ba0b7eae1bca0164331 100644 (file)
@@ -11825,12 +11825,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_11;
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T Sn T CT Rn R]
@@ -11891,12 +11891,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T CT T R]
@@ -11943,12 +11943,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_13;
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B tN CT T R]
@@ -12001,12 +12001,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_14;
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B CT T R]
@@ -12047,12 +12047,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_15;
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B N CT T R]
@@ -12105,12 +12105,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_16;
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
index 7f68f737d5d413396d5c5d3cceafaabdf843daee..5728a57786977548e300bd6786d7e7dda550c0b1 100644 (file)
@@ -5,6 +5,7 @@ Note    ####    Storing MySQL user name or password information in the master info rep
 [connection master]
 call mtr.add_suppression("Slave SQL: .*Could not execute Write_rows event on table d1.t1; Duplicate entry '13' for key 'a'");
 call mtr.add_suppression("Slave SQL: ... The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.");
+call mtr.add_suppression("Error writing relay log configuration.");
 include/stop_slave.inc
 SET @save.slave_parallel_workers=@@global.slave_parallel_workers;
 SET @@global.slave_parallel_workers=2;
@@ -57,4 +58,46 @@ include/start_slave.inc
 DROP DATABASE d1;
 DROP DATABASE d2;
 include/sync_slave_sql_with_master.inc
+[connection slave]
+include/stop_slave.inc
+SET @save.slave_parallel_workers=@@global.slave_parallel_workers;
+SET @@global.slave_parallel_workers=2;
+SET @save.relay_log_info_repository=@@global.relay_log_info_repository;
+SET @@global.relay_log_info_repository='TABLE';
+include/start_slave.inc
+[connection master]
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t1 (a int unique) ENGINE=INNODB;
+CREATE TABLE d2.t1 (a int unique) ENGINE=INNODB;
+include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d1.t1 VALUES (13);
+[connection master]
+INSERT INTO d1.t1 VALUES (6);
+INSERT INTO d2.t1 VALUES (7);
+INSERT INTO d1.t1 VALUES (13);
+INSERT INTO d2.t1 VALUES (8);
+INSERT INTO d2.t1 VALUES (9);
+[connection slave1]
+[connection slave]
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
+[connection master]
+FLUSH LOGS;
+[connection slave]
+CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= MASTER_PORT, MASTER_USER= 'root',MASTER_LOG_FILE = 'FILE', MASTER_LOG_POS = POS ;
+ERROR HY000: CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTIL.
+reset slave;
+CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= MASTER_PORT, MASTER_USER= 'root',MASTER_LOG_FILE = 'FILE', MASTER_LOG_POS = POS ;
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+SET @@global.slave_parallel_workers= @save.slave_parallel_workers;
+SET @@global.relay_log_info_repository= @save.relay_log_info_repository;
+include/start_slave.inc
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
 include/rpl_end.inc
index b940dac95bd1328accafce13da6f3d0cee661ec6..071425ebf4c3e8f11bac608e3a90250fdfed6df5 100644 (file)
@@ -13,4 +13,8 @@ include/start_slave_sql.inc
 include/sync_slave_sql_with_master.inc
 DROP TABLE t;
 include/sync_slave_sql_with_master.inc
+Matching lines are:
+--TIME-- [Warning] Slave SQL: ... The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state. A restart should restore consistency automatically, although using non-transactional storage for data or info tables or DDL queries could lead to problems. In such cases you have to examine your data (see documentation for details). Error_code: ER_MTS_INCONSISTENT_DATA
+
+Occurrences of the The slave coordinator and worker threads are stopped in the input file : 1
 include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_log_recovery_positions.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_log_recovery_positions.result
new file mode 100644 (file)
index 0000000..b4cac0d
--- /dev/null
@@ -0,0 +1,30 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (c1 INT);
+include/sync_slave_sql_with_master.inc
+CALL mtr.add_suppression("Recovery from master pos");
+include/stop_slave_sql.inc
+[connection master]
+INSERT INTO t1 VALUES (1);
+include/sync_slave_io_with_master.inc
+include/assert.inc ["Relay_log_pos points at the beginning of the INSERT trx."]
+include/assert.inc ["Exec_master_log_pos points at the CREATE TABLE statement."]
+include/assert.inc ["Read_master_log_pos points at the end of the INSERT trx."]
+Omitting server parameters, since there is a path in one of them.
+include/rpl_restart_server.inc [server_number=2]
+include/assert_grep.inc [Assert that the expected entry is in the error log]
+include/assert.inc ["Relay_log_pos points at the beginning of the new relay log file now."]
+include/assert.inc ["Read_master_log_pos after restart points at the CREATE TABLE position."]
+CHANGE MASTER TO Relay_log_pos= RELAY_LOG_POS, Relay_log_file='SLAVE_RELAY_LOG_FILE_NAME';
+include/start_slave_sql.inc
+include/start_slave_io.inc
+[connection master]
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
index cf9d9f475fae8c78bfcebf889bf84ce244fa288f..daf885d564bfe81b2c547169797f8bc68c8d3779 100644 (file)
@@ -12,11 +12,11 @@ FLUSH PRIVILEGES;
 CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a));
 INSERT INTO mysqltest1.t1 VALUES(1,USER());
 INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER());
-create procedure mysqltest1.p1()
-begin
+CREATE PROCEDURE mysqltest1.p1()
+BEGIN
 INSERT INTO mysqltest1.t1 VALUES(3,USER());
 INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
-end|
+END|
 CALL mysqltest1.p1();
 SELECT * FROM mysqltest1.t1 ORDER BY a;
 a      users
@@ -37,4 +37,35 @@ REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
 DROP USER tester@'%';
 DROP USER ''@'localhost%';
 include/sync_slave_sql_with_master.inc
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+CREATE USER 'tester1'@'' IDENTIFIED BY 'test';
+GRANT ALL ON mysqltest1.* TO 'tester1'@'' IDENTIFIED BY 'test';
+FLUSH PRIVILEGES;
+CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a));
+INSERT INTO mysqltest1.t1 VALUES(1,USER());
+INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER());
+CREATE PROCEDURE mysqltest1.p1()
+BEGIN
+INSERT INTO mysqltest1.t1 VALUES(3,USER());
+INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
+END|
+CALL mysqltest1.p1();
+SELECT * FROM mysqltest1.t1 ORDER BY a;
+a      users
+1      tester1@localhost
+2      tester1@
+3      tester1@localhost
+4      tester1@
+include/sync_slave_sql_with_master.inc
+SELECT * FROM mysqltest1.t1 ORDER BY a;
+a      users
+1      tester1@localhost
+2      tester1@
+3      tester1@localhost
+4      tester1@
+DROP DATABASE mysqltest1;
+REVOKE ALL ON mysqltest1.* FROM 'tester1'@'';
+DROP USER tester1@'';
+include/sync_slave_sql_with_master.inc
 include/rpl_end.inc
index 378bf5ebed696aa5eb62dd8654a21df16e324836..e5f11ba62503dc9553b7d39c7fb6bddc88cd0ad1 100644 (file)
@@ -47,8 +47,8 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (a int)
 master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t2 (a int)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`t2` /* generated by server */
-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 TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
 master-bin.000001      #       Query   #       #       use `test`; DROP TABLE `t1` /* generated by server */
 SHOW TABLES;
 Tables_in_test
index 79923a51fab2b3486c74cda3dd26ebc00342a6be..45bb7bc4d31b54e8d1175abedd35c3e87b564217 100644 (file)
@@ -66,7 +66,7 @@ DROP TEMPORARY TABLE tt_tmp_2;
 -b-b-b-b-b-b-b-b-b-b-b- >>  << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >>  << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-N-Temp';
@@ -74,7 +74,7 @@ DROP TEMPORARY TABLE nt_tmp_2;
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-Xe-Temp';
@@ -91,7 +91,7 @@ Note  1051    Unknown table 'test.tt_xx_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-TXe-Temp';
@@ -100,7 +100,7 @@ ERROR 42S02: Unknown table 'test.tt_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-If-TXe-Temp';
@@ -110,7 +110,7 @@ Note        1051    Unknown table 'test.tt_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-NXe-Temp';
@@ -119,7 +119,7 @@ ERROR 42S02: Unknown table 'test.tt_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-If-NXe-Temp';
@@ -129,7 +129,7 @@ Note        1051    Unknown table 'test.tt_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-TN-Temp';
@@ -137,8 +137,8 @@ DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-TT-Temp';
@@ -146,7 +146,7 @@ DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TT-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TT-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-NN-Temp';
@@ -154,7 +154,7 @@ DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2;
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NN-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 
@@ -172,7 +172,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -193,8 +193,8 @@ master-bin.000001   #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -207,7 +207,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
@@ -226,14 +226,14 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
@@ -291,7 +291,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -316,8 +316,8 @@ master-bin.000001   #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -333,7 +333,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -356,8 +356,8 @@ master-bin.000001   #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -374,7 +374,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -399,8 +399,8 @@ master-bin.000001   #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -414,7 +414,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
@@ -435,14 +435,14 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
@@ -461,7 +461,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
@@ -484,14 +484,14 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
@@ -508,12 +508,12 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -528,20 +528,20 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -556,7 +556,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -576,7 +576,7 @@ master-bin.000001   #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -589,7 +589,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
@@ -607,7 +607,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
@@ -631,7 +631,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
@@ -659,7 +659,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
@@ -683,7 +683,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
@@ -716,7 +716,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -740,8 +740,8 @@ master-bin.000001   #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -756,7 +756,7 @@ Warning     #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -774,14 +774,14 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -830,7 +830,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -858,8 +858,8 @@ master-bin.000001   #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -877,7 +877,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -903,8 +903,8 @@ master-bin.000001   #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -923,7 +923,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -951,8 +951,8 @@ master-bin.000001   #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -968,7 +968,7 @@ Warning     #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -988,14 +988,14 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1012,7 +1012,7 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1034,14 +1034,14 @@ Warning #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1056,12 +1056,12 @@ Warning #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1079,20 +1079,20 @@ Warning #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1109,7 +1109,7 @@ Log_name  Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1132,7 +1132,7 @@ master-bin.000001 #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1147,7 +1147,7 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1164,7 +1164,7 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
@@ -1187,7 +1187,7 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
@@ -1214,7 +1214,7 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
@@ -1237,7 +1237,7 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.nt_xx_1)
@@ -1356,8 +1356,8 @@ DROP TABLE tt_tmp_2, nt_tmp_2, nt_2;
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-N-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       use `test`; DROP TABLE `nt_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1366,8 +1366,8 @@ DROP TABLE tt_tmp_2, nt_tmp_2;
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 
@@ -1547,8 +1547,8 @@ master-bin.000001 #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       use `test`; DROP TABLE `nt_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1563,8 +1563,8 @@ master-bin.000001 #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 #########################################################################
@@ -1582,9 +1582,9 @@ DROP TEMPORARY TABLE nt_tmp_2;
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp';
@@ -1595,9 +1595,9 @@ DROP TEMPORARY TABLE tt_tmp_2;
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 
@@ -1616,13 +1616,13 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_xx_1)
@@ -1641,9 +1641,9 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1664,9 +1664,9 @@ master-bin.000001 #       Table_map       #       #       table_id: # (test.nt_error_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1683,9 +1683,9 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1706,9 +1706,9 @@ master-bin.000001 #       Table_map       #       #       table_id: # (test.nt_error_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1731,13 +1731,13 @@ Warning #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1755,9 +1755,9 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1782,9 +1782,9 @@ master-bin.000001 #       Table_map       #       #       table_id: # (test.nt_error_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Ne R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1804,9 +1804,9 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -1831,9 +1831,9 @@ master-bin.000001 #       Table_map       #       #       table_id: # (test.nt_error_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e-
 
index ce727f4fb825277b80a33269c2959a6ca0c6c713..c40989b36cb5dafcfa8b40adfe76fb5ba358c1b1 100644 (file)
@@ -523,7 +523,7 @@ Log_name    Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Table_map       #       #       table_id: # (test.tt_1)
 master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`new_tt_xx` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
 
index 325bfd483d75cd4856f222a83ce60b763c99a95c..81f96b00fc507f41a0fe2845014609f4a19a2780 100644 (file)
@@ -7,8 +7,9 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM;
 CREATE TABLE t2 (a int) ENGINE=MyISAM;
 INSERT INTO t1 VALUES (1), (2), (3);
 INSERT INTO t2 VALUES (4), (5), (6);
-CREATE TABLE IF NOT EXISTS t1_merge LIKE t1;
-ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1);
+CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1;
+ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1);
+CREATE TABLE t1_merge LIKE tt1_merge;
 include/sync_slave_sql_with_master.inc
 include/diff_tables.inc [master:test.t1, slave:test.t1]
 include/diff_tables.inc [master:test.t2, slave:test.t2]
index 4be4cf9baba6523c61ec63241dc26b802e36c9ef..f65f32b440d2639d1322a473348f636a380ec0ec 100644 (file)
@@ -14631,12 +14631,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_11;
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T Sn T CT Rn R]
@@ -14681,12 +14681,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T CT T R]
@@ -14721,12 +14721,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_13;
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B tN CT T R]
@@ -14772,12 +14772,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_14;
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B CT T R]
@@ -14808,12 +14808,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_15;
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B N CT T R]
@@ -14859,12 +14859,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_16;
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result
new file mode 100644 (file)
index 0000000..3f1d89a
--- /dev/null
@@ -0,0 +1,482 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+#Test case 1:
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+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|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t3 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` 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
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t3)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Query   #       #       SAVEPOINT `event_logging_1`
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t3)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+DROP TRIGGER tr1;
+DELETE FROM t1;
+DELETE FROM t2;
+DELETE FROM t3;
+# Test case 2:
+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()|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t3 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` 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
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t3)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Query   #       #       SAVEPOINT `event_logging_1`
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t3)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       use `test`; DROP TRIGGER tr1
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Delete_rows     #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Delete_rows     #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t3)
+master-bin.000001      #       Delete_rows     #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` 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
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1()
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t3)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Query   #       #       SAVEPOINT `event_logging_2`
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t3)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP PROCEDURE p1;
+# Test case 3:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB;
+CREATE TRIGGER t_insert_trig AFTER INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+ROLLBACK TO savepoint_1;
+END |
+INSERT INTO t VALUES (2);
+INSERT INTO t VALUES (3);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t_insert_trig AFTER INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+ROLLBACK TO savepoint_1;
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Query   #       #       SAVEPOINT `savepoint_1`
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Query   #       #       SAVEPOINT `savepoint_1`
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+SELECT * FROM t;
+f1
+2
+3
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t;
+f1
+2
+3
+[connection master]
+DROP TABLE t;
+# Test case 4:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+INSERT INTO t1 VALUES (5);
+END |
+INSERT INTO t VALUES (2), (3);
+INSERT INTO t1 VALUES (30);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+INSERT INTO t1 VALUES (5);
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Write_rows      #       #       table_id: #
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Query   #       #       SAVEPOINT `savepoint_1`
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Write_rows      #       #       table_id: #
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+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      #       Xid     #       #       COMMIT /* XID */
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+5
+5
+30
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+5
+5
+30
+[connection master]
+DROP TABLE t;
+DROP TABLE t1;
+# Test case 5:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+END |
+INSERT INTO t VALUES (2), (3);
+INSERT INTO t1 VALUES (30);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Query   #       #       SAVEPOINT `savepoint_1`
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+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      #       Xid     #       #       COMMIT /* XID */
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+30
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+30
+[connection master]
+DROP TABLE t;
+DROP TABLE t1;
+# Test case 6:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+ROLLBACK TO event_logging_2;
+RETURN 0;
+END|
+BEGIN;
+INSERT INTO t2 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t2 VALUES (10);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+ROLLBACK TO event_logging_2;
+RETURN 0;
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Query   #       #       SAVEPOINT `event_logging_2`
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION f1;
+# Test case 7:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+RETURN 0;
+END|
+BEGIN;
+INSERT INTO t2 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t2 VALUES (10);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+RETURN 0;
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Query   #       #       SAVEPOINT `event_logging_2`
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Write_rows      #       #       table_id: #
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t2)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+1
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+1
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION f1;
+# Test case 8:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SAVEPOINT event_logging_2;
+RETURN 0;
+END|
+BEGIN;
+INSERT INTO t1 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t1 VALUES (10);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+BEGIN
+SAVEPOINT event_logging_2;
+RETURN 0;
+END
+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   #       #       SAVEPOINT `event_logging_2`
+master-bin.000001      #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001      #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+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      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+SELECT * FROM t1;
+f1
+1
+0
+2
+4
+10
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+f1
+1
+0
+2
+4
+10
+[connection master]
+DROP TABLE t1;
+DROP FUNCTION f1;
+include/rpl_end.inc
index 36bd514418fda7dd274529cbdad89f9866a60663..0a771d28f8690b9d1bb2e14f0c0c709a7c3e147c 100644 (file)
@@ -9,11 +9,12 @@ CALL mtr.add_suppression(".*master and slave have equal MySQL server UUIDs.*");
 CALL mtr.add_suppression("Master's UUID has changed, although this should not happen unless you have changed it manually");
 CALL mtr.add_suppression("Slave I/O: SET @master_heartbeat_period to master failed with error: Lost connection to MySQL server during query");
 CALL mtr.add_suppression("Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error");
+CALL mtr.add_suppression("A slave with the same server_uuid as this slave has connected to the master");
 include/sync_slave_sql_with_master.inc
 
 # Case 1:
 # Master's UUID appears in the result of 'SHOW SLAVE STATUS'.
-# Slave's UUID appears in the resule of 'SHOW SLAVE HOSTS'.
+# Slave's UUID appears in the result of 'SHOW SLAVE HOSTS'.
 -----------------------------------------------------------------------------
 SHOW SLAVE HOSTS;
 Server_id      Host    Port    Master_id       Slave_UUID
@@ -35,7 +36,7 @@ include/stop_slave.inc
 include/check_slave_param.inc [Slave_IO_Running]
 
 # Case 3:
-# Slave generates an errror and aborts, if master's UUID is
+# Slave generates an error and aborts, if master's UUID is
 # equal to slave's UUID unless --replicate-same-server-id
 # option is set.
 -----------------------------------------------------------------------------
@@ -121,21 +122,19 @@ include/start_slave.inc
 # Case 6:
 # In an existing master-slave replication forum (M->S1), if another
 # slave (S2) with the same UUID as S1 joins the forum and connects
-# to Master(M), then there will be ping-pong reconnections happens
-# between M->S2, M->S1, M->S2, M->S1,.... And both slave1 and slave2
-# will be informed about this UUID misconfiguration in their error
-# log file. And Master log will be populated with information that
-# it found a zombie dump thread and it is killing it(only when
-# log_warnings is greater than 1)
+# to Master(M), the master will throw an error to the first slave
+# connection that will not try to reconnect.
 -----------------------------------------------------------------------------
 include/rpl_restart_server.inc [server_number=3]
-CREATE TABLE t1(i int);
-DROP TABLE t1;
-include/sync_slave_sql_with_master.inc
-include/sync_slave_sql_with_master.inc
-Pattern "found a zombie dump thread with the same UUID" found
-Pattern "master receives a binlog send request from a duplicate server UUID" found
-Pattern "master receives a binlog send request from a duplicate server UUID" found
+[connection server_2]
+include/wait_for_slave_io_error.inc [errno=1236]
+include/assert_grep.inc [Found the expected line in master's error log for server 2 disconnection]
+include/start_slave_io.inc
+[connection server_3]
+include/wait_for_slave_io_error.inc [errno=1236]
+include/assert_grep.inc [Found the expected line in master's error log for server 3 disconnection]
+include/assert_grep.inc [Found the expected line in server 2 error log]
+include/assert_grep.inc [Found the expected line in server 3 error log]
 include/rpl_restart_server.inc [server_number=3]
 include/stop_slave.inc
 include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp_privileges.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp_privileges.result
new file mode 100644 (file)
index 0000000..5bf7b24
--- /dev/null
@@ -0,0 +1,65 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection master]
+CREATE TABLE t1 (f INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+include/sync_slave_sql_with_master.inc
+[connection master]
+CREATE USER 'testuser'@'localhost';
+GRANT CREATE ROUTINE ON test.* TO 'testuser'@'localhost';
+GRANT REPLICATION CLIENT ON *.* TO 'testuser'@'localhost';
+FLUSH PRIVILEGES;
+CREATE DEFINER='testuser'@'localhost' PROCEDURE row_cnt()
+BEGIN
+SELECT COUNT(*) as total_rows FROM test.t1;
+END|
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/assert.inc [Assert that mysql.procs_priv table is empty]
+[connection slave]
+include/assert.inc [Assert that mysql.procs_priv table is empty]
+[connection master]
+DROP PROCEDURE row_cnt;
+include/sync_slave_sql_with_master.inc
+[connection master]
+CREATE  PROCEDURE row_cnt()
+BEGIN
+SELECT COUNT(*) as total_rows FROM test.t1;
+END|
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/assert.inc [Assert that mysql.procs_priv table is empty]
+[connection slave]
+include/assert.inc [Assert that mysql.procs_priv table is empty]
+[connection master]
+DROP PROCEDURE row_cnt;
+include/sync_slave_sql_with_master.inc
+CREATE DEFINER='testuser'@'localhost' PROCEDURE row_cnt()
+BEGIN
+SELECT COUNT(*) as total_rows FROM test.t1;
+END|
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/assert.inc [Assert that mysql.procs_priv table has one row for testuser]
+[connection slave]
+include/assert.inc [Assert that mysql.procs_priv table has one row for testuser]
+DROP PROCEDURE row_cnt;
+include/sync_slave_sql_with_master.inc
+CREATE PROCEDURE row_cnt()
+BEGIN
+SELECT COUNT(*) as total_rows FROM test.t1;
+END|
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/assert.inc [Assert that mysql.procs_priv table has one row for testuser]
+[connection slave]
+include/assert.inc [Assert that mysql.procs_priv table has one row for testuser]
+[connection master]
+DROP TABLE t1;
+DROP PROCEDURE row_cnt;
+DROP USER 'testuser'@'localhost';
+include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_special_charset.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_special_charset.result
new file mode 100644 (file)
index 0000000..55690c5
--- /dev/null
@@ -0,0 +1,10 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t1(i VARCHAR(20));
+INSERT INTO t1 VALUES (0xFFFF);
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/rpl_end.inc
index 2d3ef9213ec80a506d37002e419854f4dd9bfbee..62e3f22f055d7a1518cf6d747e41448e114b288c 100644 (file)
@@ -91,7 +91,7 @@ Note  1051    Unknown table 'test.tt_xx_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-TXe-Temp';
@@ -110,7 +110,7 @@ Note        1051    Unknown table 'test.tt_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-NXe-Temp';
@@ -129,7 +129,7 @@ Note        1051    Unknown table 'test.tt_1'
 -b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e-
 
 SET @commands= 'Drop-Temp-TN-Temp';
@@ -281,7 +281,7 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -304,8 +304,8 @@ master-bin.000001   #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -358,7 +358,7 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -381,8 +381,8 @@ master-bin.000001   #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -440,7 +440,7 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
@@ -462,13 +462,13 @@ COMMIT;
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
@@ -783,7 +783,7 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -809,8 +809,8 @@ master-bin.000001   #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -870,7 +870,7 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -896,8 +896,8 @@ master-bin.000001   #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_xx_1() VALUES (1)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_2`,`test`.`tt_1` /* generated by server */
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`tt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -956,7 +956,7 @@ Warning     #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
@@ -978,13 +978,13 @@ Warning   #       Some temporary tables were dropped, but these operations could not be
 include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO nt_xx_1() VALUES (1)
 master-bin.000001      #       Query   #       #       COMMIT
 master-bin.000001      #       Query   #       #       BEGIN
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`tt_1` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`tt_1` /* generated by server */
 master-bin.000001      #       Query   #       #       COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e-
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_ignore.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_ignore.result
new file mode 100644 (file)
index 0000000..253809e
--- /dev/null
@@ -0,0 +1,57 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+"Test case1"
+[connection master]
+CREATE DATABASE db_a;
+CREATE DATABASE db_b;
+include/sync_slave_sql_with_master.inc
+FLUSH LOCAL RELAY LOGS;
+[connection master]
+USE db_b;
+CREATE VIEW view_b AS SELECT NULL;
+include/sync_slave_sql_with_master.inc
+[connection master]
+CREATE VIEW view_b AS SELECT NULL;
+ERROR 42S01: Table 'view_b' already exists
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       CREATE DATABASE db_a
+master-bin.000001      #       Query   #       #       CREATE DATABASE db_b
+master-bin.000001      #       Query   #       #       use `db_b`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_b` AS SELECT NULL
+include/sync_slave_sql_with_master.inc
+include/show_relaylog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+slave-relay-bin.000003 #       Format_desc     #       #       SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000003 #       Query   #       #       use `db_b`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_b` AS SELECT NULL
+EXPLAIN view_b;
+ERROR 42S02: Table 'test.view_b' doesn't exist
+[connection master]
+DROP DATABASE db_a;
+DROP DATABASE db_b;
+include/sync_slave_sql_with_master.inc
+include/rpl_reset.inc
+"Test case2"
+[connection master]
+CREATE DATABASE db_a;
+CREATE DATABASE db_b;
+include/sync_slave_sql_with_master.inc
+[connection master]
+USE db_b;
+CREATE TABLE t2 (f INT PRIMARY KEY) ENGINE=MYISAM;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (2);
+INSERT INTO t2 VALUES (3);
+INSERT INTO t2 VALUES (5);
+include/sync_slave_sql_with_master.inc
+[connection master]
+UPDATE t2 SET f=f+2 WHERE f>=2;
+ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
+include/sync_slave_sql_with_master.inc
+[connection master]
+DROP DATABASE db_a;
+DROP DATABASE db_b;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
index 40265728d34b31edf02d5eb70aa278a0e1f3f747..e0dfb9053ef025b1a62021f69f020b944b0a80ab 100644 (file)
@@ -489,7 +489,7 @@ include/show_binlog_events.inc
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
 master-bin.000001      #       Query   #       #       BEGIN
 master-bin.000001      #       Query   #       #       use `test`; INSERT INTO tt_1(ddl_case) VALUES (8)
-master-bin.000001      #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`new_tt_xx` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */
 master-bin.000001      #       Xid     #       #       COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_rollback_to_savepoint.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_rollback_to_savepoint.result
new file mode 100644 (file)
index 0000000..bf7f909
--- /dev/null
@@ -0,0 +1,414 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+#Test case 1:
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+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|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t3 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` 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
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t2 VALUES (1)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+DROP TRIGGER tr1;
+DELETE FROM t1;
+DELETE FROM t2;
+DELETE FROM t3;
+# Test case 2:
+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()|
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t3 (f1 INTEGER PRIMARY KEY)
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` 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
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t2 VALUES (1)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       use `test`; DROP TRIGGER tr1
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; DELETE FROM t1
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; DELETE FROM t2
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; DELETE FROM t3
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` 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
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1()
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t2 VALUES (1)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t1 VALUES (1)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP PROCEDURE p1;
+# Test case 3:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB;
+CREATE TRIGGER t_insert_trig AFTER INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+ROLLBACK TO savepoint_1;
+END |
+INSERT INTO t VALUES (2);
+INSERT INTO t VALUES (3);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t_insert_trig AFTER INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+ROLLBACK TO savepoint_1;
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t VALUES (2)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t VALUES (3)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+SELECT * FROM t;
+f1
+2
+3
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t;
+f1
+2
+3
+[connection master]
+DROP TABLE t;
+# Test case 4:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+INSERT INTO t1 VALUES (5);
+END |
+INSERT INTO t VALUES (2), (3);
+INSERT INTO t1 VALUES (30);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+INSERT INTO t1 VALUES (5);
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t VALUES (2), (3)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t1 VALUES (30)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+5
+5
+30
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+5
+5
+30
+[connection master]
+DROP TABLE t;
+DROP TABLE t1;
+# Test case 5:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
+CREATE TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+END |
+INSERT INTO t VALUES (2), (3);
+INSERT INTO t1 VALUES (30);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t_insert_trig BEFORE INSERT ON t
+FOR EACH ROW
+BEGIN
+SAVEPOINT savepoint_1;
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t VALUES (2), (3)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t1 VALUES (30)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+30
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t;
+f1
+2
+3
+SELECT * FROM t1;
+f1
+30
+[connection master]
+DROP TABLE t;
+DROP TABLE t1;
+# Test case 6:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+ROLLBACK TO event_logging_2;
+RETURN 0;
+END|
+BEGIN;
+INSERT INTO t2 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t2 VALUES (10);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+ROLLBACK TO event_logging_2;
+RETURN 0;
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t2 VALUES (1), (f1()), (2), (4)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t2 VALUES (10)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION f1;
+# Test case 7:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+RETURN 0;
+END|
+BEGIN;
+INSERT INTO t2 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t2 VALUES (10);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+BEGIN
+SAVEPOINT event_logging_2;
+INSERT INTO t1 VALUES (1);
+RETURN 0;
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t2 VALUES (1), (f1()), (2), (4)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t2 VALUES (10)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+1
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2;
+f1
+1
+0
+2
+4
+10
+SELECT * FROM t1;
+f1
+1
+[connection master]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP FUNCTION f1;
+# Test case 8:
+include/rpl_reset.inc
+[connection master]
+CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SAVEPOINT event_logging_2;
+RETURN 0;
+END|
+BEGIN;
+INSERT INTO t1 VALUES (1), (f1()), (2), (4);
+COMMIT;
+INSERT INTO t1 VALUES (10);
+include/show_binlog_events.inc
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001      #       Query   #       #       use `test`; CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB
+master-bin.000001      #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+BEGIN
+SAVEPOINT event_logging_2;
+RETURN 0;
+END
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t1 VALUES (1), (f1()), (2), (4)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+master-bin.000001      #       Query   #       #       BEGIN
+master-bin.000001      #       Query   #       #       use `test`; INSERT INTO t1 VALUES (10)
+master-bin.000001      #       Xid     #       #       COMMIT /* XID */
+[connection master]
+SELECT * FROM t1;
+f1
+1
+0
+2
+4
+10
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+f1
+1
+0
+2
+4
+10
+[connection master]
+DROP TABLE t1;
+DROP FUNCTION f1;
+include/rpl_end.inc
index 24926cd38edd084a3a85afa6f5a49213e6951d67..ae309b0b8b3e3fa4b67cc24f71a2052640b81562 100644 (file)
@@ -11886,12 +11886,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_11;
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_11` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_11` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T Sn T CT Rn R]
@@ -11952,12 +11952,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_12` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_12` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B T CT T R]
@@ -12004,12 +12004,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_13;
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_13` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_13` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B tN CT T R]
@@ -12062,12 +12062,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_14;
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_14` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_14` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B CT T R]
@@ -12108,12 +12108,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_15;
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_15` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_15` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 rpl_mixing_engines.inc [commands=B N CT T R]
@@ -12166,12 +12166,12 @@ rpl_mixing_engines.inc [commands=drop-CT]
 DROP TEMPORARY TABLE IF EXISTS tt_xx_16;
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 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`.`tt_xx_16` /* generated by server */
+master-bin.000001      #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_16` /* generated by server */
 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stop_slave_threads_error.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stop_slave_threads_error.result
new file mode 100644 (file)
index 0000000..08444e8
--- /dev/null
@@ -0,0 +1,18 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t1(i INT);
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/stop_slave_io.inc
+include/start_slave_io.inc
+Pattern "Lost connection to MySQL server during query" not found
+include/stop_slave_sql.inc
+include/start_slave_sql.inc
+Pattern "Lost connection to MySQL server during query" not found
+include/stop_slave.inc
+include/start_slave.inc
+Pattern "Lost connection to MySQL server during query" not found
+include/rpl_end.inc
index 72756014e116c86595ad3738a1222e51bb012d98..8534a9028c7c26079382b26cb0077ea70e809e5b 100644 (file)
@@ -62,13 +62,13 @@ slave-bin.000001    #       Query   #       #       use `test`; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_
 slave-bin.000001       #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES ()
 slave-bin.000001       #       Query   #       #       use `test`; CREATE TEMPORARY TABLE t1_tmp (i1 int)
 slave-bin.000001       #       Query   #       #       use `test`; ALTER TABLE t1_tmp ADD COLUMN b INT
-slave-bin.000001       #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`t1_tmp` /* generated by server */
+slave-bin.000001       #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `t1_tmp` /* generated by server */
 slave-bin.000001       #       Query   #       #       use `test`; DROP TABLE `t2` /* generated by server */
 slave-bin.000001       #       Query   #       #       BEGIN
 slave-bin.000001       #       Table_map       #       #       table_id: # (test.t1)
 slave-bin.000001       #       Write_rows      #       #       table_id: # flags: STMT_END_F
 slave-bin.000001       #       Xid     #       #       COMMIT /* XID */
-slave-bin.000001       #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`t2_tmp` /* generated by server */
+slave-bin.000001       #       Query   #       #       use `test`; DROP TEMPORARY TABLE IF EXISTS `t2_tmp` /* generated by server */
 slave-bin.000001       #       Query   #       #       BEGIN
 slave-bin.000001       #       Query   #       #       use `test`; INSERT INTO t1 VALUES (2)
 slave-bin.000001       #       Xid     #       #       COMMIT /* XID */
@@ -111,7 +111,7 @@ 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   #       #       BEGIN
-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 */
 master-bin.000001      #       Query   #       #       COMMIT
 include/sync_slave_sql_with_master.inc
 # Compare the base table.
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary_error_table_repository.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary_error_table_repository.result
new file mode 100644 (file)
index 0000000..11f1820
--- /dev/null
@@ -0,0 +1,45 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection master]
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT) ENGINE= InnoDB;
+include/stop_slave.inc
+SET @saved_slave_transaction_retries = @@GLOBAL.slave_transaction_retries;
+SET @saved_innodb_lock_wait_timeout = @@GLOBAL.innodb_lock_wait_timeout;
+SET @saved_master_info_repository = @@GLOBAL.master_info_repository;
+SET @saved_relay_log_info_repository = @@GLOBAL.relay_log_info_repository;
+SET @@GLOBAL.innodb_lock_wait_timeout = 1;
+SET @@GLOBAL.master_info_repository = TYPE;
+SET @@GLOBAL.relay_log_info_repository = TYPE;
+[connection slave1]
+BEGIN;
+INSERT INTO t1 VALUES (7,0);
+[connection master]
+INSERT INTO t1 VALUES (7,7);
+[connection slave]
+SET @@GLOBAL.slave_transaction_retries = 0;
+include/start_slave.inc
+### Specified retry number is expected ###
+### Timeout error is expected ###
+include/wait_for_slave_sql_error.inc [errno=1205]
+[connection slave]
+SET @@GLOBAL.slave_transaction_retries = 1;
+include/start_slave.inc
+### Specified retry number is expected ###
+### Timeout error is expected ###
+include/wait_for_slave_sql_error.inc [errno=1205]
+[connection slave1]
+ROLLBACK;
+#### Cleanup ####
+[connection slave]
+include/stop_slave.inc
+SET @@GLOBAL.slave_transaction_retries = @saved_slave_transaction_retries;
+SET @@GLOBAL.master_info_repository = @saved_master_info_repository;
+SET @@GLOBAL.relay_log_info_repository = @saved_relay_log_info_repository;
+SET @@GLOBAL.innodb_lock_wait_timeout = @saved_innodb_lock_wait_timeout ;
+include/start_slave.inc
+[connection master]
+DROP TABLE t1;
+include/rpl_end.inc
index 71ae70a2051442cb147d66ddeae93782a8a3976f..d3e8c2c377401992907dbd2628670131ab274682 100644 (file)
@@ -186,9 +186,24 @@ DROP USER test_3@localhost;
 ERROR HY000: Table 'user' was not locked with LOCK TABLES
 INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked");
 UNLOCK TABLE;
+CREATE DATABASE db;
+CREATE TABLE db.t1 LIKE t2;
+CREATE TABLE t3 LIKE t2;
+DROP TABLE t3;
+DROP DATABASE db;
 DROP USER test_3@localhost;
 DROP FUNCTION f2;
 DROP PROCEDURE p2;
 DROP EVENT e2;
 DROP TABLE t1, t2;
+CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=MyISAM;
+CREATE TABLE t1 LIKE temp_t1;
+CREATE TABLE t2 LIKE temp_t2;
+include/assert.inc ["t1 on master and temp_t1 have the same storage engine"]
+include/assert.inc ["t2 on master and temp_t2 have the same storage engine"]
+include/assert.inc ["t1 on slave and temp_t1 have the same storage engine"]
+include/assert.inc ["t2 on slave and temp_t2 have the same storage engine"]
+DROP TEMPORARY TABLE temp_t1, temp_t2;
+DROP TABLE t1, t2;
 include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_unsafe_statements.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_unsafe_statements.result
new file mode 100644 (file)
index 0000000..90e935e
--- /dev/null
@@ -0,0 +1,56 @@
+include/master-slave.inc
+Warnings:
+Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t1(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TRIGGER trig1 AFTER INSERT ON t1
+FOR EACH ROW
+INSERT INTO t2(i) VALUES(new.i);
+START TRANSACTION;
+INSERT INTO t2(i) VALUES (1);
+ROLLBACK;
+INSERT INTO t1(i) VALUES(2);
+START TRANSACTION;
+LOCK TABLES t1 WRITE, t2 WRITE;
+INSERT INTO t1(i) VALUES(3);
+UNLOCK TABLES;
+COMMIT;
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
+DROP TABLE t1,t2;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+INSERT INTO t1 values (1), (2), (3);
+START TRANSACTION;
+INSERT INTO t2(i) VALUES (1);
+ROLLBACK;
+INSERT INTO t2(i) SELECT i FROM t1;
+START TRANSACTION;
+LOCK TABLES t2 WRITE, t1 READ;
+INSERT INTO t2(i) SELECT i FROM t1;
+UNLOCK TABLES;
+COMMIT;
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
+DROP TABLE t1,t2;
+CREATE TABLE t1(i int, id INT AUTO_INCREMENT, PRIMARY KEY (i, id)) ENGINE=MYISAM;
+INSERT INTO t1 (i) values (1);
+START TRANSACTION;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 (i) values (2);
+UNLOCK TABLES;
+COMMIT;
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+CREATE TABLE t1(i INT, j INT, UNIQUE KEY(i), UNIQUE KEY(j)) ENGINE=INNODB;
+INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+START TRANSACTION;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+UNLOCK TABLES;
+COMMIT;
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/rpl_end.inc
index a82c31cb37c6faf21ee6b8d0e2c814f152d74883..738843a2a401c6d539fa423ed47ac51e92c6c8ba 100644 (file)
@@ -13,3 +13,6 @@
 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
+rpl_rotate_logs : codership/mysql-wsrep##71 Regression: Duplicate "file was not purged because it is the active log file" warning 
+rpl.rpl_gtid_stress_failover  : BUG#20630589 2015-10-06 parveez Test needs to be stabilized
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/mysql-wsrep#110-2.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/mysql-wsrep#110-2.test
new file mode 100644 (file)
index 0000000..4a8aa1e
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# codership/mysql-wsrep/110 - Assertion `table_found' failed in unpack_row() with SAVEPOINT, trigger, error handler
+#
+
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t3 (f1 INTEGER PRIMARY KEY);
+
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1(NEW.f1);
+
+DELIMITER |;
+
+CREATE PROCEDURE p1 (IN x INT)
+BEGIN
+        DECLARE EXIT HANDLER FOR SQLEXCEPTION
+                BEGIN
+                        ROLLBACK TO event_logging;
+                        INSERT t3 VALUES (x);
+                END;
+        SAVEPOINT event_logging;
+
+        INSERT INTO t2 VALUES (x);
+
+        RELEASE SAVEPOINT event_logging;
+END|
+DELIMITER ;|
+
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 VALUES (1);
+
+
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+
+DROP PROCEDURE p1;
+
+--source include/sync_slave_sql_with_master.inc
+--source include/rpl_end.inc
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_apply_binlog_with_anonymous_gtid.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_apply_binlog_with_anonymous_gtid.test
new file mode 100644 (file)
index 0000000..497b6ee
--- /dev/null
@@ -0,0 +1,72 @@
+###############################################################################
+# Bug #20436436  NEW->OLD ASSERT FAILURE `GTID_MODE > 0' IN 5.6.24 AT LOG_EVENT.CC:13555
+#
+# The problem is caused when slave sql thread is applying an
+# anonymous_gtid log events on mysql 5.6, since the
+# anonymous_gtid log event can be generated on mysql 5.7 after
+# wl#7592 when gtid_mode is OFF or OFF_PERMISSVE. So the
+# NEW->OLD replication is broken.
+#
+# On mysql 5.6, the slave sql thread should manage to apply the
+# anonymous_gtid log event successfully if gtid_mode is OFF;
+#
+# Steps to Reproduce:
+#  1) Stop slave threads and clear slave datadir.
+#  2) Copy the binlog with Anonymous_GTID log events and
+#     relay log index to slave datadir.
+#  3) Make sure that the binlog with Anonymous_GTID log events
+#     is applied completely.
+###############################################################################
+
+--source include/not_gtid_enabled.inc
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+
+# Initial setup
+--source include/rpl_connection_slave.inc
+--let $MYSQLD_SLAVE_DATADIR= `select @@datadir`
+
+--echo #
+--echo # Stop slave threads and clear slave datadir.
+--echo #
+--source include/stop_slave.inc
+RESET SLAVE;
+--remove_file $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001
+--remove_file $MYSQLD_SLAVE_DATADIR/slave-relay-bin.index
+
+--source include/rpl_connection_master.inc
+CREATE TABLE t1 (c1 INT);
+
+--source include/rpl_connection_slave.inc
+--echo #
+--echo # Copy the binlog with Anonymous_GTID log events and
+--echo # relay log index to slave datadir.
+--echo #
+# On Win* platforms path separator is backslash.
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
+{
+  --copy_file std_data/slave-relay-bin_win.index $MYSQLD_SLAVE_DATADIR/slave-relay-bin.index
+}
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
+{
+  --copy_file std_data/slave-relay-bin_linux.index $MYSQLD_SLAVE_DATADIR/slave-relay-bin.index
+}
+--copy_file std_data/binlog_transaction_with_anonymous_GTID.000001 $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001
+
+--source include/start_slave.inc
+--source include/rpl_connection_master.inc
+--source include/sync_slave_sql_with_master.inc
+
+--echo #
+--echo # Make sure that the binlog with Anonymous_GTID log events
+--echo # is applied completely.
+--echo #
+--let $assert_text= Table t2 must contain 1
+--let $assert_cond= "[SELECT c1 FROM t2]" = "1"
+--source include/assert.inc
+DROP TABLE t2;
+
+# Cleanup
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_apply_binlog_with_anonymous_gtid_when_gtid_mode_on.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_apply_binlog_with_anonymous_gtid_when_gtid_mode_on.test
new file mode 100644 (file)
index 0000000..8dee41e
--- /dev/null
@@ -0,0 +1,74 @@
+###############################################################################
+# Bug #20436436  NEW->OLD ASSERT FAILURE `GTID_MODE > 0' IN 5.6.24 AT LOG_EVENT.CC:13555
+#
+# The problem is caused when slave sql thread is applying an
+# anonymous_gtid log events on mysql 5.6, since the
+# anonymous_gtid log event can be generated on mysql 5.7 after
+# wl#7592 when gtid_mode is OFF or OFF_PERMISSVE. So the
+# NEW->OLD replication is broken.
+#
+# On mysql 5.6, the slave sql thread should report an error and abort
+# when applying the anonymous_gtid log event if gtid_mode is ON.
+#
+# Steps to Reproduce:
+#  1) Stop slave threads and clear slave datadir.
+#  2) Copy the binlog with Anonymous_GTID log events and
+#     relay log index to slave datadir.
+#  3) Process the binlog with Anonymous_GTID log events
+#     and wait for SQL thread error.
+###############################################################################
+
+--source include/have_gtid.inc
+# We did not run the test with MTS, since the slave sql error
+# 'ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF' is
+# overwritten by 'ER_MTS_INCONSISTENT_DATA' in MTS.
+--source include/not_mts_slave_parallel_workers.inc
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+
+--source include/rpl_connection_slave.inc
+--let $MYSQLD_SLAVE_DATADIR= `select @@datadir`
+
+--echo #
+--echo # Stop slave threads and clear slave datadir.
+--echo #
+--source include/stop_slave.inc
+RESET SLAVE;
+--remove_file $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001
+--remove_file $MYSQLD_SLAVE_DATADIR/slave-relay-bin.index
+
+--echo #
+--echo # Copy the binlog with Anonymous_GTID log events and
+--echo # relay log index to slave datadir.
+--echo #
+# On Win* platforms path separator is backslash.
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
+{
+  --copy_file std_data/slave-relay-bin_win.index $MYSQLD_SLAVE_DATADIR/slave-relay-bin.index
+}
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
+{
+  --copy_file std_data/slave-relay-bin_linux.index $MYSQLD_SLAVE_DATADIR/slave-relay-bin.index
+}
+--copy_file std_data/binlog_transaction_with_anonymous_GTID.000001 $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001
+
+--echo #
+--echo # Process the binlog with Anonymous_GTID log events.
+--echo #
+START SLAVE;
+--echo #
+--echo # Wait for SQL thread error.
+--echo #
+call mtr.add_suppression("Slave.* @@SESSION.GTID_NEXT cannot be set to ANONYMOUS when @@GLOBAL.GTID_MODE = ON.");
+--let $slave_sql_errno= convert_error(ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON)
+--source include/wait_for_slave_sql_error.inc
+
+# Reset slave.
+--source include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+--source include/start_slave.inc
+
+# Cleanup
+--source include/rpl_connection_master.inc
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_apply_binlog_with_gtid_when_gtid_mode_off.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_apply_binlog_with_gtid_when_gtid_mode_off.test
new file mode 100644 (file)
index 0000000..1d67937
--- /dev/null
@@ -0,0 +1,68 @@
+###############################################################################
+# Bug #20436436  NEW->OLD ASSERT FAILURE `GTID_MODE > 0' IN 5.6.24 AT LOG_EVENT.CC:13555
+#
+# Verify that the slave sql thread should report an error and abort
+# when applying a gtid log event if gtid_mode is OFF on mysql 5.6.
+#
+# Steps to Reproduce:
+#  1) Stop slave threads and clear slave datadir.
+#  2) Copy the binlog with GTID log events and
+#     relay log index to slave datadir.
+#  3) Process the binlog with GTID log events
+#     and wait for SQL thread error.
+###############################################################################
+
+--source include/not_gtid_enabled.inc
+# We did not run the test with MTS, since the slave sql error
+# 'ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF' is
+# overwritten by 'ER_MTS_INCONSISTENT_DATA' in MTS.
+--source include/not_mts_slave_parallel_workers.inc
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+
+--source include/rpl_connection_slave.inc
+--let $MYSQLD_SLAVE_DATADIR= `select @@datadir`
+
+--echo #
+--echo # Stop slave threads and clear slave datadir.
+--echo #
+--source include/stop_slave.inc
+RESET SLAVE;
+--remove_file $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001
+--remove_file $MYSQLD_SLAVE_DATADIR/slave-relay-bin.index
+
+--echo #
+--echo # Copy the binlog with Anonymous_GTID log events and
+--echo # relay log index to slave datadir.
+--echo #
+# On Win* platforms path separator is backslash.
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
+{
+  --copy_file std_data/slave-relay-bin_win.index $MYSQLD_SLAVE_DATADIR/slave-relay-bin.index
+}
+if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
+{
+  --copy_file std_data/slave-relay-bin_linux.index $MYSQLD_SLAVE_DATADIR/slave-relay-bin.index
+}
+--copy_file std_data/binlog_transaction_with_GTID.000001 $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001
+
+--echo #
+--echo # Process the binlog with Anonymous_GTID log events.
+--echo #
+START SLAVE;
+--echo #
+--echo # Wait for SQL thread error.
+--echo #
+call mtr.add_suppression("Slave.* @@SESSION.GTID_NEXT cannot be set to UUID:NUMBER when @@GLOBAL.GTID_MODE = OFF.");
+--let $slave_sql_errno= convert_error(ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF)
+--source include/wait_for_slave_sql_error.inc
+
+# Reset slave.
+--source include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+--source include/start_slave.inc
+
+# Cleanup
+--source include/rpl_connection_master.inc
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_autogen_query_multi_byte_char.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_autogen_query_multi_byte_char.test
new file mode 100644 (file)
index 0000000..a93fcba
--- /dev/null
@@ -0,0 +1,87 @@
+###############################################################################
+# Bug#21205695 DROP TABLE MAY CAUSE SLAVES TO BREAK
+#
+# Problem:
+# ========
+# 1) Drop table queries are re-generated by server
+#    before writing the events(queries) into binlog
+#    for various reasons. If table name/db name contains
+#    a non regular characters (like latin characters),
+#    the generated query is wrong. Hence it breaks the
+#    replication.
+# 2) In the edge case, when table name contains
+#    64 latin characters (latin takes 2 bytes), server is
+#    throwing an assert (M_TBLLEN < 128)
+#
+# 3) In the edge case, when db name contains 64 latin
+#    characters, binlog contents are interpreted wrongly
+#    which is leading to replication issues.
+#
+###############################################################################
+
+--source include/not_windows.inc
+--source include/master-slave.inc
+
+--let iter=1
+# Change iteration to 4 after fixing Bug #22280214
+while ($iter <= 2)
+{
+  --connection master
+  if ($iter == 1)
+  {
+    --echo Test case 1:- table name with one character latin name.
+    --let $tblname= REPEAT(CHAR(131),1)
+  }
+  if ($iter == 2)
+  {
+    --echo Test case 2:- table name and database names with one character latin name.
+    --let $tblname= REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1)
+    --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),1),"`")
+    PREPARE STMT FROM @s; EXECUTE stmt;
+  }
+  # After fixing Bug #22280214 DATADIR LOCATION IS LIMITING
+  # IDENTIFIER MAX LENGTH,  the following two tests (iter 3 and 4) can be
+  # uncommented.
+  #if ($iter == 3)
+  #{
+    # --echo Test case 3:- table name and database names with 64 latin characters name.
+    # --let $tblname= REPEAT(CHAR(131),64),"`.`", REPEAT(CHAR(131),64)
+    # --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),64),"`")
+    # PREPARE STMT FROM @s; EXECUTE stmt;
+  #}
+  #if ($iter == 4)
+  #{
+    # --echo Test case 4:- table name and database names with 64 Euro(€) characters.
+    # --let $tblname= REPEAT(CHAR(226,130,172),64),"`.`", REPEAT(CHAR(226,130,172),64)
+    # --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(226,130,172),64),"`")
+    # PREPARE STMT FROM @s; EXECUTE stmt;
+  #}
+  --eval SET @s:=CONCAT("CREATE TABLE `",$tblname,"` (a INT)")
+  PREPARE STMT FROM @s; EXECUTE stmt;
+  --eval SET @s:=CONCAT("INSERT INTO `",$tblname,"` VALUES (1)")
+  PREPARE STMT FROM @s; EXECUTE stmt;
+  --eval SET @s:=CONCAT("DROP TABLE `",$tblname, "`")
+  PREPARE STMT FROM @s; EXECUTE stmt;
+  if ($iter == 2)
+  {
+    --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),1),"`")
+    PREPARE STMT FROM @s; EXECUTE stmt;
+  }
+  # After fixing Bug #22280214 DATADIR LOCATION IS LIMITING
+  # IDENTIFIER MAX LENGTH, the following two tests (iter 3 and 4) can be
+  # uncommented.
+  #if ($iter == 3)
+  #{
+     # --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),64),"`")
+     # PREPARE STMT FROM @s; EXECUTE stmt;
+  #}
+  #if ($iter == 4)
+  #{
+     # --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(226,130,172),64),"`")
+     # PREPARE STMT FROM @s; EXECUTE stmt;
+  #}
+  --sync_slave_with_master
+  --inc $iter
+}
+
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_avoid_temporal_upgrade.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_avoid_temporal_upgrade.test
new file mode 100644 (file)
index 0000000..1ae3e43
--- /dev/null
@@ -0,0 +1,116 @@
+--echo #
+--echo # BUG#18985760 - "FAST" ALTER TABLE CHANGE ON ENUM COLUMN
+--echo #                 TRIGGERS FULL TABLE REBUILD.
+
+--echo # Test case below ensures that the columns with old temporal
+--echo # format are not upgraded on the slave since the global variable
+--echo # 'avoid_temporal_upgrade' is enabled on the slave.
+
+--source include/master-slave.inc
+
+--connection master
+--let MASTER_DATADIR=`select @@datadir`
+--connection slave
+--let SLAVE_DATADIR=`select @@datadir`
+
+--echo # Copy the table containing the old Mysql-5.5 temporal format
+--echo # to the master and slave.
+
+--copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t1.frm
+--copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t1.MYD
+--copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t1.MYI
+
+--copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t1.frm
+--copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t1.MYD
+--copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t1.MYI
+
+--echo # Enable the 'avoid_temporal_column' global variable on slave.
+--connection slave
+STOP SLAVE;
+SET @@global.avoid_temporal_upgrade= ON;
+START SLAVE;
+
+--echo # ALTER TABLE on the master.
+--connection master
+SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+ALTER TABLE t1 ADD COLUMN fld1 INT;
+INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
+--echo # Since the global variable 'avoid_temporal_upgrade' is disabled on 
+--echo # the master, the temporal columns of old format are upgraded to the
+--echo # 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 t1;
+--source include/sync_slave_sql_with_master.inc
+
+--echo # Since 'avoid_temporal_upgrade' is enabled on the slave,
+--echo # the old temporal will not be upgraded on the slave.
+--connection slave
+SET @saved_show_old_temporals= @@session.show_old_temporals;
+SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+SET SESSION show_old_temporals= ON;
+SHOW CREATE TABLE t1;
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+SET @@session.show_old_temporals= @saved_show_old_temporals;
+
+--echo #Cleanup
+--connection master
+DROP TABLE t1;
+--source include/sync_slave_sql_with_master.inc
+
+--echo # Testcase to ensure that the temporal columns of old format
+--echo # are upgraded on the slave since 'avoid_temporal_column'
+--echo # global variable is not enabled on the slave.
+
+--echo # Copy the table containing the old Mysql-5.5 temporal format
+--echo # to the master and slave.
+
+--copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t1.frm
+--copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t1.MYD
+--copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t1.MYI
+
+--copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t1.frm
+--copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t1.MYD
+--copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t1.MYI
+
+--echo # Disable the 'avoid_temporal_column' global variable on slave.
+--connection slave
+STOP SLAVE;
+SET @@global.avoid_temporal_upgrade= 0;
+START SLAVE;
+
+--echo # ALTER TABLE on the master.
+--connection master
+SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+ALTER TABLE t1 ADD COLUMN fld1 INT;
+INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
+
+--echo # Since the default value of 'avoid_temporal_upgrade' is FALSE,
+--echo # the old temporal will be upgraded on the master.
+SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+       HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+SHOW CREATE TABLE t1;
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+
+--source include/sync_slave_sql_with_master.inc
+
+--echo # Since the default value of 'avoid_temporal_upgrade' is FALSE,
+--echo # the old temporal will be upgraded on the slave.
+--connection slave
+SET @saved_show_old_temporals= @@session.show_old_temporals;
+SET SESSION show_old_temporals= ON;
+SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+SHOW CREATE TABLE t1;
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+SET @@session.show_old_temporals= @saved_show_old_temporals;
+
+--echo # cleanup
+--connection master
+DROP TABLE t1;
+--source include/sync_slave_sql_with_master.inc
+
+
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_failed_drop_table-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_failed_drop_table-slave.opt
new file mode 100644 (file)
index 0000000..32ef505
--- /dev/null
@@ -0,0 +1 @@
+--replicate-ignore-db=db1 --replicate-wild-ignore-table=db1.%
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_failed_drop_table.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_failed_drop_table.test
new file mode 100644 (file)
index 0000000..8694b11
--- /dev/null
@@ -0,0 +1,61 @@
+# ==== Purpose ====
+#
+# Check that when the exectuion of a DROP TABLE command with single table
+# fails it should not be written to the binary log. Also test that when the
+# execution of DROP TABLE command with multiple tables fails the command
+# should be written into the binary log.
+#
+# ==== Implementation ====
+# Create a database `db1` on master and ignore this database on the slave side
+# using --replicate-ignore-db=db1 --replicate-wild-ignore-table=db1.%. Now
+# execute a DROP TABLE command with single table in it and the command should
+# fail because of foreign key constraint. Check in the binlog that query should
+# not be binlogged. Slave should also be up and running without any errors.
+# Execute another DROP TABLE command with multiple tables in the drop list and
+# this also fails because of foreign key constraint, check that query gets
+# written into the binary log and slave should not fail since query is filtered
+# on it.
+#
+# ==== References ====
+#
+# Bug#21435502: DROP TABLE IF EXISTS MAY BRAKE REPLICATION IF SLAVE HAS
+# REPLICATION FILTERS.
+#
+################################################################################
+--source include/master-slave.inc
+
+CREATE DATABASE `db1`;
+
+USE `db1`;
+
+CREATE TABLE `t1` (`ID` bigint(20) primary key) ENGINE=InnoDB;
+
+CREATE TABLE `t2` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `DIVISION_ID` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `FK_TABLE1_DIVISION_1` (`DIVISION_ID`), CONSTRAINT `FK_TABLE1_DIVISION_1` FOREIGN KEY (`DIVISION_ID`) REFERENCES `t1` (`ID`) ON DELETE CASCADE ) ENGINE=InnoDB;
+
+CREATE TABLE `t3` (`ID` bigint(20) primary key) ENGINE=InnoDB;
+
+# Save master position
+--let $saved_master_pos=query_get_value('SHOW MASTER STATUS', Position, 1)
+
+# Test a single table drop failure
+--error ER_ROW_IS_REFERENCED
+DROP TABLE IF EXISTS `db1`.`t1`;
+--let $current_master_pos=query_get_value('SHOW MASTER STATUS', Position, 1)
+--let $assert_text= Drop with single table should not be written to the binary log if the query execution fails
+--let $assert_cond= $current_master_pos = $saved_master_pos
+--source include/assert.inc
+
+# Test a multiple table drop failure
+--error ER_ROW_IS_REFERENCED
+DROP TABLE `t3`, `t1`, `t2`;
+
+--let $binlog_start= $saved_master_pos
+--source include/show_binlog_events.inc
+
+--source include/sync_slave_sql_with_master.inc
+
+--echo Cleanup
+--source include/rpl_connection_master.inc
+DROP DATABASE `db1`;
+
+--source include/rpl_end.inc
index eb60474f2e5b2a043dd90069fd00e809216fd8f5..3c3b3390400d9428f367eb3a438daf6968d7c0cf 100644 (file)
@@ -32,11 +32,14 @@ start slave;
 # but there won't be any crashes nor asserts hit.
 #
 
-# 1593 = ER_SLAVE_FATAL_ERROR 
---let $slave_sql_errno= 1593
+# Wait for the SQL thread error
+--let $slave_sql_errno= convert_error(ER_SLAVE_FATAL_ERROR)
 --let $show_slave_sql_error= 1
 --source include/wait_for_slave_sql_error.inc
 
+# In 5.6 servers, there would be no I/O thread failure reported
+# on SHOW SLAVE STATUS. We should just wait for the IO thread to stop.
+--source include/wait_for_slave_io_to_stop.inc
 #
 # Cleanup
 #
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_crc_check-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_crc_check-master.opt
new file mode 100644 (file)
index 0000000..4ec38a6
--- /dev/null
@@ -0,0 +1 @@
+--binlog_checksum=none
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_crc_check.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_crc_check.test
new file mode 100644 (file)
index 0000000..01e488b
--- /dev/null
@@ -0,0 +1,66 @@
+# ==== Purpose ====
+#
+# Bug #20644100  "Event crc check failed" when master disable binlog_checksum
+#
+# Starting slave sql_thread to apply events will cause event crc check
+# failure when master disables binlog_checksum.
+#
+# Currently relay logs have the following sequence (starting from
+# position 4):
+# Format_desc (of slave)
+# Previous-GTIDs (of slave, if GTIDs are enabled)
+# Rotate (of master)
+# Format_desc (of master)
+# The Format_desc which really describes the rest of the relay
+# log is the 4rd event, which is from master.
+# Relay_log_info::init_relay_log_pos(...) will look for a
+# Format_description_log_event from master. We only need this when
+# slave applier thread starts and opens an existing relay log and
+# has to execute it (possibly from an offset >4), because we need
+# to read the description event of the relay log to be able to
+# parse the events we have to execute.
+# But the current code supposed that relay logs have the following
+# sequence (starting from position 4):
+# Format_desc (of slave)
+# Rotate (of master)
+# Format_desc (of master)
+# So the function failed to find the Format_description_log_event
+# from master when slave applier thread starts and opens an existing
+# relay log and has to execute it, which causes some failures.
+# The event crc check failure is one of them.
+#
+# Fix code to let slave applier thread also skip the Previous-GTIDs
+# log event to find the correct Format_description_log_event from
+# master when it is starting and opening an existing relay log.
+#
+# Steps to reproduce:
+# 1) Start master and slave servers
+# 2) Stop slave applier thread.
+# 3) Write an event into binary log on master
+#    when master disables binlog_checksum.
+# 4) Start slave applier thread to verify that
+#    their is no event crc check failure.
+#
+
+# Test in this file is binlog format agnostic, thus no need
+# to rerun them for every format.
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--source include/rpl_connection_slave.inc
+--source include/stop_slave_sql.inc
+
+--source include/rpl_connection_master.inc
+CREATE TABLE t1 (c1 INT);
+
+--echo #
+--echo # Start slave applier thread to verify that
+--echo # their is no event crc check failure.
+--echo #
+--source include/rpl_connection_slave.inc
+--source include/start_slave_sql.inc
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+
+--source include/rpl_end.inc
index fab3cd042e29dbaaf99a40739d768e4078b8a500..f1edae0b59a98ba48ccf85fe25cb305f998ce5d1 100644 (file)
@@ -1 +1 @@
---replicate-do-db=MYDB --replicate-do-table=mydb.T1 --replicate-do-table=mydb.t2 --lower_case_table_names=0
+--replicate-do-db=MYDB --replicate-do-table=mydb.T1 --replicate-do-table=mydb.t2
index 6f57cf85abc986808c3a72f30e7389ab3bbfe592..2e875c69ac395fe61e811243f22e7ef2885f2539 100644 (file)
@@ -5,6 +5,10 @@
 # sensitive when setting lower_case_table_name = 0
 #
 
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 -- source include/not_gtid_enabled.inc
 -- source include/master-slave.inc
 -- source include/have_binlog_format_statement.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_sensitive-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_sensitive-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
index a513fb57e470acedf29b3181c4cc307db9ce8730..d6a9dcb0fef9b0e7d1eee4aca2e2ea0923f9fefa 100644 (file)
@@ -1 +1 @@
---replicate-do-db=mydb --replicate-do-table=mydb.Ţ1 --replicate-do-table=mydb.t2 --lower_case_table_names=0
+--replicate-do-db=mydb --replicate-do-table=mydb.Ţ1 --replicate-do-table=mydb.t2
index c35a15dff3cda2aef8b7431f2df20e128c3bd308..27275587e8b646dc8cf38c08409a4a48712d9b6a 100644 (file)
@@ -5,5 +5,10 @@
 # sensitive and accent sensitive when setting
 # lower_case_table_name == 0
 #
+
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 --source include/not_gtid_enabled.inc
 --source extra/rpl_tests/rpl_do_table_filter_sensitive.inc
index fcb38d65410b87e19b1b6f3f6fcda2929572b0ff..cd443fa3ded6bf38498b98656ae2b3f8586f49fd 100644 (file)
@@ -17,7 +17,9 @@ use db1;
 CREATE TABLE a(id INT);
 CREATE VIEW v AS SELECT * FROM a;
 CREATE TABLE table_father(id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20)) ENGINE=INNODB;
+--source include/sync_slave_sql_with_master.inc
 
+connection master;
 use db2;
 CREATE TABLE table_child(id INT PRIMARY KEY, info VARCHAR(20), father_id INT) ENGINE=INNODB;
 ALTER TABLE table_child ADD CONSTRAINT aaa FOREIGN KEY (father_id) REFERENCES db1.table_father(id);
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_tbl_with_rewrite_db-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_tbl_with_rewrite_db-slave.opt
new file mode 100644 (file)
index 0000000..2a8db3e
--- /dev/null
@@ -0,0 +1 @@
+"--replicate-rewrite-db=test->new_test"
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_tbl_with_rewrite_db.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_tbl_with_rewrite_db.test
new file mode 100644 (file)
index 0000000..1531bf3
--- /dev/null
@@ -0,0 +1,83 @@
+###############################################################################
+# Bug#21317739: APPLYING CREATE TEMPORARY TABLE SQL ON A SLAVE WITH
+# REPLICATE-REWRITE-DB FAILS
+#
+# Problem:
+# =======
+# As part of fix for BUG#16290902, at the time of writing the 'DROP TEMPORARY
+# TABLE IF EXISTS' query into the binlog, the query will not be preceded by a
+# 'use `db`' statement. The query will have a fully qualified table name.
+# Eg:
+# 'USE `db`; DROP TEMPORARY TABLE IF EXISTS `t1`;'
+# will be logged as
+# 'DROP TEMPORARY TABLE IF EXISTS `db`.`t1`;'.
+#
+# Because of this change application of 'replicate-rewrite-db' filter rule
+# will fail on slave, as it works only on default database specified in 'use'
+# statement. This causes slave to break when the 'CREATE TEMPORARY TABLE' is
+# re-executed on slave.
+#
+# Test:
+# =====
+# Specify replicate-rewrite-db=test->new_test on slave. On master use 'test'
+# database and 'CREATE TEMPORARY TABLE 't1'. Then drop the temporary table and
+# recreate it on master. Now sync master with slave. Slave should be in sync
+# and up and running.
+###############################################################################
+--source include/master-slave.inc
+--source include/have_binlog_format_statement.inc
+
+# Database 'test' on master is mapped with 'new_test' on slave by using
+# replicate_rewrite_db filter
+--source include/rpl_connection_slave.inc
+CREATE DATABASE new_test;
+
+# Create a temporary table on the default database.
+--source include/rpl_connection_master.inc
+use test;
+CREATE TEMPORARY TABLE t1(id int);
+--source include/sync_slave_sql_with_master.inc
+
+# On slave verify that all the queries are rewritten as per the rewrite db
+# rules.
+--source include/show_binlog_events.inc
+
+# On slave verify that one temporary table is created.
+SHOW STATUS LIKE 'Slave_open_temp_tables';
+
+# On master drop the temporary table.
+--source include/rpl_connection_master.inc
+use test;
+DROP TEMPORARY TABLE IF EXISTS t1;
+
+--source include/sync_slave_sql_with_master.inc
+--source include/show_binlog_events.inc
+# On slave verify that  temporary table is dropped. Hence output should
+# be 0.
+SHOW STATUS LIKE 'Slave_open_temp_tables';
+
+# On master recreate the temporary tables once again.
+--source include/rpl_connection_master.inc
+use test;
+CREATE TEMPORARY TABLE t1(id int);
+--source include/sync_slave_sql_with_master.inc
+
+# On slave temporary table should be recreated.
+SHOW STATUS LIKE 'Slave_open_temp_tables';
+
+# Disconnect the master, temp table on slave should dissapear
+disconnect master;
+
+--source include/rpl_connection_slave.inc
+# Wait until drop of temp tables appers in slave's binlog
+let $wait_binlog_event= DROP;
+source include/wait_for_binlog_event.inc;
+
+# On slave verify that  temporary table is dropped. Hence output should
+# be 0.
+SHOW STATUS LIKE 'Slave_open_temp_tables';
+
+# ===========Clean up==========
+DROP DATABASE new_test;
+
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_dump_thread_kill.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_dump_thread_kill.test
new file mode 100644 (file)
index 0000000..cb4f7f2
--- /dev/null
@@ -0,0 +1,58 @@
+###############################################################################
+# Bug #21816399 5.6.24: LOST DATA DURING MASTER RESTART IF PARTIAL TRANSACT HAS
+# BEEN DOWNLOADED
+#
+# Problem: If dump thread is killed (during shutdown/explicit kill) during
+#  dumping a non-active binary log, events in the binary log are not getting
+#  replicated.
+# Steps to reproduce:
+#  1) Create a binary log with some events
+#  2) Rotate it to make it non-active log
+#  3) While dump thread is sending data to slave, kill it.
+#  4) Make sure that dump thread is killed
+#  5) Start dump thread
+#  6) See that there is no issue in replication
+###############################################################################
+
+--source include/have_binlog_format_statement.inc
+--source include/have_debug.inc
+--let $rpl_skip_start_slave=1
+--source include/master-slave.inc
+
+#  1) Create a binary log with some events
+CREATE TABLE t1(i INT) engine=innodb;
+INSERT INTO t1 VALUES (1);
+
+#  2) Rotate it to make it non-active log
+FLUSH LOGS;
+
+#  3) While dump thread is sending data to slave, kill it.
+SET GLOBAL DEBUG='+d,simulate_dump_thread_kill';
+--connection slave
+SET GLOBAL DEBUG='+d,simulate_no_master_reconnect';
+START SLAVE IO_THREAD;
+
+#  4) Make sure that dump thread is killed and IO thread is stopped.
+--source include/wait_for_slave_io_to_stop.inc
+
+--connection master
+--let $wait_condition= SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Binlog dump' OR COMMAND = 'Binlog Dump GTID'
+--source include/wait_condition.inc
+SET GLOBAL DEBUG='-d,simulate_dump_thread_kill';
+
+#  5) Start dump thread and replication threads
+--connection slave
+SET GLOBAL DEBUG='-d,simulate_no_master_reconnect';
+--source include/start_slave.inc
+
+#  6) See that there is no issue in replication
+--connection master
+--source include/sync_slave_sql_with_master.inc
+
+--let diff_tables=master:t1,slave:t1
+--source include/diff_tables.inc
+
+# Cleanup
+--connection master
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_empty_multi_update.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_empty_multi_update.test
new file mode 100644 (file)
index 0000000..e0139db
--- /dev/null
@@ -0,0 +1,105 @@
+--source include/have_gtid.inc
+--source include/master-slave.inc
+
+#
+# BUG#16621582: REPLICATION FAILS WITH ERROR 1837 WHEN DOING MULTI-TABLE UPDATES WITH SAVEPOINTS
+#
+
+--source include/rpl_connection_slave.inc
+--source include/gtid_utils.inc
+--source include/rpl_connection_master.inc
+
+--source include/rpl_reset.inc
+
+--let $server_uuid= SELECT @@server_uuid
+
+CREATE TABLE t1(c1 int) ENGINE=InnoDB;
+CREATE TABLE t2(c1 int) ENGINE=InnoDB;
+
+#
+# Test #1: assert that on multi-table updates the tables are
+#          marked correctly, even if no table is updated at
+#          all
+#
+
+
+--source include/sync_slave_sql_with_master.inc
+
+# needed for the assert below
+--let $saved_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED`
+
+--source include/rpl_connection_master.inc
+
+START TRANSACTION;
+UPDATE t1,t2 SET t1.c1 = 0;
+SAVEPOINT sp1;
+UPDATE t1,t2 SET t1.c1 = 0;
+SAVEPOINT sp2;
+COMMIT;
+
+--source include/sync_slave_sql_with_master.inc
+
+# assert that we have 1 more transaction in STMT or MIXED
+# or no additional transaction at all in RBR
+--let $current_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED`
+--let $saved_gtid_cnt= `SELECT GTID_COUNT('$saved_gtid_executed')`
+--let $current_gtid_cnt= `SELECT GTID_COUNT('$current_gtid_executed')`
+if (`SELECT @@binlog_format = 'row'`)
+{
+  # nothing was logged in RBR
+  --let $expected_gtid_cnt= $saved_gtid_cnt
+}
+if (`SELECT @@binlog_format <> 'row'`)
+{
+  --let $expected_gtid_cnt= `SELECT $saved_gtid_cnt + 1`
+}
+
+--let $assert_cond= $current_gtid_cnt = $expected_gtid_cnt
+--let $assert_text= The correct count of transactions is expected on the slave
+--source include/assert.inc
+
+--source include/rpl_connection_master.inc
+
+#
+# Test #2: assert that on multi-table updates the tables are
+#          marked correctly, even if the table is updated on
+#          the fly
+#
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+
+--source include/sync_slave_sql_with_master.inc
+
+# needed for the assert below
+--let $saved_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED`
+
+--source include/rpl_connection_master.inc
+
+START TRANSACTION;
+UPDATE t1,t2 SET t1.c1 = 0;
+COMMIT;
+
+--source include/sync_slave_sql_with_master.inc
+
+# assert that we have 1 more transaction in STMT or MIXED
+# or no additional transaction at all in RBR
+--let $current_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED`
+--let $saved_gtid_cnt= `SELECT GTID_COUNT('$saved_gtid_executed')`
+--let $current_gtid_cnt= `SELECT GTID_COUNT('$current_gtid_executed')`
+--let $expected_gtid_cnt= `SELECT $saved_gtid_cnt + 1`
+
+--let $assert_cond= $current_gtid_cnt = $expected_gtid_cnt
+--let $assert_text= The correct count of transactions is expected on the slave
+--source include/assert.inc
+
+--source include/rpl_connection_master.inc
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--source include/sync_slave_sql_with_master.inc
+--source include/gtid_utils_end.inc
+--source include/rpl_connection_master.inc
+
+--source include/rpl_end.inc
index 08908c70100c25968dc110001ee981ce6bcaa1b5..d093a2f3fe565490cf1936c17e71dc6130319cd1 100644 (file)
@@ -101,4 +101,59 @@ DROP EVENT event44331_2;
 DROP EVENT event44331_3;
 DROP EVENT event44331_4;
 --source include/sync_slave_sql_with_master.inc
+
+# Bug#21229951 VARIABLES IN ALTER EVENT NOT REPLICATED PROPERLY
+connection master;
+DELIMITER \\;
+CREATE EVENT event1 ON SCHEDULE EVERY 100 SECOND STARTS '2000-01-01 00:00:00'
+ON COMPLETION PRESERVE ENABLE DO
+BEGIN
+   SET @dummy = 100;
+END\\
+
+# A procedure that has alter event which uses sp local variable in it
+CREATE PROCEDURE proc1()
+BEGIN
+  DECLARE dummy INT UNSIGNED;
+  SET dummy = 100;
+  ALTER EVENT EVENT1 ON SCHEDULE EVERY dummy SECOND
+  STARTS '2000-01-01 00:00:00' ENABLE;
+END \\
+
+DELIMITER ;\\
+
+CALL proc1();
+--source include/sync_slave_sql_with_master.inc
+
+# Cleanup
+connection master;
+DROP EVENT event1;
+DROP PROCEDURE proc1;
+
+#
+# Bug #19286708 REPLICATION BROKEN AFTER CREATION OF SCHEDULED EVENTS
+# Testing create/alter event that has sysdate() (which makes statement unsafe)
+# Testing create/alter event that has local variables
+#
+connection master;
+call mtr.add_suppression("Unsafe statement written to the binary log");
+--disable_warnings
+set @secs=100;
+DELIMITER |;
+CREATE EVENT EVENT_WITH_SYSDATE_AND_VARIABLES
+ON SCHEDULE EVERY @secs MINUTE STARTS sysdate()
+ON COMPLETION PRESERVE
+DO BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+SELECT CONCAT('SAMPLE MSG');
+END |
+
+ALTER EVENT EVENT_WITH_SYSDATE_AND_VARIABLES
+ON SCHEDULE
+EVERY @secs HOUR
+STARTS sysdate() |
+
+DROP EVENT EVENT_WITH_SYSDATE_AND_VARIABLES |
+--enable_warnings
+DELIMITER ;|
 --source include/rpl_end.inc
index 94670be79af4eceb1a96fbbcdeab639fa8d484ff..44d5ab06d58676e7f7492e0fc68a265e3ce60732 100644 (file)
 #
 # Test:
 # =====
-# Set replicate-do-table=test.t1. Execute  statements on ignored tables.
+# Set replicate-do-table=test.t1. Execute statements on ignored tables.
 # During the execution of the first such statement the actual warning will be
-# printed and the remaining such errors will be suppressed. Script sleeps for
-# a minute and executes another statment on the ignored table so that
-# "error throttle" becomes active and checks if 1 minute has elapsed and
-# prints the acutal error message and along with that it also prints the number
-# of errors that were suppressed. With fix less warnings should be printed.
-# With bug we get 5 warnings.
+# printed and the remaining such errors will be suppressed. The test script
+# uses debug simulation to make the error throttle to expire. Execute another
+# statement on the ignored table so that "error throttle" becomes active and
+# checks if 1 minute has elapsed and prints the actual error message and along
+# with that it also prints the number of errors that were suppressed. With fix
+# less warnings should be printed. With bug we get 5 warnings.
 ###############################################################################
 --source include/have_binlog_format_statement.inc
 # Inorder to grep a specific error pattern in error log a fresh error log
 # needs to be generated.
 --source include/force_restart.inc
 --source include/master-slave.inc
+--source include/have_debug.inc
 
 CREATE TABLE t2 (c1 INT) ENGINE=InnoDB;
 --source include/sync_slave_sql_with_master.inc
 
---connection master
+--source include/rpl_connection_master.inc
 INSERT INTO test.t2 VALUES (100);
 INSERT INTO test.t2 VALUES (200);
 INSERT INTO test.t2 VALUES (300);
-# Error log throttle is checked once per minute hence the sleep has been
-# added.
-SLEEP 60;
+--source include/sync_slave_sql_with_master.inc
+
+--let $debug_saved= `SELECT @@GLOBAL.DEBUG`
+SET @@GLOBAL.DEBUG= '+d,simulate_error_throttle_expiry';
+
+--source include/rpl_connection_master.inc
 DROP TABLE t2;
 --source include/sync_slave_sql_with_master.inc
 
+SET @@GLOBAL.DEBUG= '$debug_saved';
+
 --replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} [0-9]+/--TIME--/ s/Worker .* end_log_pos [0-9]*; //
 --let GREP_FILE=$MYSQLTEST_VARDIR/tmp/slave.err
 --let GREP_PATTERN=Slave SQL thread ignored the query because of replicate
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gap_in_retrieved_gtid_set.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gap_in_retrieved_gtid_set.test
new file mode 100644 (file)
index 0000000..43674b2
--- /dev/null
@@ -0,0 +1,107 @@
+###############################################################################
+# Bug#21046372: GAPS IN RETRIEVED_GTID_SET WHILE NO GAPS IN
+# EXECUTED_GTID_SET
+#
+# Problem:
+# ========
+# Under certain circumstances it is possible that Retrieved_Gtid_Set on slave
+# will contain gaps while actually no gaps will be in Executed_Gtid_Set and
+# slave binary logs.
+#
+# Test:
+# =====
+# case1:
+# Simulate a test scenario where slave rotates relay log in such a way that
+# last event contains record which sets GTID_NEXT, then following log contains
+# few GTIDs, then slave restarts. Post restart the retrieved set should not
+# contain any gaps.
+# case2:
+# As part of fixing case1 we add GTID to Retrieved_Gtid_Set before we write
+# the actual event to relay log. If writing the actual event to relay log
+# fails then we remove the GTID from the Retrieved_Gtid_Set. Simulate relay
+# log write failure when writing an event with gtidno:4 to relay log. Check
+# that Retrieved_Gtid_Set shows gtid set as:1-3.
+###############################################################################
+--source include/have_gtid.inc
+--source include/have_debug.inc
+# Script is independent of binlog format hence considering mixed mode
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+--echo "Test case 1"
+--let $master_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
+CREATE TABLE t1(f1 INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+
+--source include/sync_slave_sql_with_master.inc
+SET @debug_save=@@GLOBAL.debug;
+SET GLOBAL debug="d,flush_after_reading_gtid_event";
+
+--source include/rpl_connection_master.inc
+INSERT INTO t1 VALUES(1);
+
+--source include/sync_slave_sql_with_master.inc
+SET @@GLOBAL.debug=@debug_save;
+
+--source include/rpl_connection_master.inc
+INSERT INTO t1 VALUES(1);
+
+--source include/sync_slave_sql_with_master.inc
+
+--source include/stop_slave.inc
+--let $rpl_server_number= 2
+--source include/rpl_restart_server.inc
+
+--source include/rpl_connection_slave.inc
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+INSERT INTO t1 VALUES(1);
+
+--source include/sync_slave_sql_with_master.inc
+--let $slave_param= Retrieved_Gtid_Set
+--let $slave_param_value= $master_uuid:1-6
+--source include/wait_for_slave_param.inc
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_reset.inc
+
+--echo "Test case 2"
+--source include/rpl_connection_master.inc
+--let $master_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
+CREATE TABLE t1(f1 INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+
+--source include/sync_slave_sql_with_master.inc
+call mtr.add_suppression('Relay log write failure: could not queue event from master');
+SET @debug_save=@@GLOBAL.debug;
+SET GLOBAL debug="d,set_append_buffer_error";
+
+--source include/rpl_connection_master.inc
+INSERT INTO t1 VALUES(1);
+
+--source include/rpl_connection_slave.inc
+--let $slave_io_errno= convert_error(ER_SLAVE_RELAY_LOG_WRITE_FAILURE)
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
+
+SET @@GLOBAL.debug=@debug_save;
+--source include/stop_slave_sql.inc
+--let $slave_param= Retrieved_Gtid_Set
+--let $slave_param_value= $master_uuid:1-3
+--source include/wait_for_slave_param.inc
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+INSERT INTO t1 VALUES(1);
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+--source include/sync_slave_sql_with_master.inc
+--source include/rpl_end.inc
index fc5075ef6fce72337f67686005ac37e6371079e4..3303d3ba2f8e4a1e6665404c9614390e616f0e0a 100644 (file)
@@ -17,6 +17,7 @@ SET @@GLOBAL.MAX_BINLOG_SIZE= 4096;
 
 --let $connections= 11
 --let $loops= 500
+--let $error_simulation= 1
 
 --echo # Disable diff_table test
 --let $enable_diff_table= 0
@@ -25,9 +26,9 @@ SET @@GLOBAL.MAX_BINLOG_SIZE= 4096;
 --let $engine = MyISAM
 --source extra/rpl_tests/rpl_stress_test.inc
 
---echo # Enable diff_table test
---let $enable_diff_table= 1
---echo # Test tables with InnoDB engine when enableing diff_table
+--echo # Disable diff_table test
+--let $enable_diff_table= 0
+--echo # Test tables with InnoDB engine when disabling diff_table
 --echo # and simulating flush error
 --let $engine = InnoDB
 --source extra/rpl_tests/rpl_stress_test.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
index a513fb57e470acedf29b3181c4cc307db9ce8730..d6a9dcb0fef9b0e7d1eee4aca2e2ea0923f9fefa 100644 (file)
@@ -1 +1 @@
---replicate-do-db=mydb --replicate-do-table=mydb.Ţ1 --replicate-do-table=mydb.t2 --lower_case_table_names=0
+--replicate-do-db=mydb --replicate-do-table=mydb.Ţ1 --replicate-do-table=mydb.t2
index 93e7ca11ff97379a1adbba857ce9a725d562a6cd..a8eac98ae31433d5834e6c1bf8200983730df004 100644 (file)
@@ -5,5 +5,10 @@
 # sensitive and accent sensitive when setting
 # lower_case_table_name == 0
 #
+
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 --source include/have_gtid.inc
 --source extra/rpl_tests/rpl_do_table_filter_sensitive.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_group-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_group-master.opt
deleted file mode 100644 (file)
index 737bdd4..0000000
+++ /dev/null
@@ -1 +0,0 @@
---gtid-mode=on --enforce-gtid-consistency --log-slave-updates --binlog-ignore-db=db_ignore_master
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_group-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_group-slave.opt
deleted file mode 100644 (file)
index 33a650f..0000000
+++ /dev/null
@@ -1 +0,0 @@
---gtid-mode=on --enforce-gtid-consistency --log-slave-updates  --replicate-ignore-table=test.t_ignore
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_group.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_group.test
deleted file mode 100644 (file)
index 1a611ed..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-################################################################################
-# This test case checks that empty groups appearing on slave preserve GTID
-# properties. 
-# Such group can appear on slave as a result of
-#
-# a. ineffective binary logging (no events in row format)
-# b. filtered out query
-# c. processing of a master's empty group 
-#
-################################################################################
---source include/master-slave.inc
---source include/not_embedded.inc
---source include/have_binlog_format_mixed.inc
---source include/have_gtid.inc
-
-# prepare for a.
---connection slave
-SET @save.binlog_format= @@global.binlog_format;
-SET @@global.binlog_format= row;
-source include/restart_slave_sql.inc;
-
---connection master
-SET @save.binlog_format= @@session.binlog_format;
-SET @@session.binlog_format= statement;
-CREATE TABLE t1(id INTEGER) ENGINE= Innodb /* group one */;
-UPDATE t1 SET id= 1 WHERE id = 0          /* group two */;
-
-# load for b.
-CREATE TABLE t_ignore(id INTEGER) ENGINE= Innodb /* group three */;
-
---sync_slave_with_master
-
---echo must be *three* groups logged, where the two last empty:
---let $keep_gtid_events= 1
-source include/show_binlog_events.inc;
-
-# todo: add c.
-# --connection slave
-# set @@session.gtid_next='`last_master s_id: last_master seqno + 1`;
-# begin;
-# commit;
-
-
-#
-# Testing of ROLLBACK as explicit so due to an error does 
-# not log anything.
-#
-
---connection master
-FLUSH LOGS;
---error ER_BAD_TABLE_ERROR
-DROP TABLE t2;
---error ER_WRONG_VALUE_COUNT_ON_ROW
-INSERT INTO t1 VALUES (1, 1); 
-BEGIN;
-INSERT INTO t1 VALUES (2);
-ROLLBACK;
-
---echo *** must be empty log ***
-
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-source include/show_binlog_events.inc;
-
-# cleanup
-
---connection master
-DROP TABLE t1;
-DROP TABLE t_ignore;
-
---sync_slave_with_master
-SET @@global.binlog_format= @save.binlog_format;
-
---source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
index 044bdb4b931bc86c4af6e18537fedee6435a7cef..f318ceb5a9170585900bf012f113bf50043b164b 100644 (file)
@@ -1 +1 @@
---replicate-do-db=mydb --replicate-wild-ignore-table=my%.Ţ1 --replicate-ignore-table=mydb.t2 --replicate-ignore-table=mydb.t3 --lower_case_table_names=0
+--replicate-do-db=mydb --replicate-wild-ignore-table=my%.Ţ1 --replicate-ignore-table=mydb.t2 --replicate-ignore-table=mydb.t3
index e769fa3db4d0b7f41c590902a93386f706e59704..f257fdcab7f0b966b594cc6283d195dc618fdd5c 100644 (file)
@@ -4,6 +4,11 @@
 # the setting of lower_case_table_name to be case sensitive
 # and accent sensitive when setting lower_case_table_name=0
 #
+
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 --source include/have_gtid.inc
 --source extra/rpl_tests/rpl_ignore_table_filter_sensitive.inc
 
index bfbd94e376a791048abdd2146a79c4e1acf5f00a..0f4893690545a863c1b2a2042626bd67094cd5ba 100644 (file)
@@ -86,6 +86,12 @@ SET GTID_MODE = UPGRADE_STEP_1;
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
 SET GTID_MODE = UPGRADE_STEP_2;
 
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GTID_MODE = OFF_PERMISSIVE;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GTID_MODE = ON_PERMISSIVE;
+
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
 SET GTID_MODE = ON;
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode_off_new_master.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode_off_new_master.test
new file mode 100644 (file)
index 0000000..ae72ae6
--- /dev/null
@@ -0,0 +1,63 @@
+# ==== Purpose ====
+#
+# MySQL 5.7 introduced two new values for GTID_MODE: OFF_PERMISSIVE
+# and ON_PERMISSIVE. In order for 5.6 to replicate from such a master,
+# a slave that uses GTID_MODE=OFF accepts any master GTID_MODE that
+# begins with OFF (i.e., regex /OFF.*/), and a slave that uses
+# GTID_MODE=ON accepts any master GTID_MODE that begins with ON.
+#
+# This test verifies that the slave accepts such values for GTID_MODE.
+#
+# ==== Implementation ====
+#
+# Use debug symbols to simulate that the master uses unknown values
+# for GTID_MODE.
+#
+# ==== Related bugs and worklogs ====
+#
+# WL#7083: GTIDs: set gtid_mode=ON online
+# - OFF_PERMISSIVE and ON_PERMISSIVE were introduced in 5.7 in this worklog.
+# BUG#20471216: 5.6 WITH GTID_MODE=X CANT CONNECT TO 5.7.6 WITH GTID_MODE=X_PERMISSIVE
+# - 5.6 was fixed to accept ON_PERMISSIVE and OFF_PERMISSIVE in this bug.
+
+--source include/have_debug.inc
+--source include/not_gtid_enabled.inc
+--source include/have_binlog_format_row.inc
+
+--source include/master-slave.inc
+
+--connection slave
+CALL mtr.add_suppression('Slave I/O: The master uses an unknown GTID_MODE');
+CALL mtr.add_suppression('The slave IO thread stops because the master has an unknown');
+
+SET @save_debug= @@GLOBAL.DEBUG;
+
+--source include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_gtid_mode_off_permissive';
+--source include/start_slave.inc
+--let $assert_text= Receiver thread should report that off_permissive is unknown
+--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after= Slave I/O thread: connected to master
+--let $assert_select= Slave I/O: The master uses an unknown GTID_MODE 'off_permissive'. Treating it as 'OFF'.
+--let $assert_count= 1
+--source include/assert_grep.inc
+
+--source include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_gtid_mode_off_something';
+--source include/start_slave.inc
+--let $assert_text= Receiver thread should report that off_something is unknown
+--let $assert_select= Slave I/O: The master uses an unknown GTID_MODE 'off_something'. Treating it as 'OFF'.
+--source include/assert_grep.inc
+
+--source include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_unknown_gtid_mode';
+START SLAVE;
+--let $slave_io_errno= convert_error(ER_SLAVE_FATAL_ERROR)
+--source include/wait_for_slave_io_error.inc
+
+SET @@GLOBAL.DEBUG= @save_debug;
+--source include/stop_slave_sql.inc
+RESET SLAVE;
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode_on_new_master.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode_on_new_master.test
new file mode 100644 (file)
index 0000000..a9e151e
--- /dev/null
@@ -0,0 +1,43 @@
+# See rpl_gtid_mode_off_new_master.test.
+
+--source include/have_debug.inc
+--source include/have_gtid.inc
+--source include/have_binlog_format_row.inc
+
+--source include/master-slave.inc
+
+--connection slave
+CALL mtr.add_suppression('Slave I/O: The master uses an unknown GTID_MODE');
+CALL mtr.add_suppression('The slave IO thread stops because the master has an unknown');
+
+SET @save_debug= @@GLOBAL.DEBUG;
+
+--source include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_gtid_mode_on_permissive';
+--source include/start_slave.inc
+--let $assert_text= Receiver thread should report that on_permissive is unknown
+--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after= Slave I/O thread: connected to master
+--let $assert_select= Slave I/O: The master uses an unknown GTID_MODE 'on_permissive'. Treating it as 'ON'.
+--let $assert_count= 1
+--source include/assert_grep.inc
+
+--source include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_gtid_mode_on_something';
+--source include/start_slave.inc
+--let $assert_text= Receiver thread should report that on_something is unknown
+--let $assert_select= Slave I/O: The master uses an unknown GTID_MODE 'on_something'. Treating it as 'ON'.
+--source include/assert_grep.inc
+
+--source include/stop_slave.inc
+SET @@GLOBAL.DEBUG = 'd,simulate_master_has_unknown_gtid_mode';
+START SLAVE;
+--let $slave_io_errno= convert_error(ER_SLAVE_FATAL_ERROR)
+--source include/wait_for_slave_io_error.inc
+
+SET @@GLOBAL.DEBUG= @save_debug;
+--source include/stop_slave_sql.inc
+RESET SLAVE;
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off-slave.opt
new file mode 100644 (file)
index 0000000..59794e0
--- /dev/null
@@ -0,0 +1 @@
+--gtid-mode=on --enforce-gtid-consistency --log-slave-updates --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1 --slave-transaction-retries=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mts_relay_log_recovery_auto_pos_on_off.test
new file mode 100644 (file)
index 0000000..a8cbedb
--- /dev/null
@@ -0,0 +1,60 @@
+###############################################################################
+# 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 and execute the test with both master_auto_postion
+# on and master_auto_postion off. 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/force_restart.inc
+# Script is independent of binlog format hence considering mixed mode
+--source include/have_binlog_format_mixed.inc
+--source include/have_gtid.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--let $rpl_gtid_utils= 1
+--source include/master-slave.inc
+
+--source include/rpl_connection_slave.inc
+CALL mtr.add_suppression("Recovery from master pos*");
+CALL mtr.add_suppression("Slave SQL: .*Duplicate entry .1.*");
+CALL mtr.add_suppression("Slave SQL: ... The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.");
+
+--let $auto_position=0
+--let $loop_count=2
+
+# Execute the following set of instructions twice
+# once with change master with auto position 0
+# second time change master with auto position 1
+while ($loop_count)
+{
+  --source include/stop_slave.inc
+  eval CHANGE MASTER TO MASTER_AUTO_POSITION=$auto_position;
+  SET @@global.slave_parallel_workers=4;
+  SET @@global.relay_log_info_repository='TABLE';
+  SET @@global.master_info_repository='TABLE';
+  --source include/start_slave.inc
+
+  --source extra/rpl_tests/rpl_gtid_mts_relay_log_recovery.test
+
+  if ($auto_position == 0)
+  {
+    --source include/rpl_reset.inc
+  }
+
+  --dec $loop_count
+  --inc $auto_position
+}
+
+
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_parallel-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_parallel-slave.opt
deleted file mode 100644 (file)
index 8e4c7b4..0000000
+++ /dev/null
@@ -1 +0,0 @@
---gtid-mode=on --enforce-gtid-consistency --log-slave-updates
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_replay_relaylog.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_replay_relaylog.test
new file mode 100644 (file)
index 0000000..5c037b3
--- /dev/null
@@ -0,0 +1,81 @@
+############################################################################
+# Bug #17650326  MYSQLBINLOG PRINTS INVALID SQL FROM RELAY LOGS WHEN GTID IS
+# ENABLED
+# Problem: Replaying a relaylog which ends with GTID_LOG_EVENT causes error
+# "ERROR 1790 (HY000) @@SESSION.GTID_NEXT cannot be changed by a client that
+# owns a GTID. The client owns <UUID:GNO>. Ownership is released on COMMIT
+# or ROLLBACK."
+#
+# Steps to reproduce:
+#  1) Stop IO thread after reading gtid_log_event (relaylog 1 contains
+#      GTID_LOG_EVENT at the end)
+#  2) Restart IO thread which rotates relaylog file (relaylog 2)
+#  3) Replay relaylog1's 'mysqlbinlog' output against 'mysql' client tool,
+#     it should not cause any problems.
+#  4) Replay (relaylog1 + relaylog2)'s 'mysqlbinlog' output against
+#     'mysql' client tool, it should not cause any problems.
+#
+############################################################################
+--source include/have_debug.inc
+# This test is not need against MTS setup
+--source include/not_mts_slave_parallel_workers.inc
+--source include/have_gtid.inc
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+
+# Initial setup
+CREATE TABLE t1(i INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+--source include/sync_slave_sql_with_master.inc
+--let MYSQLD_DATADIR=`select @@datadir`
+SET @save_debug=@@global.debug;
+
+# Step 1: Stop I/O thread after reading GTID_LOG_EVENT
+# This will leave the relaylog in incomplete state(i.e., it ends
+# with GTID_LOG_EVENT)
+SET GLOBAL DEBUG='d,stop_io_after_reading_gtid_log_event';
+
+--source include/rpl_connection_master.inc
+INSERT INTO t1 VALUES (2);
+
+--source include/rpl_connection_slave.inc
+--source include/wait_for_slave_io_to_stop.inc
+--let $relay_file1 = query_get_value( SHOW SLAVE STATUS, Relay_Log_File, 1 )
+
+--let $auto_pos = query_get_value( SHOW SLAVE STATUS, Auto_Position, 1 )
+--let $assert_text= Slave MASTER_AUTO_POSITION should be enabled for this test
+--let $assert_cond= $auto_pos= 1
+--source include/assert.inc
+
+# Step 2: Restart I/O thread and execute the pending INSERT(2)
+SET GLOBAL DEBUG= @save_debug;
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+--source include/sync_slave_sql_with_master.inc
+--let $relay_file2 = query_get_value( SHOW SLAVE STATUS, Relay_Log_File, 1 )
+
+# Step 3: Replay the incomplete Relaylog's mysqlbinlog output against mysql and see that
+# there are no issues.
+DROP TABLE t1;
+RESET MASTER;
+--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/$relay_file1 | $MYSQL -uroot -S$SLAVE_MYSOCK -P$SLAVE_MYPORT
+
+--let $assert_text= Check that there is one tuple in the table
+--let $assert_cond= [SELECT COUNT(*) AS Val FROM t1 where i=1, Val, 1] = 1
+--source include/assert.inc
+
+# Step 4: Concat two relay logs and then replay mysqlbinlog ouput against mysql and see
+# that there are no issues.
+DROP TABLE t1;
+RESET MASTER;
+--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/$relay_file1 $MYSQLD_DATADIR/$relay_file2 | $MYSQL -uroot -S$SLAVE_MYSOCK -P$SLAVE_MYPORT
+
+--let $assert_text= Check that there are two tuples in the table
+--let $assert_cond= [SELECT COUNT(*) AS Val FROM t1 where i=1 or i=2, Val, 1] = 2
+--source include/assert.inc
+
+# Cleanup
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_temp_table.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_temp_table.test
new file mode 100644 (file)
index 0000000..a77d0c0
--- /dev/null
@@ -0,0 +1,94 @@
+###############################################################################
+# Bug #21253415 MULTIPLE DROP TEMP TABLE STATEMENTS IN SF CAUSE REPLICATION
+# FAILS USING 5.6 GTID
+# Problem: When there are more than one drop temp table in stored function or
+#          trigger, replication is failing when GTIDs are enabled.
+# Fix: When GTIDs are enabled, it is documented that CREATE/DROP temp tables
+#      are not allowed in Multi Statement Transactions. Stored functions
+#      and Triggers are also considered as another form of Multi Statement
+#      Transactions. To maintain consistency and to avoid the problems that
+#      are mentioned in this bug scenario,  CREATE/DROP temp tables are
+#      disallowed from stored functions and triggers also.
+# Step to reproduce:
+#  1) Create different combinations of functions/triggers with create/drop
+#      temp tables queries
+#  2) Test SELECT, DMLs with those restricted functions and triggers
+#  3) Server should throw error in all the cases.
+###############################################################################
+
+# This test cannot be run in STATEMENT/MIXED mode until
+# "Bug #22134026: ON BINLOGLESS SERVER ENFORCE_GTID_CONSISTENCY DOESN'T CHECK
+# FOR ER1785,1786,1787" is fixed.
+--source include/have_binlog_format_row.inc
+--source include/have_gtid.inc
+--source include/master-slave.inc
+# Initial Setup
+CREATE TABLE trans_table1 (i INT) ENGINE=INNODB;
+INSERT INTO trans_table1 VALUES (1);
+
+CREATE TABLE trans_table2 (i INT) ENGINE=INNODB;
+INSERT INTO trans_table2 VALUES (1);
+
+CREATE TABLE non_trans_table1 (i INT) ENGINE=MYISAM;
+INSERT INTO non_trans_table1 VALUES (1);
+
+CREATE TABLE non_trans_table2 (i INT) ENGINE=MYISAM;
+INSERT INTO non_trans_table2 VALUES (1);
+
+# Case 1: Function/Trigger with create and drop non trans temp table
+--let $func_or_trig_body=CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Case 2: Function/Trigger with create and drop trans temp table
+--let $func_or_trig_body=CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Case 3: Function/Trigger with just create non trans temp table
+--let $func_or_trig_body=CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM;
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Case 4: Function/Trigger with just create trans temp table
+--let $func_or_trig_body=CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB;
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Case 5: Function/Trigger with just drop temp table
+--let $func_or_trig_body=DROP TEMPORARY TABLE IF EXISTS tt1;
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Case 6: Function/Trigger with two create/drop temp tables
+--let $func_or_trig_body=CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; CREATE TEMPORARY TABLE tt2(i INT) ENGINE=Innodb; DROP TEMPORARY TABLE IF EXISTS tt1; DROP TEMPORARY TABLE IF EXISTS tt2;
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Case 7: Function/Trigger with DML operation on trans table followed by create/drop temp table
+--let $func_or_trig_body=INSERT INTO trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1;
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Case 8: Function/Trigger with DML operation on non trans table followed by create/drop temp table
+--let $func_or_trig_body=INSERT INTO non_trans_table1 VALUES (12); CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1;
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Case 9: Function/Trigger with DML operation on trans table after create/drop temp table queries
+--let $func_or_trig_body=CREATE TEMPORARY TABLE tt1(i INT) ENGINE=INNODB; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO non_trans_table1 VALUES (12);
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Case 10: Function/Trigger with DML operation on non trans table after create/drop temp table queries
+--let $func_or_trig_body=CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12);
+--source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc
+
+# Test that all Slave tables are in sync with Master tables
+--let $diff_tables=master:trans_table1, slave:trans_table1
+--source include/diff_tables.inc
+
+--let $diff_tables=master:trans_table2, slave:trans_table2
+--source include/diff_tables.inc
+
+--let $diff_tables=master:non_trans_table1, slave:non_trans_table1
+--source include/diff_tables.inc
+
+--let $diff_tables=master:non_trans_table2, slave:non_trans_table2
+--source include/diff_tables.inc
+
+# Cleanup
+DROP TABLE trans_table1, trans_table2;
+DROP TABLE non_trans_table1, non_trans_table2;
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_transaction_split_across_relay_logs.cnf b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_transaction_split_across_relay_logs.cnf
new file mode 100644 (file)
index 0000000..6f45eb6
--- /dev/null
@@ -0,0 +1,16 @@
+!include include/default_mysqld.cnf
+
+[mysqld.1]
+
+[mysqld.2]
+log-slave-updates
+relay-log-info-repository=table
+
+[mysqld.3]
+log-slave-updates
+relay-log-info-repository=table
+
+[ENV]
+SERVER_MYPORT_1= @mysqld.1.port
+SERVER_MYPORT_2= @mysqld.2.port
+SERVER_MYPORT_3= @mysqld.3.port
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_transaction_split_across_relay_logs.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_transaction_split_across_relay_logs.test
new file mode 100644 (file)
index 0000000..a52123d
--- /dev/null
@@ -0,0 +1,84 @@
+###############################################################################
+#BUG#16418100: ERROR "WHEN GTID_NEXT IS SET TO A GTID" ROW BASED REPLICATION
+# Problem: When relay log info repository is configured to be persisted in a
+# table and if a transaction that uses non-transactional engine is split across
+# multiple relay logs, on relay log flush, partial transaction is
+# committed. If the same situation occurs when gtid-mode=ON, it will cause that
+# the same GTID will be used for more than one transaction and will cause
+# ER_GTID_NEXT_TYPE_UNDEFINED_GROUP error.
+#
+# Steps to reproduce:
+#   1) Generate two write_row events for non-transactional table (MyISAM)
+#      (Default binlog_row_max_event_size= 8192). Insert two tuples with tuple
+#      size as 8192 bytes each. This will generate two write_row events.
+#   2) With Auto_position=0, stopping IO thread after receving one write_row
+#      event will split the transaction across two relay logs.
+#   3) If relaylog_info_repository=table, SQL thread should be able to apply
+#      these type of relaylogs.
+###############################################################################
+# Need debug build to run this test
+--source include/have_debug.inc
+# Problem happens only in gtid mode
+--source include/have_gtid.inc
+# Run only in row format
+--source include/have_binlog_format_row.inc
+# Disable auto position protocol
+--let use_gtids=0
+--let $rpl_skip_start_slave= 1
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
+
+--let $rpl_connection_name= server_1
+--source include/rpl_connection.inc
+
+# Non-transactional table (MyISAM engine)
+CREATE TABLE t1 (i VARCHAR(8192)) ENGINE=MyISAM;
+
+# Two tuples that will generate two write_row events.
+INSERT INTO t1 VALUES(repeat('a',8192)), (repeat('b', 8192));
+
+--let $rpl_connection_name= server_2
+--source include/rpl_connection.inc
+# Set simulation point to restart IO thread, so that the transaction
+#  is split across the relay logs.
+SET @saved_debug=@@GLOBAL.debug;
+SET GLOBAL debug="d,stop_io_after_reading_write_rows_log_event";
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+SET GLOBAL debug=@saved_debug;
+
+# Make sure there are no replication issues
+--disable_warnings
+START SLAVE;
+--enable_warnings
+
+--let $rpl_connection_name= server_3
+--source include/rpl_connection.inc
+--disable_warnings
+START SLAVE;
+--enable_warnings
+
+--let $rpl_connection_name= server_1
+--source include/rpl_connection.inc
+--source include/rpl_sync.inc
+
+--let $diff_tables= server_1:t1, server_2:t1, server_3:t1
+--source include/diff_tables.inc
+
+# Assert that relay log info pos is stored on table
+--let $rpl_connection_name= server_2
+--source include/rpl_connection.inc
+--let $sql_thread_pos=query_get_value('SHOW SLAVE STATUS', Exec_Master_Log_Pos, 1)
+--let $sql_thread_file=query_get_value('SHOW SLAVE STATUS', Relay_Master_Log_File, 1)
+--let $assert_cond= Master_log_pos = $sql_thread_pos FROM mysql.slave_relay_log_info
+--let $assert_text= SQL thread position should be updated to after the split transaction
+--source include/assert.inc
+--let $assert_cond= Master_log_name = "$sql_thread_file" FROM mysql.slave_relay_log_info
+--let $assert_text= SQL thread file should be updated to after the split transaction
+--source include/assert.inc
+
+# Cleanup
+--let $rpl_connection_name= server_1
+--source include/rpl_connection.inc
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_sensitive-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_sensitive-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
index 044bdb4b931bc86c4af6e18537fedee6435a7cef..f318ceb5a9170585900bf012f113bf50043b164b 100644 (file)
@@ -1 +1 @@
---replicate-do-db=mydb --replicate-wild-ignore-table=my%.Ţ1 --replicate-ignore-table=mydb.t2 --replicate-ignore-table=mydb.t3 --lower_case_table_names=0
+--replicate-do-db=mydb --replicate-wild-ignore-table=my%.Ţ1 --replicate-ignore-table=mydb.t2 --replicate-ignore-table=mydb.t3
index 284f28cfca02287833e0b7174adaf57efa620198..52f55d7bef241a574b7a8a916b43058e265e1bba 100644 (file)
@@ -4,5 +4,10 @@
 # the setting of lower_case_table_name to be case sensitive
 # and accent sensitive when setting lower_case_table_name=0
 #
+
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
 --source include/not_gtid_enabled.inc
 --source extra/rpl_tests/rpl_ignore_table_filter_sensitive.inc
index 6b6ff81a0a41dedead6e48bcfc5d4cebd5ef4cf3..8896c53e1afc8cf5b4a5366f01354d5bfda75d88 100644 (file)
 #
 # There are some part of the test are temporarily disabled because of
 # the following bugs, please enable then once they get fixed:
-#  - BUG#44041
-#  - BUG#43353
-#  - BUG#25705
-#  - BUG#44171
+#  - BUG#22473427
+#  - Bug#22587377
 
 source include/have_debug.inc;
 source include/master-slave.inc;
@@ -145,11 +143,9 @@ let $rpl_diff_statement= SELECT schema_name FROM information_schema.schemata
 send CREATE DATABASE d2;
 source include/kill_query_and_diff_master_slave.inc;
 
-# Temporarily disabled, see BUG#44041, the ALTER DATABASE can affect the
-# collation of other database on slave
-#send ALTER DATABASE d1
-#       DEFAULT CHARACTER SET = 'utf8';
-#source include/kill_query_and_diff_master_slave.inc;
+send ALTER DATABASE d1
+       DEFAULT CHARACTER SET = 'utf8';
+source include/kill_query_and_diff_master_slave.inc;
 
 send DROP DATABASE d1;
 source include/kill_query_and_diff_master_slave.inc;
@@ -168,8 +164,8 @@ send CREATE EVENT e2
   DO INSERT INTO test.t1 VALUES (2);
 source include/kill_query_and_diff_master_slave.inc;
 
-# Temporarily disabled because of BUG#44171, killing ALTER EVENT can
-# crash the server
+# Temporarily disabled,see Bug#22587377-RPL.RPL_KILLED_DDL
+# FAILS SPORADICALLY ON PB2 IN 5.5 AND 5.6
 #send ALTER EVENT e1
 #  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY;
 #source include/kill_query_and_diff_master_slave.inc;
@@ -198,16 +194,8 @@ source include/kill_query_and_diff_master_slave.inc;
 
 # function f2 probably does not exist because the CREATE query was
 # killed
-#
-# Temporarily disabled. Because of BUG#43353, KILL the query may
-# result in function not found, and for 5.1, DROP statements will be
-# logged if the function is not found on master, so the following DROP
-# FUNCTION statement may be interrupted and not drop the function on
-# master, but still get logged and executed on slave and cause
-# inconsistence. Also disable the following DROP PROCEDURE IF EXITS
-# below.
-#send DROP FUNCTION IF EXISTS f2;
-#source include/kill_query_and_diff_master_slave.inc;
+send DROP FUNCTION IF EXISTS f2;
+source include/kill_query_and_diff_master_slave.inc;
 
 ######## PROCEDURE ########
 
@@ -228,9 +216,8 @@ source include/kill_query_and_diff_master_slave.inc;
 send DROP PROCEDURE p1;
 source include/kill_query_and_diff_master_slave.inc;
 
-# Temporarily disabled because of bug#43353, see comment above for DROP FUNCTION IF EXISTS
-#send DROP PROCEDURE IF EXISTS p2;
-#source include/kill_query_and_diff_master_slave.inc;
+send DROP PROCEDURE IF EXISTS p2;
+source include/kill_query_and_diff_master_slave.inc;
 
 ######## TABLE ########
 
@@ -258,9 +245,10 @@ source include/kill_query_and_diff_master_slave.inc;
 
 ######## SERVER ########
 
-# Tempoarily disabled, see bug#25705
+# Temporarily disabled, see Bug #22473427 - DROP SERVER FAILS
+# AFTER ALTER SERVER+KILL QUERY
 
-# --let $rpl_diff_statement= SELECT * FROM mysql.server WHERE name like \'s%\'
+# --let $rpl_diff_statement= SELECT * FROM mysql.servers WHERE Server_name like \'s%\'
 
 # send CREATE SERVER s2
 #     FOREIGN DATA WRAPPER mysql
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_low_slave_net_time_out.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_low_slave_net_time_out.test
new file mode 100644 (file)
index 0000000..6696a81
--- /dev/null
@@ -0,0 +1,106 @@
+###############################################################################
+# Bug #19975697 SLAVE IO_THREAD MAY GET STUCK WHEN USING GTID AND LOW
+# SLAVE_NET_TIMEOUTS
+#
+# Problem: Dump thread is not checking the necessity of heartbeat event
+#  while it is scanning through the binary log files and skipping some groups
+#  which were already present at Slave.
+# Fix: Dump thread will check whether it is time to send an heartbeat event or
+#  not before skipping an event. If so, it will send one to Slave.
+###############################################################################
+
+--source include/have_binlog_format_statement.inc
+--source include/have_gtid.inc
+--source include/have_debug_sync.inc
+--source include/force_restart.inc
+# Problem is reproduced only with gtid auto position protocol
+--let $use_gtids=1
+--let $rpl_skip_start_slave=1;
+--source include/master-slave.inc
+
+# set slave_net_timeout to 10 seconds and then start slave threads
+--connection slave
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=5;
+SET @save_old_slave_net_timeout=@@global.slave_net_timeout;
+SET @@global.slave_net_timeout=10;
+--source include/start_slave.inc
+# In order to reproduce the bug with a smaller test data,
+# inject 2 seconds delay after an skipped event.
+--connection master
+SET @save_debug=@@global.debug;
+SET GLOBAL DEBUG='+d,inject_2sec_sleep_when_skipping_an_event';
+
+# Have some gtid transactions in binary log
+# Below create and two insert statements would have created '6' sub events
+#  # GTID 1
+#  # CREATE
+#  # GTID 2
+#  # BEGIN
+#  # INSERT
+#  # COMMIT
+#
+CREATE TABLE t1(i INT) engine=innodb;
+INSERT INTO t1 VALUES (1);
+
+# Sync it with Slave
+--source include/sync_slave_sql_with_master.inc
+
+# Stop the Replication
+--source include/stop_slave.inc
+
+# Create another gtid transaction at Master
+--connection master
+# Also, we introduce 'hold_dump_thread_inside_inner_loop' debug simulation now
+# to see what happens if dump thread is killed when the logic is
+# in inner while loop. The server code resets this debug point
+# after it is trigged once. So the sync of the following 'drop table'
+# statement will happen with the second dump thread that will be created
+# after slave triggers for another dump request after slave_net_timeout(10)
+# seconds.
+--source include/stop_dump_threads.inc
+SET GLOBAL DEBUG='+d,hold_dump_thread_inside_inner_loop';
+DROP TABLE t1;
+# Start the Replication
+# This will create a dump thread on Master and because of
+# debug point, it will wait in inner loop.
+--connection slave
+--source include/start_slave.inc
+
+--connection master
+SET DEBUG_SYNC='now WAIT_FOR signal_inside_inner_loop';
+
+# When a dump thread is waiting inside inner loop,
+# restart slave threads which will kill the existing
+# dump thread and will recreate it.
+--connection slave
+--source include/stop_slave.inc
+
+# Reset debug point for the next dump thread to ignore it
+--connection master
+SET GLOBAL DEBUG='-d,hold_dump_thread_inside_inner_loop';
+
+# Start slave thread
+--connection slave
+--source include/start_slave.inc
+
+# Signal the zombie dump thread to go ahead.
+--connection master
+SET DEBUG_SYNC='now signal signal_continue';
+
+# Now Dump thread-I/O thread communitcation protocol will detect that
+# it does not have recent gtid transaction(drop table) and Master
+# should send that transaction to Slave. This detection will take
+# 12 seconds because of the injected 2 seconds delay after every skipped
+# event (Please see above) which is more than the slave_net_timeout.
+# But now, after the fix, the server will check for necessity of sending an
+# heartbeat event even while it is skipping the events, the below
+# sync should not be timed out after the fix.
+--connection master
+--source include/sync_slave_sql_with_master.inc
+
+# Cleanup
+--connection master
+SET GLOBAL DEBUG=@save_debug;
+--connection slave
+SET @@global.slave_net_timeout=@save_old_slave_net_timeout;
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_missing_data_on_slave.cnf b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_missing_data_on_slave.cnf
new file mode 100644 (file)
index 0000000..248165a
--- /dev/null
@@ -0,0 +1,15 @@
+!include ../my.cnf
+[mysqld.1]
+log-slave-updates
+max_binlog_size = 4096
+[mysqld.2]
+log-slave-updates
+max_binlog_size = 4096
+log-slave-updates
+relay_log_info_repository = TABLE
+[mysqld.3]
+log-slave-updates
+max_binlog_size = 4096
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_missing_data_on_slave.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_missing_data_on_slave.test
new file mode 100644 (file)
index 0000000..7b6d786
--- /dev/null
@@ -0,0 +1,66 @@
+###############################################################################
+# Bug#21630907: MISSING DATA DETECTED WHEN MAX_BINLOG_SIZE SMALLER ON SLAVE
+# FOR 3 NODE TOPOLOGY
+#
+# Bug#21053163: MIXED BASED REPLICATION LOOSES EVENTS WHEN
+# RELAY_LOG_INFO_REPOSITORY=TABLE
+#
+# Problem:
+# =======
+# 2 level replication M1 -> S1 ->S2 ( S1 is slave of M1; S2 is slave of S1)
+# replicating a non-transactional storage engine table (e.g. MyISAM) when set
+# relay_log_info_repository=TABLE; and binlog rotation occurs in the middle
+# of statement that was translated to multiple rows, then you loose part of
+# that events.
+#
+# When binlog rotation occurs, on S1 not all rows are written to it's binlog,
+# therefore S2 seamlessly looses part of rows that were translated from one
+# statement to several rows.
+#
+# Test:
+# =====
+# Have mixed based replication, relay_log_info_repository=TABLE and
+# max_binlog_size=4096 on all servers in 3 NODE TOPOLOGY. On master
+# generate a single WRITE_ROWS_EVENT which has multiple row updates. When
+# this event is replicated to slave, it will be split across relay logs.
+# Test will verify that the data on all servers is the same.
+# In the case of bug if
+# 1) GTID_MODE is set to ON on all three servers, the slave will fail with
+# error code:1837 i.e ER_GTID_NEXT_TYPE_UNDEFINED_GROUP.
+# 2) GTID_MODE is set to OFF on all three servers diff tables command will
+# fail.
+###############################################################################
+
+--source include/have_binlog_format_mixed.inc
+--let $rpl_server_count= 3
+--let $rpl_topology= 1->2->3
+--disable_warnings
+--source include/rpl_init.inc
+--enable_warnings
+
+--connection server_1
+--echo Server 1
+CREATE TABLE `t1` (
+  `id` bigint unsigned NOT NULL auto_increment,
+  `val` varchar(255),
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO t1 (val) VALUES (REPEAT('a', 255));
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+INSERT INTO t1 (val) SELECT val FROM t1;
+
+--echo Syncing all three servers
+--source include/rpl_sync.inc
+--echo Verifying 't1' table contents on all three servers through diff tables.
+--let $diff_tables= server_1:t1, server_2:t1, server_3:t1
+--source include/diff_tables.inc
+
+# Clean up
+DROP TABLE t1;
+--source include/rpl_sync.inc
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_stop_slave-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_stop_slave-slave.opt
new file mode 100644 (file)
index 0000000..0367a27
--- /dev/null
@@ -0,0 +1 @@
+--slave-transaction-retries=0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_stop_slave.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_stop_slave.test
new file mode 100644 (file)
index 0000000..e622acf
--- /dev/null
@@ -0,0 +1,121 @@
+###############################################################################
+# Bug#20369401: MTS STOP SLAVE TAKES WAY TOO LONG(WHEN WORKER THREADS ARE SLOW)
+#
+# Problem:
+# ========
+# TOP SLAVE waits workers to catch up the queue, which may
+# take a lot of time for the command to finish. STOP SLAVE
+# must be executed quickly, even if workers are slow.
+###############################################################################
+# Following test demonstrates that STOP SLAVE command will not leave any gaps.
+# It first creates two databases (d1 and d2) and setup slave to use two parallel
+# workers. The test case then insert on the slave a tuple that will block
+# writes on d2 and generate gaps. Finally, the test case executes "STOP SLAVE"
+# and verify that the SQL thread was properly stopped and left no gaps.
+
+--source include/have_binlog_format_statement.inc
+--source include/only_mts_slave_parallel_workers.inc
+--source include/master-slave.inc
+
+--let $slave_stop_wait=5
+
+--echo #### I. Initialize ####
+
+--source include/rpl_connection_slave.inc
+--source include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+--eval set @@global.innodb_lock_wait_timeout=$slave_stop_wait + 1000
+
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+
+--echo #### II. Prepare test scenario ####
+
+--source include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local'); # Hold T3
+INSERT INTO d1.t VALUES (3, 'Slave local'); # Hold T6
+
+--source include/rpl_connection_master.inc
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3'); # This will be a gap when executed on slave
+INSERT INTO d2.t VALUES (3, 'T4'); # This will be a gap when executed on slave
+INSERT INTO d1.t VALUES (2, 'T5');
+INSERT INTO d1.t VALUES (3, 'T6');
+INSERT INTO d2.t VALUES (4, 'T7'); # This should not be executed after STOP SLAVE
+INSERT INTO d2.t VALUES (5, 'T8'); # This should not be executed after STOP SLAVE
+INSERT INTO d1.t VALUES (4, 'T9'); # This should not be executed after STOP SLAVE
+
+--source include/rpl_connection_slave1.inc
+--let $table=d2.t
+--let $count=1
+--source include/wait_until_rows_count.inc
+
+--let $table=d1.t
+--let $count=2
+--source include/wait_until_rows_count.inc
+
+--echo # Now d1.t has two rows and d2.t has one row.
+
+# Wait for coordinator to populate worker's queues.
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
+--source include/wait_show_condition.inc
+
+--echo # Now coordinator has read the entire relay log and populated workers' queues.
+
+# There is now a gap at T3,T4
+SELECT * FROM d2.t;
+SELECT * FROM d1.t;
+
+--echo #### Verify that STOP SLAVE stops at gap less state ####
+
+--send STOP SLAVE
+
+--source include/rpl_connection_slave.inc
+# Despite time elapsed, the slave should still be running, waiting for the
+# queue to be completed.
+--sleep $slave_stop_wait
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= = 'Waiting for workers to exit'
+--source include/wait_show_condition.inc
+
+--echo # Now coordinator is waiting for the worker to consume its queue.
+ROLLBACK;
+--source include/wait_for_slave_sql_to_stop.inc
+
+
+--echo # III. Now all slave threads have stopped. Verify that worker completed its queue:
+--echo # d2 should contain Т2, Т3, Т4.
+--let $assert_cond= MAX(a)=3 FROM d2.t;
+--let $assert_text= Rows until T3 in d2.t must be replicated now
+--source include/assert.inc
+
+--echo # d1 should contain Т1, Т5, T6.
+--let $assert_cond= MAX(a)=3 FROM d1.t;
+--let $assert_text= Rows until 2 in d1.t must be replicated now
+--source include/assert.inc
+--source include/start_slave.inc
+
+--source include/rpl_connection_slave1.inc
+--reap
+
+#
+# Cleanup
+#
+--source include/rpl_connection_slave.inc
+SET @@global.innodb_lock_wait_timeout= @save.innodb_lock_wait_timeout;
+--source include/rpl_connection_master.inc
+DROP DATABASE d1;
+DROP DATABASE d2;
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-master.opt
deleted file mode 100644 (file)
index 848b1e6..0000000
+++ /dev/null
@@ -1 +0,0 @@
---log-bin --gtid-mode=on  --log-slave-updates --enforce-gtid-consistency
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on-slave.opt
deleted file mode 100644 (file)
index 848b1e6..0000000
+++ /dev/null
@@ -1 +0,0 @@
---log-bin --gtid-mode=on  --log-slave-updates --enforce-gtid-consistency
index 9f1d35992b607b382211e566ede9a7f658004a1a..dec525af845aa8d73dc16f118a87c09a1b1983f0 100644 (file)
@@ -15,6 +15,7 @@
 --connection slave
 call mtr.add_suppression("Slave SQL: .*Could not execute Write_rows event on table d1.t1; Duplicate entry '13' for key 'a'");
 call mtr.add_suppression("Slave SQL: ... The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.");
+call mtr.add_suppression("Error writing relay log configuration.");
 --source include/stop_slave.inc
 SET @save.slave_parallel_workers=@@global.slave_parallel_workers;
 SET @@global.slave_parallel_workers=2;
@@ -132,4 +133,87 @@ DROP DATABASE d1;
 DROP DATABASE d2;
 --source include/sync_slave_sql_with_master.inc
 
+###############################################################################
+# Bug#20411374: CAN NOT EXECUTE CHANGE MASTER AFTER ERROR OCCURED IN MTS MODE
+#
+# Problem:
+# ========
+# When error occurred in MTS mode, If user first change master
+# (ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS received here), and then reset slave,
+# user can never change master (error ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS
+# occurred again). The debug version mysqld will crash at this case.
+#
+# Test:
+# =====
+# Generate MTS gaps and execute CHANGE MASTER command so that
+# ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS error is reported. Execute RESET
+# SLAVE command. Reexecute the CHANGE MASTER command once again it should
+# report an assert in the case of bug scenario and it should succeed after the
+# fix.
+###############################################################################
+--source include/rpl_connection_slave.inc
+--source include/stop_slave.inc
+SET @save.slave_parallel_workers=@@global.slave_parallel_workers;
+SET @@global.slave_parallel_workers=2;
+SET @save.relay_log_info_repository=@@global.relay_log_info_repository;
+SET @@global.relay_log_info_repository='TABLE';
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t1 (a int unique) ENGINE=INNODB;
+CREATE TABLE d2.t1 (a int unique) ENGINE=INNODB;
+--source include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d1.t1 VALUES (13); # to cause the dup key error
+# change-master with gaps
+--source include/rpl_connection_master.inc
+INSERT INTO d1.t1 VALUES (6);
+INSERT INTO d2.t1 VALUES (7);
+INSERT INTO d1.t1 VALUES (13);
+INSERT INTO d2.t1 VALUES (8);  # this worker will race over one inserting (13)
+INSERT INTO d2.t1 VALUES (9);
+
+--source include/rpl_connection_slave1.inc
+# make sure workers doing d2.t1 raced the one that occupied  with d1.t1
+--let $count= 1
+--let $table= d2.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 (13) to error out
+COMMIT;
+
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+--source include/stop_slave_io.inc
+
+--source include/rpl_connection_master.inc
+FLUSH LOGS;
+--let $file= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+
+--source include/rpl_connection_slave.inc
+--replace_result $MASTER_MYPORT MASTER_PORT  $file FILE $pos POS
+--replace_column 2 ####
+--error ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS
+eval CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= $MASTER_MYPORT, MASTER_USER= 'root',MASTER_LOG_FILE = '$file', MASTER_LOG_POS = $pos ;
+reset slave;
+--replace_result $MASTER_MYPORT MASTER_PORT  $file FILE $pos POS
+--replace_column 2 ####
+eval CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= $MASTER_MYPORT, MASTER_USER= 'root',MASTER_LOG_FILE = '$file', MASTER_LOG_POS = $pos ;
+
+SET @@global.slave_parallel_workers= @save.slave_parallel_workers;
+SET @@global.relay_log_info_repository= @save.relay_log_info_repository;
+--source include/start_slave.inc
+#
+# cleanup
+#
+--source include/rpl_connection_master.inc
+DROP DATABASE d1;
+DROP DATABASE d2;
+
 --source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_worker_error-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_worker_error-slave.opt
new file mode 100644 (file)
index 0000000..fb07bae
--- /dev/null
@@ -0,0 +1 @@
+--no-console --log_error=$MYSQLTEST_VARDIR/tmp/slave.err
index d797d4683d49ac66b9895b6b840f8bc0aeb91e18..17692972476e4bf253c907e906e0647fdc5ca4e7 100644 (file)
@@ -1,3 +1,6 @@
+# Inorder to grep a specific error pattern in error log a fresh error log
+# needs to be generated.
+--source include/force_restart.inc
 --source include/master-slave.inc
 --source include/have_binlog_format_statement.inc
 --source include/only_mts_slave_parallel_workers.inc
@@ -54,5 +57,19 @@ DROP TABLE t;
 DROP TABLE t;
 --source include/sync_slave_sql_with_master.inc
 
+# Bug#21198611: MULTI-THREADED SLAVE LOG SPAMMING ON FAILURE
+# When a multi-threaded slave stops with an error, the same error message is
+# printed three times.
+
+# Steps that are executed above ensure that MTS slave stops with an error.
+# Following lines check that "The slave coordinator and worker threads are
+# stopped..." error message is printed only once in the error log.
+
+--let $expected_errno= convert_error(ER_MTS_INCONSISTENT_DATA)
+--replace_result $expected_errno ER_MTS_INCONSISTENT_DATA
+--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} [0-9]+/--TIME--/
+--let GREP_FILE=$MYSQLTEST_VARDIR/tmp/slave.err
+--let GREP_PATTERN=The slave coordinator and worker threads are stopped
+--source extra/rpl_tests/grep_pattern.inc
 
 --source include/rpl_end.inc
index 9c09553b891de1fb71dccc46ca5d0115204566e4..7b1fd51f60b41d8b6ac1c499752fe0835a5cab86 100644 (file)
@@ -5,6 +5,7 @@
 
 --source include/not_gtid_enabled.inc
 --source include/master-slave.inc
+--source include/not_relay_log_info_table.inc
 
 CREATE TABLE t1 (a INT);
 INSERT INTO t1 VALUES (1);
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_relay_log_recovery_positions.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_relay_log_recovery_positions.test
new file mode 100644 (file)
index 0000000..5fccbf8
--- /dev/null
@@ -0,0 +1,108 @@
+#
+# Test case for BUG#74089 scenario
+#
+--source include/force_restart.inc
+--source include/not_gtid_enabled.inc
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+--source include/rpl_connection_slave.inc
+
+# Test starts here
+--source include/rpl_reset.inc
+--source include/rpl_connection_master.inc
+--let $prefix= `SELECT UUID()`
+--let $slave_error_log= $MYSQLTEST_VARDIR/tmp/$prefix.err
+
+CREATE TABLE t1 (c1 INT);
+
+--source include/sync_slave_sql_with_master.inc
+CALL mtr.add_suppression("Recovery from master pos");
+
+# stop the slave applier thread
+--source include/stop_slave_sql.inc
+
+--let $relay_log= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
+
+--source include/rpl_connection_master.inc
+
+INSERT INTO t1 VALUES (1);
+
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+
+# make sure that the slave copies everything, but does not apply
+# this last insert statement
+--source include/sync_slave_io_with_master.inc
+
+# Verify that the positions are the ones we expect at this
+# point in time (read all the binary log, applied just the
+# create table).
+
+--let $begin_of_insert_trx_pos_in_rl= query_get_value(SHOW RELAYLOG EVENTS in '$relay_log', Pos, 5)
+--let $create_tbl_stmt_trx_pos_in_bl= query_get_value(SHOW RELAYLOG EVENTS in '$relay_log', End_log_pos, 4)
+--let $end_of_insert_trx_log_pos_in_rl= query_get_value(SHOW RELAYLOG EVENTS in '$relay_log', End_log_pos, 7)
+
+--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
+--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)
+--let $relay_log_pos= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1)
+
+--let $assert_cond= $begin_of_insert_trx_pos_in_rl = $relay_log_pos
+--let $assert_text= "Relay_log_pos points at the beginning of the INSERT trx."
+--source include/assert.inc
+
+--let $assert_cond= $create_tbl_stmt_trx_pos_in_bl = $exec_master_log_pos
+--let $assert_text= "Exec_master_log_pos points at the CREATE TABLE statement."
+--source include/assert.inc
+
+--let $assert_cond= $end_of_insert_trx_log_pos_in_rl = $read_master_log_pos
+--let $assert_text= "Read_master_log_pos points at the end of the INSERT trx."
+--source include/assert.inc
+
+#
+# Restart the server with relay-log-recovery set - this will reset the positions
+--let $rpl_server_parameters= --relay-log-recovery=1 --skip-slave-start --log_error=$slave_error_log
+--let $rpl_omit_print_server_parameters= 1
+--echo Omitting server parameters, since there is a path in one of them.
+--source include/rpl_restart_server.inc
+
+--let $exec_master_log_pos_restart= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
+--let $read_master_log_pos_restart= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)
+--let $relay_log_pos_restart= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1)
+
+# Assert that the entry in the log contains the old relay log positions as well
+--let $assert_text= Assert that the expected entry is in the error log
+--let $assert_file= $slave_error_log
+--let $assert_select= Recovery from master pos $exec_master_log_pos and file $binlog_file. Previous relay log pos and relay log file had been set to $relay_log_pos, .*$relay_log respectively.
+--let $assert_count= 1
+--source include/assert_grep.inc
+
+--let $assert_cond=$relay_log_pos_restart = 4
+--let $assert_text= "Relay_log_pos points at the beginning of the new relay log file now."
+--source include/assert.inc
+
+--let $assert_cond= $read_master_log_pos_restart = $create_tbl_stmt_trx_pos_in_bl
+--let $assert_text= "Read_master_log_pos after restart points at the CREATE TABLE position."
+--source include/assert.inc
+
+#
+# Show that even though the positions have changed, the
+# relay logs have not yet been purged. Lets assume that
+# the master is crashed and thus the slave cannot connect
+# to it. This means that we could try to apply the existing
+# relay logs (maybe they are indeed corrupt, maybe they are
+# not).
+#
+
+--replace_result $relay_log_pos RELAY_LOG_POS $relay_log SLAVE_RELAY_LOG_FILE_NAME
+--eval CHANGE MASTER TO Relay_log_pos= $relay_log_pos, Relay_log_file='$relay_log'
+--source include/start_slave_sql.inc
+--let $wait_condition= SELECT COUNT(*)=1 FROM t1
+--source include/wait_condition.inc
+
+--source include/start_slave_io.inc
+--source include/rpl_connection_master.inc
+
+DROP TABLE t1;
+
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_end.inc
index c3aa0a0e98a759c25385dbfda1aba564257d6bf1..d9030ca9729df2125a04f590371b1d371af1699e 100644 (file)
@@ -20,7 +20,7 @@ DROP DATABASE IF EXISTS mysqltest1;
 CREATE DATABASE mysqltest1;
 --enable_warnings
 
-# Section 1 test 
+# Section 1 test anonymous user
 CREATE USER tester IDENTIFIED BY 'test';
 GRANT ALL ON mysqltest1.* TO 'tester'@'%' IDENTIFIED BY 'test';
 GRANT ALL ON mysqltest1.* TO ''@'localhost%';
@@ -31,13 +31,13 @@ connection m_1;
 CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a));
 INSERT INTO mysqltest1.t1 VALUES(1,USER());
 INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER());
-delimiter |;
-create procedure mysqltest1.p1()
-begin
+DELIMITER |;
+CREATE PROCEDURE mysqltest1.p1()
+BEGIN
  INSERT INTO mysqltest1.t1 VALUES(3,USER());
  INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
-end|
-delimiter ;|
+END|
+DELIMITER ;|
 
 CALL mysqltest1.p1();
 connection master;
@@ -49,6 +49,7 @@ connection master;
 # Lets cleanup
 #show binlog events;
 
+disconnect m_1;
 DROP DATABASE mysqltest1;
 REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
 REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
@@ -57,5 +58,46 @@ DROP USER ''@'localhost%';
 
 --source include/sync_slave_sql_with_master.inc
 
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+--enable_warnings
+
+# Section 2 test anonymous host
+CREATE USER 'tester1'@'' IDENTIFIED BY 'test';
+GRANT ALL ON mysqltest1.* TO 'tester1'@'' IDENTIFIED BY 'test';
+FLUSH PRIVILEGES;
+connect (m_2,localhost,tester1,test,mysqltest1);
+
+connection m_2;
+CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a));
+INSERT INTO mysqltest1.t1 VALUES(1,USER());
+INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER());
+DELIMITER |;
+CREATE PROCEDURE mysqltest1.p1()
+BEGIN
+ INSERT INTO mysqltest1.t1 VALUES(3,USER());
+ INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
+END|
+DELIMITER ;|
+
+CALL mysqltest1.p1();
+connection master;
+SELECT * FROM mysqltest1.t1 ORDER BY a;
+--source include/sync_slave_sql_with_master.inc
+SELECT * FROM mysqltest1.t1 ORDER BY a;
+
+connection master;
+# Lets cleanup
+
+disconnect m_2;
+DROP DATABASE mysqltest1;
+REVOKE ALL ON mysqltest1.* FROM 'tester1'@'';
+DROP USER tester1@'';
+
+--source include/sync_slave_sql_with_master.inc
+
 # End of 5.0 test case
 --source include/rpl_end.inc
index 18f93400f271a8b0be8be699ca8dad2550796855..0afe637b7000b0d250d9fae1aa91a078e3e2fc96 100644 (file)
@@ -20,8 +20,10 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM;
 CREATE TABLE t2 (a int) ENGINE=MyISAM;
 INSERT INTO t1 VALUES (1), (2), (3);
 INSERT INTO t2 VALUES (4), (5), (6);
-CREATE TABLE IF NOT EXISTS t1_merge LIKE t1;
-ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1);
+# Changed a little to check also an issue reported on BUG#20574550
+CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1;
+ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1);
+CREATE TABLE t1_merge LIKE tt1_merge;
 
 --source include/sync_slave_sql_with_master.inc
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test
new file mode 100644 (file)
index 0000000..232b3e5
--- /dev/null
@@ -0,0 +1,15 @@
+###############################################################################
+# 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.
+###############################################################################
+--source include/have_binlog_format_row.inc
+--source extra/rpl_tests/rpl_rollback_to_savepoint.inc
index 21082a57eba59f75735cf50fe8519a098cfb8dff..c3186af1f02a2a7900e831840232939fcda37431 100644 (file)
@@ -18,6 +18,7 @@ SET GLOBAL rpl_semi_sync_master_timeout= 600000;
 
 --let $connections= 11
 --let $loops= 500
+--let $error_simulation= 0
 
 --echo # Disable diff_table test
 --let $enable_diff_table= 0
index f4865c043c18ac42c5af183b8f3306d8b84ba408..d0147ee70839f2aecade0a2e58eeaafa698b3054 100644 (file)
@@ -19,6 +19,7 @@ SET GLOBAL rpl_semi_sync_master_timeout= 600000;
 
 --let $connections= 11
 --let $loops= 500
+--let $error_simulation= 0
 
 --echo # Disable diff_table test
 --let $enable_diff_table= 0
index c7130d131629ce0646d0d105f80573c3fda4256f..e1abee559b5ce816248eaa0b1f192aabffb8085d 100644 (file)
@@ -2,15 +2,11 @@
 
 [mysqld.1]
 log-warnings=2
-log-error=../../tmp/rpl_server_uuid_test.mysqld.1.err
 
 [mysqld.2]
-log-error=../../tmp/rpl_server_uuid_test.mysqld.2.err
 
 [mysqld.3]
 replicate-same-server-id=1
-gtid-mode=off
-log-error=../../tmp/rpl_server_uuid_test.mysqld.3.err
 
 [ENV]
 SERVER_MYPORT_3=               @mysqld.3.port
index d31b6c2a0ab5a97dbe37b984806fa0e90199ced7..ec74b83a8499768be11cac0e6da2a21bd2654b75 100644 (file)
@@ -8,12 +8,13 @@
 # --replicate-same-server-id is set.
 #
 ##############################################################################
---let $rpl_server_count= 3
 --source include/not_gtid_enabled.inc
---source include/master-slave.inc
---source include/not_embedded.inc
+# This test case is binlog_format agnostic
+--source include/have_binlog_format_mixed.inc
 --source include/have_debug.inc
 --source include/have_debug_sync.inc
+--let $rpl_server_count= 3
+--source include/master-slave.inc
 
 call mtr.add_suppression("Slave I/O thread .* register on master");
 call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
@@ -21,6 +22,7 @@ CALL mtr.add_suppression(".*master and slave have equal MySQL server UUIDs.*");
 CALL mtr.add_suppression("Master's UUID has changed, although this should not happen unless you have changed it manually");
 CALL mtr.add_suppression("Slave I/O: SET @master_heartbeat_period to master failed with error: Lost connection to MySQL server during query");
 CALL mtr.add_suppression("Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error");
+CALL mtr.add_suppression("A slave with the same server_uuid as this slave has connected to the master");
 
 --let $uuid_file= auto.cnf
 
@@ -39,7 +41,7 @@ connection master;
 --echo
 --echo # Case 1:
 --echo # Master's UUID appears in the result of 'SHOW SLAVE STATUS'.
---echo # Slave's UUID appears in the resule of 'SHOW SLAVE HOSTS'.
+--echo # Slave's UUID appears in the result of 'SHOW SLAVE HOSTS'.
 --echo -----------------------------------------------------------------------------
 connection master;
 --let $master_uuid_on_master= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
@@ -79,7 +81,7 @@ source include/check_slave_param.inc;
 
 --echo
 --echo # Case 3:
---echo # Slave generates an errror and aborts, if master's UUID is
+--echo # Slave generates an error and aborts, if master's UUID is
 --echo # equal to slave's UUID unless --replicate-same-server-id
 --echo # option is set.
 --echo -----------------------------------------------------------------------------
@@ -241,14 +243,14 @@ eval CHANGE MASTER TO
 --echo # Case 6:
 --echo # In an existing master-slave replication forum (M->S1), if another
 --echo # slave (S2) with the same UUID as S1 joins the forum and connects
---echo # to Master(M), then there will be ping-pong reconnections happens
---echo # between M->S2, M->S1, M->S2, M->S1,.... And both slave1 and slave2
---echo # will be informed about this UUID misconfiguration in their error
---echo # log file. And Master log will be populated with information that
---echo # it found a zombie dump thread and it is killing it(only when
---echo # log_warnings is greater than 1)
+--echo # to Master(M), the master will throw an error to the first slave
+--echo # connection that will not try to reconnect.
 --echo -----------------------------------------------------------------------------
 
+# Get current server_2 thread_id at master
+--connection server_1
+--let $slave_thread_id= query_get_value(SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND='Binlog Dump', ID, 1)
+
 # Step-1: Copy server 2(S1)'s auto.cnf into server 3 (S2)'s data directory.
 --connection server_2
 --let $datadir2=`select @@datadir`
@@ -258,38 +260,52 @@ eval CHANGE MASTER TO
 --remove_file $datadir3/auto.cnf
 --copy_file $datadir2/auto.cnf $datadir3/auto.cnf
 
-# Step-2: Restart the server(two servers with the same UUID)
+# Step-2: Restart the server 3 (two servers with the same UUID)
 --let $rpl_server_number= 3
 --source include/rpl_restart_server.inc
+# Notice that the other slave has stopped with an error
+--let $rpl_connection_name= server_2
+--source include/rpl_connection.inc
+--let $slave_io_errno= convert_error(ER_MASTER_FATAL_ERROR_READING_BINLOG)
+--source include/wait_for_slave_io_error.inc
 
-# Step-3: Just do some command on server_1
---connection server_1
-CREATE TABLE t1(i int);
-DROP TABLE t1;
-
-# Step-4: Sync the data on both the slaves and observe that
-# sync will be success at both slaves.
---let $sync_slave_connection= server_2
---source include/sync_slave_sql_with_master.inc
+--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.1.err
+# Grep only after the message that the server_2 has connected to the master
+--let $assert_only_after=Start binlog_dump to master_thread_id\($slave_thread_id\)
+--let $assert_count= 1
+--let $assert_select=found a zombie dump thread with the same UUID
+--let $assert_text= Found the expected line in master's error log for server 2 disconnection
+--source include/assert_grep.inc
 
+# Get current server_3 thread_id at master
 --connection server_1
---let $sync_slave_connection= server_3
---source include/sync_slave_sql_with_master.inc
+--let $slave_thread_id= query_get_value(SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND='Binlog Dump', ID, 1)
 
-# Step-5: Observe that misconfiguration messages are in their respective
-# error log files.
-
---let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/rpl_server_uuid_test.mysqld.1.err
---let SEARCH_PATTERN=found a zombie dump thread with the same UUID
---source include/search_pattern.inc
-
---let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/rpl_server_uuid_test.mysqld.2.err
---let SEARCH_PATTERN=master receives a binlog send request from a duplicate server UUID
---source include/search_pattern.inc
+# Step-3: Connect server 2 and notice that the slave server 3 will error
+--connection server_2
+--source include/start_slave_io.inc
+# Notice that the other slave has stopped with an error
+--let $rpl_connection_name= server_3
+--source include/rpl_connection.inc
+--let $slave_io_errno= convert_error(ER_MASTER_FATAL_ERROR_READING_BINLOG)
+--source include/wait_for_slave_io_error.inc
 
---let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/rpl_server_uuid_test.mysqld.3.err
---let SEARCH_PATTERN=master receives a binlog send request from a duplicate server UUID
---source include/search_pattern.inc
+# Grep only after the message that the server_3 has connected to the master
+--let $assert_only_after=Start binlog_dump to master_thread_id\($slave_thread_id\)
+--let $assert_text= Found the expected line in master's error log for server 3 disconnection
+--source include/assert_grep.inc
+
+# Step-4: Check for error messages on slaves
+--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.2.err
+# Assert only the occurrences after the last CHANGE MASTER
+--let $assert_only_after=CHANGE MASTER .* executed
+--let $assert_select= Slave .* Got fatal error .* from master .* slave with the same server_uuid as this slave
+--let $assert_text= Found the expected line in server 2 error log
+--source include/assert_grep.inc
+
+--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.3.err
+--let $assert_text= Found the expected line in server 3 error log
+--source include/assert_grep.inc
 
 # Cleanup (restore the server 3's auto.cnf back to proper one and restart)
 --remove_file $datadir3/auto.cnf
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp_privileges.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp_privileges.test
new file mode 100644 (file)
index 0000000..da5c4ce
--- /dev/null
@@ -0,0 +1,134 @@
+###############################################################################
+# Bug#20049894: AUTOMATIC_SP_PRIVILEGES ARE NOT CORRECTLY REPLICATED WHEN
+# SETTING DEFINER
+#
+# Problem:
+# ========
+# Privileges created by automatic_sp_privileges are not correctly replicated
+# when the procedure is created by a super user using DEFINER.
+#
+# Test:
+# =====
+# Have a privileged user who already has EXECUTE and ALTER ROUTINE privileges
+# and execute CREATE PROCEDURE command with and without DEFINER class.
+# mysq.procs_priv table should not be updated. Take a non privileged user and
+# execute CREATE PROCEDURE command with and without DEFINER class.
+# mysql.procs_priv table should be updated.
+###############################################################################
+--source include/master-slave.inc
+--source include/rpl_connection_master.inc
+
+CREATE TABLE t1 (f INT);
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (20);
+--source include/sync_slave_sql_with_master.inc
+
+# Case 1: Privileged user root creating procedure with
+# Definer. Procs_priv table should be empty
+--source include/rpl_connection_master.inc
+CREATE USER 'testuser'@'localhost';
+GRANT CREATE ROUTINE ON test.* TO 'testuser'@'localhost';
+GRANT REPLICATION CLIENT ON *.* TO 'testuser'@'localhost';
+FLUSH PRIVILEGES;
+
+DELIMITER |;
+CREATE DEFINER='testuser'@'localhost' PROCEDURE row_cnt()
+BEGIN
+SELECT COUNT(*) as total_rows FROM test.t1;
+END|
+DELIMITER ;|
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+--let $assert_text= Assert that mysql.procs_priv table is empty
+--let $assert_cond= [SELECT COUNT(*) FROM mysql.procs_priv] = 0
+--source include/assert.inc
+
+--source include/rpl_connection_slave.inc
+--let $assert_text= Assert that mysql.procs_priv table is empty
+--let $assert_cond= [SELECT COUNT(*) FROM mysql.procs_priv] = 0
+--source include/assert.inc
+
+--source include/rpl_connection_master.inc
+DROP PROCEDURE row_cnt;
+--source include/sync_slave_sql_with_master.inc
+
+# Case 2: Privileged user root creating procedure without
+# Definer. Procs_priv table should be empty
+--source include/rpl_connection_master.inc
+DELIMITER |;
+CREATE  PROCEDURE row_cnt()
+BEGIN
+SELECT COUNT(*) as total_rows FROM test.t1;
+END|
+DELIMITER ;|
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+--let $assert_text= Assert that mysql.procs_priv table is empty
+--let $assert_cond= [SELECT COUNT(*) FROM mysql.procs_priv] = 0
+--source include/assert.inc
+
+--source include/rpl_connection_slave.inc
+--let $assert_text= Assert that mysql.procs_priv table is empty
+--let $assert_cond= [SELECT COUNT(*) FROM mysql.procs_priv] = 0
+--source include/assert.inc
+
+--source include/rpl_connection_master.inc
+DROP PROCEDURE row_cnt;
+--source include/sync_slave_sql_with_master.inc
+
+# Case 3: Non Privileged user testuser creating procedure with
+# Definer. Procs_priv table should be updated
+--connect(con1,localhost,testuser,,)
+--connection con1
+DELIMITER |;
+CREATE DEFINER='testuser'@'localhost' PROCEDURE row_cnt()
+BEGIN
+SELECT COUNT(*) as total_rows FROM test.t1;
+END|
+DELIMITER ;|
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+--let $assert_text= Assert that mysql.procs_priv table has one row for testuser
+--let $assert_cond= [SELECT COUNT(*) FROM mysql.procs_priv WHERE User="testuser"] = 1
+--source include/assert.inc
+
+--source include/rpl_connection_slave.inc
+--let $assert_text= Assert that mysql.procs_priv table has one row for testuser
+--let $assert_cond= [SELECT COUNT(*) FROM mysql.procs_priv WHERE User="testuser"] = 1
+--source include/assert.inc
+
+--connection con1
+DROP PROCEDURE row_cnt;
+--source include/sync_slave_sql_with_master.inc
+
+# Case 4: Non Privileged user testuser creating procedure with
+# Definer. Procs_priv table should be updated
+--connection con1
+DELIMITER |;
+CREATE PROCEDURE row_cnt()
+BEGIN
+SELECT COUNT(*) as total_rows FROM test.t1;
+END|
+DELIMITER ;|
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+--let $assert_text= Assert that mysql.procs_priv table has one row for testuser
+--let $assert_cond= [SELECT COUNT(*) FROM mysql.procs_priv WHERE User="testuser"] = 1
+--source include/assert.inc
+
+--source include/rpl_connection_slave.inc
+--let $assert_text= Assert that mysql.procs_priv table has one row for testuser
+--let $assert_cond= [SELECT COUNT(*) FROM mysql.procs_priv WHERE User="testuser"] = 1
+--source include/assert.inc
+
+# Cleanup
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+DROP PROCEDURE row_cnt;
+DROP USER 'testuser'@'localhost';
+
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_special_charset-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_special_charset-master.opt
new file mode 100644 (file)
index 0000000..b071fb2
--- /dev/null
@@ -0,0 +1 @@
+--character-set-server=utf16
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_special_charset-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_special_charset-slave.opt
new file mode 100644 (file)
index 0000000..b071fb2
--- /dev/null
@@ -0,0 +1 @@
+--character-set-server=utf16
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_special_charset.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_special_charset.test
new file mode 100644 (file)
index 0000000..9b51eba
--- /dev/null
@@ -0,0 +1,25 @@
+################################################################################
+# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS
+# Problem: IO thread fails to connect to master if servers are configured with
+#  special character sets like utf16, utf32, ucs2.
+#
+# Analysis: MySQL server does not support few special character sets like
+#  utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
+#  When IO thread is trying to connect to Master, it sets server's character
+#  set as client's character set. When Slave server is started with these
+#  special character sets, IO thread (a connection to Master) fails because
+#  of the above said reason.
+#
+# Fix: If server's character set is not supported as client's character set,
+#  then set default's client character set(latin1) as client's character set.
+###############################################################################
+--source include/master-slave.inc
+CREATE TABLE t1(i VARCHAR(20));
+INSERT INTO t1 VALUES (0xFFFF);
+--sync_slave_with_master
+--let diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+# Cleanup
+--connection master
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_ignore-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_ignore-slave.opt
new file mode 100644 (file)
index 0000000..c3ee782
--- /dev/null
@@ -0,0 +1 @@
+--replicate-do-db=db_a
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_ignore.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_ignore.test
new file mode 100644 (file)
index 0000000..c72458d
--- /dev/null
@@ -0,0 +1,85 @@
+###############################################################################
+# Bug#20797764: FAILED CREATE VIEW IS BINLOGGED, AND NOT FILTERED OUT
+#
+# Problem:
+# ========
+# Replication slave choke on statement that should be ignored instead.
+#
+# Test:
+# =====
+# Create two database db_a and db_b. Add a replicate-do-db=db_a filter on
+# slave. On master create a view view_b on master on db_b database. This
+# statement will be replicated and ignored on slave. Re-executing same CREATE
+# VIEW statement on master will result in an error. As part of test we prove
+# that failed CREATE VIEW statement is not binlogged and slave will not error
+# out saying "query caused different errors on master and slave". Slave should
+# be in sync with master.
+###############################################################################
+--source include/master-slave.inc
+
+echo "Test case1";
+--source include/rpl_connection_master.inc
+CREATE DATABASE db_a;
+CREATE DATABASE db_b;
+--source include/sync_slave_sql_with_master.inc
+FLUSH LOCAL RELAY LOGS;
+
+--source include/rpl_connection_master.inc
+USE db_b;
+CREATE VIEW view_b AS SELECT NULL;
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+--error ER_TABLE_EXISTS_ERROR
+CREATE VIEW view_b AS SELECT NULL;
+# Prove that CREATE VIEW statement is binlogged only once
+--source include/show_binlog_events.inc
+# Prove that slave doesnot error out and is in sync with master
+--source include/sync_slave_sql_with_master.inc
+# Prove that CREATE VIEW statement was received by slave
+--let $binlog_file= LAST
+--source include/show_relaylog_events.inc
+# Prove that the CREATE VIEW statement is ignored by slave
+--error ER_NO_SUCH_TABLE
+EXPLAIN view_b;
+
+--source include/rpl_connection_master.inc
+DROP DATABASE db_a;
+DROP DATABASE db_b;
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_reset.inc
+
+echo "Test case2";
+# Create two databases db_a and db_b. Execute a partial update statement such
+# that it results in an error on master and still gets binlogged. When the
+# statement is received on slave it should not cause the slave to break.
+# Without fix slave will error out with following error message.
+# Last_Error Query caused different errors on master and slave.     Error on
+# master: message (format)='Duplicate entry '%-.192s' for key %d' error
+# code=1062 ; Error on slave: actual message='no error', error code=0. Default
+# database: 'db_b'. Query: 'update t2 set f=f+2 where f>=2'.
+--source include/rpl_connection_master.inc
+CREATE DATABASE db_a;
+CREATE DATABASE db_b;
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+USE db_b;
+CREATE TABLE t2 (f INT PRIMARY KEY) ENGINE=MYISAM;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (2);
+INSERT INTO t2 VALUES (3);
+INSERT INTO t2 VALUES (5);
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+--error ER_DUP_ENTRY
+UPDATE t2 SET f=f+2 WHERE f>=2;
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+DROP DATABASE db_a;
+DROP DATABASE db_b;
+--source include/sync_slave_sql_with_master.inc
+--source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mix_rollback_to_savepoint.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mix_rollback_to_savepoint.test
new file mode 100644 (file)
index 0000000..0fe1ac4
--- /dev/null
@@ -0,0 +1,15 @@
+###############################################################################
+# 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.
+###############################################################################
+--source include/have_binlog_format_mixed_or_statement.inc
+--source extra/rpl_tests/rpl_rollback_to_savepoint.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stop_slave_threads_error-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stop_slave_threads_error-slave.opt
new file mode 100644 (file)
index 0000000..fa77a07
--- /dev/null
@@ -0,0 +1,2 @@
+--no-console
+--log-error=$MYSQLTEST_VARDIR/tmp/slave_log.err
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stop_slave_threads_error.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stop_slave_threads_error.test
new file mode 100644 (file)
index 0000000..d66d2a0
--- /dev/null
@@ -0,0 +1,60 @@
+################################################################################
+#
+# BUG#22305605    STOP SLAVE IO THREAD PRINTS WRONG LOST CONNECTION MESSAGE
+# IN ERROR LOG FILE.
+
+# Problem:
+# STOP SLAVE IO_THREAD closes socket communication between Master and Slave.
+# This prints an ERROR message in the error log
+#    [ERROR] Error reading packet from server: Lost connection to MySQL server
+#      during query (server_errno=2013).
+# Here the socket closed intentionally by the DBA using command 'STOP SLAVE IO_THREAD'.
+# Hence no need to print the message [ERROR] that says "Lost connection" which will
+# confusion the users/DBAs.
+
+# Steps to Reproduce:
+# 1) Execute some dummy statements to make sure replication is working fine.
+# 2) Stop I/O thread and see that there is no panic message printed in log file.
+# 3) Stop SQL thread and see that there is no panic message printed in log file.
+# 4) Stop both I/O and SQL threads and see that there is no panic message printed
+#    in log file.
+#
+################################################################################
+
+--source include/master-slave.inc
+
+# Execute dummy statements on Master and sync with Slave.
+CREATE TABLE t1(i INT);
+DROP TABLE t1;
+--source include/sync_slave_sql_with_master.inc
+
+# Case:1  Stop and Start slave IO thread
+--source include/stop_slave_io.inc
+--source include/start_slave_io.inc
+
+# Make sure that there is no "Lost connection" error found in error log file
+--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/slave_log.err
+--let SEARCH_PATTERN=Lost connection to MySQL server during query
+--source include/search_pattern.inc
+
+# Case:2 Stop and Start slave SQL thread
+--source include/stop_slave_sql.inc
+--source include/start_slave_sql.inc
+
+# Make sure that there is no "Lost connection" error found in error log file
+--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/slave_log.err
+--let SEARCH_PATTERN=Lost connection to MySQL server during query
+--source include/search_pattern.inc
+
+# Case:3 Stop and start slave IO and SQL thread
+--source include/stop_slave.inc
+--source include/start_slave.inc
+
+# Make sure that there is no "Lost connection" error found in error log file
+--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/slave_log.err
+--let SEARCH_PATTERN=Lost connection to MySQL server during query
+--source include/search_pattern.inc
+
+--remove_file $MYSQLTEST_VARDIR/tmp/slave_log.err
+--source include/rpl_end.inc
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary_error_table_repository.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary_error_table_repository.test
new file mode 100644 (file)
index 0000000..6f493db
--- /dev/null
@@ -0,0 +1,91 @@
+# ==== Purpose ====
+# Testing that temporary error is processed
+# when the slave info repository type is TABLE.
+#
+# ==== Implementation ====
+# At applying a transaction the slave applier thread is made blocked
+# to time out. Upon a few retries, zero included,
+# the temporary error gets escalated to the regular and the slave applier stops.
+# After the blocking condition is removed the restarted applier
+# succeeds.
+#
+# ==== References ====
+# BUG#21095969 RPL+LOCK_WAIT_TIMEOUT: BOOL TRANS_CHECK_STATE ASSERTS
+# `THD->GET_TRANSACTION()..`
+
+# This test case is binary log format agnostic though.
+--source include/have_binlog_format_row.inc
+--source include/not_mts_slave_parallel_workers.inc
+# TODO: Use this in 5.7:
+#--source include/have_slave_repository_type_file.inc
+--let $repo_type_name = 'TABLE'
+
+--source include/master-slave.inc
+
+--source include/rpl_connection_master.inc
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT) ENGINE= InnoDB;
+
+--sync_slave_with_master
+--source include/stop_slave.inc
+SET @saved_slave_transaction_retries = @@GLOBAL.slave_transaction_retries;
+SET @saved_innodb_lock_wait_timeout = @@GLOBAL.innodb_lock_wait_timeout;
+SET @saved_master_info_repository = @@GLOBAL.master_info_repository;
+SET @saved_relay_log_info_repository = @@GLOBAL.relay_log_info_repository;
+SET @@GLOBAL.innodb_lock_wait_timeout = 1;
+--replace_result $repo_type_name TYPE
+--eval SET @@GLOBAL.master_info_repository = $repo_type_name
+--replace_result $repo_type_name TYPE
+--eval SET @@GLOBAL.relay_log_info_repository = $repo_type_name
+
+# To block the SQL thread
+--source include/rpl_connection_slave1.inc
+BEGIN;
+INSERT INTO t1 VALUES (7,0);
+
+# Generate data at the master to be replicated
+--source include/rpl_connection_master.inc
+INSERT INTO t1 VALUES (7,7);
+
+# Retry 0 and 1 time to test both execution branches.
+
+--let $retry_counted = 0
+--let $retry_number = 0
+while ($retry_number < 2)
+{
+  --source include/rpl_connection_slave.inc
+  --eval SET @@GLOBAL.slave_transaction_retries = $retry_number
+  --source include/start_slave.inc
+
+  --echo ### Specified retry number is expected ###
+
+  # Notice the status var accumulates retries over the loop
+  --let $retry_counted = `SELECT $retry_counted + $retry_number`
+  --let $status_var = Slave_retried_transactions
+  --let $status_var_value = $retry_counted
+  --source include/wait_for_status_var.inc
+
+  --echo ### Timeout error is expected ###
+
+  --let $slave_sql_errno= convert_error(ER_LOCK_WAIT_TIMEOUT)
+  --source include/wait_for_slave_sql_error.inc
+
+  --inc $retry_number
+}
+
+--source include/rpl_connection_slave1.inc
+ROLLBACK;
+
+--echo #### Cleanup ####
+
+--source include/rpl_connection_slave.inc
+--source include/stop_slave.inc
+SET @@GLOBAL.slave_transaction_retries = @saved_slave_transaction_retries;
+SET @@GLOBAL.master_info_repository = @saved_master_info_repository;
+SET @@GLOBAL.relay_log_info_repository = @saved_relay_log_info_repository;
+SET @@GLOBAL.innodb_lock_wait_timeout = @saved_innodb_lock_wait_timeout ;
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1;
+--source include/rpl_end.inc
index 7b052f96b961de40cd99aad43f1a5418d4eb31b6..83c619b4df76a027dc7d2e2f0317636705ae9707 100644 (file)
@@ -150,10 +150,71 @@ DROP USER test_3@localhost;
 INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked");
 
 UNLOCK TABLE;
+
+# Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS
+# BINLOGGED INCORRECTLY - BREAKS A SLAVE
+CREATE DATABASE db;
+CREATE TABLE db.t1 LIKE t2;
+CREATE TABLE t3 LIKE t2;
+DROP TABLE t3;
+DROP DATABASE db;
+# end of Bug #20439913 test
+
 DROP USER test_3@localhost;
 DROP FUNCTION f2;
 DROP PROCEDURE p2;
 DROP EVENT e2;
 DROP TABLE t1, t2;
 
+--sync_slave_with_master
+#
+# BUG#20574550
+# CREATE TABLE LIKE <TEMP_TABLE> does not preserve original table storage
+# engine when using row based replication
+#
+--connection master
+
+# Define temp_t1 and temp_t2 storage engines
+--let $engine_temp_t1= InnoDB
+--let $engine_temp_t2= MyISAM
+
+# Create the two temporary tables
+--eval CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=$engine_temp_t1
+--eval CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=$engine_temp_t2
+
+# Create t1 and t2 based on temporary tables
+CREATE TABLE t1 LIKE temp_t1;
+CREATE TABLE t2 LIKE temp_t2;
+--sync_slave_with_master
+
+# On master
+--connection master
+# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2
+--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1)
+--let $assert_cond= "$engine_t1" = "$engine_temp_t1"
+--let $assert_text= "t1 on master and temp_t1 have the same storage engine"
+--source include/assert.inc
+
+--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1)
+--let $assert_cond= "$engine_t2" = "$engine_temp_t2"
+--let $assert_text= "t2 on master and temp_t2 have the same storage engine"
+--source include/assert.inc
+
+# On slave
+--connection slave
+# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2
+--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1)
+--let $assert_cond= "$engine_t1" = "$engine_temp_t1"
+--let $assert_text= "t1 on slave and temp_t1 have the same storage engine"
+--source include/assert.inc
+
+--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1)
+--let $assert_cond= "$engine_t2" = "$engine_temp_t2"
+--let $assert_text= "t2 on slave and temp_t2 have the same storage engine"
+--source include/assert.inc
+
+# Cleanup
+--connection master
+DROP TEMPORARY TABLE temp_t1, temp_t2;
+DROP TABLE t1, t2;
 --source include/rpl_end.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_unsafe_statements.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_unsafe_statements.test
new file mode 100644 (file)
index 0000000..def8e8f
--- /dev/null
@@ -0,0 +1,175 @@
+################################################################################
+# Bug#17047208 REPLICATION DIFFERENCE FOR MULTIPLE TRIGGERS
+# Problem: If DML invokes a trigger or a stored function that inserts into an
+# AUTO_INCREMENT column, that DML has to be marked as 'unsafe' statement. If the
+# tables are locked in the transaction prior to DML statement (using LOCK
+# TABLES), then the DML statement is not marked as 'unsafe' statement.
+
+# Steps to reproduce the reported test case (BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS)
+# Case-1:
+#  > Create a trigger on a table and do a insert in the trigger that updates
+#     auto increment column
+#  > A DML that executes the trigger in step.1 and check that DML is marked
+#     as unsafe and DML is written into binlog using row format (in MBR)
+#  > Execute the step 2 by locking the required tables prior to DML and check
+#     that DML is marked as unsafe and DML is written into binlog using row
+#     format (in MBR)
+#
+#  This test script also adds test cases to cover few other unsafe statements.
+#    Case-2: BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT
+#    Case-3: BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST
+#    Case-4: BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS
+################################################################################
+
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+# Case-1: BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS
+#  Statement is unsafe because it invokes a trigger or a
+#  stored function that inserts into an AUTO_INCREMENT column.
+
+# Step-1.1: Create two tables, one with AUTO_INCREMENT column.
+CREATE TABLE t1(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+
+# Step-1.2: Create a trigger that inserts into an AUTO_INCREMENT column.
+CREATE TRIGGER trig1 AFTER INSERT ON t1
+FOR EACH ROW
+  INSERT INTO t2(i) VALUES(new.i);
+
+# Step-1.3: Create some gap in auto increment value on master's t2 table
+# but not on slave (by doing rollback). Just in case if the unsafe statements
+# are written in statement format, diff tables will fail.
+START TRANSACTION;
+INSERT INTO t2(i) VALUES (1);
+ROLLBACK;
+
+# Step-1.4: Insert a tuple into table t1 that triggers trig1 which inserts
+# into an AUTO_INCREMENT column.
+INSERT INTO t1(i) VALUES(2);
+
+# Step-1.5: Repeat step 1.4 but using 'LOCK TABLES' logic.
+START TRANSACTION;
+LOCK TABLES t1 WRITE, t2 WRITE;
+INSERT INTO t1(i) VALUES(3);
+UNLOCK TABLES;
+COMMIT;
+
+# Step-1.6: Sync slave with master
+--sync_slave_with_master
+
+# Step-1.7: Diff master-slave tables to make sure everything is in sync.
+--let $diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+
+--let $diff_tables=master:t2, slave:t2
+--source include/diff_tables.inc
+
+# Step-1.8: Cleanup
+--connection master
+DROP TABLE t1,t2;
+
+# Case-2: BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT
+#  Statements writing to a table with an auto-increment column after selecting
+#  from another table are unsafe because the order in which rows are retrieved
+#  determines what (if any) rows will be written. This order cannot be
+#  predicted and may differ on master and the slave.
+
+# Step-2.1: Create two tables,  one with AUTO_INCREMENT column.
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+
+# Step-2.2: Create some tuples in table t1.
+INSERT INTO t1 values (1), (2), (3);
+
+# Step-2.3: Create some gap in auto increment value on master's t2 table
+# but not on slave (by doing rollback). Just in case if the unsafe statements
+# are written in statement format, diff tables will fail.
+START TRANSACTION;
+INSERT INTO t2(i) VALUES (1);
+ROLLBACK;
+
+# Step-2.4: Insert into t2 (table with an auto-increment) by selecting tuples
+# from table t1.
+INSERT INTO t2(i) SELECT i FROM t1;
+
+# Step-2.5: Repeat step 2.4 but now with 'LOCK TABLES' logic.
+START TRANSACTION;
+LOCK TABLES t2 WRITE, t1 READ;
+INSERT INTO t2(i) SELECT i FROM t1;
+UNLOCK TABLES;
+COMMIT;
+
+# Step-2.6: Sync slave with master
+--sync_slave_with_master
+
+# Step-2.7: Diff master-slave tables to make sure everything is in sync.
+--let $diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+
+--let $diff_tables=master:t2, slave:t2
+--source include/diff_tables.inc
+
+# Step-2.8: Cleanup
+--connection master
+DROP TABLE t1,t2;
+
+# Case-3: BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST
+#  INSERT into autoincrement field which is not the first part in the
+#  composed primary key is unsafe
+#
+# Step-3.1: Create a table with auto increment column and a composed primary key
+# (second column is auto increment column). Such a definition is allowed only
+# with 'myisam' engine.
+CREATE TABLE t1(i int, id INT AUTO_INCREMENT, PRIMARY KEY (i, id)) ENGINE=MYISAM;
+
+# Step-3.2: Inserting into such a table is unsafe.
+INSERT INTO t1 (i) values (1);
+
+# Step-3.3: Repeat step 3.2, now with 'LOCK TABLES' logic.
+START TRANSACTION;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 (i) values (2);
+UNLOCK TABLES;
+COMMIT;
+
+# Step-3.4: Sync slave with master
+--sync_slave_with_master
+
+# Step-3.5: Diff master-slave tables to make sure everything is in sync.
+--let $diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+
+# Step-3.6: Cleanup
+--connection master
+DROP TABLE t1;
+
+# Case-4: BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS
+#  INSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY
+#  is unsafe Statement
+
+# Step-4.1: Create a table with two unique keys
+CREATE TABLE t1(i INT, j INT, UNIQUE KEY(i), UNIQUE KEY(j)) ENGINE=INNODB;
+
+# Step-4.2: Inserting into such a table is unsafe.
+INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+
+# Step-4.3: Repeat step 3.2, now with 'LOCK TABLES' logic.
+START TRANSACTION;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+UNLOCK TABLES;
+COMMIT;
+
+# Step-4.4: Sync slave with master
+--sync_slave_with_master
+
+# Step-4.5: Diff master-slave tables to make sure everything is in sync.
+--let $diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+
+# Step-4.6: Cleanup
+--connection master
+DROP TABLE t1;
+
+--source include/rpl_end.inc
index e042384106d26b0318565a6d7e499b57b44f2ef0..4edc03924fa1332aa9983a84a316d6b35784a319 100644 (file)
@@ -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-wsrep-5.6/mysql-test/suite/sys_vars/r/avoid_temporal_upgrade_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/avoid_temporal_upgrade_basic.result
new file mode 100644 (file)
index 0000000..f2d0c6b
--- /dev/null
@@ -0,0 +1,78 @@
+SELECT @@global.avoid_temporal_upgrade;
+@@global.avoid_temporal_upgrade
+0
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+SHOW GLOBAL VARIABLES LIKE 'avoid_temporal_upgrade';
+Variable_name  Value
+avoid_temporal_upgrade OFF
+SELECT * FROM information_schema.global_variables WHERE variable_name='avoid_temporal_upgrade';
+VARIABLE_NAME  VARIABLE_VALUE
+AVOID_TEMPORAL_UPGRADE OFF
+#It is not a session variable.
+SELECT @@session.avoid_temporal_upgrade;
+ERROR HY000: Variable 'avoid_temporal_upgrade' is a GLOBAL variable
+SHOW SESSION VARIABLES LIKE 'avoid_temporal_upgrade';
+Variable_name  Value
+avoid_temporal_upgrade OFF
+SELECT * FROM information_schema.session_variables WHERE variable_name='avoid_temporal_upgrade';
+VARIABLE_NAME  VARIABLE_VALUE
+AVOID_TEMPORAL_UPGRADE OFF
+SET SESSION avoid_temporal_upgrade= ON;
+ERROR HY000: Variable 'avoid_temporal_upgrade' is a GLOBAL variable and should be set with SET GLOBAL
+#Test setting the variable to various values.
+#Boolean values.
+SET GLOBAL avoid_temporal_upgrade= ON;
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+SELECT @@global.avoid_temporal_upgrade;
+@@global.avoid_temporal_upgrade
+1
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+SET GLOBAL avoid_temporal_upgrade= OFF;
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+SELECT @@global.avoid_temporal_upgrade;
+@@global.avoid_temporal_upgrade
+0
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+SET GLOBAL avoid_temporal_upgrade= 1;
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+SELECT @@global.avoid_temporal_upgrade;
+@@global.avoid_temporal_upgrade
+1
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+SET GLOBAL avoid_temporal_upgrade= 0;
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+SELECT @@global.avoid_temporal_upgrade;
+@@global.avoid_temporal_upgrade
+0
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+#Test for DEFAULT value.
+SET GLOBAL avoid_temporal_upgrade= DEFAULT;
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+SELECT @@global.avoid_temporal_upgrade;
+@@global.avoid_temporal_upgrade
+0
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
+#Test for invalid value.
+SET GLOBAL avoid_temporal_upgrade= 2;
+ERROR 42000: Variable 'avoid_temporal_upgrade' can't be set to the value of '2'
+#Test for invalid statement for setting the 
+#global variable.
+SET avoid_temporal_upgrade= 1;
+ERROR HY000: Variable 'avoid_temporal_upgrade' is a GLOBAL variable and should be set with SET GLOBAL
+#Fetches the current global value for the variable.
+SELECT @@avoid_temporal_upgrade;
+@@avoid_temporal_upgrade
+0
+Warnings:
+Warning        1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
index 6fc33a4f3690565eacc0dc60c79b1306ef28f5e5..6b8389df845fdd4d96cc76a4ae97b9173e6f960e 100644 (file)
@@ -23,6 +23,8 @@ SET @@session.character_set_connection = latin1;
 SELECT 'ЁЂЃЄ' AS utf_text;
 utf_text
 ????
+Warnings:
+Warning        1300    Invalid utf8 character string: '\xD0\x81\xD0\x82\xD0\x83...'
 SET @@session.character_set_connection = utf8;
 SELECT 'ЁЂЃЄ' AS utf_text;
 utf_text
@@ -30,6 +32,8 @@ utf_text
 '---now inserting utf8 string with different character_set_connection--'
 SET @@session.character_set_connection = ascii;
 INSERT INTO t1 VALUES('ЁЂЃЄ');
+Warnings:
+Warning        1300    Invalid utf8 character string: '\xD0\x81\xD0\x82\xD0\x83...'
 SELECT * FROM t1;
 b
 ????
@@ -39,6 +43,8 @@ SET @@session.character_set_connection = ascii;
 SET @@session.character_set_client = latin1;
 SET @@session.character_set_results = latin1;
 INSERT INTO t1 VALUES('ЁЂЃЄ');
+Warnings:
+Warning        1300    Invalid latin1 character string: '\xD0\x81\xD0\x82\xD0\x83...'
 SELECT * FROM t1;
 b
 ????????
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result
new file mode 100644 (file)
index 0000000..6f6fb35
--- /dev/null
@@ -0,0 +1,10 @@
+SELECT @@GLOBAL.innodb_numa_interleave;
+@@GLOBAL.innodb_numa_interleave
+1
+SET @@GLOBAL.innodb_numa_interleave=off;
+ERROR HY000: Variable 'innodb_numa_interleave' is a read only variable
+SELECT @@GLOBAL.innodb_use_native_aio;
+@@GLOBAL.innodb_use_native_aio
+0
+SELECT @@SESSION.innodb_use_native_aio;
+ERROR HY000: Variable 'innodb_use_native_aio' is a GLOBAL variable
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result
new file mode 100644 (file)
index 0000000..be10c93
--- /dev/null
@@ -0,0 +1,35 @@
+SET @start_global_value = @@global.innodb_tmpdir;
+SELECT @start_global_value;
+@start_global_value
+NULL
+select @@session.innodb_tmpdir;
+@@session.innodb_tmpdir
+NULL
+show global variables like 'innodb_tmpdir';
+Variable_name  Value
+innodb_tmpdir  
+show session variables like 'innodb_tmpdir';
+Variable_name  Value
+innodb_tmpdir  
+select * from information_schema.global_variables where variable_name='innodb_tmpdir';
+VARIABLE_NAME  VARIABLE_VALUE
+INNODB_TMPDIR  
+select * from information_schema.session_variables where variable_name='innodb_tmpdir';
+VARIABLE_NAME  VARIABLE_VALUE
+INNODB_TMPDIR  
+set global innodb_tmpdir=@@global.tmpdir;
+set session innodb_tmpdir=@@global.tmpdir;
+set global innodb_tmpdir=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_tmpdir'
+set global innodb_tmpdir=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_tmpdir'
+set global innodb_tmpdir=repeat('a',1000);
+ERROR 42000: Variable 'innodb_tmpdir' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+show warnings;
+Level  Code    Message
+Warning        1210    Path length should not exceed 512 bytes
+Error  1231    Variable 'innodb_tmpdir' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+SET @@global.innodb_tmpdir = @start_global_value;
+SELECT @@global.innodb_tmpdir;
+@@global.innodb_tmpdir
+NULL
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/max_digest_length_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/max_digest_length_basic.result
new file mode 100644 (file)
index 0000000..df3db2f
--- /dev/null
@@ -0,0 +1,23 @@
+select @@global.max_digest_length;
+@@global.max_digest_length
+123
+select @@session.max_digest_length;
+ERROR HY000: Variable 'max_digest_length' is a GLOBAL variable
+show global variables like 'max_digest_length';
+Variable_name  Value
+max_digest_length      123
+show session variables like 'max_digest_length';
+Variable_name  Value
+max_digest_length      123
+select * from information_schema.global_variables
+where variable_name='max_digest_length';
+VARIABLE_NAME  VARIABLE_VALUE
+MAX_DIGEST_LENGTH      123
+select * from information_schema.session_variables
+where variable_name='max_digest_length';
+VARIABLE_NAME  VARIABLE_VALUE
+MAX_DIGEST_LENGTH      123
+set global max_digest_length=1;
+ERROR HY000: Variable 'max_digest_length' is a read only variable
+set session max_digest_length=1;
+ERROR HY000: Variable 'max_digest_length' is a read only variable
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result
new file mode 100644 (file)
index 0000000..5830131
--- /dev/null
@@ -0,0 +1,23 @@
+select @@global.performance_schema_max_digest_length;
+@@global.performance_schema_max_digest_length
+123
+select @@session.max_digest_length;
+ERROR HY000: Variable 'max_digest_length' is a GLOBAL variable
+show global variables like 'performance_schema_max_digest_length';
+Variable_name  Value
+performance_schema_max_digest_length   123
+show session variables like 'performance_schema_max_digest_length';
+Variable_name  Value
+performance_schema_max_digest_length   123
+select * from information_schema.global_variables
+where variable_name='performance_schema_max_digest_length';
+VARIABLE_NAME  VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH   123
+select * from information_schema.session_variables
+where variable_name='performance_schema_max_digest_length';
+VARIABLE_NAME  VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH   123
+set global performance_schema_max_digest_length=1;
+ERROR HY000: Variable 'performance_schema_max_digest_length' is a read only variable
+set session performance_schema_max_digest_length=1;
+ERROR HY000: Variable 'performance_schema_max_digest_length' is a read only variable
index c408a39fdc094c3d2ae4a08b6b3bd58e162a17b3..9dc4a0d5062a0bb3c57ef5f0fbb6d994169dcad9 100644 (file)
@@ -50,7 +50,7 @@ Warnings:
 Warning        1292    Truncated incorrect query_cache_min_res_unit value: '4294967296'
 SELECT @@global.query_cache_min_res_unit;
 @@global.query_cache_min_res_unit
-0
+4294967288
 SET @@global.query_cache_min_res_unit = 511;
 SELECT @@global.query_cache_min_res_unit;
 @@global.query_cache_min_res_unit
@@ -71,23 +71,23 @@ Warnings:
 Warning        1292    Truncated incorrect query_cache_min_res_unit value: '42949672950'
 SELECT @@global.query_cache_min_res_unit;
 @@global.query_cache_min_res_unit
-0
+4294967288
 SET @@global.query_cache_min_res_unit = ON;
 ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
 SELECT @@global.query_cache_min_res_unit;
 @@global.query_cache_min_res_unit
-0
+4294967288
 SET @@global.query_cache_min_res_unit = 'test';
 ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
 SELECT @@global.query_cache_min_res_unit;
 @@global.query_cache_min_res_unit
-0
+4294967288
 '#-------------------FN_DYNVARS_132_05----------------------------#'
 SET @@session.query_cache_min_res_unit = 0;
 ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL
 SELECT @@query_cache_min_res_unit;
 @@query_cache_min_res_unit
-0
+4294967288
 '#----------------------FN_DYNVARS_132_06------------------------#'
 SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/show_old_temporals_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/show_old_temporals_basic.result
new file mode 100644 (file)
index 0000000..25dee4a
--- /dev/null
@@ -0,0 +1,130 @@
+SELECT @@session.show_old_temporals;
+@@session.show_old_temporals
+0
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SHOW SESSION VARIABLES LIKE 'show_old_temporals';
+Variable_name  Value
+show_old_temporals     OFF
+SELECT * FROM information_schema.session_variables WHERE variable_name='show_old_temporals';
+VARIABLE_NAME  VARIABLE_VALUE
+SHOW_OLD_TEMPORALS     OFF
+#Also can be set as a global variable.
+SELECT @@global.show_old_temporals;
+@@global.show_old_temporals
+0
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SHOW GLOBAL VARIABLES LIKE 'show_old_temporals';
+Variable_name  Value
+show_old_temporals     OFF
+SELECT * FROM information_schema.global_variables WHERE variable_name='show_old_temporals';
+VARIABLE_NAME  VARIABLE_VALUE
+SHOW_OLD_TEMPORALS     OFF
+#Test setting the variable to various values.
+#Boolean values.
+SET SESSION show_old_temporals= ON;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@session.show_old_temporals;
+@@session.show_old_temporals
+1
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SET SESSION show_old_temporals= OFF;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@session.show_old_temporals;
+@@session.show_old_temporals
+0
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SET SESSION show_old_temporals= 1;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@session.show_old_temporals;
+@@session.show_old_temporals
+1
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SET SESSION show_old_temporals= 0;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@session.show_old_temporals;
+@@session.show_old_temporals
+0
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+#Test for DEFAULT value.
+SET SESSION show_old_temporals= DEFAULT;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@session.show_old_temporals;
+@@session.show_old_temporals
+0
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+#Test for invalid value.
+SET SESSION show_old_temporals= 2;
+ERROR 42000: Variable 'show_old_temporals' can't be set to the value of '2'
+#Test for setting the session variable
+#using different syntax.
+SET show_old_temporals= 1;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+#Fetches the current session value for the variable.
+SELECT @@show_old_temporals;
+@@show_old_temporals
+1
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+#cleanup
+SET SESSION show_old_temporals= DEFAULT;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+#Test setting the global value of the variable.
+#Boolean values.
+SET GLOBAL show_old_temporals= ON;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@global.show_old_temporals;
+@@global.show_old_temporals
+1
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SET GLOBAL show_old_temporals= OFF;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@global.show_old_temporals;
+@@global.show_old_temporals
+0
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SET GLOBAL show_old_temporals= 1;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@global.show_old_temporals;
+@@global.show_old_temporals
+1
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SET GLOBAL show_old_temporals= 0;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@session.show_old_temporals;
+@@session.show_old_temporals
+0
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+#Test for DEFAULT value.
+SET GLOBAL show_old_temporals= DEFAULT;
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+SELECT @@global.show_old_temporals;
+@@global.show_old_temporals
+0
+Warnings:
+Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
+#Test for invalid value.
+SET GLOBAL show_old_temporals= 2;
+ERROR 42000: Variable 'show_old_temporals' can't be set to the value of '2'
similarity index 88%
rename from mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
rename to mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result
index a7afc334ba1bec7037b2d7c6cd3bf8ef1554072f..ca192d0afa2c6357e0587a944874412d1f0c56ef 100644 (file)
@@ -41,23 +41,11 @@ Warning     1292    Truncated incorrect transaction_alloc_block_size value: '60020'
 SELECT @@global.transaction_alloc_block_size;
 @@global.transaction_alloc_block_size
 59392
-SET @@global.transaction_alloc_block_size = 4294967295;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '4294967295'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-4294966272
 '#--------------------FN_DYNVARS_005_04-------------------------#'
 SET @@session.transaction_alloc_block_size = 1024;
 SELECT @@session.transaction_alloc_block_size;
 @@session.transaction_alloc_block_size
 1024
-SET @@session.transaction_alloc_block_size =4294967295;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '4294967295'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-4294966272
 SET @@session.transaction_alloc_block_size = 65535;
 Warnings:
 Warning        1292    Truncated incorrect transaction_alloc_block_size value: '65535'
@@ -77,12 +65,12 @@ Warning     1292    Truncated incorrect transaction_alloc_block_size value: '-1024'
 SELECT @@global.transaction_alloc_block_size;
 @@global.transaction_alloc_block_size
 1024
-SET @@global.transaction_alloc_block_size = 123456789201;
+SET @@global.transaction_alloc_block_size = 135217728;
 Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '123456789201'
+Warning        1292    Truncated incorrect transaction_alloc_block_size value: '135217728'
 SELECT @@global.transaction_alloc_block_size;
 @@global.transaction_alloc_block_size
-4294966272
+131072
 SET @@global.transaction_alloc_block_size = ON;
 ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
 SET @@global.transaction_alloc_block_size = OFF;
@@ -109,12 +97,12 @@ Warning    1292    Truncated incorrect transaction_alloc_block_size value: '1000'
 SELECT @@global.transaction_alloc_block_size;
 @@global.transaction_alloc_block_size
 1024
-SET @@session.transaction_alloc_block_size = 12345678901;
+SET @@session.transaction_alloc_block_size = 135217728;
 Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '12345678901'
+Warning        1292    Truncated incorrect transaction_alloc_block_size value: '135217728'
 SELECT @@session.transaction_alloc_block_size;
 @@session.transaction_alloc_block_size
-4294966272
+131072
 SET @@session.transaction_alloc_block_size = ON;
 ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
 SET @@session.transaction_alloc_block_size = OFF;
@@ -136,22 +124,22 @@ ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
 SET @@session.transaction_alloc_block_size = 'test';
 ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
 '#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='transaction_alloc_block_size';
 @@global.transaction_alloc_block_size = VARIABLE_VALUE
 1
 '#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='transaction_alloc_block_size';
 @@session.transaction_alloc_block_size = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_001_08----------------------#'
 SET @@transaction_alloc_block_size = 1024;
-SET @@global.transaction_alloc_block_size = 4294967295;
+SET @@global.transaction_alloc_block_size = 134217728;
 Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '4294967295'
+Warning        1292    Truncated incorrect transaction_alloc_block_size value: '134217728'
 SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
 @@transaction_alloc_block_size = @@global.transaction_alloc_block_size
 0
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result
deleted file mode 100644 (file)
index 3c95843..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-SET @start_global_value = @@global.transaction_alloc_block_size;
-SELECT @start_global_value;
-@start_global_value
-8192
-SET @start_session_value = @@session.transaction_alloc_block_size;
-SELECT @start_session_value;
-@start_session_value
-8192
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.transaction_alloc_block_size = 100;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '100'
-SET @@global.transaction_alloc_block_size = DEFAULT;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-8192
-SET @@session.transaction_alloc_block_size = 200;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '200'
-SET @@session.transaction_alloc_block_size = DEFAULT;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-8192
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.transaction_alloc_block_size = DEFAULT;
-SELECT @@global.transaction_alloc_block_size = 8192;
-@@global.transaction_alloc_block_size = 8192
-1
-SET @@session.transaction_alloc_block_size = DEFAULT;
-SELECT @@session.transaction_alloc_block_size = 8192;
-@@session.transaction_alloc_block_size = 8192
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.transaction_alloc_block_size = 1024;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = 60020;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '60020'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-59392
-SET @@global.transaction_alloc_block_size = 4294967295;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '4294967295'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-4294966272
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.transaction_alloc_block_size = 1024;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size =4294967295;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '4294967295'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-4294966272
-SET @@session.transaction_alloc_block_size = 65535;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '65535'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-64512
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.transaction_alloc_block_size = 0;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = -1024;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '-1024'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = 123456789201;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '123456789201'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-123456788480
-SET @@global.transaction_alloc_block_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size = True;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '1'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = False;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size = 1000;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '1000'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size = 12345678901;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '12345678901'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-12345678848
-SET @@session.transaction_alloc_block_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@session.transaction_alloc_block_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@session.transaction_alloc_block_size = True;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '1'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size = False;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@session.transaction_alloc_block_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='transaction_alloc_block_size';
-@@global.transaction_alloc_block_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='transaction_alloc_block_size';
-@@session.transaction_alloc_block_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_08----------------------#'
-SET @@transaction_alloc_block_size = 1024;
-SET @@global.transaction_alloc_block_size = 4294967295;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '4294967295'
-SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
-@@transaction_alloc_block_size = @@global.transaction_alloc_block_size
-0
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@transaction_alloc_block_size = 100;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '100'
-SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size;
-@@transaction_alloc_block_size = @@local.transaction_alloc_block_size
-1
-SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size;
-@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET transaction_alloc_block_size = 1027;
-Warnings:
-Warning        1292    Truncated incorrect transaction_alloc_block_size value: '1027'
-SELECT @@transaction_alloc_block_size;
-@@transaction_alloc_block_size
-1024
-SELECT local.transaction_alloc_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.transaction_alloc_block_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size;
-ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list'
-SET @@global.transaction_alloc_block_size = @start_global_value;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-8192
-SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
similarity index 89%
rename from mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result
rename to mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result
index 3455b9479c09db09ffde3318ea7e418d1043c554..122918dcd3d77405fc0813c9b714b6989ed605be 100644 (file)
@@ -6,7 +6,6 @@ SET @start_session_value = @@session.transaction_prealloc_size;
 SELECT @start_session_value;
 @start_session_value
 4096
-'Bug# 34876: This variable has invalid default value as compared to documentation';
 '#--------------------FN_DYNVARS_005_01-------------------------#'
 SET @@global.transaction_prealloc_size = 100;
 Warnings:
@@ -37,23 +36,19 @@ SELECT @@global.transaction_prealloc_size;
 @@global.transaction_prealloc_size
 1024
 SET @@global.transaction_prealloc_size = 60020;
+Warnings:
+Warning        1292    Truncated incorrect transaction_prealloc_size value: '60020'
 SELECT @@global.transaction_prealloc_size;
 @@global.transaction_prealloc_size
 59392
-SET @@global.transaction_prealloc_size = 4294966272;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4294966272
 '#--------------------FN_DYNVARS_005_04-------------------------#'
 SET @@session.transaction_prealloc_size = 1024;
 SELECT @@session.transaction_prealloc_size;
 @@session.transaction_prealloc_size
 1024
-SET @@session.transaction_prealloc_size =4294966272;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4294966272
 SET @@session.transaction_prealloc_size = 65535;
+Warnings:
+Warning        1292    Truncated incorrect transaction_prealloc_size value: '65535'
 SELECT @@session.transaction_prealloc_size;
 @@session.transaction_prealloc_size
 64512
@@ -70,7 +65,6 @@ Warning       1292    Truncated incorrect transaction_prealloc_size value: '-1024'
 SELECT @@global.transaction_prealloc_size;
 @@global.transaction_prealloc_size
 1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
 SET @@global.transaction_prealloc_size = ON;
 ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
 SET @@global.transaction_prealloc_size = OFF;
@@ -115,19 +109,21 @@ SELECT @@session.transaction_prealloc_size;
 1024
 SET @@session.transaction_prealloc_size = "Test";
 ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = 123456789031;
+SET @@session.transaction_prealloc_size = 135217728;
+Warnings:
+Warning        1292    Truncated incorrect transaction_prealloc_size value: '135217728'
 SELECT @@session.transaction_prealloc_size;
 @@session.transaction_prealloc_size
-123456788480
+131072
 '#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='transaction_prealloc_size';
 @@global.transaction_prealloc_size = VARIABLE_VALUE
 1
 '#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='transaction_prealloc_size';
 @@session.transaction_prealloc_size = VARIABLE_VALUE
 1
@@ -151,6 +147,8 @@ SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
 1
 '#---------------------FN_DYNVARS_001_11----------------------#'
 SET transaction_prealloc_size = 1027;
+Warnings:
+Warning        1292    Truncated incorrect transaction_prealloc_size value: '1027'
 SELECT @@transaction_prealloc_size;
 @@transaction_prealloc_size
 1024
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result
deleted file mode 100644 (file)
index 4912653..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-SET @start_global_value = @@global.transaction_prealloc_size;
-SELECT @start_global_value;
-@start_global_value
-4096
-SET @start_session_value = @@session.transaction_prealloc_size;
-SELECT @start_session_value;
-@start_session_value
-4096
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.transaction_prealloc_size = 100;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '100'
-SET @@global.transaction_prealloc_size = DEFAULT;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4096
-SET @@session.transaction_prealloc_size = 200;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '200'
-SET @@session.transaction_prealloc_size = DEFAULT;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4096
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.transaction_prealloc_size = DEFAULT;
-SELECT @@global.transaction_prealloc_size = 4096;
-@@global.transaction_prealloc_size = 4096
-1
-SET @@session.transaction_prealloc_size = DEFAULT;
-SELECT @@session.transaction_prealloc_size = 4096;
-@@session.transaction_prealloc_size = 4096
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.transaction_prealloc_size = 1024;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = 60020;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-59392
-SET @@global.transaction_prealloc_size = 4294966272;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4294966272
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.transaction_prealloc_size = 1024;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size =4294966272;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4294966272
-SET @@session.transaction_prealloc_size = 65535;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-64512
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.transaction_prealloc_size = 0;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = -1024;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '-1024'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.transaction_prealloc_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size = True;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '1'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = False;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size = 1000;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '1000'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = True;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '1'
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size = False;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = 123456789031;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '123456789031'
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4294966272
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='transaction_prealloc_size';
-@@global.transaction_prealloc_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='transaction_prealloc_size';
-@@session.transaction_prealloc_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.transaction_prealloc_size = 1024;
-SET @@global.transaction_prealloc_size = 10;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '10'
-SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
-@@transaction_prealloc_size = @@global.transaction_prealloc_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@transaction_prealloc_size = 100;
-Warnings:
-Warning        1292    Truncated incorrect transaction_prealloc_size value: '100'
-SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size;
-@@transaction_prealloc_size = @@local.transaction_prealloc_size
-1
-SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
-@@local.transaction_prealloc_size = @@session.transaction_prealloc_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET transaction_prealloc_size = 1027;
-SELECT @@transaction_prealloc_size;
-@@transaction_prealloc_size
-1024
-SELECT local.transaction_prealloc_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.transaction_prealloc_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
-ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list'
-SET @@global.transaction_prealloc_size = @start_global_value;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4096
-SET @@session.transaction_prealloc_size = @start_session_value;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4096
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result
new file mode 100644 (file)
index 0000000..4a95f45
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# wsrep_dirty_reads
+#
+# save the initial value
+SET @wsrep_dirty_reads_session_saved = @@session.wsrep_dirty_reads;
+SET @wsrep_dirty_reads_global_saved = @@global.wsrep_dirty_reads;
+# default
+SELECT @@global.wsrep_dirty_reads;
+@@global.wsrep_dirty_reads
+0
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+0
+
+# global scope and valid values
+SET @@global.wsrep_dirty_reads=OFF;
+SELECT @@global.wsrep_dirty_reads;
+@@global.wsrep_dirty_reads
+0
+SET @@global.wsrep_dirty_reads=ON;
+SELECT @@global.wsrep_dirty_reads;
+@@global.wsrep_dirty_reads
+1
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+0
+SET @@global.wsrep_dirty_reads=default;
+SELECT @@global.wsrep_dirty_reads;
+@@global.wsrep_dirty_reads
+0
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+0
+
+# local (session) scope and valid values
+SET @@session.wsrep_dirty_reads=OFF;
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+0
+SET @@session.wsrep_dirty_reads=ON;
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+1
+SET @@session.wsrep_dirty_reads=default;
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+0
+
+# invalid values
+SET @@session.wsrep_dirty_reads=NULL;
+ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'NULL'
+SET @@session.wsrep_dirty_reads='junk';
+ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'junk'
+
+# restore the initial values
+SET @@session.wsrep_dirty_reads = @wsrep_dirty_reads_session_saved;
+SET @@global.wsrep_dirty_reads = @wsrep_dirty_reads_global_saved;
+# End of test
index c2725281bb76ef104715220562bb6e7fafd42646..90f977e94c73272a289c5e1dc2beb81697f1695a 100644 (file)
@@ -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-wsrep-5.6/mysql-test/suite/sys_vars/t/avoid_temporal_upgrade_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/avoid_temporal_upgrade_basic.test
new file mode 100644 (file)
index 0000000..911b729
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# Show the global value;
+#
+SELECT @@global.avoid_temporal_upgrade;
+SHOW GLOBAL VARIABLES LIKE 'avoid_temporal_upgrade';
+SELECT * FROM information_schema.global_variables WHERE variable_name='avoid_temporal_upgrade';
+
+--echo #It is not a session variable.
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.avoid_temporal_upgrade;
+SHOW SESSION VARIABLES LIKE 'avoid_temporal_upgrade';
+SELECT * FROM information_schema.session_variables WHERE variable_name='avoid_temporal_upgrade';
+--error ER_GLOBAL_VARIABLE
+SET SESSION avoid_temporal_upgrade= ON;
+
+--echo #Test setting the variable to various values.
+
+--echo #Boolean values.
+SET GLOBAL avoid_temporal_upgrade= ON;
+SELECT @@global.avoid_temporal_upgrade;
+
+SET GLOBAL avoid_temporal_upgrade= OFF;
+SELECT @@global.avoid_temporal_upgrade;
+
+SET GLOBAL avoid_temporal_upgrade= 1;
+SELECT @@global.avoid_temporal_upgrade;
+
+SET GLOBAL avoid_temporal_upgrade= 0;
+SELECT @@global.avoid_temporal_upgrade;
+
+--echo #Test for DEFAULT value.
+SET GLOBAL avoid_temporal_upgrade= DEFAULT;
+SELECT @@global.avoid_temporal_upgrade;
+
+--echo #Test for invalid value.
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL avoid_temporal_upgrade= 2;
+
+--echo #Test for invalid statement for setting the 
+--echo #global variable.
+--error ER_GLOBAL_VARIABLE
+SET avoid_temporal_upgrade= 1;
+
+--echo #Fetches the current global value for the variable.
+SELECT @@avoid_temporal_upgrade;
index 4883920a8def79b0f61eb5800220f4c2f929792f..fd6e7ad480d23dc9f8e1be8f8f9abb1865098810 100644 (file)
@@ -9,8 +9,6 @@
 #  Do not use any TAB characters for whitespace.
 #
 ##############################################################################
-transaction_prealloc_size_basic_32  : Bug#11748572
-transaction_prealloc_size_basic_64  : Bug#11748572
 query_cache_size_basic_32           : Bug#13535584
 query_cache_size_basic_64           : Bug#11748572
 #thread_cache_size_func             : Bug#11750172: 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test
new file mode 100644 (file)
index 0000000..9f41cb7
--- /dev/null
@@ -0,0 +1,13 @@
+--source include/have_innodb.inc
+--source include/have_numa.inc
+
+SELECT @@GLOBAL.innodb_numa_interleave;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_numa_interleave=off;
+
+SELECT @@GLOBAL.innodb_use_native_aio;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_use_native_aio;
+
index 9ffc7007bebcc7a69ca255136143ccc3869f7455..0d60d341a41e92a7859014b83614cf805b7ad067 100644 (file)
@@ -1,16 +1,16 @@
-#
-# Basic test for innodb_page_size
-#
-
--- source include/have_innodb.inc
-
-# Check the default value
-SET @orig = @@global.innodb_page_size;
---replace_result 16384 {valid_page_size} 8192 {valid_page_size} 4096 {valid_page_size}
-SELECT @orig;
-
-# Confirm that we can not change the value
--- error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET GLOBAL innodb_page_size = 4k;
--- error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET GLOBAL innodb_page_size = 8k;
+#\r
+# Basic test for innodb_page_size\r
+#\r
+\r
+-- source include/have_innodb.inc\r
+\r
+# Check the default value\r
+SET @orig = @@global.innodb_page_size;\r
+--replace_result 16384 {valid_page_size} 8192 {valid_page_size} 4096 {valid_page_size}\r
+SELECT @orig;\r
+\r
+# Confirm that we can not change the value\r
+-- error ER_INCORRECT_GLOBAL_LOCAL_VAR\r
+SET GLOBAL innodb_page_size = 4k;\r
+-- error ER_INCORRECT_GLOBAL_LOCAL_VAR\r
+SET GLOBAL innodb_page_size = 8k;\r
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test
new file mode 100644 (file)
index 0000000..2f9da41
--- /dev/null
@@ -0,0 +1,43 @@
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_tmpdir;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@session.innodb_tmpdir;
+
+show global variables like 'innodb_tmpdir';
+show session variables like 'innodb_tmpdir';
+
+select * from information_schema.global_variables where variable_name='innodb_tmpdir';
+select * from information_schema.session_variables where variable_name='innodb_tmpdir';
+#
+# Show that it is writable
+#
+
+set global innodb_tmpdir=@@global.tmpdir;
+set session innodb_tmpdir=@@global.tmpdir;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_tmpdir=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_tmpdir=1e1;
+
+#
+# path len more than 512
+#
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_tmpdir=repeat('a',1000);
+show warnings;
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_tmpdir = @start_global_value;
+SELECT @@global.innodb_tmpdir;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/max_digest_length_basic-master.opt b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/max_digest_length_basic-master.opt
new file mode 100644 (file)
index 0000000..5a68113
--- /dev/null
@@ -0,0 +1 @@
+--max-digest-length=123
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/max_digest_length_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/max_digest_length_basic.test
new file mode 100644 (file)
index 0000000..e13c8c8
--- /dev/null
@@ -0,0 +1,32 @@
+
+#
+# Only global
+#
+
+select @@global.max_digest_length;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.max_digest_length;
+
+show global variables like 'max_digest_length';
+
+show session variables like 'max_digest_length';
+
+--disable_warnings
+select * from information_schema.global_variables
+  where variable_name='max_digest_length';
+
+select * from information_schema.session_variables
+  where variable_name='max_digest_length';
+--enable_warnings
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global max_digest_length=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session max_digest_length=1;
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic-master.opt b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic-master.opt
new file mode 100644 (file)
index 0000000..a215946
--- /dev/null
@@ -0,0 +1 @@
+--performance-schema-max-digest-length=123
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test
new file mode 100644 (file)
index 0000000..dcc65ca
--- /dev/null
@@ -0,0 +1,34 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_max_digest_length;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.max_digest_length;
+
+show global variables like 'performance_schema_max_digest_length';
+
+show session variables like 'performance_schema_max_digest_length';
+
+--disable_warnings
+select * from information_schema.global_variables
+  where variable_name='performance_schema_max_digest_length';
+
+select * from information_schema.session_variables
+  where variable_name='performance_schema_max_digest_length';
+--enable_warnings
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_max_digest_length=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_max_digest_length=1;
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/show_old_temporals_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/show_old_temporals_basic.test
new file mode 100644 (file)
index 0000000..0c558be
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Show the session value;
+#
+SELECT @@session.show_old_temporals;
+SHOW SESSION VARIABLES LIKE 'show_old_temporals';
+SELECT * FROM information_schema.session_variables WHERE variable_name='show_old_temporals';
+
+--echo #Also can be set as a global variable.
+SELECT @@global.show_old_temporals;
+SHOW GLOBAL VARIABLES LIKE 'show_old_temporals';
+SELECT * FROM information_schema.global_variables WHERE variable_name='show_old_temporals';
+
+--echo #Test setting the variable to various values.
+--echo #Boolean values.
+SET SESSION show_old_temporals= ON;
+SELECT @@session.show_old_temporals;
+
+SET SESSION show_old_temporals= OFF;
+SELECT @@session.show_old_temporals;
+
+SET SESSION show_old_temporals= 1;
+SELECT @@session.show_old_temporals;
+
+SET SESSION show_old_temporals= 0;
+SELECT @@session.show_old_temporals;
+
+--echo #Test for DEFAULT value.
+SET SESSION show_old_temporals= DEFAULT;
+SELECT @@session.show_old_temporals;
+
+--echo #Test for invalid value.
+--error ER_WRONG_VALUE_FOR_VAR
+SET SESSION show_old_temporals= 2;
+
+--echo #Test for setting the session variable
+--echo #using different syntax.
+SET show_old_temporals= 1;
+
+--echo #Fetches the current session value for the variable.
+SELECT @@show_old_temporals;
+
+--echo #cleanup
+SET SESSION show_old_temporals= DEFAULT;
+
+--echo #Test setting the global value of the variable.
+--echo #Boolean values.
+SET GLOBAL show_old_temporals= ON;
+SELECT @@global.show_old_temporals;
+
+SET GLOBAL show_old_temporals= OFF;
+SELECT @@global.show_old_temporals;
+
+SET GLOBAL show_old_temporals= 1;
+SELECT @@global.show_old_temporals;
+
+SET GLOBAL show_old_temporals= 0;
+SELECT @@session.show_old_temporals;
+
+--echo #Test for DEFAULT value.
+SET GLOBAL show_old_temporals= DEFAULT;
+SELECT @@global.show_old_temporals;
+
+--echo #Test for invalid value.
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL show_old_temporals= 2;
similarity index 93%
rename from mysql-wsrep-5.6/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
rename to mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test
index 4a69bbcdb011093c5e63c4d8cf652a41a8ca54a3..57325815877b5e2058bdd1c33485908561acb2b4 100644 (file)
@@ -5,7 +5,7 @@
 # Access Type: Dynamic                                                        #
 # Data Type: numeric                                                          #
 # Default Value: 8192                                                         #
-# Range: 1024-4294967295                                                      #
+# Range: 1024-131072                                                          #
 #                                                                             #
 #                                                                             #
 # Creation Date: 2008-02-14                                                   #
@@ -80,18 +80,12 @@ SELECT @@global.transaction_alloc_block_size;
 SET @@global.transaction_alloc_block_size = 60020;
 SELECT @@global.transaction_alloc_block_size;
 
-SET @@global.transaction_alloc_block_size = 4294967295;
-SELECT @@global.transaction_alloc_block_size;
-
 --echo '#--------------------FN_DYNVARS_005_04-------------------------#'
 ###################################################################
 # Change the value of variable to a valid value for SESSION Scope #
 ###################################################################
-SET @@session.transaction_alloc_block_size = 1024;
-SELECT @@session.transaction_alloc_block_size;
 
-SET @@session.transaction_alloc_block_size =4294967295;
+SET @@session.transaction_alloc_block_size = 1024;
 SELECT @@session.transaction_alloc_block_size;
 
 SET @@session.transaction_alloc_block_size = 65535;
@@ -110,7 +104,7 @@ SET @@global.transaction_alloc_block_size = -1024;
 SELECT @@global.transaction_alloc_block_size;
 
 
-SET @@global.transaction_alloc_block_size = 123456789201;
+SET @@global.transaction_alloc_block_size = 135217728;
 SELECT @@global.transaction_alloc_block_size;
 
 -- Error ER_WRONG_TYPE_FOR_VAR
@@ -136,7 +130,7 @@ SET @@global.transaction_alloc_block_size ="Test";
 SET @@global.transaction_alloc_block_size = 1000;
 SELECT @@global.transaction_alloc_block_size;
 
-SET @@session.transaction_alloc_block_size = 12345678901;
+SET @@session.transaction_alloc_block_size = 135217728;
 SELECT @@session.transaction_alloc_block_size;
 
 -- Error ER_WRONG_TYPE_FOR_VAR
@@ -165,8 +159,8 @@ SET @@session.transaction_alloc_block_size = 'test';
 ####################################################################
 
 
-SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='transaction_alloc_block_size';
 
 --echo '#------------------FN_DYNVARS_005_07-----------------------#'
@@ -174,8 +168,8 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size';
 #  Check if the value in SESSION Table matches value in variable   #
 ####################################################################
 
-SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='transaction_alloc_block_size';
 
 
@@ -185,9 +179,9 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size';
 ###########################################################################
 
 SET @@transaction_alloc_block_size = 1024;
-SET @@global.transaction_alloc_block_size = 4294967295;
+SET @@global.transaction_alloc_block_size = 134217728;
 SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
+
 
 --echo '#---------------------FN_DYNVARS_001_09----------------------#'
 ########################################################################
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test
deleted file mode 100644 (file)
index b9fbf42..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
-
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test
deleted file mode 100644 (file)
index fb68245..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
-
similarity index 94%
rename from mysql-wsrep-5.6/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc
rename to mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test
index 56c931636212b12e52dc4079846ea103df1bca01..24fb6bc562e0de75faef95b528c628eb1667cc77 100644 (file)
@@ -5,7 +5,7 @@
 # Access Type: Dynamic                                                        #
 # Data Type: numeric                                                          #
 # Default Value: 4096                                                         #
-# Range:                                                                      #
+# Range: 1024-131072                                                          #
 #                                                                             #
 #                                                                             #
 # Creation Date: 2008-02-14                                                   #
@@ -75,20 +75,14 @@ SELECT @@global.transaction_prealloc_size;
 SET @@global.transaction_prealloc_size = 60020;
 SELECT @@global.transaction_prealloc_size;
 
-SET @@global.transaction_prealloc_size = 4294966272;
-SELECT @@global.transaction_prealloc_size;
-
-
 --echo '#--------------------FN_DYNVARS_005_04-------------------------#'
 ###################################################################
 # Change the value of variable to a valid value for SESSION Scope #
 ###################################################################
+
 SET @@session.transaction_prealloc_size = 1024;
 SELECT @@session.transaction_prealloc_size;
 
-SET @@session.transaction_prealloc_size =4294966272;
-SELECT @@session.transaction_prealloc_size;
 SET @@session.transaction_prealloc_size = 65535;
 SELECT @@session.transaction_prealloc_size;
 
@@ -144,7 +138,7 @@ SELECT @@session.transaction_prealloc_size;
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@session.transaction_prealloc_size = "Test";
 
-SET @@session.transaction_prealloc_size = 123456789031;
+SET @@session.transaction_prealloc_size = 135217728;
 SELECT @@session.transaction_prealloc_size;
 
 
@@ -154,8 +148,8 @@ SELECT @@session.transaction_prealloc_size;
 ####################################################################
 
 
-SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='transaction_prealloc_size';
 
 --echo '#------------------FN_DYNVARS_005_07-----------------------#'
@@ -163,8 +157,8 @@ WHERE VARIABLE_NAME='transaction_prealloc_size';
 #  Check if the value in SESSION Table matches value in variable   #
 ####################################################################
 
-SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='transaction_prealloc_size';
 
 
@@ -179,7 +173,7 @@ SET @@global.transaction_prealloc_size = 1024;
 SET @@global.transaction_prealloc_size = 10;
 
 SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
+
 
 --echo '#---------------------FN_DYNVARS_001_10----------------------#'
 ########################################################################
@@ -222,4 +216,3 @@ SELECT @@session.transaction_prealloc_size;
 #############################################################
 #                 END OF transaction_prealloc_size TESTS     #
 #############################################################
-
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test
deleted file mode 100644 (file)
index 23ea533..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/transaction_prealloc_size_basic.inc
-
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test
deleted file mode 100644 (file)
index 79a1858..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/transaction_prealloc_size_basic.inc
-
diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test
new file mode 100644 (file)
index 0000000..cbc7656
--- /dev/null
@@ -0,0 +1,47 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_dirty_reads
+--echo #
+
+--echo # save the initial value
+SET @wsrep_dirty_reads_session_saved = @@session.wsrep_dirty_reads;
+SET @wsrep_dirty_reads_global_saved = @@global.wsrep_dirty_reads;
+
+--echo # default
+SELECT @@global.wsrep_dirty_reads;
+SELECT @@session.wsrep_dirty_reads;
+
+--echo
+--echo # global scope and valid values
+SET @@global.wsrep_dirty_reads=OFF;
+SELECT @@global.wsrep_dirty_reads;
+SET @@global.wsrep_dirty_reads=ON;
+SELECT @@global.wsrep_dirty_reads;
+SELECT @@session.wsrep_dirty_reads;
+SET @@global.wsrep_dirty_reads=default;
+SELECT @@global.wsrep_dirty_reads;
+SELECT @@session.wsrep_dirty_reads;
+
+--echo
+--echo # local (session) scope and valid values
+SET @@session.wsrep_dirty_reads=OFF;
+SELECT @@session.wsrep_dirty_reads;
+SET @@session.wsrep_dirty_reads=ON;
+SELECT @@session.wsrep_dirty_reads;
+SET @@session.wsrep_dirty_reads=default;
+SELECT @@session.wsrep_dirty_reads;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.wsrep_dirty_reads=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.wsrep_dirty_reads='junk';
+
+--echo
+--echo # restore the initial values
+SET @@session.wsrep_dirty_reads = @wsrep_dirty_reads_session_saved;
+SET @@global.wsrep_dirty_reads = @wsrep_dirty_reads_global_saved;
+
+--echo # End of test
diff --git a/mysql-wsrep-5.6/mysql-test/suite/wsrep/my.cnf b/mysql-wsrep-5.6/mysql-test/suite/wsrep/my.cnf
new file mode 100644 (file)
index 0000000..81e22a5
--- /dev/null
@@ -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
+
index b294bf013bebd83d04b0118e342fbb32ac43112f..2ebf990a58a9de2f07bcad0e60a203cab937783f 100644 (file)
@@ -1617,3 +1617,505 @@ CREATE TABLE time_zone (dummy int) ENGINE=merge;
 CREATE TABLE help_topic (dummy int) ENGINE=innodb;
 use test;
 --echo # End of Bug#11815557
+
+
+--echo #
+--echo # BUG#17246318 - ALTER TABLE SHOULD NOT ALLOW CREATION OF TABLES
+--echo #                WITH BOTH 5.5 AND 5.6 TEMPORALS
+--echo #
+
+--echo # BUG 18985760 -"FAST" ALTER TABLE CHANGE ON ENUM COLUMN 
+--echo #                TRIGGERS FULL TABLE REBUILD.
+--echo # Test for the case where 'avoid_temporal_upgrade' is set
+--echo # to the DEFAULT value(OFF).
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+--copy_file std_data/55_temporal.frm $MYSQLD_DATADIR/test/t1.frm
+--copy_file std_data/55_temporal.MYD $MYSQLD_DATADIR/test/t1.MYD
+--copy_file std_data/55_temporal.MYI $MYSQLD_DATADIR/test/t1.MYI
+
+ALTER TABLE t1 ENGINE= INNODB;
+
+--echo #ALTER operations using INPLACE algorithm is disallowed
+--echo #since the table contains old temporal type.
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 ADD COLUMN fld4 TIMESTAMP, ALGORITHM= INPLACE;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 ADD COLUMN fld4 TIMESTAMP FIRST, ALGORITHM= INPLACE;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 ADD COLUMN fld4 TIMESTAMP AFTER f_timestamp, ALGORITHM= INPLACE;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 CHANGE COLUMN f_time fld4 TIMESTAMP, ALGORITHM= INPLACE;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 MODIFY f_datetime TIME, ALGORITHM= INPLACE;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 ADD INDEX index1(f_datetime), ALGORITHM= INPLACE;
+
+--echo #ALTER operations using COPY algorithm is allowed
+--echo #when the table contains old temporal type.
+
+--echo #Note: Timestamp encoding remains the same for the non-fractional part
+--echo #even in the 5.6 format. Hence there is no change in the display before
+--echo #and after upgrade.
+
+--echo #ADD COLUMN upgrades the old temporal type.
+#Setup table having 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;
+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;
+DROP TABLE t2;
+
+--echo #ADD COLUMN FIRST upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 ADD COLUMN fld4 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;
+DROP TABLE t2;
+
+--echo #ADD COLUMN AFTER upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 ADD COLUMN fld4 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;
+DROP TABLE t2;
+
+--echo #CHANGE COLUMN upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 CHANGE COLUMN f_timestamp fld4 TIMESTAMP, ALGORITHM= COPY;
+SELECT f_time, f_datetime, fld4, HEX(WEIGHT_STRING(f_time)),
+       HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(fld4)) FROM t2;
+DROP TABLE t2;
+
+--echo #MODIFY COLUMN upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 MODIFY f_timestamp TIME, 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;
+DROP TABLE t2;
+
+--echo #ADD INDEX upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 ADD INDEX index1(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;
+DROP TABLE t2;
+
+--echo #ALTER operations using DEFAULT algorithm is allowed
+--echo #when the table contains old temporal type.
+
+--echo #ADD COLUMN upgrades the old temporal type.
+#Setup table having 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;
+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;
+DROP TABLE t2;
+
+--echo #ADD COLUMN FIRST upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 ADD COLUMN fld4 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;
+DROP TABLE t2;
+
+--echo #ADD COLUMN AFTER upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 ADD COLUMN fld4 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;
+DROP TABLE t2;
+
+--echo #CHANGE COLUMN upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 CHANGE COLUMN f_timestamp fld4 DATETIME, ALGORITHM= DEFAULT;
+SELECT f_time, f_datetime, fld4, HEX(WEIGHT_STRING(f_time)),
+       HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(fld4)) FROM t2;
+DROP TABLE t2;
+
+--echo #MODIFY COLUMN upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 MODIFY f_timestamp TIME, 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;
+DROP TABLE t2;
+
+--echo #ADD INDEX upgrades the old temporal type.
+#Setup table having 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;
+ALTER TABLE t2 ADD INDEX index1(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;
+DROP TABLE t2;
+
+--echo #ALTER TABLE FORCE upgrades the old temporal types.
+#Setup table having 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;
+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;
+DROP TABLE t2;
+
+--echo #Examples where the NOT NULL/NULL FLAG and DEFAULT values are retained
+--echo #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');
+
+--echo #Before upgrade.
+SHOW CREATE TABLE t2;
+ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP, ALGORITHM= COPY;
+--echo #After upgrade.
+SHOW CREATE TABLE t2;
+
+--echo #Examples of the Alter operation which does not upgrade
+--echo #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;
+
+ALTER TABLE t1 DROP COLUMN f_timestamp;
+SELECT f_time, f_datetime, HEX(WEIGHT_STRING(f_time)),
+       HEX(WEIGHT_STRING(f_datetime)) FROM t1;
+
+RENAME TABLE t1 to t3;
+SELECT f_time, f_datetime, HEX(WEIGHT_STRING(f_time)),
+              HEX(WEIGHT_STRING(f_datetime)) FROM t3;
+
+--echo #Once the old temporal type is upgraded to new temporal type,
+--echo #ADD/CHANGE COLUMN, ADD INDEX operations succeed using INPLACE
+--echo #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;
+
+--echo #Cleanup
+DROP TABLE t2, t3;
+
+
+--echo #
+--echo # BUG 18985760 -"FAST" ALTER TABLE CHANGE ON ENUM COLUMN 
+--echo #                TRIGGERS FULL TABLE REBUILD.
+--echo #   
+
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+--copy_file std_data/55_temporal.frm $MYSQLD_DATADIR/test/t1.frm
+--copy_file std_data/55_temporal.MYD $MYSQLD_DATADIR/test/t1.MYD
+--copy_file std_data/55_temporal.MYI $MYSQLD_DATADIR/test/t1.MYI
+
+--echo # To support INPLACE ALTER table operations later in the test.
+ALTER TABLE t1 ENGINE= INNODB;
+
+--echo #Test cases with the global variable 'avoid_temporal_upgrade'
+--echo #enabled.
+
+SET @save_avoid_temporal_upgrade= @@global.avoid_temporal_upgrade;
+SET GLOBAL avoid_temporal_upgrade= ON;
+
+--echo #ALTER operations using INPLACE algorithm are allowed
+--echo #when the table contains old temporal type since
+--echo #the global variable 'avoid_temporal_upgrade' is
+--echo #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;
+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;
+
+SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+       HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2;
+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;
+
+SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+       HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2;
+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;
+
+SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+       HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2;
+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;
+DROP TABLE t2;
+
+--echo #ALTER operations using COPY algorithm are allowed
+--echo #when the table contains old temporal type and 
+--echo #does not upgrade the old temporal types.
+
+--echo #ADD COLUMN does not upgrade the old temporal type.
+#Setup table having 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;
+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;
+
+--echo #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;
+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;
+
+--echo #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;
+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;
+
+--echo #CHANGE COLUMN upgrades the old temporal type only for the column which
+--echo #is changed.
+#Setup table having 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;
+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;
+
+--echo #MODIFY COLUMN upgrades the old temporal type only for the column
+--echo #modified.
+SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+       HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2;
+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;
+
+--echo #ADD INDEX does not upgrade the old temporal type.
+#Setup table having 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;
+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;
+DROP TABLE t2;
+
+--echo #ALTER operations using DEFAULT algorithm are allowed
+--echo #when the table contains old temporal type and does not
+--echo #upgrade the old temporal types.
+
+--echo #ADD COLUMN does not upgrade the old temporal type.
+#Setup table having 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;
+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;
+
+--echo #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;
+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;
+
+--echo #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;
+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;
+
+--echo #CHANGE COLUMN upgrades the old temporal type only for the column which
+--echo #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;
+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;
+
+--echo #MODIFY COLUMN upgrades the old temporal type only for the column
+--echo #modified.
+SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)),
+       HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2;
+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;
+
+--echo #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;
+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;
+DROP TABLE t2;
+
+--echo #ALTER TABLE FORCE does not upgrade the old temporal types.
+#Setup table having 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;
+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;
+DROP TABLE t2;
+
+SET @@global.avoid_temporal_upgrade= @save_avoid_temporal_upgrade;
+
+--echo #Test cases with the session variable 'show_old_temporals'
+--echo #enabled.
+
+--echo #Setup
+CREATE TABLE t2(fld1 time, fld2 datetime, fld3 timestamp);
+SET @save_show_old_temporals= @@session.show_old_temporals;
+SET SESSION show_old_temporals= ON;
+
+--echo #Displays a comment to indicate that the columns are of 5.5
+--echo #binary format
+SHOW CREATE TABLE t1;
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+
+--echo #Since the temporal types are in new format, no comment is 
+--echo #displayed
+SHOW CREATE TABLE t2;
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t2';
+
+--echo #Does not display the comment for table with old temporal types 
+--echo #since the session variable 'show_old_temporals' is OFF.
+SET SESSION show_old_temporals= OFF;
+SHOW CREATE TABLE t1;
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+
+--echo #Cleanup
+SET @@session.show_old_temporals= @save_show_old_temporals;
+DROP TABLE t1, t2;
+
+
+--echo #
+--echo # Bug#21345391: ALTER TABLE ... CONVERT TO CHARACTER SET NOT EFFECT
+--echo #               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;
+
+--echo # Without fix, the CHARSET SET for table remains gbk.
+SHOW CREATE TABLE t1;
+
+let $test_dir =
+    `SELECT CONCAT(variable_value, 'test/') FROM
+     INFORMATION_SCHEMA.GLOBAL_VARIABLES
+     WHERE LOWER(variable_name) = 'datadir'`;
+
+--echo # Without fix, the temporary .frm file is not cleaned up.
+--list_files $test_dir `#sql-*.frm`
+
+DROP TABLE t1;
+
+--echo # Test cases added for coverage.
+
+--echo # Reports an error for tables containing datatypes supporting
+--echo # characters.
+
+CREATE TABLE t1 (fld1 CHAR(10) PRIMARY KEY) ENGINE = INNODB CHARACTER SET gbk;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 CONVERT TO CHARACTER SET UTF8, ALGORITHM = INPLACE;
+
+DROP TABLE t1;
+
+--echo # 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;
+
+let $test_dir =
+    `SELECT CONCAT(variable_value, 'test/') FROM
+     INFORMATION_SCHEMA.GLOBAL_VARIABLES
+     WHERE LOWER(variable_name) = 'datadir'`;
+
+--list_files $test_dir `#sql-*.frm`
+
+DROP TABLE t1;
index 8c3ba81f44449ad54ccbb671036720e2085fa4ce..10fb888ea06235edf6fe9a97547adcbb3776e753 100644 (file)
@@ -18,7 +18,7 @@ if(`SELECT CONVERT(@@version_compile_os USING latin1)
 let $expected_calls= 21;
 if(`SELECT $PS_PROTOCOL > 0`)
 {
-   let $expected_calls= 46;
+   let $expected_calls= 47;
 }
 if(`SELECT $SP_PROTOCOL > 0`)
 {
index 961d2aa64eb6755ec7bc2f4be4adaec0bb212b02..36f2e4960999f2fdff3c1a0636134544962d4ca2 100644 (file)
@@ -1,69 +1,69 @@
---source include/have_plugin_auth.inc
---source include/not_embedded.inc
---source include/master-slave.inc
-
-#
-# Check that replication slave can connect to master using an account
-# which authenticates with an external authentication plugin (bug#12897501).
-
-#
-# First stop the slave to guarantee that nothing is replicated.
-#
---connection slave
---echo [connection slave]
---source include/stop_slave.inc
-#
-# Create an replication account on the master.
-#
---connection master
---echo [connection master]
-CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
-GRANT REPLICATION SLAVE ON *.* TO plug_user;
-FLUSH PRIVILEGES;
-
-#
-# Now go to slave and change the replication user.
-#
---connection slave
---echo [connection slave]
---let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
+--source include/have_plugin_auth.inc\r
+--source include/not_embedded.inc\r
+--source include/master-slave.inc\r
+\r
+#\r
+# Check that replication slave can connect to master using an account\r
+# which authenticates with an external authentication plugin (bug#12897501).\r
+\r
+#\r
+# First stop the slave to guarantee that nothing is replicated.\r
+#\r
+--connection slave\r
+--echo [connection slave]\r
+--source include/stop_slave.inc\r
+#\r
+# Create an replication account on the master.\r
+#\r
+--connection master\r
+--echo [connection master]\r
+CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';\r
+GRANT REPLICATION SLAVE ON *.* TO plug_user;\r
+FLUSH PRIVILEGES;\r
+\r
+#\r
+# Now go to slave and change the replication user.\r
+#\r
+--connection slave\r
+--echo [connection slave]\r
+--let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)\r
 --replace_column 2 ####
-CHANGE MASTER TO 
-  MASTER_USER=     'plug_user',
-  MASTER_PASSWORD= 'plug_user',
-  MASTER_RETRY_COUNT= 0;
-
-#
-# Start slave with new replication account - this should trigger connection
-# to the master server.
-#
---source include/start_slave.inc
-
-# Replicate all statements executed on master, in this case,
-# (creation of the plug_user account).
-#
---connection master
---sync_slave_with_master
---echo # Slave in-sync with master now.
-
-SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
-
-#
-# Now we can stop the slave and clean up.
-#
-# Note: it is important that slave is stopped at this
-# moment - otherwise master's cleanup statements
-# would be replicated on slave!
-#
---echo # Cleanup (on slave).
---source include/stop_slave.inc
+CHANGE MASTER TO \r
+  MASTER_USER=     'plug_user',\r
+  MASTER_PASSWORD= 'plug_user',\r
+  MASTER_RETRY_COUNT= 0;\r
+\r
+#\r
+# Start slave with new replication account - this should trigger connection\r
+# to the master server.\r
+#\r
+--source include/start_slave.inc\r
+\r
+# Replicate all statements executed on master, in this case,\r
+# (creation of the plug_user account).\r
+#\r
+--connection master\r
+--sync_slave_with_master\r
+--echo # Slave in-sync with master now.\r
+\r
+SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';\r
+\r
+#\r
+# Now we can stop the slave and clean up.\r
+#\r
+# Note: it is important that slave is stopped at this\r
+# moment - otherwise master's cleanup statements\r
+# would be replicated on slave!\r
+#\r
+--echo # Cleanup (on slave).\r
+--source include/stop_slave.inc\r
 --replace_column 2 ####
-eval CHANGE MASTER TO MASTER_USER='$master_user';
-DROP USER 'plug_user';
-
---echo # Cleanup (on master).
---connection master
-DROP USER 'plug_user';
-
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
+eval CHANGE MASTER TO MASTER_USER='$master_user';\r
+DROP USER 'plug_user';\r
+\r
+--echo # Cleanup (on master).\r
+--connection master\r
+DROP USER 'plug_user';\r
+\r
+--let $rpl_only_running_threads= 1\r
+--source include/rpl_end.inc\r
diff --git a/mysql-wsrep-5.6/mysql-test/t/connect_debug.test b/mysql-wsrep-5.6/mysql-test/t/connect_debug.test
new file mode 100644 (file)
index 0000000..77ecd03
--- /dev/null
@@ -0,0 +1,80 @@
+
+# This test makes no sense with the embedded server
+--source include/not_embedded.inc
+
+--source include/have_debug_sync.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo
+--echo # -- Bug#20201006: Spamming show processlist prevents old connection
+--echo # -- threads from cleaning up.
+
+--enable_connect_log
+SET @saved_max_connections = @@global.max_connections;
+SET GLOBAL max_connections = 2;
+
+--echo
+--echo # -- Check that we allow only max_connections + 1 connections here
+--connect (con_1, localhost, root)
+--connect (con_2, localhost, root)
+--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
+--error ER_CON_COUNT_ERROR
+--connect (con_3, localhost, root)
+
+--echo
+--echo # -- Ensure we have max_connections + 1 connections.
+SELECT count(*)= @@global.max_connections + 1 FROM information_schema.processlist;
+
+--echo
+--echo # -- Take LOCK_thd_remove and close one connection then
+--echo # attempt new one [should fail]...
+SET DEBUG_SYNC='fill_schema_processlist_after_copying_threads SIGNAL disconnect_connection WAIT_FOR continue';
+--send SELECT user FROM INFORMATION_SCHEMA.PROCESSLIST GROUP BY user;
+
+--connection default
+SET DEBUG_SYNC='now WAIT_FOR disconnect_connection';
+--disconnect con_1
+
+--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
+--error ER_CON_COUNT_ERROR
+--connect (con_3, localhost, root)
+
+--echo
+--echo # -- Release the lock. Now new connection should go through
+SET DEBUG_SYNC='now SIGNAL continue';
+--connection con_2
+reap;
+
+SET DEBUG_SYNC='RESET';
+
+--echo
+--echo # -- Waiting for connection to close...
+let $wait_condition =
+  SELECT COUNT(*) = 2
+  FROM information_schema.processlist;
+--source include/wait_condition.inc
+
+--connect (con_3, localhost, root)
+
+--echo
+--echo # -- Closing connections...
+--disconnect con_3
+--disconnect con_2
+--source include/wait_until_disconnected.inc
+
+--connection default
+
+--echo
+--echo # -- Resetting variables...
+SET GLOBAL max_connections= @saved_max_connections;
+
+--disable_connect_log
+
+--echo
+--echo # -- End of Bug#20201006.
+--echo
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
index 821b66832d79012d651520cfce146ba9edc5ac08..468a452c5205c91d9af258a47ce1120a9355917d 100644 (file)
@@ -1588,7 +1588,6 @@ SET NAMES utf8;
 SET NAMES utf8;
 CREATE TABLE t1 (a INT);
 INSERT INTO t1 VALUES (0), (0), (1), (0), (0);
---error ER_DUP_ENTRY
 SELECT COUNT(*) FROM t1, t1 t2 
 GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size));
 DROP TABLE t1;
index 2a2134da0dc94bf10c19c5d202481642577e9285..df7a854a9c7ca5c1465246b3e5748a6bbc657445 100644 (file)
@@ -17,3 +17,5 @@ log_tables-big           : Bug#11756699 2010-11-15 mattiasj report already exist
 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 : Galera mysql-wsrep#4 2014-10-28 pstoev main.file_contents MTR test fails in mysql-wsrep 
+bootstrap : Galera mysql-wsrep#19 2014-11-21 pstoev Crash in LOGGER::error_log_print when printing a WSREP message 
diff --git a/mysql-wsrep-5.6/mysql-test/t/enable_cleartext_plugin-master.opt b/mysql-wsrep-5.6/mysql-test/t/enable_cleartext_plugin-master.opt
new file mode 100644 (file)
index 0000000..3536d10
--- /dev/null
@@ -0,0 +1,2 @@
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
diff --git a/mysql-wsrep-5.6/mysql-test/t/enable_cleartext_plugin.test b/mysql-wsrep-5.6/mysql-test/t/enable_cleartext_plugin.test
new file mode 100644 (file)
index 0000000..e2ae35c
--- /dev/null
@@ -0,0 +1,65 @@
+--source include/have_plugin_auth.inc
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug #21235226 : THE --ENABLE-CLEARTEXT-PLUGIN IS NOT IMPLEMENTED
+--echo #                 IN ALL CLIENT PROGRAMS
+--echo #
+
+CREATE DATABASE db21235226;
+USE db21235226;
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1), (2);
+SELECT * FROM t1;
+
+CREATE USER uplain@localhost IDENTIFIED WITH 'cleartext_plugin_server'
+  AS 'cleartext_test';
+
+GRANT ALL PRIVILEGES ON *.* TO uplain@localhost;
+
+#Reset the LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN variable.
+let LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN=N;
+
+#Scenario 1 : MYSQL_DUMP without --enable_cleartext_plugin
+#             Should get CR_AUTH_PLUGIN_CANNOT_LOAD error
+--error 2
+--exec $MYSQL_DUMP --user=uplain --password=cleartext_test --tab=$MYSQLTEST_VARDIR/tmp/ db21235226 2>&1
+
+#Scenario 2 : MYSQL_DUMP with --enable_cleartext_plugin
+--exec $MYSQL_DUMP --enable_cleartext_plugin --user=uplain --password=cleartext_test --tab=$MYSQLTEST_VARDIR/tmp/ db21235226
+--exec $MYSQL --enable_cleartext_plugin --user=uplain --password=cleartext_test db21235226 < $MYSQLTEST_VARDIR/tmp/t1.sql
+SELECT * FROM t1;
+
+#Scenario 3 : MYSQL_IMPORT without --enable_cleartext_plugin
+#             Should get CR_AUTH_PLUGIN_CANNOT_LOAD error
+--replace_regex /.*mysqlimport(\.exe)*/mysqlimport/
+--error 1
+--exec $MYSQL_IMPORT --user=uplain --password=cleartext_test --silent db21235226 $MYSQLTEST_VARDIR/tmp/t1.txt 2>&1
+
+#Scenario 4 : MYSQL_IMPORT with --enable_cleartext_plugin
+--exec $MYSQL_IMPORT --enable_cleartext_plugin --user=uplain --password=cleartext_test --silent db21235226 $MYSQLTEST_VARDIR/tmp/t1.txt
+SELECT * FROM t1;
+
+#Scenario 5 : MYSQL_SHOW without --enable_cleartext_plugin
+#             Should get CR_AUTH_PLUGIN_CANNOT_LOAD error
+--replace_regex /.*mysqlshow(\.exe)*/mysqlshow/
+--error 1
+--exec $MYSQL_SHOW --user=uplain --password=cleartext_test db21235226 2>&1
+
+#Scenario 6 : MYSQL_SHOW with --enable_cleartext_plugin
+--exec $MYSQL_SHOW --enable_cleartext_plugin --user=uplain --password=cleartext_test db21235226
+
+#Scenario 7 : MYSQL_CHECK without --enable_cleartext_plugin
+#             Should get CR_AUTH_PLUGIN_CANNOT_LOAD error
+--replace_regex /.*mysqlcheck(\.exe)*/mysqlcheck/
+--error 2
+--exec $MYSQL_CHECK --user=uplain --password=cleartext_test db21235226 t1 2>&1
+
+#Scenario 8 : MYSQL_CHECK with --enable_cleartext_plugin
+--exec $MYSQL_CHECK --enable_cleartext_plugin --user=uplain --password=cleartext_test db21235226 t1
+
+#Cleanup
+DROP TABLE t1;
+DROP DATABASE db21235226;
+DROP USER uplain@localhost;
index 89e8f9ca7dc2d788637a35f788fbeb54fbb7fc94..bf5a356cee30837bd08c4ca1fcde6cae0fa4246e 100644 (file)
@@ -125,7 +125,7 @@ drop event existant;
 
 create table t_event3 (a int, b float);
 drop event if exists event3;
-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());
 let $wait_condition=SELECT count(*)=0 from t_event3;
 --source include/wait_condition.inc
 select count(*) from t_event3;
index 6cabd5f935b52e89dda15ec34f9ddf0104476ef6..8ed3a7a2bf2ce4370b20e1fcd96d3c5d00ea0733 100644 (file)
@@ -400,3 +400,25 @@ DROP TABLE t1, t2;
 --echo # End WL#4897
 
 --echo End of 6.0 tests.
+
+--echo #
+--echo # Bug #18899860: EXPLAIN .. SELECT .. FOR UPDATE TAKES LOCKS
+--echo #
+
+CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1),(2),(3);
+CONNECT (c1,localhost,root,,);
+CONNECT (c2,localhost,root,,);
+CONNECTION c1;
+START TRANSACTION;
+EXPLAIN SELECT * FROM t1 WHERE c1 = 1 FOR UPDATE;
+CONNECTION c2;
+START TRANSACTION;
+EXPLAIN SELECT * FROM t1 WHERE c1 = 1 FOR UPDATE;
+CONNECTION default;
+DISCONNECT c1;
+DISCONNECT c2;
+DROP TABLE t1;
+
+--echo # End of test for Bug#18899860
+
index 83b4347b9d16f5aec9d702a5bdc1b820f782f26e..7939c25d1f31cf5bd1fe9a5fdcf03b4722ce043f 100644 (file)
@@ -49,9 +49,9 @@ select grp,group_concat(c order by grp desc) from t1 group by grp order by grp;
 
 # Test transfer to real values
 
-select grp, group_concat(a separator "")+0 from t1 group by grp;
-select grp, group_concat(a separator "")+0.0 from t1 group by grp;
-select grp, ROUND(group_concat(a separator "")) from t1 group by grp;
+select grp, group_concat(a separator "")+0 from t1 group by grp;\r
+select grp, group_concat(a separator "")+0.0 from t1 group by grp;\r
+select grp, ROUND(group_concat(a separator "")) from t1 group by grp;\r
 drop table t1;
 
 # Test NULL values
index d520c3f439394bb9908332352a375002bff02b0b..03e2444e16a3993fa3e287137fd56c0f880c8a1a 100644 (file)
@@ -1723,6 +1723,16 @@ SELECT * FROM t1 WHERE a=to_base64('a');
 DROP TABLE t1;
 SET NAMES latin1;
 
+--echo #
+--echo # Bug #21056907: CONTENTS OF NOT REQUESTED CHAR/VARCHAR COLUMN ARE
+--echo #                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;
+SELECT id, insert(0x3a, 1, 0, d) FROM t1;
+DROP TABLE t1;
+
 --echo #
 --echo # End of 5.6 tests
 --echo #
diff --git a/mysql-wsrep-5.6/mysql-test/t/func_str_debug.test b/mysql-wsrep-5.6/mysql-test/t/func_str_debug.test
new file mode 100644 (file)
index 0000000..c18d994
--- /dev/null
@@ -0,0 +1,14 @@
+--source include/have_debug_sync.inc
+
+--echo # 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/t/func_str_no_ps.test b/mysql-wsrep-5.6/mysql-test/t/func_str_no_ps.test
new file mode 100644 (file)
index 0000000..141317e
--- /dev/null
@@ -0,0 +1,26 @@
+# Some of the queries give different set of warnings with --ps-protocol
+if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
+{
+   --skip Need normal protocol
+}
+
+--echo #
+--echo # Bug#20315088 LCASE/LTRIM, SOURCE AND DESTINATION OVERLAP IN MEMCPY
+--echo #
+
+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'));
+do nullif(1,'-' between lcase(right(11111111," 7,]" ))and '1');
+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;
index 9d24aa660a03b941783f803b3c14e03d31f23350..5600263c45b7c2d9c2e9cdc9c3206b5b19c068a5 100644 (file)
@@ -1669,6 +1669,9 @@ use test;
 #
 # Bug#16470 crash on grant if old grant tables
 #
+
+call mtr.add_suppression("Can't open and lock privilege tables");
+
 --echo FLUSH PRIVILEGES without procs_priv table.
 RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
 --error ER_NO_SUCH_TABLE
index 3d355f79b8b3f8d8a55a778d09006e4e7b881bbc..86bf27857300760bc6d379b87b7bee234b2e6d8a 100644 (file)
@@ -1288,3 +1288,27 @@ SET optimizer_trace=DEFAULT;
 SET end_markers_in_json=DEFAULT;
 
 DROP TABLE t;
+
+--echo #
+--echo # Bug#18109609: LOOSE INDEX SCAN IS NOT USED WHEN IT SHOULD
+--echo #
+
+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;
+FLUSH STATUS;
+SELECT MAX(c2), c1 FROM t1 WHERE c1 = 4 GROUP BY c1;
+SHOW SESSION STATUS LIKE 'Handler_read%';
+
+DROP TABLE t1;
+
+--echo # End of test for Bug#18109609
index 83475a3a25e686fa835697e8a9d4c40eca1edc1e..f13fa1437a2b770d8cd98ec9737f97ba65cd8b8d 100644 (file)
@@ -688,4 +688,58 @@ HAVING min_pk <= 10;
 --echo
 DROP TABLE t1;
 
+
+--echo #
+--echo # Bug#17055185: WRONG RESULTS WHEN RUNNING A SELECT THAT INCLUDE
+--echo #               A HAVING BASED ON A FUNCTION.
+--echo #
+
+# Generate series 1, 0, 1, 0....
+CREATE TABLE series (
+  val INT(10) UNSIGNED NOT NULL
+);
+INSERT INTO series VALUES(1);
+
+DELIMITER |;
+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;
+|
+DELIMITER ;|
+
+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;
+SELECT t, next_seq_value() r FROM t1 FORCE INDEX(t)
+       GROUP BY t HAVING r = 1  ORDER BY t1.u;
+
+# For below tests Item_refs still refer to items0 ref_array. Expexted to
+# produce wrong results.
+SELECT DISTINCT t1.t, next_seq_value() r  FROM t1, t1 P
+       WHERE P.t = t1.t HAVING r = 1 ORDER BY t1.u;
+
+# Prepare statement.
+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;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+# Loose-index scan.
+INSERT INTO t1 SELECT * FROM t1;
+ALTER TABLE t1 ADD KEY(t, u);
+ANALYZE TABLE t1;
+SELECT next_seq_value() r, MIN(u) FROM t1 GROUP BY t HAVING r = 1;
+
+# Cleanup
+DROP TABLE t1;
+DROP FUNCTION next_seq_value;
+DROP TABLE series;
+
 --echo End of 5.6 tests
index 14f99207dc4123043d10c982e9b60ae7514afd37..35c82321395ca3ae990202e2f64606e1fa92a301 100644 (file)
@@ -550,3 +550,44 @@ INSERT IGNORE t1 (a, a) SELECT 1,1;
 INSERT IGNORE t1 (a, a) SELECT 1,1 UNION SELECT 2,2;
 
 DROP TABLE t1;
+
+
+--echo #
+--echo # BUG#22037930: INSERT IGNORE FAILS TO IGNORE
+--echo #               FOREIGN KEY CONSTRAINT
+
+--echo # 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);
+
+--echo # Without fix, an error is reported.
+--enable_warnings
+INSERT IGNORE INTO t2 VALUES(1);
+UPDATE IGNORE t2 SET fld2=20 WHERE fld2=0;
+UPDATE IGNORE t1 SET fld1=20 WHERE fld1=0;
+
+--echo # Test for multi update.
+UPDATE IGNORE t1, t2 SET t2.fld2= t2.fld2 + 3;
+UPDATE IGNORE t1, t2 SET t1.fld1= t1.fld1 + 3;
+--disable_warnings
+
+--echo # Reports an error since IGNORE is not used.
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO t2 VALUES(1);
+
+--error ER_NO_REFERENCED_ROW_2
+UPDATE t2 SET fld2=20 WHERE fld2=0;
+
+--error ER_ROW_IS_REFERENCED_2
+UPDATE t1 SET fld1=20 WHERE fld1=0;
+
+--error ER_NO_REFERENCED_ROW_2
+UPDATE t1, t2 SET t2.fld2= t2.fld2 + 3;
+
+--error ER_ROW_IS_REFERENCED_2
+UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3;
+
+DROP TABLE t2, t1;
index 6faf712b6ce88d2c0c7154793bd0a6063ea2bf6a..93e6e82189f064adb4a22dd0550560cc17c27e45 100644 (file)
@@ -116,3 +116,17 @@ LOAD XML INFILE '../../std_data/loadxml.dat' INTO TABLE t1
 ROWS IDENTIFIED BY '<row>' (a,@b) SET b=concat('!',@b);
 SELECT * FROM t1 ORDER BY a;
 DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#16171518 LOAD XML DOES NOT HANDLE EMPTY ELEMENTS
+--echo #
+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;
+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;
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/t/log_empty_name.opt b/mysql-wsrep-5.6/mysql-test/t/log_empty_name.opt
new file mode 100644 (file)
index 0000000..c002447
--- /dev/null
@@ -0,0 +1,2 @@
+--general-log-file=
+--slow-query-log-file=
diff --git a/mysql-wsrep-5.6/mysql-test/t/log_empty_name.test b/mysql-wsrep-5.6/mysql-test/t/log_empty_name.test
new file mode 100644 (file)
index 0000000..e1b1a3a
--- /dev/null
@@ -0,0 +1,7 @@
+--echo # --
+--echo # -- Bug#19392264: SERVER CRASH WHEN SPECIFYING EMPTY --GENERAL-LOG-FILE
+--echo # --               OPTION
+--echo # --
+
+--echo # Before fix, server should crash. After fix server has to start
+--echo # successfully with the options provided in general_log-master.opt file.
diff --git a/mysql-wsrep-5.6/mysql-test/t/lowercase_fs_on.test b/mysql-wsrep-5.6/mysql-test/t/lowercase_fs_on.test
new file mode 100644 (file)
index 0000000..6da3ef3
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Specific tests for case-insensitive file systems
+# i.e. lower_case_filesystem=ON
+#
+-- source include/have_case_insensitive_file_system.inc
+# Embedded server does not support restarting.
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS
+--echo #
+
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
+
+--error 0,1
+--remove_file $SEARCH_FILE
+
+#Shutdown the server
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+#Start the server with --lower_case_table_names=0 in Windows.
+--enable_reconnect
+--error 1
+--exec $MYSQLD_CMD --lower_case_table_names=0 > $SEARCH_FILE  2>&1
+
+#Search for the error messege in the server error log.
+let SEARCH_PATTERN= \[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination\. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode\.;
+--source include/search_pattern_in_file.inc
+
+#Restart the server
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/wait_until_connected_again.inc
+
+#Cleanup
+--error 0,1
+--remove_file $SEARCH_FILE
diff --git a/mysql-wsrep-5.6/mysql-test/t/lowercase_table3-master.opt b/mysql-wsrep-5.6/mysql-test/t/lowercase_table3-master.opt
deleted file mode 100644 (file)
index 9b27aef..0000000
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
diff --git a/mysql-wsrep-5.6/mysql-test/t/lowercase_table3.test b/mysql-wsrep-5.6/mysql-test/t/lowercase_table3.test
deleted file mode 100644 (file)
index 7e27342..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Test of force of lower-case-table-names=0
-# (User has case insensitive file system and wants to preserve case of
-# table names)
-#
-
---source include/have_innodb.inc
---source include/have_lowercase0.inc
---source include/have_case_insensitive_file_system.inc
---source include/not_windows.inc
-
-call mtr.add_suppression("InnoDB: Cannot open table test/BUG29839 from");
-
---disable_warnings
-DROP TABLE IF EXISTS t1,T1;
---enable_warnings
-
-#
-# This is actually an error, but ok as the user has forced this
-# by using --lower-case-table-names=0
-CREATE TABLE t1 (a INT);
-SELECT * FROM T1;
-FLUSH TABLES;
-DROP TABLE t1;
-
-#
-# InnoDB should in this case be case sensitive
-# Note that this is not true on windows as no this OS, InnoDB is always
-# storing things in lower case.
-#
-
-CREATE TABLE bug29839 (a INT) ENGINE=INNODB;
---error ER_NO_SUCH_TABLE
-SELECT * FROM BUG29839;
-DROP TABLE bug29839;
-
-# End of 4.1 tests
index 0775d87fc9d364077e945efc7c2c1417954399af..783a4fcae517bf991274ec177ad08bbe34eaf034 100644 (file)
---source include/have_case_insensitive_file_system.inc
---source include/have_innodb.inc
-
---echo #
---echo # Bug#46941 crash with lower_case_table_names=2 and
---echo #           foreign data dictionary confusion
---echo #
-
-CREATE DATABASE XY;
-USE XY;
-
-#
-# Logs are disabled, since the number of creates tables
-# and subsequent select statements may vary between
-# versions
-#
---disable_query_log
---disable_result_log
-
+--source include/have_case_insensitive_file_system.inc\r
+--source include/have_innodb.inc\r
+\r
+--echo #\r
+--echo # Bug#46941 crash with lower_case_table_names=2 and\r
+--echo #           foreign data dictionary confusion\r
+--echo #\r
+\r
+CREATE DATABASE XY;\r
+USE XY;\r
+\r
+#\r
+# Logs are disabled, since the number of creates tables\r
+# and subsequent select statements may vary between\r
+# versions\r
+#\r
+--disable_query_log\r
+--disable_result_log\r
+\r
 let $tcs = `SELECT @@table_open_cache + 1`;
-
-let $i = $tcs;
-
-while ($i)
-{
-  eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, 
-                             primary key(a, b), unique(b)) ENGINE=InnoDB;
-  dec $i;
-}
-
-eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b), 
-                           ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b);
-                   
-eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b),
-                           ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a);
-let $i = $tcs;
-while ($i)
-{
-  eval SELECT * FROM XY.T_$i LIMIT 1;
-  dec $i;
-}
-
-DROP DATABASE XY;
-CREATE DATABASE XY;
-USE XY;
-eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, 
-                             PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB;
-#
-# The bug causes this SELECT to err
-eval SELECT * FROM XY.T_$tcs LIMIT 1;
-
---enable_query_log
---enable_result_log
-DROP DATABASE XY;
-USE TEST;
-
---echo #
---echo # Bug55222 Mysqldump table names case bug in REFERENCES clause
---echo # InnoDB did not handle lower_case_table_names=2 for
---echo # foreign_table_names and referenced_table_names.
---echo #
-
-SHOW VARIABLES LIKE 'lower_case_table_names';
-
---disable_warnings
-DROP TABLE IF EXISTS `Table2`;
-DROP TABLE IF EXISTS `Table1`;
---disable_warnings
-
-CREATE TABLE `Table1`(c1 INT PRIMARY KEY) ENGINE=InnoDB;
-CREATE TABLE `Table2`(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB;
-ALTER TABLE `Table2` ADD CONSTRAINT fk1 FOREIGN KEY(c2) REFERENCES `Table1`(c1);
-query_vertical SHOW CREATE TABLE `Table2`;
-query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
-DROP TABLE `Table2`;
-DROP TABLE `Table1`;
-
---disable_warnings
-DROP TABLE IF EXISTS Product_Order;
-DROP TABLE IF EXISTS Product;
-DROP TABLE IF EXISTS Customer;
---enable_warnings
-
-CREATE TABLE Product (Category INT NOT NULL, Id INT NOT NULL,
-       Price DECIMAL, PRIMARY KEY(Category, Id)) ENGINE=InnoDB;
-CREATE TABLE Customer (Id INT NOT NULL, PRIMARY KEY (Id)) ENGINE=InnoDB;
-CREATE TABLE Product_Order (No INT NOT NULL AUTO_INCREMENT,
-       Product_Category INT NOT NULL,
-       Product_Id INT NOT NULL,
-       Customer_Id INT NOT NULL,
-       PRIMARY KEY(No),
-       INDEX (Product_Category, Product_Id),
-       FOREIGN KEY (Product_Category, Product_Id)
-               REFERENCES Product(Category, Id) ON UPDATE CASCADE ON DELETE RESTRICT,
-       INDEX (Customer_Id),
-       FOREIGN KEY (Customer_Id)
-               REFERENCES Customer(Id)
-       ) ENGINE=INNODB;
-
-query_vertical SHOW CREATE TABLE Product_Order;
-query_vertical SHOW CREATE TABLE Product;
-query_vertical SHOW CREATE TABLE Customer;
-query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
-DROP TABLE Product_Order;
-DROP TABLE Product;
-DROP TABLE Customer;
-
+\r
+let $i = $tcs;\r
+\r
+while ($i)\r
+{\r
+  eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, \r
+                             primary key(a, b), unique(b)) ENGINE=InnoDB;\r
+  dec $i;\r
+}\r
+\r
+eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b), \r
+                           ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b);\r
+                   \r
+eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b),\r
+                           ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a);\r
\r
+let $i = $tcs;\r
+while ($i)\r
+{\r
+  eval SELECT * FROM XY.T_$i LIMIT 1;\r
+  dec $i;\r
+}\r
+\r
+DROP DATABASE XY;\r
+CREATE DATABASE XY;\r
+USE XY;\r
+eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, \r
+                             PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB;\r
+#\r
+# The bug causes this SELECT to err\r
+eval SELECT * FROM XY.T_$tcs LIMIT 1;\r
+\r
+--enable_query_log\r
+--enable_result_log\r
+DROP DATABASE XY;\r
+USE TEST;\r
+\r
+--echo #\r
+--echo # Bug55222 Mysqldump table names case bug in REFERENCES clause\r
+--echo # InnoDB did not handle lower_case_table_names=2 for\r
+--echo # foreign_table_names and referenced_table_names.\r
+--echo #\r
+\r
+SHOW VARIABLES LIKE 'lower_case_table_names';\r
+\r
+--disable_warnings\r
+DROP TABLE IF EXISTS `Table2`;\r
+DROP TABLE IF EXISTS `Table1`;\r
+--disable_warnings\r
+\r
+CREATE TABLE `Table1`(c1 INT PRIMARY KEY) ENGINE=InnoDB;\r
+CREATE TABLE `Table2`(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB;\r
+ALTER TABLE `Table2` ADD CONSTRAINT fk1 FOREIGN KEY(c2) REFERENCES `Table1`(c1);\r
+query_vertical SHOW CREATE TABLE `Table2`;\r
+query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;\r
+DROP TABLE `Table2`;\r
+DROP TABLE `Table1`;\r
+\r
+--disable_warnings\r
+DROP TABLE IF EXISTS Product_Order;\r
+DROP TABLE IF EXISTS Product;\r
+DROP TABLE IF EXISTS Customer;\r
+--enable_warnings\r
+\r
+CREATE TABLE Product (Category INT NOT NULL, Id INT NOT NULL,\r
+       Price DECIMAL, PRIMARY KEY(Category, Id)) ENGINE=InnoDB;\r
+CREATE TABLE Customer (Id INT NOT NULL, PRIMARY KEY (Id)) ENGINE=InnoDB;\r
+CREATE TABLE Product_Order (No INT NOT NULL AUTO_INCREMENT,\r
+       Product_Category INT NOT NULL,\r
+       Product_Id INT NOT NULL,\r
+       Customer_Id INT NOT NULL,\r
+       PRIMARY KEY(No),\r
+       INDEX (Product_Category, Product_Id),\r
+       FOREIGN KEY (Product_Category, Product_Id)\r
+               REFERENCES Product(Category, Id) ON UPDATE CASCADE ON DELETE RESTRICT,\r
+       INDEX (Customer_Id),\r
+       FOREIGN KEY (Customer_Id)\r
+               REFERENCES Customer(Id)\r
+       ) ENGINE=INNODB;\r
+\r
+query_vertical SHOW CREATE TABLE Product_Order;\r
+query_vertical SHOW CREATE TABLE Product;\r
+query_vertical SHOW CREATE TABLE Customer;\r
+query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;\r
+DROP TABLE Product_Order;\r
+DROP TABLE Product;\r
+DROP TABLE Customer;\r
+\r
index b80a2e4936ead3532b37524623f0252b990d90fa..2c9579f2ff7f38b0cbe64a376309afcdc74faef5 100644 (file)
@@ -4799,6 +4799,76 @@ disconnect con1;
 disconnect con2;
 
 
+--echo #
+--echo # Bug#21021848 ASSERTION `M_STATUS == DA_ERROR' FAILED.
+--echo #
+CREATE TABLE t1(c1 INT NOT NULL) ENGINE = csv;
+CREATE TABLE t2(c1 INT NOT NULL);
+
+--echo # Emulate corruption of t1
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 VALUES(0);
+CHECK TABLE t1;
+UNLOCK TABLES;
+
+--echo # Start XA txn on default
+XA START 'test2';
+--echo # Acquire SR on t2
+SELECT * FROM t2;
+--echo # Block IS query just before calling lock_table_names() (before X on t1)
+SET DEBUG_SYNC='recover_ot_repair SIGNAL parked WAIT_FOR go';
+--send SELECT COUNT(*)FROM information_schema.key_column_usage
+
+--echo # Create a new conncection which will compete for MDL lock
+--connect (con1,localhost,root,,)
+--echo # Wait until default becomes blocked
+SET DEBUG_SYNC='now WAIT_FOR parked';
+--echo # Try to acquire X on t1 and t2, which will block while default
+--echo # holds SR on t2
+--send DROP TABLES t1, t2
+
+--echo # Create control connection
+--connect (con2,localhost,root,,)
+
+--echo # Wait until con1 is blocked
+let $wait_condition=
+  select count(*) = 1 from information_schema.processlist
+  where state = "Waiting for table metadata lock" and
+        info = "DROP TABLES t1, t2";
+--source include/wait_condition.inc
+--echo # Wake up XA txn/IS query on default
+SET DEBUG_SYNC='now SIGNAL go';
+--echo # Disconnect control connection
+--disconnect con2
+--source include/wait_until_disconnected.inc
+
+--echo # Switch to default connection
+--connection default
+--echo # Wait for IS query which will try repair t1 which requires X.
+--echo # Previously that resulted in deadlock with con1 over t1,
+--echo # but now t1 is skipped and a warning is issued
+--reap
+
+--echo # Finish XA txn 'test2' to release SR on t2 so that con1
+--echo # becomes unblocked
+XA END 'test2';
+XA PREPARE 'test2';
+XA COMMIT 'test2';
+
+--echo # Cleanup
+SET DEBUG_SYNC= 'RESET';
+
+--echo # Clean up con1 now that the XA txn has finished
+--connection con1
+--echo # Wait for the now unblocked DROP t1, t2 to complete
+--reap
+--echo # Disconnecting con1
+--disconnect con1
+--source include/wait_until_disconnected.inc
+
+--echo # Switching to back to default at end of test case
+--connection default
+
 # Check that all connections opened by test cases in this file are really
 # gone so execution of other tests won't be affected by their presence.
 --source include/wait_until_count_sessions.inc
similarity index 58%
rename from mysql-wsrep-5.6/mysql-test/t/merge_recover.test
rename to mysql-wsrep-5.6/mysql-test/t/myisam_recover.test
index f2cb204eeb6697dce7109bba6611de3f43857eaa..9b0166435891cd2e712b4e412826d0c051c54212 100644 (file)
@@ -1,5 +1,9 @@
+--source include/count_sessions.inc
+
+--echo #
+--echo # Tests for corrupted MyISAM tables and MyISAMMRG tables with corrupted
+--echo # children..
 --echo #
---echo # Test of MyISAM MRG tables with corrupted children.
 --echo # Run with --myisam-recover=force option.
 --echo #
 --echo # Preparation: we need to make sure that the merge parent
@@ -20,6 +24,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;
 --disable_warnings
@@ -57,10 +63,10 @@ eval $lock;
 --echo #
 connection default;
 --echo #
---echo # We have to disable the ps-protocol, to avoid 
+--echo # We have to disable the ps-protocol, to avoid
 --echo # "Prepared statement needs to be re-prepared" errors
 --echo # -- table def versions change all the time with full table cache.
---echo # 
+--echo #
 --disable_ps_protocol
 --disable_warnings
 drop table if exists t1, t1_mrg, t1_copy;
@@ -69,12 +75,12 @@ let $MYSQLD_DATADIR=`select @@datadir`;
 --echo #
 --echo # Prepare a MERGE engine table, that refers to a corrupted
 --echo # child.
---echo # 
+--echo #
 create table t1 (a int, key(a)) engine=myisam;
 create table t1_mrg (a int) union (t1) engine=merge;
 --echo #
 --echo # Create a table with a corrupted index file:
---echo # save an old index file, insert more rows, 
+--echo # save an old index file, insert more rows,
 --echo # overwrite the new index file with the old one.
 --echo #
 insert into  t1 (a) values (1), (2), (3);
@@ -106,8 +112,70 @@ 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;
 disconnect con1;
 connection default;
 --enable_ps_protocol
+
+--echo #
+--echo # 18075170 - sql node restart required to avoid deadlock after
+--echo #            restore
+--echo #
+--echo # Check that auto-repair for MyISAM tables can now happen in the
+--echo # middle of transaction, without aborting it.
+
+connection default;
+
+create table t1 (a int, key(a)) engine=myisam;
+create table t2 (a int);
+insert into t2 values (1);
+
+--echo # Create a table with a corrupted index file:
+--echo # save an old index file, insert more rows,
+--echo # overwrite the new index file with the old one.
+insert into  t1 (a) values (1);
+flush table t1;
+--copy_file $MYSQLD_DATADIR/test/t1.MYI $MYSQLD_DATADIR/test/t1_copy.MYI
+insert into  t1 (a) values (4);
+flush table t1;
+--remove_file $MYSQLD_DATADIR/test/t1.MYI
+--copy_file $MYSQLD_DATADIR/test/t1_copy.MYI $MYSQLD_DATADIR/test/t1.MYI
+--remove_file $MYSQLD_DATADIR/test/t1_copy.MYI
+
+--echo # Check table is needed to mark the table as crashed.
+check table t1;
+
+--echo # At this point we have a corrupt t1
+set autocommit = 0;
+select * from t2;
+--echo # Without fix select from t1 will break the transaction. After the fix
+--echo # transaction should be active and should hold lock on table t2. Alter
+--echo # table from con2 will wait only if the transaction is not broken.
+--replace_regex /'.*[\/\\]/'/
+select * from t1;
+
+connect(con2, localhost, root);
+--SEND ALTER TABLE t2 ADD val INT
+
+connection default;
+--echo # With fix we should have alter table waiting for t2 lock here.
+let $wait_condition=
+  SELECT count(*) = 1 FROM information_schema.processlist WHERE state
+  LIKE "Waiting%" AND info = "ALTER TABLE t2 ADD val INT";
+
+--source include/wait_condition.inc
+ROLLBACK;
+SET autocommit = 1;
+
+connection con2;
+--REAP
+
+connection default;
+disconnect con2;
+
+--echo # Cleanup
+drop table t1, t2;
+
+# Wait till all disconnects are completed
+-- source include/wait_until_count_sessions.inc
index 1b731b8a1ebbaa7058cdcca1053aaa3dca7e6479..13f203bcfb7d4b557d42001d953886c845987916 100644 (file)
@@ -1 +1 @@
---binlog-format=row --binlog-row-event-max-size=1024
+--binlog-format=row --binlog-row-event-max-size=1024\r
index 1b731b8a1ebbaa7058cdcca1053aaa3dca7e6479..13f203bcfb7d4b557d42001d953886c845987916 100644 (file)
@@ -1 +1 @@
---binlog-format=row --binlog-row-event-max-size=1024
+--binlog-format=row --binlog-row-event-max-size=1024\r
index b08fcabd94e0383221f4b782c5dda68d8792d86a..c49ba75005c328e28cdcc4ffb22a5ed632357f19 100644 (file)
@@ -1,67 +1,67 @@
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
---echo #
---echo # Bug#11940249: RBR: MYISAM TABLE CORRUPTION AFTER FIRST LARGE INSERT
---echo #               ON SLAVE
---echo #
-
---echo # Must have > 100 rows in the first rpl event (to trigger bulk_insert
---echo # optimization for insert into an empty table, by disable all non-unique
---echo # indexes and recreate them afterwards.)
---echo # and then it must be a second rpl event for the same insert (i.e.
---echo # during the same lock).
---echo # Note that --binlog-row-event-max-size=1024 is set in the .opt files
---echo # to enforce the default size.
-
-CREATE TABLE tmp (a VARCHAR(10), b INT) ENGINE=Memory;
-INSERT INTO tmp VALUES ('aZa', 1), ('zAz', 2), ('M', 3);
-# 6 rows
-INSERT INTO tmp SELECT * FROM tmp;
-# 12 rows
-INSERT INTO tmp SELECT * FROM tmp;
-# 24
-INSERT INTO tmp SELECT * FROM tmp;
-# 48
-INSERT INTO tmp SELECT * FROM tmp;
-# 96
-INSERT INTO tmp SELECT * FROM tmp;
-# 192 rows
-INSERT INTO tmp SELECT * FROM tmp;
-
-CREATE TABLE t
-(a VARCHAR(10),
- b INT,
- KEY a (a))
-ENGINE = MyISAM;
-
---let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
---let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1)
-INSERT INTO t SELECT * FROM tmp;
-
---sync_slave_with_master
---connection slave
---echo # on slave:
-SELECT COUNT(*) FROM t WHERE b > -1;
---connection master
---echo # on master:
---source include/show_binlog_events.inc
-
-RENAME TABLE t to t_2;
-RENAME TABLE t_2 to t;
-
---sync_slave_with_master
---connection slave
---echo # on slave:
-SELECT COUNT(*) FROM t WHERE b > -1;
-CHECK TABLE t;
-REPAIR TABLE t;
-SELECT COUNT(*) FROM t WHERE b > -1;
---let $diff_tables= master:t, slave:t
---source include/diff_tables.inc
-
---connection master
-DROP TABLE t, tmp;
---sync_slave_with_master
-
---source include/rpl_end.inc
+--source include/have_binlog_format_row.inc\r
+--source include/master-slave.inc\r
+\r
+--echo #\r
+--echo # Bug#11940249: RBR: MYISAM TABLE CORRUPTION AFTER FIRST LARGE INSERT\r
+--echo #               ON SLAVE\r
+--echo #\r
+\r
+--echo # Must have > 100 rows in the first rpl event (to trigger bulk_insert\r
+--echo # optimization for insert into an empty table, by disable all non-unique\r
+--echo # indexes and recreate them afterwards.)\r
+--echo # and then it must be a second rpl event for the same insert (i.e.\r
+--echo # during the same lock).\r
+--echo # Note that --binlog-row-event-max-size=1024 is set in the .opt files\r
+--echo # to enforce the default size.\r
+\r
+CREATE TABLE tmp (a VARCHAR(10), b INT) ENGINE=Memory;\r
+INSERT INTO tmp VALUES ('aZa', 1), ('zAz', 2), ('M', 3);\r
+# 6 rows\r
+INSERT INTO tmp SELECT * FROM tmp;\r
+# 12 rows\r
+INSERT INTO tmp SELECT * FROM tmp;\r
+# 24\r
+INSERT INTO tmp SELECT * FROM tmp;\r
+# 48\r
+INSERT INTO tmp SELECT * FROM tmp;\r
+# 96\r
+INSERT INTO tmp SELECT * FROM tmp;\r
+# 192 rows\r
+INSERT INTO tmp SELECT * FROM tmp;\r
+\r
+CREATE TABLE t\r
+(a VARCHAR(10),\r
+ b INT,\r
+ KEY a (a))\r
+ENGINE = MyISAM;\r
+\r
+--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)\r
+--let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1)\r
+INSERT INTO t SELECT * FROM tmp;\r
+\r
+--sync_slave_with_master\r
+--connection slave\r
+--echo # on slave:\r
+SELECT COUNT(*) FROM t WHERE b > -1;\r
+--connection master\r
+--echo # on master:\r
+--source include/show_binlog_events.inc\r
+\r
+RENAME TABLE t to t_2;\r
+RENAME TABLE t_2 to t;\r
+\r
+--sync_slave_with_master\r
+--connection slave\r
+--echo # on slave:\r
+SELECT COUNT(*) FROM t WHERE b > -1;\r
+CHECK TABLE t;\r
+REPAIR TABLE t;\r
+SELECT COUNT(*) FROM t WHERE b > -1;\r
+--let $diff_tables= master:t, slave:t\r
+--source include/diff_tables.inc\r
+\r
+--connection master\r
+DROP TABLE t, tmp;\r
+--sync_slave_with_master\r
+\r
+--source include/rpl_end.inc\r
index a5e8b5a2913e7dfa26e93f398f2171664135b646..6dc0cab6218a566b50d321f305f617a7af8c0290 100644 (file)
@@ -202,5 +202,14 @@ DROP USER B20023823_def@localhost;
 DROP USER B20023823_41hash@localhost;
 DROP USER B20023823_16hash@localhost;
 
+
+--echo #
+--echo # Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR
+--echo #
+
+--echo Run mysql_upgrade with unauthorized access
+--error 1
+--exec $MYSQL_UPGRADE --skip-verbose --user=root --password=wrong_password 2>&1
+
 --echo
 --echo End of tests
index efb3e8393d1a625c2fda6d517747ce7f29631114..1da8c2029c268067edf8be91a716c4092c6f5b8a 100644 (file)
@@ -876,13 +876,8 @@ select * from t1;
 create  view v1 as
 select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
 
-# Disable warnings since LIMIT warning for unsafe statement if
-# binlog_format = STATEMENT. Note: after BUG#45832, the warning should
-# not be issued.
---disable_warnings
 create  view v2 as
 select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
---enable_warnings
 
 --exec $MYSQL_DUMP --skip-comments test
 
@@ -2500,3 +2495,31 @@ SELECT HEX(a) FROM t1;
 --exec $MYSQL_DUMP -necqt --compact --hex-blob dump_gis
 DROP DATABASE dump_gis;
 
+--echo #
+--echo # Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS
+--echo #
+
+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;
+SELECT * FROM t2;
+
+--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ db_20772273
+--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t1.sql
+--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t2.sql
+
+# Test mysqlimport with multiple threads
+--exec $MYSQL_IMPORT --silent --use-threads=2 db_20772273 $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+#Cleanup
+DROP TABLE t1;
+DROP TABLE t2;
+DROP DATABASE db_20772273;
index 2b92d9e4d37a64d2a0dca9a3d251ec0cd8bbc1ea..b11fdd8cb5168b65772c677b4b244dc32bba8ecc 100644 (file)
@@ -708,8 +708,20 @@ 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
 
+# BUG#13687542 MTR BEHAVES WRONG WHEN EXECUTING 'ERROR $VAR' IN A LOOP
+--let $i= 0
+--let $error= 0
+while ($i < 3)
+{
+  --error $error
+  CREATE TABLE t1 (a INT);
+  --let $error= 1050
+  --inc $i
+}
+
+DROP TABLE t1;
 
 # ----------------------------------------------------------------------------
 # Test echo command
index 4dc25a0e96a4cb8cf5eaf7d71ad14db9a6e5dd92..1459c325f38f9bc560d76b18e521b279dfaeab4e 100644 (file)
@@ -39,6 +39,7 @@ LOCK TABLES t1 READ;
 --error ER_TABLE_NOT_LOCKED
 FLUSH PRIVILEGES;
 UNLOCK TABLES;
+FLUSH PRIVILEGES;
 DROP TABLE t1;
 
 --echo #
index d782ef92d03448d28fd10c01e562a86d46089568..ecd8bcd472f28ee2ad203995300fbeab21720336 100644 (file)
@@ -1145,7 +1145,7 @@ subpartition by hash (rand(a+b));
 #
 # Subpartition by hash, wrong subpartition function
 #
---error ER_SUBPARTITION_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
 CREATE TABLE t1 (
 a int not null,
 b int not null,
index 2de03d6047f8fdd781e65201a0dc13ae828a54bb..8c5f9adfe753acc2c7611872afaa4e1be0b6e9dc 100644 (file)
@@ -400,9 +400,9 @@ DROP TABLE t1;
 #
 create table t1 (a int) engine=innodb partition by hash(a) ;
 # Avg_row_length (col 6) and Data_length (col 7) vary depending
-# on the page size.  Data_free for InnoDB tablespace varies
-# depending on which tests have been run before this one.
---replace_column 6 # 7 # 10 #
+# on the page size.  Data_free for InnoDB tablespace varies depending on which
+# tests have been run before this one.  create_time(col 12) varies with time
+--replace_column 6 # 7 # 10 # 12 #
 show table status like 't1';
 drop table t1;
 
@@ -413,16 +413,16 @@ create table t1 (a int)
 engine = innodb
 partition by key (a);
 # Avg_row_length (col 6) and Data_length (col 7) vary depending
-# on the page size.  Data_free for InnoDB tablespace varies
-# depending on which tests have been run before this one.
---replace_column 6 # 7 # 10 #
+# on the page size.  Data_free for InnoDB tablespace varies depending on which
+# tests have been run before this one. create_time(col 12) varies with time
+--replace_column 6 # 7 # 10 # 12 #
 show table status;
 insert into t1 values (0), (1), (2), (3);
 analyze table t1;
 # Avg_row_length (col 6) and Data_length (col 7) vary depending
-# on the page size.  Data_free for InnoDB tablespace varies
-# depending on which tests have been run before this one.
---replace_column 6 # 7 # 10 #
+# on the page size.  Data_free for InnoDB tablespace varies depending on which
+# tests have been run before this one.  create_time(col 12) varies with time
+--replace_column 6 # 7 # 10 # 12 #
 show table status;
 drop table t1;
 
@@ -430,23 +430,23 @@ create table t1 (a int auto_increment primary key)
 engine = innodb
 partition by key (a);
 # Avg_row_length (col 6) and Data_length (col 7) vary depending
-# on the page size.  Data_free for InnoDB tablespace varies
-# depending on which tests have been run before this one.
---replace_column 6 # 7 # 10 #
+# on the page size.  Data_free for InnoDB tablespace varies depending on which
+# tests have been run before this one.create_time(col 12) varies with time
+--replace_column 6 # 7 # 10 # 12 #
 show table status;
 insert into t1 values (NULL), (NULL), (NULL), (NULL);
 analyze table t1;
 # Avg_row_length (col 6) and Data_length (col 7) vary depending
-# on the page size.  Data_free for InnoDB tablespace varies
-# depending on which tests have been run before this one.
---replace_column 6 # 7 # 10 #
+# on the page size.  Data_free for InnoDB tablespace varies depending on which
+# tests have been run before this one.create_time(col 12) varies with time
+--replace_column 6 # 7 # 10 # 12 #
 show table status;
 insert into t1 values (NULL), (NULL), (NULL), (NULL);
 analyze table t1;
 # Avg_row_length (col 6) and Data_length (col 7) vary depending
-# on the page size.  Data_free for InnoDB tablespace varies
-# depending on which tests have been run before this one.
---replace_column 6 # 7 # 10 #
+# on the page size.  Data_free for InnoDB tablespace varies depending on which
+# tests have been run before this one.create_time(col 12) varies with time
+--replace_column 6 # 7 # 10 # 12 #
 show table status;
 drop table t1;
 
@@ -872,3 +872,70 @@ CHECK TABLE t7;
 ALTER TABLE t7 CHANGE f1 f1 INT AFTER f4, ALGORITHM=INPLACE;
 
 DROP TABLE t1,t2,t3,t4,t5,t6,t7;
+
+--echo #
+--echo # Bug #17299181  CREATE_TIME AND UPDATE_TIME ARE
+--echo #                WRONG FOR PARTITIONED TABLES
+--echo #
+
+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';
+
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#20160327 OPTIMIZE TABLE REMOVES THE DATA DIRECTORY IN PARTITIONS
+--echo #
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval 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);
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+SHOW CREATE TABLE t1;
+
+OPTIMIZE TABLE t1;
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+SHOW CREATE TABLE t1;
+--replace_regex  /#P#/#p#/  /#SP#/#sp#/
+--list_files $MYSQL_TMP_DIR/temp_dir/test
+
+ALTER TABLE t1 OPTIMIZE PARTITION p0;
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+SHOW CREATE TABLE t1;
+--replace_regex  /#P#/#p#/  /#SP#/#sp#/
+--list_files $MYSQL_TMP_DIR/temp_dir/test
+
+ALTER TABLE t1 OPTIMIZE PARTITION p1;
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+SHOW CREATE TABLE t1;
+--replace_regex  /#P#/#p#/  /#SP#/#sp#/
+--list_files $MYSQL_TMP_DIR/temp_dir/test
+
+ALTER TABLE t1 REBUILD PARTITION ALL;
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+SHOW CREATE TABLE t1;
+--replace_regex  /#P#/#p#/  /#SP#/#sp#/
+--list_files $MYSQL_TMP_DIR/temp_dir/test
+
+ALTER TABLE t1 ADD extracol VARCHAR(32) NULL;
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+SHOW CREATE TABLE t1;
+--replace_regex  /#P#/#p#/  /#SP#/#sp#/
+--list_files $MYSQL_TMP_DIR/temp_dir/test
+
+DROP TABLE t1;
+
+--rmdir $MYSQL_TMP_DIR/temp_dir/test
+--rmdir $MYSQL_TMP_DIR/temp_dir
index 067eb7fae596ec5b9e70b5557700a765c50183e5..5d74dfae7f484ee5e7b716b8fd6b99211531e4cc 100644 (file)
@@ -152,13 +152,9 @@ SELECT COUNT(*) FROM t2;
 FLUSH TABLES;
 
 --echo # Restrict partitioned commands to partitioned tables only
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 CACHE INDEX t2 PARTITION (p0,`p1`) INDEX (`PRIMARY`) IN hot_cache;
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 CACHE INDEX t2 PARTITION (`p1`) INDEX (`PRIMARY`,`inx_b`) IN hot_cache;
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 CACHE INDEX t2 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN hot_cache;
 --echo # Basic key cache testing
 --echo # The manual correctly says: "The syntax of CACHE INDEX enables you to
@@ -213,7 +209,6 @@ LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_b`);
 CACHE INDEX t2 IN default;
 LOAD INDEX INTO CACHE t2 IGNORE LEAVES;
 
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 LOAD INDEX INTO CACHE t2 PARTITION (p1) INDEX (`PRIMARY`);
 LOAD INDEX INTO CACHE t1, t2;
 --echo # only one table at a time if specifying partitions
@@ -233,7 +228,6 @@ LOAD INDEX INTO CACHE t1 PARTITIONS ALL;
 LOAD INDEX INTO CACHE t1 PARTITION (p1,`p0`) IGNORE LEAVES;
 DROP INDEX `inx_b` on t1;
 DROP INDEX `inx_b` on t2;
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
 CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache;
 CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
index 0987c427fc735e3e83fa656d2c2a4e1faf77d739..7420ac3dbc9fbe4903f4b9513387806c46baeb13 100644 (file)
@@ -125,16 +125,12 @@ ALTER TABLE t1 DROP PARTITION x1;
 --error ER_PARTITION_MGMT_ON_NONPARTITIONED
 ALTER TABLE t1 COALESCE PARTITION 1;
 
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 ALTER TABLE t1 ANALYZE PARTITION p1;
 
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 ALTER TABLE t1 CHECK PARTITION p1;
 
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 ALTER TABLE t1 OPTIMIZE PARTITION p1;
 
---error ER_PARTITION_MGMT_ON_NONPARTITIONED
 ALTER TABLE t1 REPAIR PARTITION p1;
 
 DROP TABLE t1;
@@ -223,3 +219,28 @@ SUBPARTITION BY KEY (s2) (
 PARTITION p1 VALUES IN (0) (SUBPARTITION p1b), 
 PARTITION p2 VALUES IN (2) (SUBPARTITION p1b)
 );
+
+--echo #
+--echo # Bug#20284744: COMMANDS OUT OF SYNC, MALFORMED PACKET, HANG,
+--echo # DISCONNECTIONS
+--echo #
+create table t1 (a int) engine=innodb;
+delimiter $;
+
+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 $
+
+delimiter ;$
+
+--echo # Without the fix this would fail with 2027: Malformed packet
+call p1();
+--echo # Without the fix the connection would get out of sync here (error 2014)!
+call p1();
+
+drop procedure p1;
+drop table t1;
index 620193f63c9edeca019453aa6538beb747dd06e8..56cb46e9ab311918aab2c286b26c3406bf74450e 100644 (file)
@@ -1,5 +1,13 @@
 --source include/have_partition.inc
 
+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.");
 --disable_warnings
 DROP TABLE IF EXISTS `t1`;
 --enable_warnings
index c6e998b87c3a73df70f245eaaef9466635eae4b2..e1ecf4af035ffe7f6ccdeec30d8bd1e9d1abd842 100644 (file)
@@ -1,4 +1,3 @@
-#
 # WL#5706/Bug#58712/Bug#11746378
 # Encrypt or remove passwords from slow, query, and binary logs
 # (see sql/sql_rewrite.cc for bulk of implementation)
@@ -107,6 +106,29 @@ SELECT argument FROM mysql.general_log WHERE argument LIKE 'GRANT SELECT%' AND a
 # VIEWs do not accepted variables at this time.
 EXPLAIN EXTENDED SELECT @a=5,@b:=10,@c:=20,@d:=40+5,(@e:=80)+5;
 
+--echo #
+--echo # Bug#16953758: PREPARED STATEMENT IS WRITTEN TO GENERAL QUERY LOG AFTER ITS EXECUTION IS FINISH
+--echo #
+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;
+DEALLOCATE PREPARE stmt;
+
+
+--echo #
+--echo # Bug#18616826: PREPARED STATEMENTS WHOSE EXECUTION FAIL ARE NOT LOGGED TO THE GENERAL LOG
+--echo #
+TRUNCATE TABLE mysql.general_log;
+SET @sql='DROP TABLE 18616826_does_not_exist';
+PREPARE stmt FROM @sql;
+--error ER_BAD_TABLE_ERROR
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "DROP TABLE 18616826_does_not_exist";
+
+
 DROP TABLE test_log;
 
 --remove_file $MYSQLTEST_VARDIR/log/rewrite_general.log
@@ -115,4 +137,8 @@ SET GLOBAL general_log_file=  @old_general_log_file;
 SET GLOBAL general_log=       @old_general_log;
 SET GLOBAL log_output=        @old_log_output;
 
+
+--echo
 --echo End of 5.6 tests!
+--echo
+
index 643e79689a241077f103980854ce2723a7e6555a..d2c3b06d98d4ae64396904806b174230c216f6df 100644 (file)
@@ -82,6 +82,7 @@ connection con2root;
 --sleep 2
 # There should be call statement in locked state.
 --replace_column 1 # 3 localhost 6 #
+--replace_result "starting" STATE "init" STATE "cleaning up" STATE
 --sorted_result
 show processlist;
 unlock tables;
index 6fd3c5e1af2a0f1da919682547238d0a444c51a5..e3c4fa0c6e1643c112686cb8fcbdbb3fa7ae5224 100644 (file)
@@ -15,6 +15,9 @@
 # Tests that require multibyte character sets, which are not always available,
 #   go into separate files (e.g. sp-ucs2.test)
 
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
 use test;
 
 # Test tables
@@ -9005,4 +9008,119 @@ DROP PROCEDURE p1;
 
 DROP TABLE t1;
 
+
+--echo
+--echo #
+--echo # BUG 16041903: CONTINUE HANDLER NOT INVOKED
+--echo # IN A STORED FUNCTION AFTER A LOCK WAIT TIMEOUT
+--echo #
+
+--echo
+--echo # 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;
+
+--echo
+--echo # Create a function with exit handler:
+DELIMITER //;
+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//
+
+--echo
+--echo # Create a function calling f1():
+CREATE FUNCTION f2() RETURNS VARCHAR(20)
+BEGIN
+  RETURN f1();
+END//
+
+--echo
+--echo # 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//
+
+--echo
+--echo # Create a function calling f3, to create
+--echo # a deadlock indirectly:
+CREATE FUNCTION f4() RETURNS VARCHAR(20)
+BEGIN
+  RETURN f3();
+END//
+DELIMITER ;//
+
+--echo
+--echo # Open another connection, create and initialize a table
+--echo # to be used for provoking deadlock, put a lock on the table:
+connect (con1,localhost,root,,);
+CREATE TABLE t1 (i INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET AUTOCOMMIT= 0;
+UPDATE t1 SET i=1 WHERE i=1;
+
+--echo
+--echo # On the default connection, do an update to provoke a
+--echo # deadlock, then call the function with handler. This case
+--echo # fails without the patch (with error ER_NO_SUCH_TABLE):
+--connection default
+SET AUTOCOMMIT= 0;
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET i=1 WHERE i=1;
+SELECT f1() AS 'f1():';
+
+--echo
+--echo # Provoke another deadlock, then call the function with
+--echo # handler indirectly. This case fails without the patch
+--echo # (with error ER_NO_SUCH_TABLE):
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET i= 1 WHERE i= 1;
+SELECT f2() AS 'f2():';
+
+--echo
+--echo # Provoke yet another deadlock, but now from within a function,
+--echo # then call the function with handler. This succeeds even
+--echo # without the patch because is_fatal_sub_stmt_error is reset
+--echo # in restore_sub_stmt after the failing function has been
+--echo # executed. The test case is included anyway for better coverage:
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT f3() AS 'f3():';
+SELECT f1() AS 'f1():';
+
+--echo # Provoke yet another deadlock, but now from within a function,
+--echo # calling another function, then call the function with handler.
+--echo # This succeeds even without the patch because
+--echo # is_fatal_sub_stmt_error is reset in restore_sub_stmt after
+--echo # the failing function has been executed. The test case is
+--echo # included anyway for better coverage:
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT f4() AS 'f4():';
+SELECT f1() AS 'f1():';
+
+--echo
+--echo # Disconnect, drop functions and table:
+--disconnect con1
+DROP FUNCTION f4;
+DROP FUNCTION f3;
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+--echo
+--echo # Reset lock wait timeouts
+SET @@lock_wait_timeout= @lock_wait_timeout_saved;
+SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved;
+
+--echo #
+--echo # BUG 16041903: End of test case
+--echo #
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
+
 --echo # End of 5.6 tests
diff --git a/mysql-wsrep-5.6/mysql-test/t/ssl_mode.test b/mysql-wsrep-5.6/mysql-test/t/ssl_mode.test
new file mode 100644 (file)
index 0000000..ce1f2aa
--- /dev/null
@@ -0,0 +1,47 @@
+-- source include/not_embedded.inc
+-- source include/have_ssl_communication.inc
+
+--echo # positive client tests
+--echo # mysql
+--exec $MYSQL test --ssl-mode=ReQuIrEd --ssl-cipher=DHE-RSA-AES256-SHA -e "SHOW STATUS LIKE 'Ssl_cipher'" 2>&1
+--exec $MYSQL test --ssl-mode=REQUIRED --ssl --ssl-cipher=DHE-RSA-AES256-SHA -e "SHOW STATUS LIKE 'Ssl_cipher'" 2>&1
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(0);
+
+--echo # mysqldump
+--exec $MYSQL_DUMP --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA --compact --skip-comments test 2>&1
+--echo # mysqladmin
+--exec $MYSQLADMIN --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
+--echo # mysqlcheck
+--exec $MYSQL_CHECK --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA test 2>&1
+--echo # mysqlimport
+CREATE TABLE words(a VARCHAR(255));
+--exec $MYSQL_IMPORT --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA test $MYSQLTEST_VARDIR/std_data/words.dat 2>&1
+DROP TABLE words;
+--echo # mysqlshow
+--exec $MYSQL_SHOW --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA test 2>&1
+--echo # mysqlslap
+--exec $MYSQL_SLAP --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA --create-schema=test --query="select * from t1" --silent 2>&1
+--echo # mysqltest
+--exec $MYSQL_TEST --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
+
+DROP TABLE t1;
+
+--echo # negative client tests
+--echo # mysql
+--error 5
+--exec $MYSQL test --ssl-mode
+--error 1
+--exec $MYSQL test --ssl-mode= 2>&1
+--error 1
+--exec $MYSQL test --ssl-mode=DERIUQER 2>&1
+--error 1
+--exec $MYSQL test --ssl-mode=REQUIRED 2>&1
+--error 1
+--exec $MYSQL test --ssl-mode=REQUIRED --ssl 2>&1
+--error 1
+--exec $MYSQL test --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA --skip-ssl 2>&1
+
+--echo
+--echo End of tests
diff --git a/mysql-wsrep-5.6/mysql-test/t/ssl_mode_no_ssl-master.opt b/mysql-wsrep-5.6/mysql-test/t/ssl_mode_no_ssl-master.opt
new file mode 100644 (file)
index 0000000..0ca403e
--- /dev/null
@@ -0,0 +1 @@
+--skip-ssl
diff --git a/mysql-wsrep-5.6/mysql-test/t/ssl_mode_no_ssl.test b/mysql-wsrep-5.6/mysql-test/t/ssl_mode_no_ssl.test
new file mode 100644 (file)
index 0000000..65f7d1c
--- /dev/null
@@ -0,0 +1,41 @@
+-- source include/not_embedded.inc
+
+--echo # negative client tests
+--echo # mysql
+--error 1
+--exec $MYSQL test --ssl-mode=REQUIRED 2>&1
+--error 1
+--exec $MYSQL test --ssl-mode=REQUIRED --ssl 2>&1
+--error 1
+--exec $MYSQL test --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA 2>&1
+--error 1
+--exec $MYSQL test --ssl-mode=REQUIRED --ssl --ssl-cipher=DHE-RSA-AES256-SHA 2>&1
+--echo # mysqldump
+--error 2
+--exec $MYSQL_DUMP --ssl-mode=REQUIRED test 2>&1
+--echo # mysqladmin
+--replace_regex /.*mysqladmin.*/mysqladmin: /
+--error 1
+--exec $MYSQLADMIN --ssl-mode=REQUIRED -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
+--echo # mysqlcheck
+--replace_regex /.*mysqlcheck(\.exe)*/mysqlcheck/
+--error 2
+--exec $MYSQL_CHECK --ssl-mode=REQUIRED test 2>&1
+--echo # mysqlimport
+--replace_regex /.*mysqlimport(\.exe)*/mysqlimport/
+--error 1
+--exec $MYSQL_IMPORT --ssl-mode=REQUIRED test $MYSQLTEST_VARDIR/tmp/t1.txt 2>&1
+--echo # mysqlshow
+--replace_regex /.*mysqlshow(\.exe)*/mysqlshow/
+--error 1
+--exec $MYSQL_SHOW --ssl-mode=REQUIRED test 2>&1
+--echo # mysqlslap
+--replace_regex /.*mysqlslap(\.exe)*/mysqlslap/
+--error 1
+--exec $MYSQL_SLAP --ssl-mode=REQUIRED 2>&1
+--echo # mysqltest
+--error 1
+--exec $MYSQL_TEST --ssl-mode=REQUIRED -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
+
+--echo
+--echo End of tests
diff --git a/mysql-wsrep-5.6/mysql-test/t/status_debug.test b/mysql-wsrep-5.6/mysql-test/t/status_debug.test
new file mode 100644 (file)
index 0000000..41ebea3
--- /dev/null
@@ -0,0 +1,45 @@
+#
+--source include/have_debug_sync.inc
+
+# Save the initial number of concurrent sessions.
+--source include/count_sessions.inc
+
+--echo #
+--echo # Bug#18591145 - SOME MONOTONICALLY INCREASING STATUS VARIABLES DECREASES UNEXPECTEDLY
+--echo #
+
+--enable_connect_log
+
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(64), val VARCHAR(1024));
+--echo # 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';
+--SEND 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';
+--change_user root,,test
+
+CONNECTION con1;
+--REAP
+
+SET DEBUG_SYNC='RESET';
+CONNECTION default;
+INSERT INTO t1(name, val)
+  SELECT * FROM INFORMATION_SCHEMA.global_status WHERE variable_name='com_insert';
+
+# With fix, difference of com_insert status should be "0" here.
+SELECT (SELECT val FROM t1 WHERE id = 2) - (SELECT val FROM t1 WHERE id = 3);
+
+# Cleanup
+DISCONNECT con1;
+DROP TABLE t1;
+
+--disable_connect_log
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
index 330a488235307ec0e638f80e55b7035e07c98ff1..33ace70ca4a1dd1b0dc50ef9ed09860dda853263 100644 (file)
 -- source include/not_embedded.inc
 -- source include/have_innodb_16k.inc
 
+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.");
 if (`select $PS_PROTOCOL != 0`)
 {
    --skip Test requires: ps-protocol disabled
index 82bee7aa224d2f78d0e054dcea21bd036764e1ed..c17202055e12b245d44ab77ca885c496da83fcc2 100644 (file)
@@ -2,6 +2,9 @@
 # (or just InnoDB storage engine)
 --source include/have_innodb.inc
 
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
 --disable_warnings
 drop table if exists t1;
 --enable_warnings
@@ -182,3 +185,54 @@ insert into t1 values ( 654, 'a'), ( 654, 'b'), ( 654, 'c'),
 select * from t2 order by b;
 drop trigger t1_after_insert;
 drop table t1,t2;
+
+--echo #
+--echo #Bug#19683834 SOME INNODB ERRORS CAUSES STORED FUNCTION
+--echo #             AND TRIGGER HANDLERS TO BE IGNORED
+
+--echo #Code fixed in Bug#16041903
+--enable_connect_log
+
+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;
+
+# Trigger with continue handler for ER_DUP_ENTRY(1062)
+DELIMITER //;
+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//
+DELIMITER ;//
+
+# Transaction 1: Grab locks on t1
+START TRANSACTION;
+UPDATE t1 SET val = val + 1;
+
+# Transaction 2:
+--connect (con2,localhost,root,,test,,)
+SET SESSION innodb_lock_wait_timeout = 2;
+# Trigger lock timeout (1205)
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET val = val + 1;
+
+# This insert should go through, as the continue handler should
+# handle ER_DUP_ENTRY, even after ER_LOCK_WAIT_TIMEOUT (Bug#16041903)
+INSERT INTO t2 (id) VALUES (1);
+
+# Cleanup
+disconnect con2;
+--source include/wait_until_disconnected.inc
+connection default;
+
+DROP TABLE t3, t2, t1;
+
+--disable_connect_log
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
index 58cc342e53be34233cb7045eacdd435aabe12bf9..a205caae44402416f233b748477e0616f446c13f 100644 (file)
@@ -541,3 +541,16 @@ UPDATE t2 SET c = 10 ORDER BY a, b DESC LIMIT 5;
 SHOW STATUS LIKE 'HANDLER_UPDATE';
 ROLLBACK;
 DROP TABLE t1, t2;
+
+--echo # Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT
+--echo #                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;
+UPDATE t1 SET b = c, c = 'inject';
+SELECT c, b FROM t1;
+
+DROP TABLE t1;
index 2641ec69b005918833f88e38ad23a38e5de460e9..94a738314fcc7b4758721f253abb9f5bddae33c4 100644 (file)
@@ -109,34 +109,8 @@ 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;
-
---echo # restarting the server with dictionary file.
-
-# Write file to make mysql-test-run.pl wait for the server to stop
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
-# Request shutdown
--- send_shutdown
-
-# Call script that will poll the server waiting for it to disapear
--- source include/wait_until_disconnected.inc
-
---echo # Restart server.
-
---exec echo "restart:--loose-validate_password_dictionary_file=$MYSQL_ERRMSG_BASEDIR/dictionary.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
-# Turn on reconnect
---enable_reconnect
-
-# Call script that will poll the server waiting for it to be back online again
---source include/wait_until_connected_again.inc
-
-# Turn off reconnect again
---disable_reconnect
-
---replace_regex /\.dll/.so/
-eval INSTALL PLUGIN validate_password SONAME '$VALIDATE_PASSWORD';
+--replace_result $MYSQL_ERRMSG_BASEDIR MYSQL_ERRMSG_BASEDIR
+eval SET @@global.validate_password_dictionary_file="$MYSQL_ERRMSG_BASEDIR/dictionary.txt";
 
 --echo # password policy strong
 --echo # default_file : dictionary.txt
@@ -189,7 +163,7 @@ SET @@global.validate_password_special_char_count= 0;
 --error ER_SPECIFIC_ACCESS_DENIED_ERROR
 SET @@global.validate_password_mixed_case_count= 0;
 # user has the update/create privilege but needs to satisfy password policy
-# to update/create new account 
+# to update/create new account
 --error ER_NOT_VALID_PASSWORD
 CREATE USER 'user2'@'localhost' IDENTIFIED BY 'password';
 CREATE USER 'user2'@'localhost' IDENTIFIED BY 'PA00wrd!#';
@@ -204,4 +178,94 @@ connection default;
 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;
+
+
+--echo #
+--echo # Bug#14588145 -        NEED ABILITY TO FLUSH PASSWORD VALIDATION DICTIONARY FILE
+--echo #
+
+SET @@global.validate_password_policy=STRONG;
+
+--write_file $MYSQLTEST_VARDIR/tmp/dictionary.txt
+password
+validate
+EOF
+
+--write_file $MYSQLTEST_VARDIR/tmp/dictionary2.txt
+password
+validate
+monkey
+EOF
+
+--echo # No dictionary file, password is accepted
+CREATE USER 'user1'@'localhost' IDENTIFIED BY 'passWORD123#';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SET @@global.validate_password_dictionary_file="$MYSQLTEST_VARDIR/tmp/dictionary2.txt";
+# Dictionary file loaded
+
+--echo # must return 3
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+  WHERE VARIABLE_NAME = 'validate_password_dictionary_file_words_count';
+
+SELECT VARIABLE_VALUE into @ts1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+  WHERE VARIABLE_NAME = "validate_password_dictionary_file_last_parsed";
+
+--echo # check format of the TS
+--replace_regex /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/0000-00-00 00:00:00/
+SELECT @ts1;
+
+--echo # must return 19
+SELECT LENGTH(@ts1);
+
+--echo # must sleep for at least 1 sec so that the timestamps differ
+--sleep 1
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SET @@global.validate_password_dictionary_file="$MYSQLTEST_VARDIR/tmp/dictionary.txt";
+
+--echo # must return 2
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+  WHERE VARIABLE_NAME = 'validate_password_dictionary_file_words_count';
+
+SELECT VARIABLE_VALUE into @ts2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+  WHERE VARIABLE_NAME = "validate_password_dictionary_file_last_parsed";
+
+--echo # must return 1
+SELECT @ts1 <> @ts2;
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user2'@'localhost' IDENTIFIED BY 'passWORD123#';
+
+SET @@global.validate_password_dictionary_file=NULL;
+
+--echo # Cache flushed and no dictionary file is loaded
+CREATE USER 'user2'@'localhost' IDENTIFIED BY 'passWORD123#';
+
+--echo # Select commands to show that the validate_password lock is instrumented
+SELECT NAME FROM performance_schema.setup_instruments WHERE NAME LIKE '%validate%';
+SELECT NAME FROM performance_schema.rwlock_instances WHERE NAME LIKE '%validate%';
+
+--echo # cleanup
+DROP USER 'user1'@'localhost', 'user2'@'localhost';
+SET @@global.validate_password_policy=DEFAULT;
+remove_file $MYSQLTEST_VARDIR/tmp/dictionary.txt;
+remove_file $MYSQLTEST_VARDIR/tmp/dictionary2.txt;
+
+--echo # clean up after the test
 UNINSTALL PLUGIN validate_password;
+
+
+--echo End of tests
index fc1dfb24fb25c7f022abdb9f314393f75072ddb3..b4a730874b4d76346f873cd5ce6b9a60a97538d0 100644 (file)
@@ -8,10 +8,9 @@
 # Bug#27322 failure to allocate transaction_prealloc_size causes crash
 #
 #
-# Manual (6.0):
+# Manual (5.1):
 # Platform Bit Size  Range                      Default
-# 32                 1024-4294967295 (4 Gi - 1) 4096
-# 64                 1024-18446744073709547520  4096
+# 32/64              1024-128k                  4096
 #
 # Observation(mleich):
 # 1. - Linux 64 Bit, MySQL 64 Bit, 4 GiB RAM, 8 GiB swap
@@ -39,18 +38,23 @@ SET @def_var= @@session.transaction_prealloc_size;
 --disable_warnings
 SET SESSION transaction_prealloc_size=1024*1024*1024*1;
 --replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--sorted_result
 SHOW PROCESSLIST;
 SET SESSION transaction_prealloc_size=1024*1024*1024*2;
 --replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--sorted_result
 SHOW PROCESSLIST;
 SET SESSION transaction_prealloc_size=1024*1024*1024*3;
 --replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--sorted_result
 SHOW PROCESSLIST;
 SET SESSION transaction_prealloc_size=1024*1024*1024*4;
 --replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--sorted_result
 SHOW PROCESSLIST;
 SET SESSION transaction_prealloc_size=1024*1024*1024*5;
 --replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--sorted_result
 SHOW PROCESSLIST;
 --enable_warnings
 
index 06e326e781742792149c47bee9490a41a18dfe78..7bd0914b1dadf8fbd23f988fb1093f3e43c8bd2c 100644 (file)
@@ -4354,6 +4354,328 @@ SHOW CREATE VIEW v4;
 
 DROP VIEW v1, v2, v3, v4;
 
+#
+# - Test cases for INSERT, UPDATE and DELETE against composite views
+
+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;
+
+--error ER_VIEW_SELECT_DERIVED
+CREATE VIEW vtrd AS
+SELECT * FROM t1 JOIN (SELECT DISTINCT * FROM t2) AS dt2 ON t1.a1=dt2.a2;
+
+CREATE VIEW vrt AS
+SELECT * FROM vmat1 AS dt1 JOIN t2 ON dt1.a1=t2.a2;
+
+--error ER_VIEW_SELECT_DERIVED
+CREATE VIEW vrtd AS
+SELECT * FROM (SELECT DISTINCT * FROM t1) AS dt1 JOIN t2 ON dt1.a1=t2.a2;
+
+CREATE VIEW vrr AS
+SELECT * FROM vmat1 AS dt1 JOIN vmat2 AS dt2 ON dt1.a1=dt2.a2;
+
+--error ER_VIEW_SELECT_DERIVED
+CREATE VIEW vrrd AS
+SELECT * FROM (SELECT DISTINCT * FROM t1) AS dt1 JOIN
+              (SELECT DISTINCT * FROM t2) AS dt2 ON dt1.a1=dt2.a2;
+
+# v0  - Dummy view for use in UPDATE
+# vtt - View defined over two tables
+# vtr - View defined over a table and a read-only view
+# vrt - View defined over a read-only view and a table
+# vrr - View defined over two read-only views
+# vtrd, vrtd, vrrd: Like above but using derived tables instead of views
+
+INSERT INTO vtt(a1,b1) VALUES (1,100);
+
+INSERT INTO vtt(a2,b2) VALUES (1,100);
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vtr(a1,b1) VALUES (2,100);
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vtrd(a1,b1) VALUES (3,100);
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vtr(a2,b2) VALUES (2,100);
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vtrd(a2,b2) VALUES (3,100);
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vrt(a1,b1) VALUES (4,100);
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vrtd(a1,b1) VALUES (5,100);
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vrt(a2,b2) VALUES (4,100);
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vrtd(a2,b2) VALUES (5,100);
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vrr(a1,b1) VALUES (6,100);
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vrrd(a1,b1) VALUES (7,100);
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vrr(a2,b2) VALUES (6,100);
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vrrd(a2,b2) VALUES (7,100);
+
+SELECT * FROM vtt;
+
+DELETE FROM t1;
+DELETE FROM t2;
+
+INSERT INTO vtt(a1,b1) SELECT 1,100;
+
+INSERT INTO vtt(a2,b2) SELECT 1,100;
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vtr(a1,b1) SELECT 2,100;
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vtrd(a1,b1) SELECT 3,100;
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vtr(a2,b2) SELECT 2,100;
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vtrd(a2,b2) SELECT 3,100;
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vrt(a1,b1) SELECT 4,100;
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vrtd(a1,b1) SELECT 5,100;
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vrt(a2,b2) SELECT 4,100;
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vrtd(a2,b2) SELECT 5,100;
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vrr(a1,b1) SELECT 6,100;
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vrrd(a1,b1) SELECT 7,100;
+
+--error ER_NON_INSERTABLE_TABLE
+INSERT INTO vrr(a2,b2) SELECT 6,100;
+
+--error ER_NO_SUCH_TABLE
+INSERT INTO vrrd(a2,b2) SELECT 7,100;
+
+SELECT * FROM vtt;
+
+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);
+
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE FROM vtt WHERE a1=1;
+
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE FROM vtr WHERE a1=2;
+
+--error ER_NO_SUCH_TABLE
+DELETE FROM vtrd WHERE a1=3;
+
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE FROM vrt WHERE a1=4;
+
+--error ER_NO_SUCH_TABLE
+DELETE FROM vrtd WHERE a1=5;
+
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE FROM vrr WHERE a1=6;
+
+--error ER_NO_SUCH_TABLE
+DELETE FROM vrrd WHERE a1=7;
+
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE vtt FROM vtt WHERE a1=8;
+
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE vtr FROM vtr WHERE a1=9;
+
+--error ER_NO_SUCH_TABLE
+DELETE vtrd FROM vtrd WHERE a1=10;
+
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE vrt FROM vrt WHERE a1=11;
+
+--error ER_NO_SUCH_TABLE
+DELETE vrtd FROM vrtd WHERE a1=12;
+
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE vrr FROM vrr WHERE a1=13;
+
+--error ER_NO_SUCH_TABLE
+DELETE vrrd FROM vrrd WHERE a1=14;
+
+SELECT * FROM vtt;
+
+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;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vtrd SET b1=b1+1 WHERE a1=1;
+
+--error ER_NON_UPDATABLE_TABLE
+UPDATE vtr SET b2=b2+1 WHERE a2=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vtrd SET b2=b2+1 WHERE a2=1;
+
+--error ER_NON_UPDATABLE_TABLE
+UPDATE vrt SET b1=b1+1 WHERE a1=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vrtd SET b1=b1+1 WHERE a1=1;
+
+UPDATE vrt SET b2=b2+1 WHERE a2=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vrtd SET b2=b2+1 WHERE a2=1;
+
+--error ER_NON_UPDATABLE_TABLE
+UPDATE vrr SET b1=b1+1 WHERE a1=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vrrd SET b1=b1+1 WHERE a1=1;
+
+--error ER_NON_UPDATABLE_TABLE
+UPDATE vrr SET b2=b2+1 WHERE a2=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vrrd SET b2=b2+1 WHERE a2=1;
+
+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;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vtrd, v0 SET b1=b1+1 WHERE a1=1;
+
+--error ER_NON_UPDATABLE_TABLE
+UPDATE vtr, v0 SET b2=b2+1 WHERE a2=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vtrd, v0 SET b2=b2+1 WHERE a2=1;
+
+--error ER_NON_UPDATABLE_TABLE
+UPDATE vrt, v0 SET b1=b1+1 WHERE a1=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vrtd, v0 SET b1=b1+1 WHERE a1=1;
+
+UPDATE vrt, v0 SET b2=b2+1 WHERE a2=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vrtd, v0 SET b2=b2+1 WHERE a2=1;
+
+--error ER_NON_UPDATABLE_TABLE
+UPDATE vrr, v0 SET b1=b1+1 WHERE a1=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vrrd, v0 SET b1=b1+1 WHERE a1=1;
+
+--error ER_NON_UPDATABLE_TABLE
+UPDATE vrr, v0 SET b2=b2+1 WHERE a2=1;
+
+--error ER_NO_SUCH_TABLE
+UPDATE vrrd, v0 SET b2=b2+1 WHERE a2=1;
+
+SELECT * FROM vtt;
+
+DROP VIEW v0, vtt, vtr, vrt, vrr, vmat1, vmat2;
+#DROP VIEW vtrd, vrtd, vrrd;
+DROP TABLE t0, t1, t2;
+
+
+--echo #
+--echo # BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION,
+--echo #               IS REJECTED
+
+--echo # 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;
+
+--echo # The column names are explicitly specified and not duplicates, hence
+--echo # succeeds.
+CREATE VIEW v2 (fld1, fld2) AS
+  SELECT 1 AS a, 2 AS a
+    UNION ALL
+  SELECT 1 AS a, 1 AS a;
+
+--echo # 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;
+
+--echo # Should report an error, since the explicitly specified column names are
+--echo # duplicates.
+--error ER_DUP_FIELDNAME
+CREATE VIEW v4 (fld1, fld1) AS
+  SELECT 1 AS a, 2 AS b
+    UNION ALL
+  SELECT 1 AS a, 1 AS a;
+
+--echo # Should report an error, since duplicate column name is specified in the
+--echo # First SELECT.
+--error ER_DUP_FIELDNAME
+CREATE VIEW v4 AS
+  SELECT 1 AS a, 2 AS a
+    UNION ALL
+  SELECT 1 AS a, 1 AS a;
+
+--echo # Cleanup
+DROP VIEW v1, v2, v3;
+
 
 # Check that all connections opened by test cases in this file are really
 # gone so execution of other tests won't be affected by their presence.
index b24bf893f5a6f327c286610271cb6c7f27c1623c..3ef9c2bc9aa4db239f4af72ba1f58bf4d142544c 100644 (file)
@@ -1,3 +1,4 @@
+--source include/have_profiling.inc
 --source include/not_embedded.inc
 --source include/have_validate_password_plugin.inc
 
index b36bd2067cc5d23eff87650eb696f451fefe76f7..cddaf64addc75cb3eb303e0434a8e705a2b9ad45 100644 (file)
@@ -676,3 +676,22 @@ SELECT ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b');
 --echo #
 --echo # End of 5.5 tests
 --echo #
+
+--echo #
+--echo # Bug#13358486 WEIGHT_STRING = MY_STRNXFRM_UNICODE:
+--echo #              ASSERTION `SRC' FAILED
+--echo #
+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;
+
+--echo #
+--echo # Bug#22552615 EXTRACTVALUE RETURNS NULL WHEN NO MATCHING
+--echo #              TEXT NODE IS FOUND FOR THE EXPRESSION
+--echo #
+
+set @x = '<MESSAGE><DATA1>HOLA</DATA1></MESSAGE>';
+set @y = 'Default Value';
+select ExtractValue( @x, '/MESSAGE/DATA2' ) into @y;
+select @y;
index f77ec7611197716d551479f4da8a908b860a0593..2bff5ebe8405107c75028709e36643cdc0a81b5b 100644 (file)
@@ -1,4 +1,4 @@
-# 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 Library General Public
    fun:mi_arena.*
    fun:malloc_info
 }
+
+{
+   GitHub codership/mysql-wsrep#176
+   Memcheck:Leak
+   fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+   fun:galera_parameters_get
+   fun:_ZL24refresh_provider_optionsv
+   fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+   fun:_Z24do_handle_one_connectionP3THD
+   fun:handle_one_connection
+}
+
+{
+   GitHub codership/galera#330
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:CRYPTO_malloc
+   fun:sk_new
+   obj:/usr/lib64/libssl.so.1.0.1e
+   fun:SSL_COMP_get_compression_methods
+   fun:SSL_library_init
+   fun:_ZN4asio3ssl6detail12openssl_initILb1EE7do_initC1Ev
+   fun:_ZN4asio3ssl6detail12openssl_initILb1EE7do_init8instanceEv
+   fun:_ZN4asio3ssl6detail12openssl_initILb1EEC1Ev
+   fun:_Z41__static_initialization_and_destruction_0ii.constprop.120
+   fun:call_init.part.0
+   fun:_dl_init
+   fun:dl_open_worker
+   fun:_dl_catch_error
+   fun:_dl_open
+   fun:dlopen_doit
+}
+{
+   GitHub codership/galera#330
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:CRYPTO_malloc
+   fun:sk_new
+   obj:/usr/lib64/libssl.so.1.0.1e
+   fun:SSL_COMP_get_compression_methods
+   fun:SSL_library_init
+   fun:_ZN4asio3ssl6detail12openssl_initILb1EE7do_initC1Ev
+   fun:_ZN4asio3ssl6detail12openssl_initILb1EE7do_init8instanceEv
+   fun:_ZN4asio3ssl6detail12openssl_initILb1EEC1Ev
+   fun:_Z41__static_initialization_and_destruction_0ii.constprop.120
+   fun:call_init.part.0
+   fun:_dl_init
+   fun:dl_open_worker
+   fun:_dl_catch_error
+   fun:_dl_open
+   fun:dlopen_doit
+}
+
+{
+   GitHub codership/mysql-wsrep#175
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:calloc
+   fun:do_lookup_x
+   fun:_dl_lookup_symbol_x
+   fun:_dl_relocate_object
+   fun:dl_open_worker
+   fun:_dl_catch_error
+   fun:_dl_open
+   fun:dlopen_doit
+   fun:_dl_catch_error
+   fun:_dlerror_run
+   fun:dlopen@@GLIBC_2.2.5
+   fun:wsrep_load
+   fun:_Z10wsrep_initv
+   fun:_Z18wsrep_init_startupb
+   fun:_ZL22init_server_componentsv
+   fun:_Z11mysqld_mainiPPc
+}
+
+{
+   galera/mysql-wsrep#147
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   fun:_ZNK6galera13ReplicatorSMM9stats_getEv
+   fun:_ZL28export_wsrep_status_to_mysqlP3THD
+   fun:_Z17wsrep_show_statusP3THDP17st_mysql_show_varPc
+   fun:_ZL17show_status_arrayP3THDPKcP17st_mysql_show_var13enum_var_typeP17system_status_varS2_P5TABLEbP4Item
+   fun:_Z11fill_statusP3THDP10TABLE_LISTP4Item
+   fun:_ZL13do_fill_tableP3THDP10TABLE_LISTP13st_join_table
+   fun:_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state
+   fun:_ZN4JOIN14prepare_resultEPP4ListI4ItemE
+   fun:_ZN4JOIN4execEv
+   fun:_ZL20mysql_execute_selectP3THDP13st_select_lexb
+   fun:_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_P10SQL_I_ListI8st_orderESB_S7_yP13select_resultP18st_select_lex_unitP13st_select_lex
+   fun:_Z13handle_selectP3THDP13select_resultm
+   fun:_ZL21execute_sqlcom_selectP3THDP10TABLE_LIST
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+}
+
+{
+g   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+   fun:galera_parameters_get
+   fun:_ZL24refresh_provider_optionsv
+   fun:_Z21wsrep_provider_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+   fun:_Z24do_handle_one_connectionP3THD
+   fun:handle_one_connection
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:DbugMalloc
+   fun:ListParse
+   fun:_gu_db_push_
+   fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+   fun:galera_parameters_set
+   fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+   fun:_Z24do_handle_one_connectionP3THD
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:state_map_insert
+   fun:code_state
+   fun:_gu_db_push_
+   fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+   fun:galera_parameters_set
+   fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+   fun:_Z24do_handle_one_connectionP3THD
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:DbugMalloc
+   fun:StrDup
+   fun:ListParse
+   fun:_gu_db_push_
+   fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+   fun:galera_parameters_set
+   fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:code_state
+   fun:_gu_db_push_
+   fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+   fun:galera_parameters_set
+   fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+   fun:_Z24do_handle_one_connectionP3THD
+   fun:handle_one_connection
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:DbugMalloc
+   fun:PushState
+   fun:_gu_db_push_
+   fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+   fun:galera_parameters_set
+   fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+   fun:_Z24do_handle_one_connectionP3THD
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   fun:strdup
+   fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+   fun:galera_parameters_get
+   fun:_ZL24refresh_provider_optionsv
+   fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+   fun:_Z24do_handle_one_connectionP3THD
+   fun:handle_one_connection
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:strdup
+   fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+   fun:galera_parameters_get
+   fun:_ZL24refresh_provider_optionsv
+   fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+   fun:_Z24do_handle_one_connectionP3THD
+   fun:handle_one_connection
+}
+
+{
+   codership/mysql-wsrep/issues#176
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:strdup
+   fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+   fun:galera_parameters_get
+   fun:_ZL24refresh_provider_optionsv
+   fun:_Z21wsrep_provider_updateP7sys_varP3THD13enum_var_type
+   fun:_ZN7sys_var6updateEP3THDP7set_var
+   fun:_ZN7set_var6updateEP3THD
+   fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
+   fun:_Z21mysql_execute_commandP3THD
+   fun:_Z11mysql_parseP3THDPcjP12Parser_state
+   fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
+   fun:_Z16dispatch_command19enum_server_commandP3THDPcj
+   fun:_Z10do_commandP3THD
+   fun:_Z24do_handle_one_connectionP3THD
+   fun:handle_one_connection
+}
+
+{
+   codership/galera#331
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:state_map_insert
+   fun:code_state
+   fun:_gu_db_keyword_
+   fun:_ZN6galera3ist6Sender4sendEll
+   fun:run_async_sender
+   fun:start_thread
+   fun:clone
+}
+
+{
+   codership/galera#331
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:code_state
+   fun:_gu_db_keyword_
+   fun:_ZN6galera3ist6Sender4sendEll
+   fun:run_async_sender
+   fun:start_thread
+   fun:clone
+}
+
+#supress warnings from openssl
+
+{
+   OpenSSL PB2 / 1
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:CRYPTO_malloc
+   fun:sk_new
+
+   fun:SSL_COMP_get_compression_methods
+   fun:SSL_library_init
+   fun:ssl_start
+   fun:_Z8init_sslv
+   fun:_Z11mysqld_mainiPPc
+   fun:main
+}
+
+{
+   OpenSSL PB2 / 2
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   fun:CRYPTO_malloc
+   fun:sk_new
+
+   fun:SSL_COMP_get_compression_methods
+   fun:SSL_library_init
+   fun:ssl_start
+   fun:_ZL8init_sslv
+   fun:_Z11mysqld_mainiPPc
+   fun:main
+}
index cc8a083e248cdf6544e17b7e74f2f31dc296335d..b880111d737e5243a328123e042f83218f932fc2 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2014, 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
@@ -76,6 +76,10 @@ TARGET_LINK_LIBRARIES(queues mysys)
 SET_TARGET_PROPERTIES(queues PROPERTIES COMPILE_FLAGS "-DMAIN")
 ADD_TEST(queues_test queues)
 
+ADD_EXECUTABLE(base64_test base64.c)
+SET_TARGET_PROPERTIES(base64_test PROPERTIES COMPILE_FLAGS "-DMAIN")
+TARGET_LINK_LIBRARIES(base64_test mysys)
+
 IF(MSVC)
    INSTALL_DEBUG_TARGET(mysys DESTINATION ${INSTALL_LIBDIR}/debug)
 ENDIF()
index 20f031e1322e37e77c38db3c660083abe26daabb..3deafeab9b3a3b2c1f6e35011830719982d719ea 100644 (file)
@@ -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
@@ -28,15 +28,15 @@ static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  * Maximum length base64_needed_encoded_length()
  * can handle without overflow.
  */
-int
+uint64
 base64_encode_max_arg_length()
 {
-#if (SIZEOF_INT == 8)
+#if (SIZEOF_VOIDP == 8)
   /*
     6827690988321067803 ->   9223372036854775805
     6827690988321067804 ->  -9223372036854775807
   */
-  return 0x5EC0D4C77B03531BLL
+  return 0x5EC0D4C77B03531BLL;
 #else
   /*
     1589695686 ->  2147483646
@@ -47,10 +47,11 @@ base64_encode_max_arg_length()
 }
 
 
-int
-base64_needed_encoded_length(int length_of_data)
+uint64
+base64_needed_encoded_length(uint64 length_of_data)
 {
-  int nb_base64_chars;
+  uint64 nb_base64_chars;
+  if (length_of_data == 0) return 1;
   nb_base64_chars= (length_of_data + 2) / 3 * 4;
 
   return
@@ -64,10 +65,10 @@ base64_needed_encoded_length(int length_of_data)
  * Maximum length base64_needed_decoded_length()
  * can handle without overflow.
  */
-int
+uint64
 base64_decode_max_arg_length()
 {
-#if (SIZEOF_INT == 8)
+#if (SIZEOF_VOIDP == 8)
   return 0x2AAAAAAAAAAAAAAALL;
 #else
   return 0x2AAAAAAA;
@@ -75,10 +76,10 @@ base64_decode_max_arg_length()
 }
 
 
-int
-base64_needed_decoded_length(int length_of_encoded_data)
+uint64
+base64_needed_decoded_length(uint64 length_of_encoded_data)
 {
-  return (int) ceil(length_of_encoded_data * 3 / 4);
+  return (uint64) ceil(length_of_encoded_data * 3 / 4);
 }
 
 
@@ -313,7 +314,7 @@ my_base64_decoder_getch(MY_BASE64_DECODER *decoder)
  * @flags         flags e.g. allow multiple chunks
  * @return Number of bytes written at 'dst', or -1 in case of failure
  */
-int
+int64
 base64_decode(const char *src_base, size_t len,
               void *dst, const char **end_ptr, int flags)
 {
@@ -379,16 +380,31 @@ main(void)
   size_t k, l;
   size_t dst_len;
   size_t needed_length;
-
-  for (i= 0; i < 500; i++)
+  char * src;
+  char * s;
+  char * str;
+  char * dst;
+  const char *end_ptr;
+  size_t src_len;
+
+  for (i= 0; i <= 500; i++)
   {
     /* Create source data */
-    const size_t src_len= rand() % 1000 + 1;
+    if (i == 500)
+    {
+#if (SIZEOF_VOIDP == 8)
+      printf("Test case for base64 max event length: 2119594243\n");
+      src_len= 2119594243;
+#else
+      printf("Test case for base64 max event length: 536870912\n");
+      src_len= 536870912;
+#endif
+    }
+    else
+     src_len= rand() % 1000 + 1;
 
-    char * src= (char *) malloc(src_len);
-    char * s= src;
-    char * str;
-    char * dst;
+    src= (char *) malloc(src_len);
+    s= src;
 
     require(src);
     for (j= 0; j<src_len; j++)
@@ -409,7 +425,7 @@ main(void)
     /* Decode */
     dst= (char *) malloc(base64_needed_decoded_length(strlen(str)));
     require(dst);
-    dst_len= base64_decode(str, strlen(str), dst, NULL);
+    dst_len= base64_decode(str, strlen(str), dst, &end_ptr, 0);
     require(dst_len == src_len);
 
     if (memcmp(src, dst, src_len) != 0)
@@ -437,6 +453,9 @@ main(void)
              (uint) src_len, (uint) dst_len);
       require(0);
     }
+    free(src);
+    free(str);
+    free(dst);
   }
   printf("Test succeeded.\n");
   return 0;
index 9f1f104260c2596c7065b4a1d666d32d87e33917..9972c1dd686f61cfd6babb2a793101572d9cca61 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2010, 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
@@ -45,7 +45,7 @@ const int LF_HASH_OVERHEAD= sizeof(LF_SLIST);
 
 /*
   a structure to pass the context (pointers two the three successive elements
-  in a list) from lfind to linsert/ldelete
+  in a list) from my_lfind to linsert/ldelete
 */
 typedef struct {
   intptr volatile *prev;
@@ -72,7 +72,7 @@ typedef struct {
     cursor is positioned in either case
     pins[0..2] are used, they are NOT removed on return
 */
-static int lfind(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
+static int my_lfind(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
                  const uchar *key, uint keylen, CURSOR *cursor, LF_PINS *pins)
 {
   uint32       cur_hashnr;
@@ -140,7 +140,7 @@ retry:
 /*
   DESCRIPTION
     insert a 'node' in the list that starts from 'head' in the correct
-    position (as found by lfind)
+    position (as found by my_lfind)
 
   RETURN
     0     - inserted
@@ -158,7 +158,7 @@ static LF_SLIST *linsert(LF_SLIST * volatile *head, CHARSET_INFO *cs,
 
   for (;;)
   {
-    if (lfind(head, cs, node->hashnr, node->key, node->keylen,
+    if (my_lfind(head, cs, node->hashnr, node->key, node->keylen,
               &cursor, pins) &&
         (flags & LF_HASH_UNIQUE))
     {
@@ -209,7 +209,7 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
 
   for (;;)
   {
-    if (!lfind(head, cs, hashnr, key, keylen, &cursor, pins))
+    if (!my_lfind(head, cs, hashnr, key, keylen, &cursor, pins))
     {
       res= 1; /* not found */
       break;
@@ -233,7 +233,7 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
             (to ensure the number of "set DELETED flag" actions
             is equal to the number of "remove from the list" actions)
           */
-          lfind(head, cs, hashnr, key, keylen, &cursor, pins);
+          my_lfind(head, cs, hashnr, key, keylen, &cursor, pins);
         }
         res= 0;
         break;
@@ -259,12 +259,12 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
     it uses pins[0..2], on return the pin[2] keeps the node found
     all other pins are removed.
 */
-static LF_SLIST *lsearch(LF_SLIST * volatile *head, CHARSET_INFO *cs,
+static LF_SLIST *my_lsearch(LF_SLIST * volatile *head, CHARSET_INFO *cs,
                          uint32 hashnr, const uchar *key, uint keylen,
                          LF_PINS *pins)
 {
   CURSOR cursor;
-  int res= lfind(head, cs, hashnr, key, keylen, &cursor, pins);
+  int res= my_lfind(head, cs, hashnr, key, keylen, &cursor, pins);
   if (res)
     _lf_pin(pins, 2, cursor.curr);
   _lf_unpin(pins, 0);
@@ -445,7 +445,7 @@ int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
     MY_ERRPTR    if OOM
 
   NOTE
-    see lsearch() for pin usage notes
+    see my_lsearch() for pin usage notes
 */
 void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
 {
@@ -459,7 +459,7 @@ void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
     return MY_ERRPTR;
   if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins)))
     return MY_ERRPTR;
-  found= lsearch(el, hash->charset, my_reverse_bits(hashnr) | 1,
+  found= my_lsearch(el, hash->charset, my_reverse_bits(hashnr) | 1,
                  (uchar *)key, keylen, pins);
   lf_rwunlock_by_pins(pins);
   return found ? found+1 : 0;
@@ -503,3 +503,187 @@ static int initialize_bucket(LF_HASH *hash, LF_SLIST * volatile *node,
   */
   return 0;
 }
+
+/**
+  Search for list element satisfying condition specified by match
+  function and position cursor on it.
+
+  @param head          Head of the list to search in.
+  @param first_hashnr  Hash value to start search from.
+  @param last_hashnr   Hash value to stop search after.
+  @param match         Match function.
+  @param cursor        Cursor to be position.
+  @param pins          LF_PINS for the calling thread to be used during
+                       search for pinning result.
+
+  @retval 0 - not found
+  @retval 1 - found
+*/
+
+static int lfind_match(LF_SLIST * volatile *head,
+                       uint32 first_hashnr, uint32 last_hashnr,
+                       lf_hash_match_func *match,
+                       CURSOR *cursor, LF_PINS *pins)
+{
+  uint32       cur_hashnr;
+  intptr       link;
+
+retry:
+  cursor->prev= (intptr *)head;
+  do { /* PTR() isn't necessary below, head is a dummy node */
+    cursor->curr= (LF_SLIST *)(*cursor->prev);
+    lf_pin(pins, 1, cursor->curr);
+  } while (*cursor->prev != (intptr)cursor->curr && LF_BACKOFF);
+  for (;;)
+  {
+    if (unlikely(!cursor->curr))
+      return 0; /* end of the list */
+    do {
+      /* QQ: XXX or goto retry ? */
+      link= cursor->curr->link;
+      cursor->next= PTR(link);
+      lf_pin(pins, 0, cursor->next);
+    } while (link != cursor->curr->link && LF_BACKOFF);
+    cur_hashnr= cursor->curr->hashnr;
+    if (*cursor->prev != (intptr)cursor->curr)
+    {
+      (void)LF_BACKOFF;
+      goto retry;
+    }
+    if (!DELETED(link))
+    {
+      if (cur_hashnr >= first_hashnr)
+      {
+        if (cur_hashnr > last_hashnr)
+          return 0;
+
+        if (cur_hashnr & 1)
+        {
+          /* Normal node. Check if element matches condition. */
+          if ((*match)((uchar *)(cursor->curr + 1)))
+            return 1;
+        }
+        else
+        {
+          /*
+            Dummy node. Nothing to check here.
+
+            Still thanks to the fact that dummy nodes are never deleted we
+            can save it as a safe place to restart iteration if ever needed.
+          */
+          head= (LF_SLIST * volatile *)&(cursor->curr->link);
+        }
+      }
+
+      cursor->prev= &(cursor->curr->link);
+      lf_pin(pins, 2, cursor->curr);
+    }
+    else
+    {
+      /*
+        we found a deleted node - be nice, help the other thread
+        and remove this deleted node
+      */
+      if (my_atomic_casptr((void **)cursor->prev,
+                           (void **)&cursor->curr, cursor->next))
+        lf_pinbox_free(pins, cursor->curr);
+      else
+      {
+        (void)LF_BACKOFF;
+        goto retry;
+      }
+    }
+    cursor->curr= cursor->next;
+    lf_pin(pins, 1, cursor->curr);
+  }
+}
+
+/**
+  Find random hash element which satisfies condition specified by
+  match function.
+
+  @param hash      Hash to search element in.
+  @param pin       Pins for calling thread to be used during search
+                   and for pinning its result.
+  @param match     Pointer to match function. This function takes
+                   pointer to object stored in hash as parameter
+                   and returns 0 if object doesn't satisfy its
+                   condition (and non-0 value if it does).
+  @param rand_val  Random value to be used for selecting hash
+                   bucket from which search in sort-ordered
+                   list needs to be started.
+
+  @retval A pointer to a random element matching condition.
+  @retval NULL      - if nothing is found
+  @retval MY_ERRPTR - OOM.
+
+  @note This function follows the same pinning protocol as lf_hash_search(),
+        i.e. uses pins[0..2]. On return pins[0..1] are removed and pins[2]
+        is used to pin object found. It is also not removed in case when
+        object is not found/error occurs but its value is undefined in
+        this case.
+        So calling lf_hash_unpin() is mandatory after call to this function
+        in case of both success and failure.
+*/
+
+void *lf_hash_random_match(LF_HASH *hash, LF_PINS *pins,
+                           lf_hash_match_func *match,
+                           uint rand_val)
+{
+  /* Convert random value to valid hash value. */
+  uint hashnr= (rand_val & INT_MAX32);
+  uint bucket;
+  uint32 rev_hashnr;
+  LF_SLIST * volatile *el;
+  CURSOR cursor;
+  int res;
+
+  bucket= hashnr % hash->size;
+  rev_hashnr= my_reverse_bits(hashnr);
+
+  el= lf_dynarray_lvalue(&hash->array, bucket);
+  if (unlikely(!el))
+    return MY_ERRPTR;
+  /*
+    Bucket might be totally empty if it has not been accessed since last
+    time LF_HASH::size has been increased. In this case we initialize it
+    by inserting dummy node for this bucket to the correct position in
+    split-ordered list. This should help future lf_hash_* calls trying to
+    access the same bucket.
+  */
+  if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins)))
+    return MY_ERRPTR;
+
+  /*
+    To avoid bias towards the first matching element in the bucket, we start
+    looking for elements with inversed hash value greater or equal than
+    inversed value of our random hash.
+  */
+  res= lfind_match(el, rev_hashnr | 1, UINT_MAX32, match, &cursor, pins);
+
+  if (! res && hashnr != 0)
+  {
+    /*
+      We have not found matching element - probably we were too close to
+      the tail of our split-ordered list. To avoid bias against elements
+      at the head of the list we restart our search from its head. Unless
+      we were already searching from it.
+
+      To avoid going through elements at which we have already looked
+      twice we stop once we reach element from which we have begun our
+      first search.
+    */
+    el= lf_dynarray_lvalue(&hash->array, 0);
+    if (unlikely(!el))
+      return MY_ERRPTR;
+    res= lfind_match(el, 1, rev_hashnr, match, &cursor, pins);
+  }
+
+  if (res)
+    lf_pin(pins, 2, cursor.curr);
+  lf_unpin(pins, 0);
+  lf_unpin(pins, 1);
+
+  return res ? cursor.curr + 1 : 0;
+}
+
index 40178ce8e5a6016f0f7593c74971cec35855e003..da66d458c727911da766daa18280f58e754d3448 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -1740,6 +1740,10 @@ int my_b_flush_io_cache(IO_CACHE *info,
   DBUG_ENTER("my_b_flush_io_cache");
   DBUG_PRINT("enter", ("cache: 0x%lx", (long) info));
 
+  DBUG_EXECUTE_IF("simulate_error_during_flush_cache_to_file",
+                  {
+                    DBUG_RETURN(TRUE);
+                  });
   if (!append_cache)
     need_append_buffer_lock= 0;
 
index 776435e0e7521b5963f822acb10913b57d4e27ef..812c3895becbe5382e1e7156ee0963718b52471c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, 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
@@ -47,7 +47,7 @@ char * my_load_path(char * to, const char *path,
       (void) strnmov(buff, path, FN_REFLEN);                   /* Return org file name */
   }
   else
-    (void) strxnmov(buff, FN_REFLEN, own_path_prefix, path, NullS);
+    (void) strxnmov(buff, sizeof(buff)-1, own_path_prefix, path, NullS);
   strnmov(to, buff, FN_REFLEN);
   to[FN_REFLEN-1]= '\0';
   DBUG_PRINT("exit",("to: %s",to));
index b590bc323a16e7541fadc14a3629cc10a501d8ee..78ba7cf30de34194f0a10e291166ab1b161ab848 100644 (file)
@@ -24,7 +24,7 @@
 #ifdef _MSC_VER
 #include <locale.h>
 #include <crtdbg.h>
-/* WSAStartup needs winsock library*/
+/* WSAStartup needs winsock library*/\r
 #pragma comment(lib, "ws2_32")
 #endif
 my_bool have_tcpip=0;
diff --git a/mysql-wsrep-5.6/mysys/my_isnan.c b/mysql-wsrep-5.6/mysys/my_isnan.c
deleted file mode 100644 (file)
index f24bbf3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
-
-#include "my_global.h"
-
-#ifdef __WIN__
-#include <float.h>
-#endif
-
-#include <math.h>
-
-double my_double_isnan(double x)
-{
-  return isnan(x);
-}
index 7212d7768efdefe41b823300e8d75a1bf6c3b4c3..566cc9b2a40e5486a10318a415db7894b4754721 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2003, 2014, 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
@@ -115,6 +115,8 @@ int my_sync(File fd, myf my_flags)
 } /* my_sync */
 
 
+#ifdef NEED_EXPLICIT_SYNC_DIR
+
 static const char cur_dir_name[]= {FN_CURLIB, 0};
 
 
@@ -130,8 +132,6 @@ static const char cur_dir_name[]= {FN_CURLIB, 0};
     0 if ok, !=0 if error
 */
 
-#ifdef NEED_EXPLICIT_SYNC_DIR
-
 int my_sync_dir(const char *dir_name, myf my_flags)
 {
   File dir_fd;
index 15131f8db65a1b87771ec909462f4020c071f2db..1de4fcad5b1d58577a89c7a53ae3ee60e1d88dfe 100644 (file)
@@ -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
@@ -88,6 +88,7 @@ static void check_native_cond_availability(void)
 
 static DWORD get_milliseconds(const struct timespec *abstime)
 {
+#ifndef HAVE_STRUCT_TIMESPEC
   long long millis; 
   union ft64 now;
 
@@ -118,6 +119,21 @@ static DWORD get_milliseconds(const struct timespec *abstime)
     millis= UINT_MAX;
 
   return (DWORD)millis;
+#else
+  /*
+    Convert timespec to millis and subtract current time.
+    my_getsystime() returns time in 100 ns units.
+  */
+  if (abstime == NULL)
+   return INFINITE;
+
+  ulonglong future= abstime->tv_sec * 1000 + abstime->tv_nsec / 1000000;
+  ulonglong now= my_getsystime() / 10000;
+  /* Don't allow the timeout to be negative. */
+  if (future < now)
+    return 0;
+  return (DWORD)(future - now);
+#endif
 }
 
 
index c6af352c509f22f5b191811fce8e506b7838829e..63d189a4ded238f704079320700dd3a5b011aedd 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -629,12 +629,11 @@ digest_start_noop(PSI_statement_locker *locker NNN)
   return NULL;
 }
 
-static PSI_digest_locker*
-digest_add_token_noop(PSI_digest_locker *locker NNN,
-                      uint token NNN,
-                      struct OPAQUE_LEX_YYSTYPE *yylval NNN)
+void
+digest_end_noop(PSI_digest_locker *locker NNN,
+                const struct sql_digest_storage *digest NNN)
 {
-  return NULL;
+  return;
 }
 
 static int
@@ -742,7 +741,7 @@ static PSI PSI_noop=
   set_socket_info_noop,
   set_socket_thread_owner_noop,
   digest_start_noop,
-  digest_add_token_noop,
+  digest_end_noop,
   set_thread_connect_attrs_noop
 };
 
index 9ef86321643b28f33fcb9baacc6fa7e61a351a6f..00f461aad601aa3b351090f5a26fb2e7b1492751 100644 (file)
@@ -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
@@ -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
@@ -377,18 +394,6 @@ has_old_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner)
   return 0;
 }
 
-static inline my_bool have_specific_lock(THR_LOCK_DATA *data,
-                                        enum thr_lock_type type)
-{
-  for ( ; data ; data=data->next)
-  {
-    if (data->type == type)
-      return 1;
-  }
-  return 0;
-}
-
-
 static void wake_up_waiters(THR_LOCK *lock);
 
 
@@ -536,6 +541,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 +651,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 +723,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 +757,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 +772,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 +815,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 +925,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);
index 3ce5bb84cd72fa8ae1d7d0735c0c25787d8cb637..da4ade5669a87149b801fffa972bc5994e76b5b8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, 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
@@ -294,7 +294,10 @@ uint32 wt_wait_stats[WT_WAIT_STATS+1];
 uint32 wt_cycle_stats[2][WT_CYCLE_STATS+1];
 uint32 wt_success_stats;
 
-static my_atomic_rwlock_t cycle_stats_lock, wait_stats_lock, success_stats_lock;
+static my_atomic_rwlock_t
+  cycle_stats_lock __attribute__((unused)),
+  wait_stats_lock __attribute__((unused)),
+  success_stats_lock __attribute__((unused));
 
 #ifdef SAFE_STATISTICS
 #define incr(VAR, LOCK)                           \
index 6712b79c1ba2b923c85b5b94bb37e63fc7ad006d..ff8f44c755dbb2e8022fcd628884488da74e7978 100644 (file)
@@ -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))
   {
index 3eefa78feee838da458519b789651b20fd329ee0..d67d23aeb5330f7da6845c2adbda483234bbeaa4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
@@ -1012,6 +1012,46 @@ static longlong eval_num_suffix(char *argument, int *error, char *option_name)
   return num;
 }
 
+/*
+  function: eval_num_suffix_ull
+
+  Transforms a number with a suffix to unsigned longlong number. Suffix can
+  be k|K for kilo, m|M for mega or g|G for giga.
+*/
+
+static ulonglong eval_num_suffix_ull(char *argument, int *error,
+                                     char *option_name)
+{
+  char *endchar;
+  ulonglong num;
+
+  *error= 0;
+  errno= 0;
+  num= strtoull(argument, &endchar, 10);
+  if (errno == ERANGE)
+  {
+    my_getopt_error_reporter(ERROR_LEVEL,
+                             "Incorrect unsigned integer value:'%s'", argument);
+    *error= 1;
+    return 0;
+  }
+  if (*endchar == 'k' || *endchar == 'K')
+    num*= 1024L;
+  else if (*endchar == 'm' || *endchar == 'M')
+    num*= 1024L * 1024L;
+  else if (*endchar == 'g' || *endchar == 'G')
+    num*= 1024L * 1024L * 1024L;
+  else if (*endchar)
+  {
+    fprintf(stderr,
+           "Unknown suffix '%c' used for variable '%s' (value '%s')\n",
+           *endchar, option_name, argument);
+    *error= 1;
+    return 0;
+  }
+  return num;
+}
+
 /* 
   function: getopt_ll
 
@@ -1107,6 +1147,14 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp,
   return num;
 }
 
+static inline my_bool is_negative_num(char* num)
+{
+  while (my_isspace(&my_charset_latin1, *num))
+    num++;
+
+  return (*num == '-');
+}
+
 /*
   function: getopt_ull
 
@@ -1116,7 +1164,20 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp,
 
 static ulonglong getopt_ull(char *arg, const struct my_option *optp, int *err)
 {
-  ulonglong num= eval_num_suffix(arg, err, (char*) optp->name);
+  char buf[255];
+  ulonglong num;
+
+  /* If a negative number is specified as a value for the option. */
+  if (arg == NULL || is_negative_num(arg) == TRUE)
+  {
+    num= (ulonglong) optp->min_value;
+    my_getopt_error_reporter(WARNING_LEVEL,
+                             "option '%s': value %s adjusted to %s",
+                             optp->name, arg, ullstr(num, buf));
+  }
+  else
+    num= eval_num_suffix_ull(arg, err, (char*) optp->name);
+
   return getopt_ull_limit_value(num, optp, NULL);
 }
 
index 4c14366a4e3e4e7edfca07e621648111949b4a6d..1ef0b421040bf9085144489a7fad63a66fec4ba3 100644 (file)
@@ -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
index befe0c8f1e8c6f0f38e0cf94b2688fac1787ba1c..ec10d9a9c2bb37fb3ca1d658a3e5661cc275f510 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 2013, 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
@@ -23,8 +23,15 @@ FIND_PATH(WIX_DIR heat.exe
   "$ENV{ProgramFiles}/Windows Installer XML v3/bin"
   "$ENV{ProgramFiles}/Windows Installer XML v3.5/bin"
   "$ENV{ProgramFiles}/WiX Toolset V3.6/bin"
+  "$ENV{ProgramFiles}/WiX Toolset V3.8/bin"
 )
 
+IF(NOT WIX_DIR)
+  FIND_PATH(WIX_DIR heat.exe
+    "$ENV{ProgramFiles}/WiX Toolset V3.10/bin"
+  )
+ENDIF()
+
 IF(NOT WIX_DIR)
   IF(NOT _WIX_DIR_CHECKED)
     SET(_WIX_DIR_CHECKED 1 CACHE INTERNAL "")
@@ -101,6 +108,7 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
   SET(WixWin64 " Win64='yes'")
 ELSE()
   SET(WixWin64)
+  SET(WixWin64 " Win64='no'")
 ENDIF()
 
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server_extra.wxs.in
index 9caae8375d8046bab4f06f7f3e2b6eb6d8948058..e9d886971d45be8e65d790815c07f1e2825f4dff 100644 (file)
-# Copyright (c) 2010, 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
-# 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
-
-IF(ESSENTIALS)
- SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles")
- SET(CPACK_WIX_UI "WixUI_InstallDir")
- IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
-  SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-winx64")
- ELSE()
-  SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-win32")
- ENDIF()
-ELSE()
-  SET(CPACK_COMPONENTS_USED 
-    "Server;Client;DataFiles;Development;SharedLibraries;Documentation;IniFiles;Readme;Server_Scripts;DebugBinaries")
-ENDIF()
-
-
-# Some components like Embedded are optional
-# We will build MSI without embedded if it was not selected for build
-#(need to modify CPACK_COMPONENTS_ALL for that)
-SET(CPACK_ALL)
-FOREACH(comp1 ${CPACK_COMPONENTS_USED})
- SET(found)
- FOREACH(comp2 ${CPACK_COMPONENTS_ALL})
-  IF(comp1 STREQUAL comp2)
-    SET(found 1)
-    BREAK()
-  ENDIF()
- ENDFOREACH()
- IF(found)
-   SET(CPACK_ALL ${CPACK_ALL} ${comp1})
- ENDIF()
-ENDFOREACH()
-SET(CPACK_COMPONENTS_ALL ${CPACK_ALL})
-
-# Always install (hidden), includes Readme files
-SET(CPACK_COMPONENT_GROUP_ALWAYSINSTALL_HIDDEN 1)
-SET(CPACK_COMPONENT_README_GROUP "AlwaysInstall")
-
-# Feature MySQL Server
-SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DISPLAY_NAME "MySQL Server")
-SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_EXPANDED "1")
-SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install MySQL Server")
- # Subfeature "Server" (hidden)
- SET(CPACK_COMPONENT_SERVER_GROUP "MySQLServer")
- SET(CPACK_COMPONENT_SERVER_HIDDEN 1)
- # Subfeature "Client" 
- SET(CPACK_COMPONENT_CLIENT_GROUP "MySQLServer")
- SET(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client Programs")
- SET(CPACK_COMPONENT_CLIENT_DESCRIPTION 
-   "Various helpful (commandline) tools including the mysql command line client" )
- # Subfeature "Debug binaries" 
- SET(CPACK_COMPONENT_DEBUGBINARIES_GROUP "MySQLServer")
- SET(CPACK_COMPONENT_DEBUGBINARIES_DISPLAY_NAME "Debug binaries")
- SET(CPACK_COMPONENT_DEBUGBINARIES_DESCRIPTION 
-   "Debug/trace versions of executables and libraries" )
- #SET(CPACK_COMPONENT_DEBUGBINARIES_WIX_LEVEL 2)
-  
-   
- #Subfeature "Data Files" 
- SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer")
- SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files")
- SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" )
- SET(CPACK_COMPONENT_DATAFILES_HIDDEN 1)
-#Feature "Devel"
-SET(CPACK_COMPONENT_GROUP_DEVEL_DISPLAY_NAME "Development Components")
-SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Installs C/C++ header files and libraries")
- #Subfeature "Development"
- SET(CPACK_COMPONENT_DEVELOPMENT_GROUP "Devel")
- SET(CPACK_COMPONENT_DEVELOPMENT_HIDDEN 1)
- #Subfeature "Shared libraries"
- SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "Devel")
- SET(CPACK_COMPONENT_SHAREDLIBRARIES_DISPLAY_NAME "Client C API library (shared)")
- SET(CPACK_COMPONENT_SHAREDLIBRARIES_DESCRIPTION "Installs shared client library")
- #Subfeature "Embedded"
- SET(CPACK_COMPONENT_EMBEDDED_GROUP "Devel")
- SET(CPACK_COMPONENT_EMBEDDED_DISPLAY_NAME "Embedded server library")
- SET(CPACK_COMPONENT_EMBEDDED_DESCRIPTION "Installs embedded server library")
- SET(CPACK_COMPONENT_EMBEDDED_WIX_LEVEL 2)
-
-#Feature Debug Symbols
-SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DISPLAY_NAME "Debug Symbols")
-SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DESCRIPTION "Installs Debug Symbols")
-SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_WIX_LEVEL 2)
- SET(CPACK_COMPONENT_DEBUGINFO_GROUP "DebugSymbols")
- SET(CPACK_COMPONENT_DEBUGINFO_HIDDEN 1)
-
-#Feature Documentation
-SET(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation")
-SET(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Installs documentation")
-SET(CPACK_COMPONENT_DOCUMENTATION_WIX_LEVEL 2)
-
-#Feature tests
-SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "Tests")
-SET(CPACK_COMPONENT_TEST_DESCRIPTION "Installs unittests (requires Perl to run)")
-SET(CPACK_COMPONENT_TEST_WIX_LEVEL 2)
-
-
-#Feature Misc (hidden, installs only if everything is installed)
-SET(CPACK_COMPONENT_GROUP_MISC_HIDDEN 1)
-SET(CPACK_COMPONENT_GROUP_MISC_WIX_LEVEL 100)
-  SET(CPACK_COMPONENT_INIFILES_GROUP "Misc")
-  SET(CPACK_COMPONENT_SERVER_SCRIPTS_GROUP "Misc")
+# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.\r
+# \r
+# This program is free software; you can redistribute it and/or modify\r
+# it under the terms of the GNU General Public License as published by\r
+# the Free Software Foundation; version 2 of the License.\r
+# \r
+# This program is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+# GNU General Public License for more details.\r
+# \r
+# You should have received a copy of the GNU General Public License\r
+# along with this program; if not, write to the Free Software\r
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA\r
+\r
+IF(ESSENTIALS)\r
+ SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles")\r
+ SET(CPACK_WIX_UI "WixUI_InstallDir")\r
+ IF(CMAKE_SIZEOF_VOID_P MATCHES 8)\r
+  SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-winx64")\r
+ ELSE()\r
+  SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-win32")\r
+ ENDIF()\r
+ELSE()\r
+  SET(CPACK_COMPONENTS_USED \r
+    "Server;Client;DataFiles;Development;SharedLibraries;Documentation;IniFiles;Readme;Server_Scripts")\r
+ENDIF()\r
+\r
+\r
+# Some components like Embedded are optional\r
+# We will build MSI without embedded if it was not selected for build\r
+#(need to modify CPACK_COMPONENTS_ALL for that)\r
+SET(CPACK_ALL)\r
+FOREACH(comp1 ${CPACK_COMPONENTS_USED})\r
+ SET(found)\r
+ FOREACH(comp2 ${CPACK_COMPONENTS_ALL})\r
+  IF(comp1 STREQUAL comp2)\r
+    SET(found 1)\r
+    BREAK()\r
+  ENDIF()\r
+ ENDFOREACH()\r
+ IF(found)\r
+   SET(CPACK_ALL ${CPACK_ALL} ${comp1})\r
+ ENDIF()\r
+ENDFOREACH()\r
+SET(CPACK_COMPONENTS_ALL ${CPACK_ALL})\r
+\r
+# Always install (hidden), includes Readme files\r
+SET(CPACK_COMPONENT_GROUP_ALWAYSINSTALL_HIDDEN 1)\r
+SET(CPACK_COMPONENT_README_GROUP "AlwaysInstall")\r
+\r
+# Feature MySQL Server\r
+SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DISPLAY_NAME "MySQL Server")\r
+SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_EXPANDED "1")\r
+SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install MySQL Server")\r
+ # Subfeature "Server" (hidden)\r
+ SET(CPACK_COMPONENT_SERVER_GROUP "MySQLServer")\r
+ SET(CPACK_COMPONENT_SERVER_HIDDEN 1)\r
+ # Subfeature "Client" \r
+ SET(CPACK_COMPONENT_CLIENT_GROUP "MySQLServer")\r
+ SET(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client Programs")\r
+ SET(CPACK_COMPONENT_CLIENT_DESCRIPTION \r
+   "Various helpful (commandline) tools including the mysql command line client" )\r
+ # Subfeature "Debug binaries" \r
+ #SET(CPACK_COMPONENT_DEBUGBINARIES_GROUP "MySQLServer")\r
+ #SET(CPACK_COMPONENT_DEBUGBINARIES_DISPLAY_NAME "Debug binaries")\r
+ #SET(CPACK_COMPONENT_DEBUGBINARIES_DESCRIPTION \r
+ #  "Debug/trace versions of executables and libraries" )\r
+ #SET(CPACK_COMPONENT_DEBUGBINARIES_WIX_LEVEL 2)\r
+  \r
+   \r
+ #Subfeature "Data Files" \r
+ SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer")\r
+ SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files")\r
+ SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" )\r
+ SET(CPACK_COMPONENT_DATAFILES_HIDDEN 1)\r
\r
\r
+#Feature "Devel"\r
+SET(CPACK_COMPONENT_GROUP_DEVEL_DISPLAY_NAME "Development Components")\r
+SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Installs C/C++ header files and libraries")\r
+ #Subfeature "Development"\r
+ SET(CPACK_COMPONENT_DEVELOPMENT_GROUP "Devel")\r
+ SET(CPACK_COMPONENT_DEVELOPMENT_HIDDEN 1)\r
\r
+ #Subfeature "Shared libraries"\r
+ SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "Devel")\r
+ SET(CPACK_COMPONENT_SHAREDLIBRARIES_DISPLAY_NAME "Client C API library (shared)")\r
+ SET(CPACK_COMPONENT_SHAREDLIBRARIES_DESCRIPTION "Installs shared client library")\r
\r
+ #Subfeature "Embedded"\r
+ SET(CPACK_COMPONENT_EMBEDDED_GROUP "Devel")\r
+ SET(CPACK_COMPONENT_EMBEDDED_DISPLAY_NAME "Embedded server library")\r
+ SET(CPACK_COMPONENT_EMBEDDED_DESCRIPTION "Installs embedded server library")\r
+ SET(CPACK_COMPONENT_EMBEDDED_WIX_LEVEL 2)\r
+\r
+#Feature Debug Symbols\r
+SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DISPLAY_NAME "Debug Symbols")\r
+SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DESCRIPTION "Installs Debug Symbols")\r
+SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_WIX_LEVEL 2)\r
+ SET(CPACK_COMPONENT_DEBUGINFO_GROUP "DebugSymbols")\r
+ SET(CPACK_COMPONENT_DEBUGINFO_HIDDEN 1)\r
+\r
+#Feature Documentation\r
+SET(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation")\r
+SET(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Installs documentation")\r
+SET(CPACK_COMPONENT_DOCUMENTATION_WIX_LEVEL 2)\r
+\r
+#Feature tests\r
+SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "Tests")\r
+SET(CPACK_COMPONENT_TEST_DESCRIPTION "Installs unittests (requires Perl to run)")\r
+SET(CPACK_COMPONENT_TEST_WIX_LEVEL 2)\r
+\r
+\r
+#Feature Misc (hidden, installs only if everything is installed)\r
+SET(CPACK_COMPONENT_GROUP_MISC_HIDDEN 1)\r
+SET(CPACK_COMPONENT_GROUP_MISC_WIX_LEVEL 100)\r
+  SET(CPACK_COMPONENT_INIFILES_GROUP "Misc")\r
+  SET(CPACK_COMPONENT_SERVER_SCRIPTS_GROUP "Misc")\r
index 81622a1d158e76615cea7a5b86f5345db01dd786..2afa5aff64d0715dea4e722b1f393aff5e8217ba 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 2011, 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
 # 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(${WIX_DIR}/../SDK/inc ${WIX_DIR}/SDK/inc)
-LINK_DIRECTORIES(${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib)
-
-SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def)
-
 IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
-  SET(WIX_ARCH_SUFFIX "_x64")
+  SET(WIX_ARCH "x64")
 ELSE()
-  SET(WIX_ARCH_SUFFIX)
+  SET(WIX_ARCH "x86")
 ENDIF()
 
-IF(MSVC_VERSION EQUAL 1400)
-  SET(WIX35_MSVC_SUFFIX "_2005")
-ELSEIF(MSVC_VERSION EQUAL 1500)
-  SET(WIX35_MSVC_SUFFIX "_2008")
+IF(MSVC_VERSION EQUAL 1900)
+  SET(WIX_MSVC_DIR "VS2015")
+ELSEIF(MSVC_VERSION EQUAL 1800)
+  SET(WIX_MSVC_DIR "VS2013")
 ELSEIF(MSVC_VERSION EQUAL 1600)
-  SET(WIX35_MSVC_SUFFIX "_2010")
+  SET(WIX_MSVC_DIR "VS2010")
 ELSE()
   # When next VS is out, add the correct version here
   MESSAGE(FATAL_ERROR "Unknown VS version")
 ENDIF()
 
-MESSAGE(STATUS "Searching for wcautil${WIX_ARCH_SUFFIX} or wcautil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX} in ${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib")
-MESSAGE(STATUS "Searching for dutil${WIX_ARCH_SUFFIX} or dutil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX} in ${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib")
+INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/inc)
+LINK_DIRECTORIES(${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH})
+
+SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def)
+
+MESSAGE(STATUS "Searching for wcautil in ${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH}")
+MESSAGE(STATUS "Searching for dutil in ${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH}")
 
 FIND_LIBRARY(WIX_WCAUTIL_LIBRARY 
-  NAMES wcautil${WIX_ARCH_SUFFIX}  wcautil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
-  HINTS ${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib)
+  NAMES wcautil
+  PATHS ${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH})
 
 FIND_LIBRARY(WIX_DUTIL_LIBRARY 
-  NAMES dutil${WIX_ARCH_SUFFIX}  dutil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
-  PATHS ${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib)
+  NAMES dutil
+  PATHS ${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH})
 
 MESSAGE(STATUS "Found: ${WIX_WCAUTIL_LIBRARY}")
 MESSAGE(STATUS "Found: ${WIX_DUTIL_LIBRARY}")
index d0a8f0046cff27752858d65f5220790af1d77528..8de271fc1cff9bdbb8267ec5dc585eaf03ab6cad 100644 (file)
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
-SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
-SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@")
-SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@")
-SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
-SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@")
-SET(VERSION "@VERSION@")
-SET(MAJOR_VERSION "@MAJOR_VERSION@")
-SET(MINOR_VERSION "@MINOR_VERSION@")
-SET(PATCH_VERSION "@PATCH_VERSION@")
-SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
-SET(MANUFACTURER "@MANUFACTURER@")
-SET(WIXCA_LOCATION "@WIXCA_LOCATION@")
-SET(COPYING_RTF "@COPYING_RTF@")
-SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@")
-SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@")
-
-LIST(APPEND EXCLUDE_DIRS
-     bin/debug
-     data/test
-     lib/plugin/debug
-     mysql-test
-     scripts
-     sql-bench
-)
-
-LIST(APPEND EXCLUDE_FILES
-     bin/echo.exe
-     bin/mysql_client_test_embedded.exe
-     bin/mysqld-debug.exe
-     bin/mysqltest_embedded.exe
-     bin/replace.exe
-     lib/debug/mysqlserver.lib
-     lib/libmysqld.dll
-     lib/libmysqld.lib
-     lib/mysqlserver.lib
-     lib/mysqlservices.lib
-)
-
-IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
-  SET(Win64 " Win64='yes'")
-  SET(Platform x64)
-  SET(PlatformProgramFilesFolder ProgramFiles64Folder)
-ELSE()
-  SET(Platform x86)
-  SET(PlatformProgramFilesFolder ProgramFilesFolder)
-  SET(Win64)
-ENDIF()
-
-SET(ENV{VS_UNICODE_OUTPUT})
-
-# Switch off the monolithic install
-EXECUTE_PROCESS(
-  COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=0 ${CMAKE_BINARY_DIR}
-  OUTPUT_QUIET
-)
-
-INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)
-
-IF(CPACK_WIX_CONFIG)
-  INCLUDE(${CPACK_WIX_CONFIG})
-ENDIF()
-
-IF(NOT CPACK_WIX_UI)
-  SET(CPACK_WIX_UI "WixUI_Mondo_Custom")
-ENDIF()
-
-SET(WIX_FEATURES)
-FOREACH(comp ${CPACK_COMPONENTS_ALL})
- STRING(TOUPPER "${comp}" comp_upper)
- IF(NOT CPACK_COMPONENT_${comp_upper}_GROUP)
-   SET(WIX_FEATURE_${comp_upper}_COMPONENTS "${comp}")
-   SET(CPACK_COMPONENT_${comp_upper}_HIDDEN 1)
-   SET(CPACK_COMPONENT_GROUP_${comp_upper}_DISPLAY_NAME ${CPACK_COMPONENT_${comp_upper}_DISPLAY_NAME})
-   SET(CPACK_COMPONENT_GROUP_${comp_upper}_DESCRIPTION ${CPACK_COMPONENT_${comp_upper}_DESCRIPTION})
-   SET(CPACK_COMPONENT_GROUP_${comp_upper}_WIX_LEVEL ${CPACK_COMPONENT_${comp_upper}_WIX_LEVEL})
-   SET(WIX_FEATURES ${WIX_FEATURES} WIX_FEATURE_${comp_upper})
- ELSE()
-   SET(FEATURE_NAME WIX_FEATURE_${CPACK_COMPONENT_${comp_upper}_GROUP})
-   SET(WIX_FEATURES ${WIX_FEATURES} ${FEATURE_NAME})
-   LIST(APPEND ${FEATURE_NAME}_COMPONENTS ${comp})
- ENDIF()
-ENDFOREACH()
-
-LIST(REMOVE_DUPLICATES WIX_FEATURES)
-
-SET(CPACK_WIX_FEATURES)
-
-FOREACH(f ${WIX_FEATURES})
- STRING(TOUPPER "${f}" f_upper)
- STRING(REPLACE "WIX_FEATURE_" "" f_upper ${f_upper})
- IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
-  SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME})
- ELSE()
-  SET(TITLE  CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
- ENDIF()
-
- IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
-  SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION})
- ELSE()
-  SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
- ENDIF()
- IF(CPACK_COMPONENT_${f_upper}_WIX_LEVEL)
-   SET(Level ${CPACK_COMPONENT_${f_upper}_WIX_LEVEL})
- ELSE()
-   SET(Level 1)
- ENDIF()
- IF(CPACK_COMPONENT_GROUP_${f_upper}_HIDDEN)
-   SET(DISPLAY "Display='hidden'")
-   SET(TITLE ${f_upper})
-   SET(DESCRIPTION ${f_upper})
- ELSE()
-   SET(DISPLAY)
-   IF(CPACK_COMPONENT_GROUP_${f_upper}_EXPANDED)
-    SET(DISPLAY "Display='expand'")
-   ENDIF()
-   IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
-    SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME})
-   ELSE()
-     SET(TITLE  CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
-   ENDIF()
-   IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
-     SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION})
-   ELSE()
-     SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
-   ENDIF()
- ENDIF()
- SET(CPACK_WIX_FEATURES 
- "${CPACK_WIX_FEATURES}
-   <Feature  Id='${f_upper}'
-     Title='${TITLE}'
-     Description='${DESCRIPTION}'
-     ConfigurableDirectory='INSTALLDIR'
-     Level='${Level}' ${DISPLAY} >"
-  )
- FOREACH(c ${${f}_COMPONENTS})
-   STRING(TOUPPER "${c}" c_upper)
-   IF (CPACK_COMPONENT_${c_upper}_DISPLAY_NAME)
-    SET(TITLE ${CPACK_COMPONENT_${c_upper}_DISPLAY_NAME})
-   ELSE()
-    SET(TITLE CPACK_COMPONENT_${c_upper}_DISPLAY_NAME)
-   ENDIF()
-
-   IF (CPACK_COMPONENT_${c_upper}_DESCRIPTION)
-     SET(DESCRIPTION ${CPACK_COMPONENT_${c_upper}_DESCRIPTION})
-   ELSE()
-     SET(DESCRIPTION CPACK_COMPONENT_${c_upper}_DESCRIPTION)
-   ENDIF()
-   IF(CPACK_COMPONENT_${c_upper}_WIX_LEVEL)
-    SET(Level ${CPACK_COMPONENT_${c_upper}_WIX_LEVEL})
-   ELSE()
-    SET(Level 1)
-   ENDIF()
-   IF(CPACK_COMPONENT_${c_upper}_HIDDEN)
-   SET(CPACK_WIX_FEATURES
-   "${CPACK_WIX_FEATURES} 
-     <ComponentGroupRef Id='componentgroup.${c}'/>")
-   ELSE()
-   SET(CPACK_WIX_FEATURES
-   "${CPACK_WIX_FEATURES} 
-    <Feature Id='${c}' 
-       Title='${TITLE}'
-       Description='${DESCRIPTION}'
-       ConfigurableDirectory='INSTALLDIR'
-       Level='${Level}'>
-       <ComponentGroupRef Id='componentgroup.${c}'/>
-    </Feature>")
-  ENDIF()
-  
-  ENDFOREACH()
-   SET(CPACK_WIX_FEATURES
-   "${CPACK_WIX_FEATURES}
-   </Feature>
-   ") 
-ENDFOREACH()
-
-
-IF(CMAKE_INSTALL_CONFIG_NAME)
-  STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}" 
-    WIXCA_LOCATION "${WIXCA_LOCATION}")
-  SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}")
-ENDIF()
-
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in 
- ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)
-
-FOREACH(comp ${CPACK_COMPONENTS_ALL})
- SET(ENV{DESTDIR} testinstall/${comp})
- SET(DIRS ${DIRS} testinstall/${comp})
- EXECUTE_PROCESS(
-  COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DCMAKE_INSTALL_COMPONENT=${comp}  
-   -DCMAKE_INSTALL_PREFIX=  -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
-   OUTPUT_QUIET
-  )
-ENDFOREACH()
-
-MACRO(GENERATE_GUID VarName)
- EXECUTE_PROCESS(COMMAND uuidgen -c 
- OUTPUT_VARIABLE ${VarName}
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-ENDMACRO()
-
-SET(INC_VAR 0)
-MACRO(MAKE_WIX_IDENTIFIER str varname)
-  STRING(REPLACE "/" "." ${varname} "${str}")
-  STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}")
-  STRING(LENGTH "${${varname}}" len)
-  # Identifier should be smaller than 72 character
-  # We have to cut down the length to 70 chars, since we add 2 char prefix
-  # pretty often
-  IF(len GREATER 70)
-   STRING(SUBSTRING  "${${varname}}" 0 67 shortstr)
-   MATH(EXPR INC_VAR ${INC_VAR}+1)
-   SET(${varname} "${shortstr}${INC_VAR}")
-  ENDIF()
-ENDMACRO()
-
-
-FUNCTION(TRAVERSE_FILES dir topdir file file_comp  dir_root)
-  FILE(RELATIVE_PATH dir_rel ${topdir} ${dir})
-  IF(dir_rel)
-    LIST(FIND EXCLUDE_DIRS ${dir_rel} TO_EXCLUDE)
-    IF(NOT TO_EXCLUDE EQUAL -1)
-      MESSAGE(STATUS "excluding directory: ${dir_rel}")
-      RETURN()
-    ENDIF()
-  ENDIF()
-  FILE(GLOB all_files ${dir}/*)
-  IF(NOT all_files)
-    RETURN()
-  ENDIF()
-  IF(dir_rel)
-   MAKE_DIRECTORY(${dir_root}/${dir_rel})
-   MAKE_WIX_IDENTIFIER("${dir_rel}" id)
-   SET(DirectoryRefId  "D.${id}")
-  ELSE()
-   SET(DirectoryRefId "INSTALLDIR")
-  ENDIF()
-  FILE(APPEND ${file} "<DirectoryRef Id='${DirectoryRefId}'>\n")
-  SET(NONEXEFILES)
-  FOREACH(f ${all_files})
-    IF(NOT IS_DIRECTORY ${f})
-      FILE(RELATIVE_PATH rel ${topdir} ${f})
-      SET(TO_EXCLUDE)
-      IF(rel MATCHES "\\.pdb$")
-        SET(TO_EXCLUDE TRUE)
-      ELSE()
-        LIST(FIND EXCLUDE_FILES ${rel} RES)
-        IF(NOT RES EQUAL -1)
-          SET(TO_EXCLUDE TRUE)
-        ENDIF()
-      ENDIF()
-      IF(TO_EXCLUDE)
-        MESSAGE(STATUS "excluding file: ${rel}")
-      ELSE()
-       MAKE_WIX_IDENTIFIER("${rel}" id)
-       FILE(TO_NATIVE_PATH ${f} f_native)
-       GET_FILENAME_COMPONENT(f_ext "${f}" EXT)
-       # According to MSDN each DLL or EXE should be in the own component
-       IF(f_ext MATCHES ".exe" OR f_ext MATCHES ".dll")
-
-         FILE(APPEND ${file} "  <Component Id='C.${id}' Guid='*' ${Win64}>\n")
-         FILE(APPEND ${file} "    <File Id='F.${id}' KeyPath='yes' Source='${f_native}'/>\n")
-         FILE(APPEND ${file} "  </Component>\n")
-         FILE(APPEND ${file_comp} "  <ComponentRef Id='C.${id}'/>\n")
-       ELSE()
-       SET(NONEXEFILES  "${NONEXEFILES}\n<File Id='F.${id}' Source='${f_native}'/>" )
-       ENDIF()
-      ENDIF()
-    ENDIF()
-  ENDFOREACH()
-  FILE(APPEND ${file} "</DirectoryRef>\n")
-  IF(NONEXEFILES)
-    GENERATE_GUID(guid)
-    SET(ComponentId "C._files_${COMP_NAME}.${DirectoryRefId}")
-    FILE(APPEND ${file} 
-    "<DirectoryRef Id='${DirectoryRefId}'>\n<Component Guid='${guid}' Id='${ComponentId}' ${Win64}>${NONEXEFILES}\n</Component></DirectoryRef>\n")
-       FILE(APPEND ${file_comp} "  <ComponentRef Id='${ComponentId}'/>\n")
-  ENDIF()
-  FOREACH(f ${all_files})
-    IF(IS_DIRECTORY ${f})
-      TRAVERSE_FILES(${f} ${topdir} ${file} ${file_comp}  ${dir_root})
-    ENDIF()
-  ENDFOREACH()
-ENDFUNCTION()
-
-FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
-  FILE(RELATIVE_PATH rel ${topdir} ${dir})
-  IF(rel)
-    MAKE_WIX_IDENTIFIER("${rel}" id)
-    GET_FILENAME_COMPONENT(name ${dir} NAME)
-    FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n")
-  ENDIF()
-  FILE(GLOB all_files ${dir}/*)
-  FOREACH(f ${all_files})
-    IF(IS_DIRECTORY ${f})
-      TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix}  ")
-    ENDIF()
-  ENDFOREACH()
-  IF(rel)
-    FILE(APPEND ${file} "${prefix}</Directory>\n")
-  ENDIF()
-ENDFUNCTION()
-
-SET(CPACK_WIX_COMPONENTS)
-SET(CPACK_WIX_COMPONENT_GROUPS)
-GET_FILENAME_COMPONENT(abs . ABSOLUTE)
-FOREACH(d ${DIRS})
-  GET_FILENAME_COMPONENT(d ${d} ABSOLUTE)
-  GET_FILENAME_COMPONENT(d_name ${d} NAME)
-  FILE(WRITE ${abs}/${d_name}_component_group.wxs  "<ComponentGroup Id='componentgroup.${d_name}'>")
-  SET(COMP_NAME ${d_name})
-  TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs")
-  FILE(APPEND  ${abs}/${d_name}_component_group.wxs   "</ComponentGroup>")
-  IF(EXISTS ${d_name}.wxs)
-    FILE(READ ${d_name}.wxs WIX_TMP)
-    SET(CPACK_WIX_COMPONENTS "${CPACK_WIX_COMPONENTS}\n${WIX_TMP}")
-    FILE(REMOVE ${d_name}.wxs)
-  ENDIF()
-  
-  FILE(READ ${d_name}_component_group.wxs WIX_TMP)
-  SET(CPACK_WIX_COMPONENT_GROUPS "${CPACK_WIX_COMPONENT_GROUPS}\n${WIX_TMP}")
-  FILE(REMOVE ${d_name}_component_group.wxs)
-ENDFOREACH()
-
-FILE(WRITE directories.wxs "<DirectoryRef Id='INSTALLDIR'>\n")
-TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")
-FILE(APPEND directories.wxs "</DirectoryRef>\n")
-
-FILE(READ directories.wxs CPACK_WIX_DIRECTORIES)
-FILE(REMOVE directories.wxs)
-
-
-FOREACH(src ${CPACK_WIX_INCLUDE})
-SET(CPACK_WIX_INCLUDES 
-"${CPACK_WIX_INCLUDES}
- <?include ${src}?>"
-)
-ENDFOREACH()
-
-
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in 
- ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)
-
-SET(EXTRA_CANDLE_ARGS)
-IF("$ENV{EXTRA_CANDLE_ARGS}")
-       SET(EXTRA_CANDLE_ARGS "$ENV{EXTRA_CANDLE_ARGS}")
-ENDIF()
-
-SET(EXTRA_LIGHT_ARGS)
-IF("$ENV{EXTRA_LIGHT_ARGS}")
-       SET(EXTRA_LIGHT_ARGS "$ENV{EXTRA_LIGHT_ARGS}")
-ENDIF()
-
-FILE(REMOVE mysql_server.wixobj)
-EXECUTE_PROCESS(
- COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension  mysql_server.wxs ${EXTRA_CANDLE_ARGS}
- RESULT_VARIABLE CANDLE_RESULT
-)
-
-IF(CANDLE_RESULT)
-  MESSAGE(FATAL_ERROR "ERROR: can't run candle")
-ENDIF()
-
-EXECUTE_PROCESS(
- COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension
-  mysql_server.wixobj  -out  ${CPACK_PACKAGE_FILE_NAME}.msi
-  ${EXTRA_LIGHT_ARGS}
- RESULT_VARIABLE LIGHT_RESULT
-)
-
-IF(LIGHT_RESULT)
-  MESSAGE(FATAL_ERROR "ERROR: can't run light")
-ENDIF()
-
-# Switch monolithic install on again
-EXECUTE_PROCESS(
-  COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=1 ${CMAKE_BINARY_DIR}
-)
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.\r
+# \r
+# This program is free software; you can redistribute it and/or modify\r
+# it under the terms of the GNU General Public License as published by\r
+# the Free Software Foundation; version 2 of the License.\r
+# \r
+# This program is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+# GNU General Public License for more details.\r
+# \r
+# You should have received a copy of the GNU General Public License\r
+# along with this program; if not, write to the Free Software\r
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
+\r
+SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")\r
+SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")\r
+SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@")\r
+SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@")\r
+SET(CMAKE_COMMAND "@CMAKE_COMMAND@")\r
+SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@")\r
+SET(VERSION "@VERSION@")\r
+SET(MAJOR_VERSION "@MAJOR_VERSION@")\r
+SET(MINOR_VERSION "@MINOR_VERSION@")\r
+SET(PATCH_VERSION "@PATCH_VERSION@")\r
+SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)\r
+SET(MANUFACTURER "@MANUFACTURER@")\r
+SET(WIXCA_LOCATION "@WIXCA_LOCATION@")\r
+SET(COPYING_RTF "@COPYING_RTF@")\r
+SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@")\r
+SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@")\r
+\r
+LIST(APPEND EXCLUDE_DIRS\r
+     bin/debug\r
+     data/test\r
+     lib/plugin/debug\r
+     mysql-test\r
+     scripts\r
+     sql-bench\r
+)\r
+\r
+LIST(APPEND EXCLUDE_FILES\r
+     bin/echo.exe\r
+     bin/mysql_client_test_embedded.exe\r
+     bin/mysqld-debug.exe\r
+     bin/mysqltest_embedded.exe\r
+     bin/replace.exe\r
+     lib/debug/mysqlserver.lib\r
+     lib/libmysqld.dll\r
+     lib/libmysqld.lib\r
+     lib/mysqlserver.lib\r
+     lib/mysqlservices.lib\r
+)\r
+\r
+IF(CMAKE_SIZEOF_VOID_P EQUAL 8)\r
+  SET(Win64 " Win64='yes'")\r
+  SET(Platform x64)\r
+  SET(PlatformProgramFilesFolder ProgramFiles64Folder)\r
+ELSE()\r
+  SET(Platform x86)\r
+  SET(PlatformProgramFilesFolder ProgramFilesFolder)\r
+  SET(Win64)\r
+ENDIF()\r
+\r
+SET(ENV{VS_UNICODE_OUTPUT})\r
+\r
+# Switch off the monolithic install\r
+EXECUTE_PROCESS(\r
+  COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=0 ${CMAKE_BINARY_DIR}\r
+  OUTPUT_QUIET\r
+)\r
+\r
+INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)\r
+\r
+IF(CPACK_WIX_CONFIG)\r
+  INCLUDE(${CPACK_WIX_CONFIG})\r
+ENDIF()\r
+\r
+IF(NOT CPACK_WIX_UI)\r
+  SET(CPACK_WIX_UI "WixUI_Mondo_Custom")\r
+ENDIF()\r
+\r
+SET(WIX_FEATURES)\r
+FOREACH(comp ${CPACK_COMPONENTS_ALL})\r
+ STRING(TOUPPER "${comp}" comp_upper)\r
+ IF(NOT CPACK_COMPONENT_${comp_upper}_GROUP)\r
+   SET(WIX_FEATURE_${comp_upper}_COMPONENTS "${comp}")\r
+   SET(CPACK_COMPONENT_${comp_upper}_HIDDEN 1)\r
+   SET(CPACK_COMPONENT_GROUP_${comp_upper}_DISPLAY_NAME ${CPACK_COMPONENT_${comp_upper}_DISPLAY_NAME})\r
+   SET(CPACK_COMPONENT_GROUP_${comp_upper}_DESCRIPTION ${CPACK_COMPONENT_${comp_upper}_DESCRIPTION})\r
+   SET(CPACK_COMPONENT_GROUP_${comp_upper}_WIX_LEVEL ${CPACK_COMPONENT_${comp_upper}_WIX_LEVEL})\r
+   SET(WIX_FEATURES ${WIX_FEATURES} WIX_FEATURE_${comp_upper})\r
+ ELSE()\r
+   SET(FEATURE_NAME WIX_FEATURE_${CPACK_COMPONENT_${comp_upper}_GROUP})\r
+   SET(WIX_FEATURES ${WIX_FEATURES} ${FEATURE_NAME})\r
+   LIST(APPEND ${FEATURE_NAME}_COMPONENTS ${comp})\r
+ ENDIF()\r
+ENDFOREACH()\r
+\r
+LIST(REMOVE_DUPLICATES WIX_FEATURES)\r
+\r
+SET(CPACK_WIX_FEATURES)\r
+\r
+FOREACH(f ${WIX_FEATURES})\r
+ STRING(TOUPPER "${f}" f_upper)\r
+ STRING(REPLACE "WIX_FEATURE_" "" f_upper ${f_upper})\r
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)\r
+  SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME})\r
+ ELSE()\r
+  SET(TITLE  CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)\r
+ ENDIF()\r
+\r
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)\r
+  SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION})\r
+ ELSE()\r
+  SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)\r
+ ENDIF()\r
+ IF(CPACK_COMPONENT_${f_upper}_WIX_LEVEL)\r
+   SET(Level ${CPACK_COMPONENT_${f_upper}_WIX_LEVEL})\r
+ ELSE()\r
+   SET(Level 1)\r
+ ENDIF()\r
+ IF(CPACK_COMPONENT_GROUP_${f_upper}_HIDDEN)\r
+   SET(DISPLAY "Display='hidden'")\r
+   SET(TITLE ${f_upper})\r
+   SET(DESCRIPTION ${f_upper})\r
+ ELSE()\r
+   SET(DISPLAY)\r
+   IF(CPACK_COMPONENT_GROUP_${f_upper}_EXPANDED)\r
+    SET(DISPLAY "Display='expand'")\r
+   ENDIF()\r
+   IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)\r
+    SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME})\r
+   ELSE()\r
+     SET(TITLE  CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)\r
+   ENDIF()\r
+   IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)\r
+     SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION})\r
+   ELSE()\r
+     SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)\r
+   ENDIF()\r
+ ENDIF()\r
\r
+ SET(CPACK_WIX_FEATURES \r
+ "${CPACK_WIX_FEATURES}\r
+   <Feature  Id='${f_upper}'\r
+     Title='${TITLE}'\r
+     Description='${DESCRIPTION}'\r
+     ConfigurableDirectory='INSTALLDIR'\r
+     Level='${Level}' ${DISPLAY} >"\r
+  )\r
+ FOREACH(c ${${f}_COMPONENTS})\r
+   STRING(TOUPPER "${c}" c_upper)\r
+   IF (CPACK_COMPONENT_${c_upper}_DISPLAY_NAME)\r
+    SET(TITLE ${CPACK_COMPONENT_${c_upper}_DISPLAY_NAME})\r
+   ELSE()\r
+    SET(TITLE CPACK_COMPONENT_${c_upper}_DISPLAY_NAME)\r
+   ENDIF()\r
+\r
+   IF (CPACK_COMPONENT_${c_upper}_DESCRIPTION)\r
+     SET(DESCRIPTION ${CPACK_COMPONENT_${c_upper}_DESCRIPTION})\r
+   ELSE()\r
+     SET(DESCRIPTION CPACK_COMPONENT_${c_upper}_DESCRIPTION)\r
+   ENDIF()\r
+   IF(CPACK_COMPONENT_${c_upper}_WIX_LEVEL)\r
+    SET(Level ${CPACK_COMPONENT_${c_upper}_WIX_LEVEL})\r
+   ELSE()\r
+    SET(Level 1)\r
+   ENDIF()\r
+   IF(CPACK_COMPONENT_${c_upper}_HIDDEN)\r
+   SET(CPACK_WIX_FEATURES\r
+   "${CPACK_WIX_FEATURES} \r
+     <ComponentGroupRef Id='componentgroup.${c}'/>")\r
+   ELSE()\r
+   SET(CPACK_WIX_FEATURES\r
+   "${CPACK_WIX_FEATURES} \r
+    <Feature Id='${c}' \r
+       Title='${TITLE}'\r
+       Description='${DESCRIPTION}'\r
+       ConfigurableDirectory='INSTALLDIR'\r
+       Level='${Level}'>\r
+       <ComponentGroupRef Id='componentgroup.${c}'/>\r
+    </Feature>")\r
+  ENDIF()\r
+  \r
+  ENDFOREACH()\r
+   SET(CPACK_WIX_FEATURES\r
+   "${CPACK_WIX_FEATURES}\r
+   </Feature>\r
+   ") \r
+ENDFOREACH()\r
+\r
+\r
+IF(CMAKE_INSTALL_CONFIG_NAME)\r
+  STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}" \r
+    WIXCA_LOCATION "${WIXCA_LOCATION}")\r
+  SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}")\r
+ENDIF()\r
+\r
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in \r
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)\r
\r
+\r
+FOREACH(comp ${CPACK_COMPONENTS_ALL})\r
+ SET(ENV{DESTDIR} testinstall/${comp})\r
+ SET(DIRS ${DIRS} testinstall/${comp})\r
+ EXECUTE_PROCESS(\r
+  COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DCMAKE_INSTALL_COMPONENT=${comp}  \r
+   -DCMAKE_INSTALL_PREFIX=  -P ${CMAKE_BINARY_DIR}/cmake_install.cmake\r
+   OUTPUT_QUIET\r
+  )\r
+ENDFOREACH()\r
+\r
+MACRO(GENERATE_GUID VarName)\r
+ EXECUTE_PROCESS(COMMAND uuidgen -c \r
+ OUTPUT_VARIABLE ${VarName}\r
+ OUTPUT_STRIP_TRAILING_WHITESPACE)\r
+ENDMACRO()\r
+\r
+SET(INC_VAR 0)\r
+MACRO(MAKE_WIX_IDENTIFIER str varname)\r
+  STRING(REPLACE "/" "." ${varname} "${str}")\r
+  STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}")\r
+  STRING(LENGTH "${${varname}}" len)\r
+  # Identifier should be smaller than 72 character\r
+  # We have to cut down the length to 70 chars, since we add 2 char prefix\r
+  # pretty often\r
+  IF(len GREATER 70)\r
+   STRING(SUBSTRING  "${${varname}}" 0 67 shortstr)\r
+   MATH(EXPR INC_VAR ${INC_VAR}+1)\r
+   SET(${varname} "${shortstr}${INC_VAR}")\r
+  ENDIF()\r
+ENDMACRO()\r
+\r
+\r
+FUNCTION(TRAVERSE_FILES dir topdir file file_comp  dir_root)\r
+  FILE(RELATIVE_PATH dir_rel ${topdir} ${dir})\r
+  IF(dir_rel)\r
+    LIST(FIND EXCLUDE_DIRS ${dir_rel} TO_EXCLUDE)\r
+    IF(NOT TO_EXCLUDE EQUAL -1)\r
+      MESSAGE(STATUS "excluding directory: ${dir_rel}")\r
+      RETURN()\r
+    ENDIF()\r
+  ENDIF()\r
+  FILE(GLOB all_files ${dir}/*)\r
+  IF(NOT all_files)\r
+    RETURN()\r
+  ENDIF()\r
+  IF(dir_rel)\r
+   MAKE_DIRECTORY(${dir_root}/${dir_rel})\r
+   MAKE_WIX_IDENTIFIER("${dir_rel}" id)\r
+   SET(DirectoryRefId  "D.${id}")\r
+  ELSE()\r
+   SET(DirectoryRefId "INSTALLDIR")\r
+  ENDIF()\r
+  FILE(APPEND ${file} "<DirectoryRef Id='${DirectoryRefId}'>\n")\r
\r
+  SET(NONEXEFILES)\r
+  FOREACH(f ${all_files})\r
+    IF(NOT IS_DIRECTORY ${f})\r
+      FILE(RELATIVE_PATH rel ${topdir} ${f})\r
+      SET(TO_EXCLUDE)\r
+      IF(rel MATCHES "\\.pdb$")\r
+        SET(TO_EXCLUDE TRUE)\r
+      ELSE()\r
+        LIST(FIND EXCLUDE_FILES ${rel} RES)\r
+        IF(NOT RES EQUAL -1)\r
+          SET(TO_EXCLUDE TRUE)\r
+        ENDIF()\r
+      ENDIF()\r
+      IF(TO_EXCLUDE)\r
+        MESSAGE(STATUS "excluding file: ${rel}")\r
+      ELSE()\r
+       MAKE_WIX_IDENTIFIER("${rel}" id)\r
+       FILE(TO_NATIVE_PATH ${f} f_native)\r
+       GET_FILENAME_COMPONENT(f_ext "${f}" EXT)\r
+       # According to MSDN each DLL or EXE should be in the own component\r
+       IF(f_ext MATCHES ".exe" OR f_ext MATCHES ".dll")\r
+\r
+         FILE(APPEND ${file} "  <Component Id='C.${id}' Guid='*' ${Win64}>\n")\r
+         FILE(APPEND ${file} "    <File Id='F.${id}' KeyPath='yes' Source='${f_native}'/>\n")\r
+         FILE(APPEND ${file} "  </Component>\n")\r
+         FILE(APPEND ${file_comp} "  <ComponentRef Id='C.${id}'/>\n")\r
+       ELSE()\r
+       SET(NONEXEFILES  "${NONEXEFILES}\n<File Id='F.${id}' Source='${f_native}'/>" )\r
+       ENDIF()\r
+      ENDIF()\r
+    ENDIF()\r
+  ENDFOREACH()\r
+  FILE(APPEND ${file} "</DirectoryRef>\n")\r
+  IF(NONEXEFILES)\r
+    GENERATE_GUID(guid)\r
+    SET(ComponentId "C._files_${COMP_NAME}.${DirectoryRefId}")\r
+    FILE(APPEND ${file} \r
+    "<DirectoryRef Id='${DirectoryRefId}'>\n<Component Guid='${guid}' Id='${ComponentId}' ${Win64}>${NONEXEFILES}\n</Component></DirectoryRef>\n")\r
+       FILE(APPEND ${file_comp} "  <ComponentRef Id='${ComponentId}'/>\n")\r
+  ENDIF()\r
+  FOREACH(f ${all_files})\r
+    IF(IS_DIRECTORY ${f})\r
+      TRAVERSE_FILES(${f} ${topdir} ${file} ${file_comp}  ${dir_root})\r
+    ENDIF()\r
+  ENDFOREACH()\r
+ENDFUNCTION()\r
+\r
+FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)\r
+  FILE(RELATIVE_PATH rel ${topdir} ${dir})\r
+  IF(rel)\r
+    MAKE_WIX_IDENTIFIER("${rel}" id)\r
+    GET_FILENAME_COMPONENT(name ${dir} NAME)\r
+    FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n")\r
+  ENDIF()\r
+  FILE(GLOB all_files ${dir}/*)\r
+  FOREACH(f ${all_files})\r
+    IF(IS_DIRECTORY ${f})\r
+      TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix}  ")\r
+    ENDIF()\r
+  ENDFOREACH()\r
+  IF(rel)\r
+    FILE(APPEND ${file} "${prefix}</Directory>\n")\r
+  ENDIF()\r
+ENDFUNCTION()\r
+\r
+SET(CPACK_WIX_COMPONENTS)\r
+SET(CPACK_WIX_COMPONENT_GROUPS)\r
+GET_FILENAME_COMPONENT(abs . ABSOLUTE)\r
+FOREACH(d ${DIRS})\r
+  GET_FILENAME_COMPONENT(d ${d} ABSOLUTE)\r
+  GET_FILENAME_COMPONENT(d_name ${d} NAME)\r
+  FILE(WRITE ${abs}/${d_name}_component_group.wxs  "<ComponentGroup Id='componentgroup.${d_name}'>")\r
+  SET(COMP_NAME ${d_name})\r
+  TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs")\r
+  FILE(APPEND  ${abs}/${d_name}_component_group.wxs   "</ComponentGroup>")\r
+  IF(EXISTS ${d_name}.wxs)\r
+    FILE(READ ${d_name}.wxs WIX_TMP)\r
+    SET(CPACK_WIX_COMPONENTS "${CPACK_WIX_COMPONENTS}\n${WIX_TMP}")\r
+    FILE(REMOVE ${d_name}.wxs)\r
+  ENDIF()\r
+  \r
+  FILE(READ ${d_name}_component_group.wxs WIX_TMP)\r
\r
+  SET(CPACK_WIX_COMPONENT_GROUPS "${CPACK_WIX_COMPONENT_GROUPS}\n${WIX_TMP}")\r
+  FILE(REMOVE ${d_name}_component_group.wxs)\r
+ENDFOREACH()\r
+\r
+FILE(WRITE directories.wxs "<DirectoryRef Id='INSTALLDIR'>\n")\r
+TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")\r
+FILE(APPEND directories.wxs "</DirectoryRef>\n")\r
+\r
+FILE(READ directories.wxs CPACK_WIX_DIRECTORIES)\r
+FILE(REMOVE directories.wxs)\r
+\r
+\r
+FOREACH(src ${CPACK_WIX_INCLUDE})\r
+SET(CPACK_WIX_INCLUDES \r
+"${CPACK_WIX_INCLUDES}\r
+ <?include ${src}?>"\r
+)\r
+ENDFOREACH()\r
+\r
+\r
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in \r
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)\r
+\r
+SET(EXTRA_CANDLE_ARGS)\r
+IF("$ENV{EXTRA_CANDLE_ARGS}")\r
+       SET(EXTRA_CANDLE_ARGS "$ENV{EXTRA_CANDLE_ARGS}")\r
+ENDIF()\r
+\r
+SET(EXTRA_LIGHT_ARGS)\r
+IF("$ENV{EXTRA_LIGHT_ARGS}")\r
+       SET(EXTRA_LIGHT_ARGS "$ENV{EXTRA_LIGHT_ARGS}")\r
+ENDIF()\r
+\r
+FILE(REMOVE mysql_server.wixobj)\r
+EXECUTE_PROCESS(\r
+ COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension  mysql_server.wxs ${EXTRA_CANDLE_ARGS}\r
+ RESULT_VARIABLE CANDLE_RESULT\r
+)\r
+\r
+IF(CANDLE_RESULT)\r
+  MESSAGE(FATAL_ERROR "ERROR: can't run candle")\r
+ENDIF()\r
+\r
+EXECUTE_PROCESS(\r
+ COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension\r
+  mysql_server.wixobj  -out  ${CPACK_PACKAGE_FILE_NAME}.msi\r
+  ${EXTRA_LIGHT_ARGS}\r
+ RESULT_VARIABLE LIGHT_RESULT\r
+)\r
+\r
+IF(LIGHT_RESULT)\r
+  MESSAGE(FATAL_ERROR "ERROR: can't run light")\r
+ENDIF()\r
+\r
+# Switch monolithic install on again\r
+EXECUTE_PROCESS(\r
+  COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=1 ${CMAKE_BINARY_DIR}\r
+)\r
index 0ccd30f6754ee82229074b1f34d4ba992e1e499f..e96ab0fe505e9a7b5fcc6ed33ae6ff75879a0973 100644 (file)
-<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
-         xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
-
-<!--
-   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
-   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
--->
-
-  <UI Id="WixUI_Mondo_Custom">
-    <Dialog Id="CustomWelcomeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
-      <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
-        <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
-      </Control>
-      <Control Id="Next" Type="PushButton" X="220" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
-        <Publish Event="NewDialog" Value="LicenseAgreementDlg">NOT OLDERVERSIONBEINGUPGRADED</Publish>
-        <Publish Event="NewDialog" Value="UpgradeDlg">OLDERVERSIONBEINGUPGRADED</Publish>
-         </Control>      
-      <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" Disabled="yes" />
-      <Control Id="Description" Type="Text" X="135" Y="80" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgDescription)" />
-      <Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgTitle)" />
-      <Control Id="CopyrightText" Type="Text" X="135" Y="200" Width="220" Height="40" Transparent="yes" Text="Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved." />
-      <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeDlgBitmap)" />
-      <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
-    </Dialog>
-
-    <Dialog Id="UpgradeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
-      <Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes"  Text="Upgrade">
-        <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
-        <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
-        <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
-        <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
-        <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
-      </Control>
-      <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
-        <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
-      </Control>
-      <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">
-        <Condition Action="default">WixUI_InstallMode = "Remove"</Condition>
-      </Control>
-      <Control Id="InstallTitle" Type="Text" X="15" Y="15" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Hidden="yes" Text="!(loc.VerifyReadyDlgInstallTitle)">
-        <Condition Action="show">NOT Installed</Condition>
-      </Control>
-      <Control Id="InstallText" Type="Text" X="25" Y="70" Width="320" Height="80" Hidden="yes" Text="!(loc.VerifyReadyDlgInstallText)">
-        <Condition Action="show">NOT Installed</Condition>
-      </Control>
-      <Control Id="UpgradeText" Type="Text" X="25" Y="70" Width="320" Height="80" Hidden="no" NoPrefix="yes"
-      Text="Click Upgrade to upgrade your installation from version [OLDERVERSION] to version [ProductVersion]. Click Cancel to exit the upgrade."/>
-      <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.VerifyReadyDlgBannerBitmap)" />
-      <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
-      <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
-    </Dialog>
-
-    <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
-    <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
-    <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
-
-    <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
-    <Property Id="WixUI_Mode" Value="Mondo" />
-
-    <DialogRef Id="ErrorDlg" />
-    <DialogRef Id="FatalError" />
-    <DialogRef Id="FilesInUse" />
-    <DialogRef Id="MsiRMFilesInUse" />
-    <DialogRef Id="PrepareDlg" />
-    <DialogRef Id="ProgressDlg" />
-    <DialogRef Id="ResumeDlg" />
-    <DialogRef Id="UserExit" />
-
-    <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
-
-    <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeDlg">1</Publish>
-    <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg" Order="2">LicenseAccepted = "1"</Publish>
-
-    <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
-    <Publish Dialog="SetupTypeDlg" Control="TypicalButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
-    <Publish Dialog="SetupTypeDlg" Control="CustomButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
-    <Publish Dialog="SetupTypeDlg" Control="CompleteButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
-
-    <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">WixUI_InstallMode = "Change"</Publish>
-    <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallCustom"</Publish>
-    <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
-
-    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "InstallCustom"</Publish>
-    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish>
-    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="3">WixUI_InstallMode = "Change"</Publish>
-    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="4">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish>
-
-    <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
-
-    <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
-    <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
-    <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
-    <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
-
-    <Publish Dialog="UpgradeDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeDlg">1</Publish>
-       
-    <InstallUISequence>
-      <Show Dialog="CustomWelcomeDlg" Before="ProgressDlg">NOT Installed</Show>
-    </InstallUISequence>
-  </UI>
-
-  <UIRef Id="WixUI_Common" />
-</Include>
+<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"\r
+         xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">\r
+\r
+<!--\r
+   Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.\r
+   \r
+   This program is free software; you can redistribute it and/or modify\r
+   it under the terms of the GNU General Public License as published by\r
+   the Free Software Foundation; version 2 of the License.\r
+   \r
+   This program is distributed in the hope that it will be useful,\r
+   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+   GNU General Public License for more details.\r
+   \r
+   You should have received a copy of the GNU General Public License\r
+   along with this program; if not, write to the Free Software\r
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
+-->\r
+\r
+  <UI Id="WixUI_Mondo_Custom">\r
+    <Dialog Id="CustomWelcomeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">\r
+      <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">\r
+        <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>\r
+      </Control>\r
+      <Control Id="Next" Type="PushButton" X="220" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">\r
+        <Publish Event="NewDialog" Value="LicenseAgreementDlg">NOT OLDERVERSIONBEINGUPGRADED</Publish>\r
+        <Publish Event="NewDialog" Value="UpgradeDlg">OLDERVERSIONBEINGUPGRADED</Publish>\r
+         </Control>      \r
+      <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" Disabled="yes" />\r
+      <Control Id="Description" Type="Text" X="135" Y="80" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgDescription)" />\r
+      <Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgTitle)" />\r
+      <Control Id="CopyrightText" Type="Text" X="135" Y="200" Width="220" Height="40" Transparent="yes" Text="Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved." />\r
+      <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeDlgBitmap)" />\r
+      <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />\r
+    </Dialog>\r
+\r
+    <Dialog Id="UpgradeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">\r
+      <Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes"  Text="Upgrade">\r
+        <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>\r
+        <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>\r
+        <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>\r
+        <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>\r
+        <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>\r
+      </Control>\r
+      <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">\r
+        <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>\r
+      </Control>\r
+      <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">\r
+        <Condition Action="default">WixUI_InstallMode = "Remove"</Condition>\r
+      </Control>\r
+      <Control Id="InstallTitle" Type="Text" X="15" Y="15" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Hidden="yes" Text="!(loc.VerifyReadyDlgInstallTitle)">\r
+        <Condition Action="show">NOT Installed</Condition>\r
+      </Control>\r
+      <Control Id="InstallText" Type="Text" X="25" Y="70" Width="320" Height="80" Hidden="yes" Text="!(loc.VerifyReadyDlgInstallText)">\r
+        <Condition Action="show">NOT Installed</Condition>\r
+      </Control>\r
+      <Control Id="UpgradeText" Type="Text" X="25" Y="70" Width="320" Height="80" Hidden="no" NoPrefix="yes"\r
+      Text="Click Upgrade to upgrade your installation from version [OLDERVERSION] to version [ProductVersion]. Click Cancel to exit the upgrade."/>\r
+      <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.VerifyReadyDlgBannerBitmap)" />\r
+      <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />\r
+      <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />\r
+    </Dialog>\r
+\r
+    <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />\r
+    <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />\r
+    <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />\r
+\r
+    <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />\r
+    <Property Id="WixUI_Mode" Value="Mondo" />\r
+\r
+    <DialogRef Id="ErrorDlg" />\r
+    <DialogRef Id="FatalError" />\r
+    <DialogRef Id="FilesInUse" />\r
+    <DialogRef Id="MsiRMFilesInUse" />\r
+    <DialogRef Id="PrepareDlg" />\r
+    <DialogRef Id="ProgressDlg" />\r
+    <DialogRef Id="ResumeDlg" />\r
+    <DialogRef Id="UserExit" />\r
+\r
+    <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>\r
+\r
+    <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeDlg">1</Publish>\r
+    <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg" Order="2">LicenseAccepted = "1"</Publish>\r
+\r
+    <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>\r
+    <Publish Dialog="SetupTypeDlg" Control="TypicalButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>\r
+    <Publish Dialog="SetupTypeDlg" Control="CustomButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>\r
+    <Publish Dialog="SetupTypeDlg" Control="CompleteButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>\r
+\r
+    <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">WixUI_InstallMode = "Change"</Publish>\r
+    <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallCustom"</Publish>\r
+    <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>\r
+\r
+    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "InstallCustom"</Publish>\r
+    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish>\r
+    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="3">WixUI_InstallMode = "Change"</Publish>\r
+    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="4">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish>\r
+\r
+    <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>\r
+\r
+    <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>\r
+    <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>\r
+    <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>\r
+    <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>\r
+\r
+    <Publish Dialog="UpgradeDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeDlg">1</Publish>\r
+       \r
+    <InstallUISequence>\r
+      <Show Dialog="CustomWelcomeDlg" Before="ProgressDlg">NOT Installed</Show>\r
+    </InstallUISequence>\r
+  </UI>\r
+\r
+  <UIRef Id="WixUI_Common" />\r
+</Include>\r
index 92a79064d54b8709067c174f5fc1a9a9b0c1b331..91bf3f64b8ebeace0e98b8c750ced7c50fba6a23 100644 (file)
@@ -1,81 +1,81 @@
-<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
-         xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
-
-<!--
-   Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-   
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--->
-
-  <!-- Datafiles that installation will copy to CommonAppData (initial database)
-  They are declared Permanent and NeverOverwrite since it is user data -->
-  <DirectoryRef Id='TARGETDIR'>
-    <Directory Id="CommonAppDataFolder">
-      <Directory Id="datadir.mysql" Name="MySQL">
-        <Directory Id="datadir.mysql.mysqlserver"
-          Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">
-          <Directory Id="DATADIR" Name=".">
-            <Component Id="component.datadir" Guid="d3491319-5dbc-4477-95f3-4f809ef1dd2d">
-              <CreateFolder>
-                <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
-              </CreateFolder>
-            </Component>
-            <Directory Id="datadir.mysql.mysqlserver.data" Name="data">
-              <Directory Id="datadir.mysql.mysqlserver.data.mysql" Name="mysql">
-                <Component Id="component.datadir.mysql"
-                  Guid="19ec0f1f-1a7f-424e-a788-b09346c0a709"
-                  Permanent="yes" NeverOverwrite="yes">
-                  <CreateFolder>
-                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
-                  </CreateFolder>
-                  @DATADIR_MYSQL_FILES@
-                </Component>
-              </Directory>
-              <Directory Id="datadir.mysql.mysqlserver.data.performance_schema"
-                 Name="performance_schema">
-                <Component Id="component.datadir.performance_schema"
-                  Guid="af2a6776-2655-431f-a748-9e9f4645acc3"
-                  Permanent="yes" NeverOverwrite="yes">
-                  <CreateFolder>
-                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
-                  </CreateFolder>
-                  @DATADIR_PERFORMANCE_SCHEMA_FILES@
-                </Component>
-              </Directory>
-              <Directory Id="datadir.mysql.mysqlserver.data.test" Name="test">
-                <Component Id="component.datadir.test" Guid="52fa9f0a-fcd1-420a-b2ac-95a8f70ad20a">
-                  <CreateFolder/>
-                </Component>
-              </Directory>
-            </Directory>
-          </Directory>
-        </Directory>
-      </Directory>
-    </Directory>
-  </DirectoryRef>
-
-  <Feature Id='UserEditableDataFiles' 
-       Title='Server data files'
-       Description='Server data files'
-       ConfigurableDirectory='DATADIR'
-       Level='1'>
-    <ComponentRef Id="component.datadir"/>
-    <ComponentRef Id="component.datadir.mysql"/>
-    <ComponentRef Id="component.datadir.performance_schema"/>
-    <ComponentRef Id="component.datadir.test"/>
-  </Feature>
-</Include>
-
-
-
+<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"\r
+         xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">\r
+\r
+<!--\r
+   Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.\r
+   \r
+   This program is free software; you can redistribute it and/or modify\r
+   it under the terms of the GNU General Public License as published by\r
+   the Free Software Foundation; version 2 of the License.\r
+   \r
+   This program is distributed in the hope that it will be useful,\r
+   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+   GNU General Public License for more details.\r
+   \r
+   You should have received a copy of the GNU General Public License\r
+   along with this program; if not, write to the Free Software\r
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
+-->\r
+\r
+  <!-- Datafiles that installation will copy to CommonAppData (initial database)\r
+  They are declared Permanent and NeverOverwrite since it is user data -->\r
+  <DirectoryRef Id='TARGETDIR'>\r
+    <Directory Id="CommonAppDataFolder">\r
+      <Directory Id="datadir.mysql" Name="MySQL">\r
+        <Directory Id="datadir.mysql.mysqlserver"\r
+          Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">\r
+          <Directory Id="DATADIR" Name=".">\r
+            <Component Id="component.datadir" Guid="d3491319-5dbc-4477-95f3-4f809ef1dd2d">\r
+              <CreateFolder>\r
+                <util:PermissionEx User="[LogonUser]" GenericAll="yes" />\r
+              </CreateFolder>\r
+            </Component>\r
+            <Directory Id="datadir.mysql.mysqlserver.data" Name="data">\r
+              <Directory Id="datadir.mysql.mysqlserver.data.mysql" Name="mysql">\r
+                <Component Id="component.datadir.mysql"\r
+                  Guid="19ec0f1f-1a7f-424e-a788-b09346c0a709"\r
+                  Permanent="yes" NeverOverwrite="yes">\r
+                  <CreateFolder>\r
+                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />\r
+                  </CreateFolder>\r
+                  @DATADIR_MYSQL_FILES@\r
+                </Component>\r
+              </Directory>\r
+              <Directory Id="datadir.mysql.mysqlserver.data.performance_schema"\r
+                 Name="performance_schema">\r
+                <Component Id="component.datadir.performance_schema"\r
+                  Guid="af2a6776-2655-431f-a748-9e9f4645acc3"\r
+                  Permanent="yes" NeverOverwrite="yes">\r
+                  <CreateFolder>\r
+                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />\r
+                  </CreateFolder>\r
+                  @DATADIR_PERFORMANCE_SCHEMA_FILES@\r
+                </Component>\r
+              </Directory>\r
+              <Directory Id="datadir.mysql.mysqlserver.data.test" Name="test">\r
+                <Component Id="component.datadir.test" Guid="52fa9f0a-fcd1-420a-b2ac-95a8f70ad20a">\r
+                  <CreateFolder/>\r
+                </Component>\r
+              </Directory>\r
+            </Directory>\r
+          </Directory>\r
+        </Directory>\r
+      </Directory>\r
+    </Directory>\r
+  </DirectoryRef>\r
+\r
+  <Feature Id='UserEditableDataFiles' \r
+       Title='Server data files'\r
+       Description='Server data files'\r
+       ConfigurableDirectory='DATADIR'\r
+       Level='1'>\r
+    <ComponentRef Id="component.datadir"/>\r
+    <ComponentRef Id="component.datadir.mysql"/>\r
+    <ComponentRef Id="component.datadir.performance_schema"/>\r
+    <ComponentRef Id="component.datadir.test"/>\r
+  </Feature>\r
+</Include>\r
+\r
+\r
+\r
index 13f5edae488ca9cdcf8638f385c5053d4b715b8b..73db450b10313cb91cefdb1b9e62ca473b89d060 100644 (file)
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
-      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
-
-<!--
-   Copyright (c) 2010, 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
-   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
--->
-
-  <Product 
-    Id="*" 
-    UpgradeCode="88AD3A5F-E83F-4B83-9D6B-6B38189E9AC5"
-    Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" 
-    Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@" 
-    Language="1033" 
-    Manufacturer="@MANUFACTURER@">
-    
-    <Package Id='*'
-       Keywords='Installer'
-       Description="MySQL Database Server"
-       Manufacturer='@MANUFACTURER@'
-       InstallerVersion='200'
-       Languages='1033'
-       Compressed='yes'
-       SummaryCodepage='1252'
-       Platform='@Platform@'
-       InstallScope="perMachine"/>
-  
-    <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
-
-    <!-- Upgrade -->
-    
-    <Upgrade Id="88AD3A5F-E83F-4B83-9D6B-6B38189E9AC5">
-      <?if '@PATCH_VERSION@' != '0'?>
-      <UpgradeVersion 
-        Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"
-        IncludeMinimum="yes"
-        Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
-        IncludeMaximum="yes"
-        Property="OLDERVERSIONBEINGUPGRADED"
-        MigrateFeatures="yes"
-        />
-      <?endif?>
-      <UpgradeVersion 
-        Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
-        IncludeMinimum="no"
-        OnlyDetect="yes"
-        Property="NEWERVERSIONDETECTED" />
-    </Upgrade>
-    <Upgrade Id="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3">
-      <UpgradeVersion 
-        Minimum="5.6.0"
-        IncludeMinimum="yes"
-        Maximum="5.6.6"
-               IncludeMaximum="yes"
-        Property="OLDUPGRADECODE"
-        MigrateFeatures="yes"
-        />
-    </Upgrade> 
-    <Condition Message="A later version of [ProductName] is already installed. Setup will now exit.">
-      NOT NEWERVERSIONDETECTED OR Installed
-    </Condition>
-    <InstallExecuteSequence>
-      <RemoveExistingProducts After="InstallInitialize"/>
-    </InstallExecuteSequence>
-
-    <!-- Save/restore install location -->
-    <CustomAction Id="SaveTargetDir" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
-    <InstallExecuteSequence>
-      <Custom Action="SaveTargetDir" After="InstallValidate">
-        NOT
-        Installed
-      </Custom>
-    </InstallExecuteSequence>
-    <InstallUISequence>
-      <!-- App search is what does FindInstallLocation, and it is dependent on FindRelatedProducts -->
-      <AppSearch After="FindRelatedProducts"/>
-    </InstallUISequence>
-    <!-- Find previous installation -->
-    <Property Id="INSTALLDIR">
-      <RegistrySearch Id="FindInstallLocation"
-          Root="HKLM"
-          Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
-          Name="InstallLocation"
-          Type="raw" />
-    </Property>
-    <?if @Platform@ != "x64" ?>
-        <Property Id="OLDERVERSION"> 
-          <RegistrySearch Id="FindOlderVersion"
-            Root="HKLM"
-            Win64 = "no"
-            Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
-            Name="DisplayVersion"
-            Type="raw" />
-        </Property>
-    <?else ?>
-        <Property Id="OLDERVERSION"> 
-          <RegistrySearch Id="FindOlderVersion"
-            Root="HKLM"
-            Win64 = "yes"
-            Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
-            Name="DisplayVersion"
-            Type="raw" />
-        </Property>
-    <?endif ?>
-    <Property Id="DATADIR">
-      <RegistrySearch Id="FindDataDir"
-          Root="HKLM"
-          Key="SOFTWARE\MySQL AB\[ProductName]"
-          Name="DataLocation"
-          Type="raw" />
-    </Property>
-    <Property Id="INSTALLDIR2">
-       <RegistrySearch Id="FindInstallLocation2"
-          Root="HKLM"
-          Key="SOFTWARE\MySQL AB\[ProductName]"
-          Name="Location"
-          Type="raw" />
-    </Property>
-    <CustomAction Id="SetInstallDir2" Property="INSTALLDIR" Value="[INSTALLDIR2]" /> 
-    <InstallUISequence>
-    <Custom Action="SetInstallDir2" After="AppSearch">INSTALLDIR2</Custom> 
-    </InstallUISequence>
-
-
-    <!-- UI -->
-    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
-    <UIRef Id="@CPACK_WIX_UI@" />
-    <UIRef Id="WixUI_ErrorProgressText" />
-    <WixVariable
-      Id="WixUIBannerBmp"
-      Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminHeader.jpg" />
-    <WixVariable
-      Id="WixUIDialogBmp"
-      Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminBackground.jpg" />
-    <Icon
-      Id="icon.ico"
-      SourceFile="@CMAKE_CURRENT_SOURCE_DIR@/MySQLServer.ico"/>
-    <Icon 
-      Id="Icon.MysqlCmdShell" 
-      SourceFile='@CMAKE_CURRENT_SOURCE_DIR@/mysqlcommandlineshell.ico' />               
-    <Property
-      Id="ARPPRODUCTICON"
-      Value="icon.ico" />
-    
-    <!-- License -->
-    <WixVariable
-      Id="WixUILicenseRtf"
-      Value="@COPYING_RTF@"/>
-
-    <!-- How to remove the service on uninstall -->
-    <Binary Id='wixca.dll' SourceFile='@WIXCA_LOCATION@' />
-    <CustomAction Id="UnregisterProperty" Property="UnregisterService" Value="[INSTALLDIR]" Return="check" />
-    <CustomAction Id="UnregisterPropertySilent" Property="UnregisterServiceSilently" Value="[INSTALLDIR]" Return="check" />
-    <CustomAction Id="UnregisterService"
-                  BinaryKey="wixca.dll"
-                  DllEntry="RemoveService"
-                  Execute="deferred"
-                  Impersonate="no"
-                  Return="check" />
-    <CustomAction Id="UnregisterServiceSilently"
-                  BinaryKey="wixca.dll"
-                  DllEntry="RemoveServiceNoninteractive"
-                  Execute="deferred"
-                  Impersonate="no"
-                  Return="check" />
-    <InstallExecuteSequence>
-      <Custom Action="UnregisterProperty" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>
-      <Custom Action="UnregisterPropertySilent" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>
-      <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel&gt;4</Custom>
-      <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel&lt;=4</Custom>
-    </InstallExecuteSequence>
-
-    <!-- Installation root-->
-    <Directory Id='TARGETDIR' Name='SourceDir'>
-      <Directory Id='@PlatformProgramFilesFolder@'>
-        <Directory Id='directory.MySQL' Name='MySQL'>
-          <Directory Id='INSTALLDIR' Name='MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@'>
-          </Directory>
-        </Directory>
-      </Directory>
-    </Directory>
-
-    <!-- CPACK_WIX_FEATURES -->
-    @CPACK_WIX_FEATURES@
-    
-    <!-- CPACK_WIX_DIRECTORIES -->
-    @CPACK_WIX_DIRECTORIES@
-    
-    <!--CPACK_WIX_COMPONENTS-->
-    @CPACK_WIX_COMPONENTS@
-    
-    <!--CPACK_WIX_COMPONENTS_GROUPS -->
-    @CPACK_WIX_COMPONENT_GROUPS@
-    
-    <!--CPACK_WIX_INCLUDES -->
-    @CPACK_WIX_INCLUDES@
-  </Product>
-
-</Wix>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" \r
+      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">\r
+\r
+<!--\r
+   Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.\r
+   \r
+   This program is free software; you can redistribute it and/or modify\r
+   it under the terms of the GNU General Public License as published by\r
+   the Free Software Foundation; version 2 of the License.\r
+   \r
+   This program is distributed in the hope that it will be useful,\r
+   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+   GNU General Public License for more details.\r
+   \r
+   You should have received a copy of the GNU General Public License\r
+   along with this program; if not, write to the Free Software\r
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
+-->\r
+\r
+  <Product \r
+    Id="*" \r
+    UpgradeCode="88AD3A5F-E83F-4B83-9D6B-6B38189E9AC5"\r
+    Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" \r
+    Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@" \r
+    Language="1033" \r
+    Manufacturer="@MANUFACTURER@">\r
+    \r
+    <Package Id='*'\r
+       Keywords='Installer'\r
+       Description="MySQL Database Server"\r
+       Manufacturer='@MANUFACTURER@'\r
+       InstallerVersion='200'\r
+       Languages='1033'\r
+       Compressed='yes'\r
+       SummaryCodepage='1252'\r
+       Platform='@Platform@'\r
+       InstallScope="perMachine"/>\r
+  \r
+    <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />\r
+\r
+    <!-- Upgrade -->\r
+    \r
+    <Upgrade Id="88AD3A5F-E83F-4B83-9D6B-6B38189E9AC5">\r
+      <?if '@PATCH_VERSION@' != '0'?>\r
+      <UpgradeVersion \r
+        Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"\r
+        IncludeMinimum="yes"\r
+        Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"\r
+        IncludeMaximum="yes"\r
+        Property="OLDERVERSIONBEINGUPGRADED"\r
+        MigrateFeatures="yes"\r
+        />\r
+      <?endif?>\r
+      <UpgradeVersion \r
+        Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"\r
+        IncludeMinimum="no"\r
+        OnlyDetect="yes"\r
+        Property="NEWERVERSIONDETECTED" />\r
+    </Upgrade>\r
+    <Upgrade Id="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3">\r
+      <UpgradeVersion \r
+        Minimum="5.6.0"\r
+        IncludeMinimum="yes"\r
+        Maximum="5.6.6"\r
+               IncludeMaximum="yes"\r
+        Property="OLDUPGRADECODE"\r
+        MigrateFeatures="yes"\r
+        />\r
+    </Upgrade> \r
+    <Condition Message="A later version of [ProductName] is already installed. Setup will now exit.">\r
+      NOT NEWERVERSIONDETECTED OR Installed\r
+    </Condition>\r
+    <InstallExecuteSequence>\r
+      <RemoveExistingProducts After="InstallInitialize"/>\r
+    </InstallExecuteSequence>\r
+\r
+    <!-- Save/restore install location -->\r
+    <CustomAction Id="SaveTargetDir" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />\r
+    <InstallExecuteSequence>\r
+      <Custom Action="SaveTargetDir" After="InstallValidate">\r
+        NOT\r
+        Installed\r
+      </Custom>\r
+    </InstallExecuteSequence>\r
+    <InstallUISequence>\r
+      <!-- App search is what does FindInstallLocation, and it is dependent on FindRelatedProducts -->\r
+      <AppSearch After="FindRelatedProducts"/>\r
+    </InstallUISequence>\r
\r
+    <!-- Find previous installation -->\r
+    <Property Id="INSTALLDIR">\r
+      <RegistrySearch Id="FindInstallLocation"\r
+          Root="HKLM"\r
+          Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"\r
+          Name="InstallLocation"\r
+          Type="raw" />\r
+    </Property>\r
+    <?if @Platform@ != "x64" ?>\r
+        <Property Id="OLDERVERSION"> \r
+          <RegistrySearch Id="FindOlderVersion"\r
+            Root="HKLM"\r
+            Win64 = "no"\r
+            Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"\r
+            Name="DisplayVersion"\r
+            Type="raw" />\r
+        </Property>\r
+    <?else ?>\r
+        <Property Id="OLDERVERSION"> \r
+          <RegistrySearch Id="FindOlderVersion"\r
+            Root="HKLM"\r
+            Win64 = "yes"\r
+            Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"\r
+            Name="DisplayVersion"\r
+            Type="raw" />\r
+        </Property>\r
+    <?endif ?>\r
+    <Property Id="DATADIR">\r
+      <RegistrySearch Id="FindDataDir"\r
+          Root="HKLM"\r
+          Key="SOFTWARE\MySQL AB\[ProductName]"\r
+          Name="DataLocation"\r
+          Type="raw" />\r
+    </Property>\r
+    <Property Id="INSTALLDIR2">\r
+       <RegistrySearch Id="FindInstallLocation2"\r
+          Root="HKLM"\r
+          Key="SOFTWARE\MySQL AB\[ProductName]"\r
+          Name="Location"\r
+          Type="raw" />\r
+    </Property>\r
+    <CustomAction Id="SetInstallDir2" Property="INSTALLDIR" Value="[INSTALLDIR2]" /> \r
+    <InstallUISequence>\r
+    <Custom Action="SetInstallDir2" After="AppSearch">INSTALLDIR2</Custom> \r
+    </InstallUISequence>\r
+\r
+\r
+    <!-- UI -->\r
+    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>\r
+    <UIRef Id="@CPACK_WIX_UI@" />\r
+    <UIRef Id="WixUI_ErrorProgressText" />\r
+    <WixVariable\r
+      Id="WixUIBannerBmp"\r
+      Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminHeader.jpg" />\r
+    <WixVariable\r
+      Id="WixUIDialogBmp"\r
+      Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminBackground.jpg" />\r
+    <Icon\r
+      Id="icon.ico"\r
+      SourceFile="@CMAKE_CURRENT_SOURCE_DIR@/MySQLServer.ico"/>\r
+    <Icon \r
+      Id="Icon.MysqlCmdShell" \r
+      SourceFile='@CMAKE_CURRENT_SOURCE_DIR@/mysqlcommandlineshell.ico' />               \r
+    <Property\r
+      Id="ARPPRODUCTICON"\r
+      Value="icon.ico" />\r
+    \r
+    <!-- License -->\r
+    <WixVariable\r
+      Id="WixUILicenseRtf"\r
+      Value="@COPYING_RTF@"/>\r
+\r
+    <!-- How to remove the service on uninstall -->\r
+    <Binary Id='wixca.dll' SourceFile='@WIXCA_LOCATION@' />\r
+    <CustomAction Id="UnregisterProperty" Property="UnregisterService" Value="[INSTALLDIR]" Return="check" />\r
+    <CustomAction Id="UnregisterPropertySilent" Property="UnregisterServiceSilently" Value="[INSTALLDIR]" Return="check" />\r
+    <CustomAction Id="UnregisterService"\r
+                  BinaryKey="wixca.dll"\r
+                  DllEntry="RemoveService"\r
+                  Execute="deferred"\r
+                  Impersonate="no"\r
+                  Return="check" />\r
+    <CustomAction Id="UnregisterServiceSilently"\r
+                  BinaryKey="wixca.dll"\r
+                  DllEntry="RemoveServiceNoninteractive"\r
+                  Execute="deferred"\r
+                  Impersonate="no"\r
+                  Return="check" />\r
+    <InstallExecuteSequence>\r
+      <Custom Action="UnregisterProperty" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>\r
+      <Custom Action="UnregisterPropertySilent" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>\r
+      <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel&gt;4</Custom>\r
+      <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel&lt;=4</Custom>\r
+    </InstallExecuteSequence>\r
+\r
+    <!-- Installation root-->\r
+    <Directory Id='TARGETDIR' Name='SourceDir'>\r
+      <Directory Id='@PlatformProgramFilesFolder@'>\r
+        <Directory Id='directory.MySQL' Name='MySQL'>\r
+          <Directory Id='INSTALLDIR' Name='MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@'>\r
+          </Directory>\r
+        </Directory>\r
+      </Directory>\r
+    </Directory>\r
+\r
+    <!-- CPACK_WIX_FEATURES -->\r
+    @CPACK_WIX_FEATURES@\r
+    \r
+    <!-- CPACK_WIX_DIRECTORIES -->\r
+    @CPACK_WIX_DIRECTORIES@\r
+    \r
+    <!--CPACK_WIX_COMPONENTS-->\r
+    @CPACK_WIX_COMPONENTS@\r
+    \r
+    <!--CPACK_WIX_COMPONENTS_GROUPS -->\r
+    @CPACK_WIX_COMPONENT_GROUPS@\r
+    \r
+    <!--CPACK_WIX_INCLUDES -->\r
+    @CPACK_WIX_INCLUDES@\r
+  </Product>\r
+\r
+</Wix>\r
index 533ebbeba944797f9a3798e3efd0542230f55897..b164fdb81ae4c5df75a4335b7c42e34747342de6 100644 (file)
-<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
-         xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
-
-<!--
-   Copyright (c) 2012, 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
-   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 shortcuts -->
-    <DirectoryRef Id='INSTALLDIR'>
-    <Directory Id="DesktopFolder"/>
-    <Directory Id="ProgramMenuFolder">
-      <Directory Id="MysqlProgramMenuFolder" Name="MySQL">
-        <Directory Id="MysqlProductMenuFolder" Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">
-          <Component Id="MysqlProductMenuFolder" Guid="*" @WixWin64@>
-            <!-- Include a shortcut to the mysql command line client -->
-            <Shortcut Id="MysqlCommandLineShellShortcut"
-                      Name="MySQL @MAJOR_VERSION@.@MINOR_VERSION@ Command Line Client"
-                      Description="The MySQL Command Line Shell"
-                      Icon="Icon.MysqlCmdShell"
-                      Target="[D.bin]mysql.exe"
-                      Arguments='"--defaults-file=[INSTALLDIR]my.ini" "-uroot" "-p"'
-                      WorkingDirectory="D.bin"/>
-            <?if "@MAJOR_VERSION@.@MINOR_VERSION@" != "5.5" ?>
-            <!-- Include another shortcut to the mysql command line client with a different name -->
-              <Shortcut Id="MysqlCommandLineShellShortcutUnicode"
-                      Name="MySQL @MAJOR_VERSION@.@MINOR_VERSION@ Command Line Client - Unicode"
-                      Description="The MySQL Command Line Shell in UTF8 Mode"
-                      Icon="Icon.MysqlCmdShell"
-                      Target="[D.bin]mysql.exe"
-                      Arguments='"--defaults-file=[INSTALLDIR]my.ini" "-uroot" "-p" "--default-character-set=utf8"'
-                      WorkingDirectory="D.bin"/>
-            <!-- Write Console settings for applications with this name to the registry -->
-              <RegistryKey Root="HKCU" 
-                           Key="Console\MySQL @MAJOR_VERSION@.@MINOR_VERSION@ Command Line Client - Unicode"
-                           Action="createAndRemoveOnUninstall">
-                <RegistryValue Type="string" Name="FaceName" Value="Lucida Console"/>
-                <RegistryValue Type="integer" Name="FontWeight" Value="400"/>
-              </RegistryKey>
-            <?endif ?>
-            <!-- Make sure this gets deleted on uninstall -->
-            <RemoveFolder Id="MysqlProductMenuFolder" Directory="MysqlProductMenuFolder" On="uninstall"/>
-            <RemoveFolder Id="MysqlProgramMenuFolder" Directory="MysqlProgramMenuFolder" On="uninstall"/>
-            <RegistryValue Root="HKCU" Key="Software\MySQL AB\MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
-          </Component>
-        </Directory>
-      </Directory>
-    </Directory>
-    </DirectoryRef>
-    <Feature Id="ProgramMenu" Level="1" Display="hidden" ConfigurableDirectory="INSTALLDIR">
-    <ComponentRef Id="MysqlProductMenuFolder"/>
-    </Feature>    
-      
-    <!-- Registry -->
-    <!-- We still use "MySQL AB" because we don't want to break software that expects it -->
-    <DirectoryRef Id='TARGETDIR'>
-    <Component Id="RegKeys" Guid="*">
-      <RegistryKey
-        Id='MySQLKey'
-        Root='HKLM'
-        Key='SOFTWARE\MySQL AB\[ProductName]'
-        Action='createAndRemoveOnUninstall'>
-        <RegistryValue
-          Type='string'
-          Name='Location'
-          Value='[INSTALLDIR]'/>
-        <RegistryValue
-          Type="string"
-          Name="Version"
-          Value="[ProductVersion]"/>
-        <RegistryValue
-          Type="string"
-          Name="DataLocation"
-          Value="[DATADIR]"/>
-      </RegistryKey>
-    </Component>
-    </DirectoryRef>
-    <Feature
-    Id='RegKeys'
-    Display='hidden'
-    Level='1'>
-    <ComponentRef Id='RegKeys'/>
-    </Feature>
-
-    <!-- Datafiles that installation will copy to CommonAppData (initial database)
-    They are declared Permanent and NeverOverwrite since it is user data -->
-    <DirectoryRef Id='TARGETDIR'>
-    <Directory Id="CommonAppDataFolder">
-      <Directory Id="datadir.mysql" Name="MySQL">
-        <Directory Id="datadir.mysql.mysqlserver"
-          Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">
-          <Directory Id="DATADIR" Name=".">
-            <Component Id="component.datadir" Guid="d3491319-5dbc-4477-95f3-4f809ef1dd2d">
-              <CreateFolder>
-                <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
-              </CreateFolder>
-            </Component>
-            <Directory Id="datadir.mysql.mysqlserver.data" Name="data">
-              <Component Id="component.datadir.data"
-                Guid="1d9a385d-6edf-4fb7-8652-35973c399d0c"
-                Permanent="yes" NeverOverwrite="yes">
-                <CreateFolder>
-                  <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
-                </CreateFolder>
-                @DATADIR_FILES@
-              </Component>                  
-              <Directory Id="datadir.mysql.mysqlserver.data.mysql" Name="mysql">
-                <Component Id="component.datadir.mysql"
-                  Guid="19ec0f1f-1a7f-424e-a788-b09346c0a709"
-                  Permanent="yes" NeverOverwrite="yes">
-                  <CreateFolder>
-                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
-                  </CreateFolder>
-                  @DATADIR_MYSQL_FILES@
-                </Component>
-              </Directory>
-              <Directory Id="datadir.mysql.mysqlserver.data.performance_schema"
-                 Name="performance_schema">
-                <Component Id="component.datadir.performance_schema"
-                  Guid="af2a6776-2655-431f-a748-9e9f4645acc3"
-                  Permanent="yes" NeverOverwrite="yes">
-                  <CreateFolder>
-                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
-                  </CreateFolder>
-                  @DATADIR_PERFORMANCE_SCHEMA_FILES@
-                </Component>
-              </Directory>
-              <Directory Id="datadir.mysql.mysqlserver.data.test" Name="test">
-                <Component Id="component.datadir.test" Guid="52fa9f0a-fcd1-420a-b2ac-95a8f70ad20a">
-                  <CreateFolder/>
-                </Component>
-              </Directory>
-            </Directory>
-          </Directory>
-        </Directory>
-      </Directory>
-    </Directory>
-    </DirectoryRef>
-
-    <Feature Id='UserEditableDataFiles' 
-       Title='Server data files'
-       Description='Server data files'
-       ConfigurableDirectory='DATADIR'
-       Level='1'>
-    <ComponentRef Id="component.datadir"/>
-    <ComponentRef Id="component.datadir.data"/>
-    <ComponentRef Id="component.datadir.mysql"/>
-    <ComponentRef Id="component.datadir.performance_schema"/>
-    <ComponentRef Id="component.datadir.test"/>
-    </Feature>
-
-</Include>
-
-
-
+<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"\r
+         xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">\r
+\r
+<!--\r
+   Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.\r
+   \r
+   This program is free software; you can redistribute it and/or modify\r
+   it under the terms of the GNU General Public License as published by\r
+   the Free Software Foundation; version 2 of the License.\r
+   \r
+   This program is distributed in the hope that it will be useful,\r
+   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+   GNU General Public License for more details.\r
+   \r
+   You should have received a copy of the GNU General Public License\r
+   along with this program; if not, write to the Free Software\r
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
+-->\r
+    <!-- Include shortcuts -->\r
+    <DirectoryRef Id='INSTALLDIR'>\r
+    <Directory Id="DesktopFolder"/>\r
+    <Directory Id="ProgramMenuFolder">\r
+      <Directory Id="MysqlProgramMenuFolder" Name="MySQL">\r
+        <Directory Id="MysqlProductMenuFolder" Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">\r
+          <Component Id="MysqlProductMenuFolder" Guid="*" @WixWin64@>\r
+            <!-- Include a shortcut to the mysql command line client -->\r
+            <Shortcut Id="MysqlCommandLineShellShortcut"\r
+                      Name="MySQL @MAJOR_VERSION@.@MINOR_VERSION@ Command Line Client"\r
+                      Description="The MySQL Command Line Shell"\r
+                      Icon="Icon.MysqlCmdShell"\r
+                      Target="[D.bin]mysql.exe"\r
+                      Arguments='"--defaults-file=[INSTALLDIR]my.ini" "-uroot" "-p"'\r
+                      WorkingDirectory="D.bin"/>\r
+            <?if "@MAJOR_VERSION@.@MINOR_VERSION@" != "5.5" ?>\r
+            <!-- Include another shortcut to the mysql command line client with a different name -->\r
+              <Shortcut Id="MysqlCommandLineShellShortcutUnicode"\r
+                      Name="MySQL @MAJOR_VERSION@.@MINOR_VERSION@ Command Line Client - Unicode"\r
+                      Description="The MySQL Command Line Shell in UTF8 Mode"\r
+                      Icon="Icon.MysqlCmdShell"\r
+                      Target="[D.bin]mysql.exe"\r
+                      Arguments='"--defaults-file=[INSTALLDIR]my.ini" "-uroot" "-p" "--default-character-set=utf8"'\r
+                      WorkingDirectory="D.bin"/>\r
+            <!-- Write Console settings for applications with this name to the registry -->\r
+              <RegistryKey Root="HKCU" \r
+                           Key="Console\MySQL @MAJOR_VERSION@.@MINOR_VERSION@ Command Line Client - Unicode"\r
+                           Action="createAndRemoveOnUninstall">\r
+                <RegistryValue Type="string" Name="FaceName" Value="Lucida Console"/>\r
+                <RegistryValue Type="integer" Name="FontWeight" Value="400"/>\r
+              </RegistryKey>\r
+            <?endif ?>\r
+            <!-- Make sure this gets deleted on uninstall -->\r
+            <RemoveFolder Id="MysqlProductMenuFolder" Directory="MysqlProductMenuFolder" On="uninstall"/>\r
+            <RemoveFolder Id="MysqlProgramMenuFolder" Directory="MysqlProgramMenuFolder" On="uninstall"/>\r
+            <RegistryValue Root="HKCU" Key="Software\MySQL AB\MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" Name="installed" Type="integer" Value="1" KeyPath="yes"/>\r
+          </Component>\r
+        </Directory>\r
+      </Directory>\r
+    </Directory>\r
+    </DirectoryRef>\r
+    <Feature Id="ProgramMenu" Level="1" Display="hidden" ConfigurableDirectory="INSTALLDIR">\r
+    <ComponentRef Id="MysqlProductMenuFolder"/>\r
+    </Feature>    \r
+      \r
+    <!-- Registry -->\r
+    <!-- We still use "MySQL AB" because we don't want to break software that expects it -->\r
+    <DirectoryRef Id='TARGETDIR'>\r
+    <Component Id="RegKeys" Guid="*">\r
+      <RegistryKey\r
+        Id='MySQLKey'\r
+        Root='HKLM'\r
+        Key='SOFTWARE\MySQL AB\[ProductName]'\r
+        Action='createAndRemoveOnUninstall'>\r
+        <RegistryValue\r
+          Type='string'\r
+          Name='Location'\r
+          Value='[INSTALLDIR]'/>\r
+        <RegistryValue\r
+          Type="string"\r
+          Name="Version"\r
+          Value="[ProductVersion]"/>\r
+        <RegistryValue\r
+          Type="string"\r
+          Name="DataLocation"\r
+          Value="[DATADIR]"/>\r
+      </RegistryKey>\r
+    </Component>\r
+    </DirectoryRef>\r
+    <Feature\r
+    Id='RegKeys'\r
+    Display='hidden'\r
+    Level='1'>\r
+    <ComponentRef Id='RegKeys'/>\r
+    </Feature>\r
+\r
+    <!-- Datafiles that installation will copy to CommonAppData (initial database)\r
+    They are declared Permanent and NeverOverwrite since it is user data -->\r
+    <DirectoryRef Id='TARGETDIR'>\r
+    <Directory Id="CommonAppDataFolder">\r
+      <Directory Id="datadir.mysql" Name="MySQL">\r
+        <Directory Id="datadir.mysql.mysqlserver"\r
+          Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">\r
+          <Directory Id="DATADIR" Name=".">\r
+            <Component Id="component.datadir" Guid="d3491319-5dbc-4477-95f3-4f809ef1dd2d">\r
+              <CreateFolder>\r
+                <util:PermissionEx User="[LogonUser]" GenericAll="yes" />\r
+              </CreateFolder>\r
+            </Component>\r
+            <Directory Id="datadir.mysql.mysqlserver.data" Name="data">\r
+              <Component Id="component.datadir.data"\r
+                Guid="1d9a385d-6edf-4fb7-8652-35973c399d0c"\r
+                Permanent="yes" NeverOverwrite="yes">\r
+                <CreateFolder>\r
+                  <util:PermissionEx User="[LogonUser]" GenericAll="yes" />\r
+                </CreateFolder>\r
+                @DATADIR_FILES@\r
+              </Component>                  \r
+              <Directory Id="datadir.mysql.mysqlserver.data.mysql" Name="mysql">\r
+                <Component Id="component.datadir.mysql"\r
+                  Guid="19ec0f1f-1a7f-424e-a788-b09346c0a709"\r
+                  Permanent="yes" NeverOverwrite="yes">\r
+                  <CreateFolder>\r
+                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />\r
+                  </CreateFolder>\r
+                  @DATADIR_MYSQL_FILES@\r
+                </Component>\r
+              </Directory>\r
+              <Directory Id="datadir.mysql.mysqlserver.data.performance_schema"\r
+                 Name="performance_schema">\r
+                <Component Id="component.datadir.performance_schema"\r
+                  Guid="af2a6776-2655-431f-a748-9e9f4645acc3"\r
+                  Permanent="yes" NeverOverwrite="yes">\r
+                  <CreateFolder>\r
+                    <util:PermissionEx User="[LogonUser]" GenericAll="yes" />\r
+                  </CreateFolder>\r
+                  @DATADIR_PERFORMANCE_SCHEMA_FILES@\r
+                </Component>\r
+              </Directory>\r
+              <Directory Id="datadir.mysql.mysqlserver.data.test" Name="test">\r
+                <Component Id="component.datadir.test" Guid="52fa9f0a-fcd1-420a-b2ac-95a8f70ad20a">\r
+                  <CreateFolder/>\r
+                </Component>\r
+              </Directory>\r
+            </Directory>\r
+          </Directory>\r
+        </Directory>\r
+      </Directory>\r
+    </Directory>\r
+    </DirectoryRef>\r
+\r
+    <Feature Id='UserEditableDataFiles' \r
+       Title='Server data files'\r
+       Description='Server data files'\r
+       ConfigurableDirectory='DATADIR'\r
+       Level='1'>\r
+    <ComponentRef Id="component.datadir"/>\r
+    <ComponentRef Id="component.datadir.data"/>\r
+    <ComponentRef Id="component.datadir.mysql"/>\r
+    <ComponentRef Id="component.datadir.performance_schema"/>\r
+    <ComponentRef Id="component.datadir.test"/>\r
+    </Feature>\r
+\r
+</Include>\r
+\r
+\r
+\r
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/changelog b/mysql-wsrep-5.6/packaging/deb-jessie/changelog
new file mode 100644 (file)
index 0000000..6c78850
--- /dev/null
@@ -0,0 +1,95 @@
+mysql-community (5.6.26-1debian8) jessie; urgency=low
+
+  * new upstream release
+  * mysql-commercial-server now depends on perl, psmisc
+    mysql-commercial-test now depends on python, libmysqlclient-dev
+    (Closes: #20893836)
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Thu, 18 Jun 2015 16:34:10 +0530
+
+mysql-community (5.6.25-2debian8) jessie; urgency=low
+
+  * new upstream release
+  * added systemd support
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Fri, 29 May 2015 17:07:34 +0530
+
+mysql-community (5.6.24-2debian8) jessie; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 14 Apr 2015 16:40:14 +0530
+
+mysql-community (5.6.24-1debian7) wheezy; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 16 Feb 2015 15:45:09 +0530
+
+mysql-community (5.6.23-1debian7) wheezy; urgency=low
+
+  * new upstream release
+  * mysql-community-server now recommends mysql-client
+  * removed template install-test-db; not installed by default
+  * d/compat incremented to 9 from 8
+  * d/control updated to build depend on debhelper 9
+  * added d/*.lintian-overrides and d/source/lintian-overrides
+  * d/rules updated to reflect correct file permissions
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 31 Dec 2014 10:51:07 +0530
+
+mysql-community (5.6.22-1debian7) wheezy; urgency=low
+
+  * new upstream release
+  * fixed d/*server.postinst to allow dropping test db without
+    setting root password
+  * init script will now run my_i_db if data dir is not present or empty
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 24 Sep 2014 14:48:07 +0530
+
+mysql-community (5.6.21-1debian7) wheezy; urgency=low
+
+  * new upstream release
+  * updated d/rules to increment -j8 as make option
+  * updated d/source/include-binaries to add mysql_no_login plugin
+  * updated CMake option WITH_EXTRA_CHARSETS from complex to all
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 20 Aug 2014 19:12:30 +0530
+
+mysql-community (5.6.20-1debian7) wheezy; urgency=low
+
+  * new upstream release
+  * added fakeroot as build-dep in d/control
+  * added d/*.dirs for bench, dev and test pkg
+  * updated d/rules to make compilation verbose
+  * removed default CFLAGS, CXXFLAGS in d/rules
+  * added patch for testsuite search paths under d/patches
+  * modified cmake option for testsuite in d/rules
+  * updated patch d/fix-mysql_install_db.patch
+  * enabled two patches in d/patches/series
+  * removed extra permissions check in d/rules when fixed in source
+  * modified d/mysql-*-server.postinst to stop removing /usr/my.cnf
+  * modified d/*-test.* for updated location of testsuite
+  * updated d/{mysql-*-server.install,rules} to include debug plugins
+  * updated d/rules to remove storage engine cmake options
+  * modified data dir permission in d/*server.{pre,post}inst
+  * updated d/source/include-binaries to add debug plugins
+  * updated d/rules to rename debug plugins
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 02 Jul 2014 17:45:30 +0530
+
+mysql-community (5.6.19-1debian7) wheezy; urgency=low
+
+  * new upstream release
+  * d/rules updated to rid of files removed from source
+  * modified path for source tar in source pkg
+  * obscured actual filenames in d/source/include-binaries
+  * modified d/rules to handle obscured filenames
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 05 May 2014 15:45:10 +0530
+
+mysql-community (5.6.17-1debian7) stable; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Fri, 28 Feb 2014 18:06:30 +0530
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/compat b/mysql-wsrep-5.6/packaging/deb-jessie/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/control b/mysql-wsrep-5.6/packaging/deb-jessie/control
new file mode 100644 (file)
index 0000000..7ce536d
--- /dev/null
@@ -0,0 +1,188 @@
+Source: mysql-community
+Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Section: database
+Priority: optional
+Standards-Version: 3.9.5
+Homepage: http://www.mysql.com/
+Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-systemd (>= 1.5), lsb-release, cmake, fakeroot, libnuma-dev
+
+Package: mysql-server
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Server meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql server
+ package available in the repository.
+
+Package: mysql-community-server
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), adduser
+Depends: mysql-common (= ${binary:Version}), perl, psmisc,
+ ${shlibs:Depends}, ${misc:Depends}
+Recommends: mysql-client (= ${binary:Version})
+Conflicts: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server
+Replaces: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server
+Provides: virtual-mysql-server, virtual-mysql-server-core,
+ mysql-server-5.6, mysql-server-core-5.6
+Description: MySQL Server
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package includes the MySQL server binary as well as related
+ utilities to run and administer a MySQL server.
+
+Package: mysql-client
+Architecture: any
+Depends: mysql-community-client (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Client meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql client
+ package available in the repository.
+
+Package: mysql-community-client
+Architecture: any
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Replaces: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Provides: virtual-mysql-client, virtual-mysql-client-core,
+ mysql-client-5.6, mysql-client-core-5.6
+Description: MySQL Client
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the standard MySQL clients and
+ administration tools.
+
+Package: libmysqlclient18
+Architecture: any
+Section: libs
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL shared client libraries
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the shared libraries for MySQL client
+ applications.
+
+Package: mysql-common
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), ${misc:Pre-Depends}
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql
+Replaces: mysql, mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev
+Provides: mysql-common
+Description: MySQL Common
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains common files needed by MySQL client
+ library, MySQL database server, and MySQL embedded server.
+
+Package: libmysqlclient-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient18 (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL development headers
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the development header files necessary
+ to develop MySQL client applications.
+
+Package: libmysqld-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient-dev (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL embedded server library
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL server as an embedded library.
+
+Package: mysql-testsuite
+Architecture: any
+Depends: mysql-community-test (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Testsuite meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql test
+ package available in the repository.
+
+Package: mysql-community-test
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ mysql-community-client (= ${binary:Version}), python,
+ libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
+ mysql-testsuite-5.6, mysql-commercial-test
+Description: MySQL Test Run MTR - The MySQL testsuite
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL regression test suite for MySQL
+ database server.
+
+Package: mysql-community-bench
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-commercial-bench
+Description: MySQL Bench
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
+
+Package: mysql-community-source
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: MySQL source
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/copyright b/mysql-wsrep-5.6/packaging/deb-jessie/copyright
new file mode 100644 (file)
index 0000000..482a676
--- /dev/null
@@ -0,0 +1,41 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: MySQL Server 5.6
+Upstream-Contact: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Source: http://dev.mysql.com/
+
+Copyright: 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+License:
+ This is a release of MySQL, a dual-license SQL database server.
+ For the avoidance of doubt, this particular copy of the software
+ is released under the version 2 of the GNU General Public License.
+ MySQL is brought to you by Oracle.
+ .
+ MySQL FOSS License Exception
+ We want free and open source software applications under certain
+ licenses to be able to use specified GPL-licensed MySQL client
+ libraries despite the fact that not all such FOSS licenses are
+ compatible with version 2 of the GNU General Public License.
+ Therefore there are special exceptions to the terms and conditions
+ of the GPLv2 as applied to these client libraries, which are
+ identified and described in more detail in the FOSS License
+ Exception at
+ <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
+ .
+ This distribution may include materials developed by third
+ parties. For license and attribution notices for these
+ materials, please refer to the documentation that accompanies
+ this distribution (see the "Licenses for Third-Party Components"
+ appendix) or view the online documentation at
+ <http://dev.mysql.com/doc/>.
+ .
+ GPLv2 Disclaimer
+ For the avoidance of doubt, except that if any license choice
+ other than GPL or LGPL is available it will apply instead,
+ Oracle elects to use only the General Public License version 2
+ (GPLv2) at this time for any software where a choice of GPL
+ license versions is made available with the language indicating
+ that GPLv2 or any later version may be used, or where a choice
+ .
+ The full text of the GNU General Public License version 2 can
+ be found in the file
+ `/usr/share/mysql/doc/COPYING'.
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/extra/my.cnf b/mysql-wsrep-5.6/packaging/deb-jessie/extra/my.cnf
new file mode 100644 (file)
index 0000000..3a5445f
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Community Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[client]
+port           = 3306
+socket         = /var/run/mysqld/mysqld.sock
+
+[mysqld_safe]
+pid-file       = /var/run/mysqld/mysqld.pid
+socket         = /var/run/mysqld/mysqld.sock
+nice           = 0
+
+[mysqld]
+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
+explicit_defaults_for_timestamp
+
+# 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
+
+log-error      = /var/log/mysql/error.log
+
+# Recommended in standard MySQL setup
+sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
+
+# Disabling symbolic-links is recommended to prevent assorted security risks
+symbolic-links=0
+
+# * 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/mysql-wsrep-5.6/packaging/deb-jessie/extra/mysql-systemd-start b/mysql-wsrep-5.6/packaging/deb-jessie/extra/mysql-systemd-start
new file mode 100644 (file)
index 0000000..143d175
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+# Scripts to run by MySQL systemd service
+#
+# Needed argument: pre | post
+#
+# pre mode  :  try to perform sanity check for configuration, log, data
+# post mode :  ping server until answer is received
+
+pinger () {
+       while /bin/true ; do
+               sleep 1
+               mysqladmin ping >/dev/null 2>&1 && break
+       done
+}
+
+sanity () {
+       MYSQLRUN=/var/run/mysqld
+       MYSQLDATA=/var/lib/mysql
+       MYSQLLOG=/var/log/mysql
+
+       if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+       then
+               mkdir ${MYSQLDATA}
+               chown mysql:mysql ${MYSQLDATA}
+               chmod 750 ${MYSQLDATA}
+       fi
+
+       if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+       then
+               mkdir ${MYSQLDATA}/mysql
+               chown mysql:mysql ${MYSQLDATA}/mysql
+               chmod 750 ${MYSQLDATA}/mysql
+       fi
+
+       if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+       then
+               mysql_install_db --user=mysql > /dev/null
+       fi
+
+       if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+       then
+               mkdir ${MYSQLLOG}
+               chown mysql:adm ${MYSQLLOG}
+               chmod 750 ${MYSQLLOG}
+               touch ${MYSQLLOG}/error.log
+               chmod 640 ${MYSQLLOG}/error.log
+               chown mysql:adm ${MYSQLLOG}/error.log
+       fi
+
+       if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+       then
+               mkdir ${MYSQLRUN}
+               chown mysql:mysql ${MYSQLRUN}
+               chmod 755 ${MYSQLRUN}
+       fi
+
+       if [ ! -r /etc/mysql/my.cnf ]; then
+               echo "MySQL configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives."
+               exit 1
+       fi
+}
+
+case $1 in
+       "pre")  sanity ;;
+       "post") pinger ;;
+esac
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/extra/mysql_embedded.1 b/mysql-wsrep-5.6/packaging/deb-jessie/extra/mysql_embedded.1
new file mode 100644 (file)
index 0000000..735c4e0
--- /dev/null
@@ -0,0 +1 @@
+.so man1/mysql.1
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient-dev.dirs b/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient-dev.dirs
new file mode 100644 (file)
index 0000000..c287614
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (c) 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
+# 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
+
+usr/include/mysql
+usr/include/mysql/mysql
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient-dev.install b/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient-dev.install
new file mode 100644 (file)
index 0000000..e7e98c1
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (c) 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
+# 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
+
+usr/include/mysql/*.h
+usr/include/mysql/mysql/*.h
+usr/include/mysql/mysql/*.h.pp
+usr/include/mysql/mysql/psi/*.h
+usr/lib/*/libmysqlclient.a
+usr/lib/*/libmysqlclient.so
+usr/lib/*/libmysqlservices.a
+usr/bin/mysql_config
+usr/bin/mysql_config_editor
+usr/share/man/man1/mysql_config.1
+usr/share/man/man1/mysql_config_editor.1
+# legal
+usr/share/doc/libmysqlclient-dev/COPYING
+usr/share/doc/libmysqlclient-dev/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..09960eb
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/LICENSE.mysql
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/COPYING.gz
+libmysqlclient-dev: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient-dev: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient18.install b/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient18.install
new file mode 100644 (file)
index 0000000..fe6aa56
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/*/libmysqlclient.so.*
+# legal
+usr/share/doc/libmysqlclient18/COPYING
+usr/share/doc/libmysqlclient18/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient18.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/libmysqlclient18.lintian-overrides
new file mode 100644 (file)
index 0000000..1f26511
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/LICENSE.mysql
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/COPYING.gz
+libmysqlclient18: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient18: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/libmysqld-dev.install b/mysql-wsrep-5.6/packaging/deb-jessie/libmysqld-dev.install
new file mode 100644 (file)
index 0000000..923f826
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/*/libmysqld.a
+usr/lib/*/libmysqld-debug.a
+# legal
+usr/share/doc/libmysqld-dev/COPYING
+usr/share/doc/libmysqld-dev/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/libmysqld-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/libmysqld-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..35caaec
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/COPYING.gz
+libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-client.install b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-client.install
new file mode 100644 (file)
index 0000000..13b877e
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-client/COPYING
+usr/share/doc/mysql-client/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5c4891c
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
+mysql-client: extra-license-file usr/share/doc/mysql-client/COPYING.gz
+mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-common.dirs b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-common.dirs
new file mode 100644 (file)
index 0000000..69265ef
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/conf.d
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-common.install b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-common.install
new file mode 100644 (file)
index 0000000..8a22acd
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/my.cnf
+usr/share/aclocal/mysql.m4
+usr/share/mysql/docs/INFO_SRC
+usr/share/mysql/docs/INFO_BIN
+usr/share/mysql/docs/ChangeLog
+# localized error msgs
+usr/share/mysql/*/errmsg.sys
+usr/share/mysql/errmsg-utf8.txt
+# charsets
+usr/share/mysql/charsets/*.xml
+usr/share/mysql/charsets/README
+# legal
+usr/share/doc/mysql-common/COPYING
+usr/share/doc/mysql-common/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-common.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-common.lintian-overrides
new file mode 100644 (file)
index 0000000..70ddcdf
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
+mysql-common: extra-license-file usr/share/doc/mysql-common/COPYING.gz
+mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-bench.dirs b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-bench.dirs
new file mode 100644 (file)
index 0000000..d630d6b
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql
+usr/lib/mysql/sql-bench
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-bench.install b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-bench.install
new file mode 100644 (file)
index 0000000..065124b
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql/sql-bench/*
+# legal
+usr/share/doc/mysql-community-bench/COPYING
+usr/share/doc/mysql-community-bench/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-bench.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-bench.lintian-overrides
new file mode 100644 (file)
index 0000000..04df14e
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/LICENSE.mysql
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/COPYING.gz
+mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-client.install b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-client.install
new file mode 100644 (file)
index 0000000..46cd07d
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright (c) 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
+# 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
+
+# binaries
+usr/bin/innochecksum
+usr/bin/myisam_ftdump
+usr/bin/mysql
+usr/bin/mysql_embedded
+usr/bin/mysqlaccess
+usr/bin/mysqlaccess.conf
+usr/bin/mysqladmin
+usr/bin/mysqlbug
+usr/bin/mysqlcheck
+usr/bin/mysql_client_test
+usr/bin/mysql_client_test_embedded
+usr/bin/mysqldump
+usr/bin/mysqldumpslow
+usr/bin/mysql_find_rows
+usr/bin/mysql_fix_extensions
+usr/bin/mysqlimport
+usr/bin/mysql_plugin
+usr/bin/mysqlshow
+usr/bin/mysqlslap
+usr/bin/mysql_waitpid
+# man pages
+usr/share/man/man1/innochecksum.1
+usr/share/man/man1/myisam_ftdump.1
+usr/share/man/man1/mysql.1
+usr/share/man/man1/mysql_embedded.1
+usr/share/man/man1/mysqlaccess.1
+usr/share/man/man1/mysqladmin.1
+usr/share/man/man1/mysqlbug.1
+usr/share/man/man1/mysqlcheck.1
+usr/share/man/man1/mysql_client_test.1
+usr/share/man/man1/mysql_client_test_embedded.1
+usr/share/man/man1/mysqldump.1
+usr/share/man/man1/mysqldumpslow.1
+usr/share/man/man1/mysql_find_rows.1
+usr/share/man/man1/mysql_fix_extensions.1
+usr/share/man/man1/mysqlimport.1
+usr/share/man/man1/mysqlman.1
+usr/share/man/man1/mysql_plugin.1
+usr/share/man/man1/mysqlshow.1
+usr/share/man/man1/mysqlslap.1
+usr/share/man/man1/mysql_waitpid.1
+# legal
+usr/share/doc/mysql-community-client/COPYING
+usr/share/doc/mysql-community-client/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5892935
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-client/LICENSE.mysql
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-clienti/COPYING.gz
+mysql-community-client: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-client: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.config b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.config
new file mode 100755 (executable)
index 0000000..cb6c39c
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+# 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
+# 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
+
+. /usr/share/debconf/confmodule
+
+if [ "$1" = "configure" ] && [ -z "$2" ];
+then
+
+       set -e
+
+       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-commercial-server
+       INSTALLED_PKG=none
+       MYSQLDATA=/var/lib/mysql
+
+       IFS_BACKUP=${IFS}
+       IFS=":"
+       for PKG in ${PKG_LIST};
+       do
+               STATUS=$(dpkg -s ${PKG} 2> /dev/null | grep Status: | cut -d' ' -f4)
+               if [ "${STATUS}" = "installed" ];
+               then
+                       INSTALLED_PKG=${PKG}
+                       break
+               fi
+       done
+       IFS=${IFS_BACKUP}
+
+       if [ "${INSTALLED_PKG}" = "none" ];
+       then
+               if [ -d ${MYSQLDATA} -o -L ${MYSQLDATA} ];
+               then
+                       db_input high mysql-community-server/data-dir || true
+               else
+                       db_fset mysql-community-server/data-dir seen true
+               fi
+
+               while :; do
+                       PASSWD=""
+                       db_input high mysql-community-server/root-pass || true
+                       db_go
+
+                       db_get mysql-community-server/root-pass
+                       if [ -z "${RET}" ];
+                       then
+                               db_fset mysql-community-server/root-pass seen true
+                               db_fset mysql-community-server/re-root-pass seen true
+                               break
+                       fi
+                       PASSWD="${RET}"
+
+                       db_input high mysql-community-server/re-root-pass || true
+                       db_go
+
+                       db_get mysql-community-server/re-root-pass
+                       if [ "${RET}" == "${PASSWD}" ];
+                       then
+                               PASSWD=""
+                               break
+                       fi
+
+                       db_fset mysql-community-server/root-pass-mismatch seen false
+                       db_input critical mysql-community-server/root-pass-mismatch
+                       db_set mysql-community-server/root-pass ""
+                       db_set mysql-community-server/re-root-pass ""
+               done
+
+       else
+               db_fset mysql-community-server/data-dir seen true
+               db_fset mysql-community-server/root-pass seen true
+               db_fset mysql-community-server/re-root-pass seen true
+       fi
+
+       set +e
+fi
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.dirs b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.dirs
new file mode 100644 (file)
index 0000000..91e7185
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/conf.d
+etc/init.d
+usr/lib/mysql
+usr/lib/mysql/plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.install b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.install
new file mode 100644 (file)
index 0000000..03de843
--- /dev/null
@@ -0,0 +1,85 @@
+# 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
+# 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
+
+# binaries
+usr/bin/msql2mysql
+usr/bin/myisamchk
+usr/bin/myisamlog
+usr/bin/myisampack
+usr/bin/my_print_defaults
+usr/bin/mysqlbinlog
+usr/bin/mysql_convert_table_format
+usr/bin/mysqld_multi
+usr/bin/mysqld_safe
+usr/bin/mysqlhotcopy
+usr/bin/mysql_install_db
+usr/bin/mysql_secure_installation
+usr/bin/mysql_setpermission
+usr/bin/mysqltest
+usr/bin/mysqltest_embedded
+usr/bin/mysql_tzinfo_to_sql
+usr/bin/mysql_upgrade
+usr/bin/mysql_zap
+usr/bin/perror
+usr/bin/replace
+usr/bin/resolveip
+usr/bin/resolve_stack_dump
+usr/sbin/mysqld
+# debug binary
+usr/sbin/mysqld-debug
+# man pages
+usr/share/man/man1/comp_err.1
+usr/share/man/man1/msql2mysql.1
+usr/share/man/man1/myisamchk.1
+usr/share/man/man1/myisamlog.1
+usr/share/man/man1/myisampack.1
+usr/share/man/man1/my_print_defaults.1
+usr/share/man/man1/mysqlbinlog.1
+usr/share/man/man1/mysql_convert_table_format.1
+usr/share/man/man1/mysqld_multi.1
+usr/share/man/man1/mysqld_safe.1
+usr/share/man/man1/mysqlhotcopy.1
+usr/share/man/man1/mysql_install_db.1
+usr/share/man/man1/mysql_secure_installation.1
+usr/share/man/man1/mysql.server.1
+usr/share/man/man1/mysql_setpermission.1
+usr/share/man/man1/mysql-stress-test.pl.1
+usr/share/man/man1/mysqltest.1
+usr/share/man/man1/mysqltest_embedded.1
+usr/share/man/man1/mysql_tzinfo_to_sql.1
+usr/share/man/man1/mysql_upgrade.1
+usr/share/man/man1/mysql_zap.1
+usr/share/man/man1/perror.1
+usr/share/man/man1/replace.1
+usr/share/man/man1/resolveip.1
+usr/share/man/man1/resolve_stack_dump.1
+usr/share/man/man8/mysqld.8
+# SQL files
+usr/share/mysql/*.sql
+# plugins
+usr/lib/mysql/plugin/*.so
+usr/lib/mysql/plugin/debug/*.so
+usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/debug/daemon_example.ini
+# support files
+usr/share/mysql/mysqld_multi.server
+usr/share/mysql/magic
+usr/share/mysql/mysql-log-rotate
+usr/share/mysql/mysql-systemd-start
+usr/share/mysql/my-default.cnf
+usr/share/mysql/dictionary.txt
+# legal
+usr/share/doc/mysql-community-server/COPYING
+usr/share/doc/mysql-community-server/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.lintian-overrides
new file mode 100644 (file)
index 0000000..08b3865
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/LICENSE.mysql
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/COPYING.gz
+mysql-community-server: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-server: embedded-library
+# Since we ship debug plugins so this error is overridden
+mysql-community-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.mysql.init b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.mysql.init
new file mode 100755 (executable)
index 0000000..d8c0808
--- /dev/null
@@ -0,0 +1,190 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides:          mysql
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Should-Start:      $network $time
+# Should-Stop:       $network $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start/ Stop MySQL Community Server daemon
+# Description:       This service script facilitates startup and shutdown of
+#                    mysqld daemon throught its wrapper script mysqld_safe
+### END INIT INFO
+#
+
+# 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
+# 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
+
+. /lib/lsb/init-functions
+
+cd /
+umask 077
+
+MYSQLDATA=/var/lib/mysql
+VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
+
+get_mysql_option() {
+       RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
+       if [ -z "$RESULT" ];
+       then
+               RESULT="$3"
+       fi
+       echo $RESULT
+}
+
+get_running () {
+       PIDFILE=$(get_mysql_option mysqld_safe pid-file "")
+       if [ -z "$PIDFILE" ];
+       then
+               PIDFILE=$(get_mysql_option mysqld pid-file "$MYSQLDATA/$(hostname).pid")
+       fi
+       if [ -e "$PIDFILE" ] && [ -d "/proc/$(cat "$PIDFILE")" ];
+       then
+               echo 1
+       else
+               echo 0
+       fi
+}
+
+server_stop () {
+       RUNNING=$(get_running)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${RUNNING}" -eq 0 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               RUNNING=$(get_running)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+  'start')
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
+       then
+               log_action_msg "A MySQL Server is already started"
+       else
+               MYSQLRUN=/var/run/mysqld
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+               fi
+
+               if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+               then
+                       mysql_install_db --user=mysql > /dev/null
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
+               if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+               then
+                       mkdir ${MYSQLRUN}
+                       chown mysql:mysql ${MYSQLRUN}
+                       chmod 755 ${MYSQLRUN}
+               fi
+
+               su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
+               for i in 1 2 3 4 5 6;
+               do
+                       sleep 1
+                       echo -n .
+               done
+               echo
+               RUNNING=$(get_running)
+               if [ "${RUNNING}" -eq 1 ];
+               then
+                       log_action_msg "MySQL Community Server ${VERSION} is started"
+               else
+                       log_action_msg "MySQL Community Server ${VERSION} did not start. Please check logs for more details."
+               fi
+       fi
+       ;;
+
+  'stop')
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
+       then
+               killall -15 mysqld
+               server_stop
+               if [ "$?" -eq 0 ];
+               then
+                       log_action_msg "MySQL Community Server ${VERSION} is stopped"
+               else
+                       log_action_msg "Attempt to shutdown MySQL Community Server ${VERSION} timed out"
+               fi
+       else
+               log_action_msg "MySQL Community Server ${VERSION} is already stopped"
+       fi
+       ;;
+
+  'restart'|'reload'|'force-reload')
+       log_action_msg "Stopping MySQL Community Server ${VERSION}"
+       $0 stop
+       log_action_msg "Re-starting MySQL Community Server ${VERSION}"
+       $0 start
+       ;;
+
+  'status')
+       RUNNING=$(get_running)
+       if [ ${RUNNING} -eq 1 ];
+       then
+               log_action_msg "MySQL Community Server ${VERSION} is running"
+       else
+               log_action_msg "MySQL Community Server ${VERSION} is not running"
+               exit 3
+       fi
+       ;;
+
+  *)
+       echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
+       exit 1
+       ;;
+esac
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.mysql.service b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.mysql.service
new file mode 100644 (file)
index 0000000..b3e3305
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (c) 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
+# 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
+
+# MySQL systemd service file
+
+[Unit]
+Description=MySQL Community Server
+After=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+User=mysql
+Group=mysql
+PermissionsStartOnly=true
+ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
+ExecStart=/usr/bin/mysqld_safe
+ExecStartPost=/usr/share/mysql/mysql-systemd-start post
+TimeoutSec=600
+Restart=on-failure
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.postinst b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.postinst
new file mode 100755 (executable)
index 0000000..2870337
--- /dev/null
@@ -0,0 +1,93 @@
+#!/bin/bash
+
+# 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
+# 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
+
+. /usr/share/debconf/confmodule
+
+take_upstart_job_backup () {
+       if [ -e "/etc/init/mysql.conf" ] && [ -d "/var/lib/mysql" ];
+       then
+               mv /etc/init/mysql.conf /var/lib/mysql/.mysql.conf.backup
+       fi
+}
+
+case "$1" in
+       configure)
+
+       if [ -z "$2" ];
+       then
+               set -e
+
+               MYSQLDATA=/var/lib/mysql
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+                       if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+                       then
+                               mysql_install_db --user=mysql > /dev/null
+                       fi
+               fi
+
+               db_get mysql-community-server/root-pass && PASSWD=${RET}
+               if [ ! -z "${PASSWD}" ];
+               then
+                       db_set mysql-community-server/root-pass ""
+                       db_set mysql-community-server/re-root-pass ""
+                       PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
+               else
+                       PASSWD=""
+               fi
+
+               SQL=`mktemp`
+               if [ -f "${SQL}" ];
+               then
+                       chmod 700 ${SQL}
+                       cat << EOF > ${SQL}
+USE mysql;
+${PASSWD}
+DELETE FROM user WHERE user='';
+FLUSH PRIVILEGES;
+EOF
+                       mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
+                       PASSWD=""
+                       rm -f ${SQL}
+               fi
+
+               set +e
+
+       fi
+
+       ;;
+
+       abort-upgrade|abort-remove|abort-configure)
+
+       ;;
+
+       *)
+       exit 1
+       ;;
+esac
+
+db_stop
+
+take_upstart_job_backup
+
+#DEBHELPER#
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.postrm b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.postrm
new file mode 100755 (executable)
index 0000000..c75743f
--- /dev/null
@@ -0,0 +1,154 @@
+#!/bin/bash
+
+# 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
+# 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
+
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ];
+then
+. /usr/share/debconf/confmodule
+fi
+
+place_upstart_job_back () {
+       if [ -e "/var/lib/mysql/.mysql.conf.backup" ];
+       then
+               mv /var/lib/mysql/.mysql.conf.backup /etc/init/mysql.conf
+       fi
+}
+
+get_pcount () {
+       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+       echo "${PSCOUNT}"
+}
+
+server_stop () {
+       PSCOUNT=$(get_pcount)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${PSCOUNT}" -eq 1 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               PSCOUNT=$(get_pcount)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+       remove)
+
+       set -e
+
+       place_upstart_job_back
+
+       set +e
+
+       ;;
+
+       purge)
+
+       set -e
+
+       place_upstart_job_back
+
+       MYSQLDATA=/var/lib/mysql
+       MYSQLLOG=/var/log/mysql
+       MYSQLRUN=/var/run/mysqld
+
+       server_stop
+
+       db_input high mysql-community-server/remove-data-dir || true
+       db_go
+       db_get mysql-community-server/remove-data-dir && RMDATADIR=${RET}
+       if [ "${RMDATADIR}" = "true" ];
+       then
+               if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+               then
+                       rm -rf ${MYSQLRUN}
+               fi
+
+               if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+               then
+                       rm -rf ${MYSQLLOG}
+               fi
+
+               if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+               then
+                       rm -rf ${MYSQLDATA}
+               fi
+
+               if getent passwd mysql >/dev/null;
+               then
+                       userdel mysql
+               fi
+       fi
+
+       set +e
+       ;;
+
+       abort-install)
+
+       set -e
+
+       place_upstart_job_back
+
+       if [ -x "/etc/init.d/mysql" ];
+       then
+               invoke-rc.d mysql start || exit $?
+       else
+               if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+               then
+                       rm -rf ${MYSQLRUN}
+               fi
+
+               if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+               then
+                       rm -rf ${MYSQLLOG}
+               fi
+
+               if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+               then
+                       rm -rf ${MYSQLDATA}
+               fi
+
+               if getent passwd mysql >/dev/null;
+               then
+                       userdel mysql
+               fi
+       fi
+
+       set +e
+       ;;
+
+       upgrade|abort-upgrade)
+
+       ;;
+
+       *)
+       exit 1
+       ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.preinst b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.preinst
new file mode 100755 (executable)
index 0000000..f1838b0
--- /dev/null
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+# 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
+# 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
+
+get_pcount () {
+       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+       echo "${PSCOUNT}"
+}
+
+server_stop () {
+       PSCOUNT=$(get_pcount)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${PSCOUNT}" -eq 1 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               PSCOUNT=$(get_pcount)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+       install)
+
+       if [ -z "$2" ];
+       then
+
+               set -e
+
+               if [ -x "/etc/init.d/mysql" ];
+               then
+                       invoke-rc.d mysql stop || exit $?
+                       server_stop
+               fi
+
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+               MYSQLRUN=/var/run/mysqld
+
+               if ! getent group mysql >/dev/null;
+               then
+                       addgroup --system mysql >/dev/null
+               fi
+
+               if ! getent passwd mysql >/dev/null;
+               then
+                       adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
+               fi
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
+               if [ ! -d ${MYSQLRUN} -a ! -L ${MYSQLRUN} ];
+               then
+                       mkdir ${MYSQLRUN}
+                       chown mysql:mysql ${MYSQLRUN}
+                       chmod 755 ${MYSQLRUN}
+               fi
+
+               set +e
+
+       fi
+
+       ;;
+
+       upgrade)
+
+       set -e
+
+       #DEBHELPER#
+       server_stop
+
+       set +e
+
+       ;;
+
+       abort-upgrade)
+
+       ;;
+
+       *)
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.prerm b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.prerm
new file mode 100755 (executable)
index 0000000..7509de7
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# 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
+# 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
+
+set -e
+
+#DEBHELPER#
+
+set +e
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.templates b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-server.templates
new file mode 100644 (file)
index 0000000..7b7e0ac
--- /dev/null
@@ -0,0 +1,33 @@
+Template: mysql-community-server/root-pass
+Type: password
+Description: Enter root password:
+ Please provide a strong password that will be set for the root account of your MySQL database.
+ Leave it blank if you do not wish to set or change the root password at this time.
+
+Template: mysql-community-server/re-root-pass
+Type: password
+Description: Re-enter root password:
+ Now that you have selected a password for the root account, please confirm by typing it again. Do not share the password with anyone.
+
+Template: mysql-community-server/root-pass-mismatch
+Type: error
+Description: The two passwords did not match
+ Please try again. Make sure you type the exact same password twice.
+
+Template: mysql-community-server/remove-data-dir
+Type: boolean
+Default: false
+Description: Remove data directory at /var/lib/mysql ?
+ This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ It is highly recommended to take data backup before removing the data directory.
+
+Template: mysql-community-server/data-dir
+Type: note
+Description: Data directory found when no MySQL server package is installed
+ A data directory '/var/lib/mysql' is present on this system when no MySQL server 
+ package is currently installed on the system. The directory may be under control of
+ server package received from third-party vendors. It may also be an unclaimed data
+ directory from previous removal of mysql packages.
+ .
+ It is highly recommended to take data backup. If you have not done so, now would be
+ the time to take backup in another shell. Once completed, press 'Ok' to continue.
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-source.install b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-source.install
new file mode 100644 (file)
index 0000000..dd7a094
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (c) 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
+# 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
+
+../*.dsc    usr/src/mysql/
+../*.tar.xz usr/src/mysql/
+# legal
+usr/share/doc/mysql-community-source/COPYING
+usr/share/doc/mysql-community-source/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-source.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-source.lintian-overrides
new file mode 100644 (file)
index 0000000..9ca84e9
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/LICENSE.mysql
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/COPYING.gz
+mysql-community-source: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.dirs b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.dirs
new file mode 100644 (file)
index 0000000..f93ca25
--- /dev/null
@@ -0,0 +1,16 @@
+# 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
+# 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
+
+usr/lib/mysql-test
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.install b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.install
new file mode 100644 (file)
index 0000000..d5f820d
--- /dev/null
@@ -0,0 +1,20 @@
+# 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
+# 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
+
+usr/lib/mysql-test/*
+usr/share/man/man1/mysql-test-run.pl.1
+# legal
+usr/share/doc/mysql-community-test/COPYING
+usr/share/doc/mysql-community-test/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.links b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.links
new file mode 100644 (file)
index 0000000..aedf2db
--- /dev/null
@@ -0,0 +1,17 @@
+# 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
+# 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
+
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mysql-test-run
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mtr
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-community-test.lintian-overrides
new file mode 100644 (file)
index 0000000..ff273bb
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/LICENSE.mysql
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/COPYING.gz
+mysql-community-test: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-server.install b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-server.install
new file mode 100644 (file)
index 0000000..e3aa8de
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-server/COPYING
+usr/share/doc/mysql-server/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-server.lintian-overrides
new file mode 100644 (file)
index 0000000..4877097
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-server: extra-license-file usr/share/doc/mysql-server/LICENSE.mysql
+mysql-server: extra-license-file usr/share/doc/mysql-server/COPYING.gz
+mysql-server: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-testsuite.install b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-testsuite.install
new file mode 100644 (file)
index 0000000..dfc1733
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-testsuite/COPYING
+usr/share/doc/mysql-testsuite/README
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/mysql-testsuite.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/mysql-testsuite.lintian-overrides
new file mode 100644 (file)
index 0000000..37488fe
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/LICENSE.mysql
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/COPYING.gz
+mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl
similarity index 87%
rename from debian/patches/fix-man-page-links.patch
rename to mysql-wsrep-5.6/packaging/deb-jessie/patches/fix-man-page-links.patch
index 126b5d3c2af3fb2669596183701db75e1214c59f..004ccdf77d03aa2cd73f3c6e63465e1eba0a1ab9 100644 (file)
@@ -5,10 +5,10 @@ Bug: http://bugs.mysql.com/bug.php?id=70952
 --- a/man/mysql_client_test_embedded.1 2013-11-08 19:00:22.000000000 +0530
 +++ b/man/mysql_client_test_embedded.1 2013-11-14 19:29:56.768315219 +0530
 @@ -1 +1 @@
--.so man/mysql_client_test.1
+-.so man-gpl-tmp2/mysql_client_test.1
 +.so man1/mysql_client_test.1
 --- a/man/mysqltest_embedded.1 2013-11-08 19:00:22.000000000 +0530
 +++ b/man/mysqltest_embedded.1 2013-11-14 19:31:19.079280675 +0530
 @@ -1 +1 @@
--.so man/mysqltest.1
+-.so man-gpl-tmp2/mysqltest.1
 +.so man1/mysqltest.1
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/patches/fix-mtr-search-paths.patch b/mysql-wsrep-5.6/packaging/deb-jessie/patches/fix-mtr-search-paths.patch
new file mode 100644 (file)
index 0000000..8a27a09
--- /dev/null
@@ -0,0 +1,13 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Adding extra search path for testsuite.
+
+--- a/mysql-test/lib/mtr_cases.pm      2014-02-24 13:14:37 +0530
++++ b/mysql-test/lib/mtr_cases.pm      2014-07-02 11:46:24 +0530
+@@ -288,6 +288,7 @@
+     {
+       $suitedir= my_find_dir($::basedir,
+                            ["share/mysql-test/suite",
++                            "lib/mysql-test/suite",
+                             "mysql-test/suite",
+                             "internal/mysql-test/suite",
+                             "mysql-test",
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/patches/fix-mysql_install_db.patch b/mysql-wsrep-5.6/packaging/deb-jessie/patches/fix-mysql_install_db.patch
new file mode 100644 (file)
index 0000000..41311b2
--- /dev/null
@@ -0,0 +1,43 @@
+From: Terje Røsten <terje.rosten@oracle.com>
+Description: Maintains the pending --skip-my-cnf option in mainline
+Bug: <TODO>
+
+diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
+index 440a977..7d068fc 100644
+--- a/scripts/mysql_install_db.pl.in
++++ b/scripts/mysql_install_db.pl.in
+@@ -113,6 +113,7 @@ EOF2
+   print <<EOF3;
+   --rpm                For internal use.  This option is used by RPM files
+                        during the MySQL installation process.
++                       Implies --keep-my-cnf option.
+   --skip-name-resolve  Use IP addresses rather than hostnames when creating
+                        grant table entries.  This option can be useful if
+                        your DNS does not work.
+@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} )
+ {
+   error($opt,"Specify either --basedir or --srcdir, not both");
+ }
+-if ( $opt->{'keep-my-cnf'} )
++if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
+ {
+   $keep_my_cnf = 1;
+ }
+@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
+ }
+
+ # ----------------------------------------------------------------------
+-# Create database directories mysql & test
++# Create database directory mysql
+ # ----------------------------------------------------------------------
+
+ # FIXME The shell variant uses "mkdir -p":
+@@ -697,7 +698,7 @@ if ($opt_user)
+   }
+ }
+
+-foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
++foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql")
+ {
+   mkdir($dir, 0700) unless -d $dir;
+   if ($opt_user and -w "/")
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/patches/series b/mysql-wsrep-5.6/packaging/deb-jessie/patches/series
new file mode 100644 (file)
index 0000000..31af2dc
--- /dev/null
@@ -0,0 +1,18 @@
+# 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
+# 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
+
+#fix-man-page-links.patch
+fix-mysql_install_db.patch
+fix-mtr-search-paths.patch
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/rules b/mysql-wsrep-5.6/packaging/deb-jessie/rules
new file mode 100755 (executable)
index 0000000..92f0d1a
--- /dev/null
@@ -0,0 +1,136 @@
+#!/usr/bin/make -f
+
+# 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
+# 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
+
+%:
+       dh $@
+
+export DH_VERBOSE=1
+export CFLAGS=
+export CXXFLAGS=
+
+override_dh_auto_configure:
+       @echo "RULES.$@"
+       cmake . \
+               -DBUILD_CONFIG=mysql_release \
+               -DCMAKE_INSTALL_PREFIX=/usr \
+               -DINSTALL_DOCDIR=share/mysql/docs \
+               -DINSTALL_DOCREADMEDIR=share/mysql \
+               -DINSTALL_INCLUDEDIR=include/mysql \
+               -DINSTALL_INFODIR=share/mysql/docs \
+               -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
+               -DINSTALL_MANDIR=share/man \
+               -DINSTALL_MYSQLSHAREDIR=share/mysql \
+               -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
+               -DINSTALL_PLUGINDIR=lib/mysql/plugin \
+               -DINSTALL_SBINDIR=sbin \
+               -DINSTALL_SCRIPTDIR=bin \
+               -DINSTALL_SQLBENCHDIR=lib/mysql \
+               -DINSTALL_SUPPORTFILESDIR=share/mysql \
+               -DMYSQL_DATADIR=/var/lib/mysql \
+               -DSYSCONFDIR=/etc/mysql \
+               -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
+               -DWITH_SSL=bundled \
+               -DWITH_ZLIB=system \
+               -DWITH_EXTRA_CHARSETS=all \
+               -DWITH_INNODB_MEMCACHED=1 \
+               -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
+               -DINSTALL_LAYOUT=DEB
+
+       cat CMakeCache.txt
+       touch $@
+
+override_dh_auto_build:
+       @echo "RULES.$@"
+       $(MAKE) -j8 VERBOSE=1
+       touch $@
+
+override_dh_auto_test:
+       @echo "RULES.$@"
+       echo "No tests run because test 9: pfs_connect_attr is failing unreasonably"
+       touch $@
+
+override_dh_auto_install:
+
+       @echo "RULES.$@"
+       # complete install first
+       $(MAKE) install DESTDIR=debian/tmp
+       # remove all redundant files and links
+       rm debian/tmp/usr/lib/*/*_r*
+       rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
+       rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
+       rm debian/tmp/usr/lib/mysql-test/Makefile
+       # add missing man pages
+       install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+       # add MySQL Server configuration file my.cnf to mysql-common package
+       install -g root -o root -m 0644 -D debian/extra/my.cnf debian/tmp/etc/mysql/my.cnf
+       # add MySQL Server debug binary and library to package
+       install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+       install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       # add debug plugin libraries to package
+       install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
+       for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
+       install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+       install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
+       # add systemd script
+       install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/
+       # add directory for legal docs
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-bench
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-test
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-source
+       # add COPYING file to each package
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
+       # add README file to each package
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
+       touch $@
+
+override_dh_installinit:
+       @echo "RULES.$@"
+       dh_systemd_enable --name=mysql
+       dh_installinit --name=mysql -- defaults 19 21
+       dh_systemd_start --restart-after-upgrade
+       touch $@
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/source/format b/mysql-wsrep-5.6/packaging/deb-jessie/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/source/include-binaries b/mysql-wsrep-5.6/packaging/deb-jessie/source/include-binaries
new file mode 100644 (file)
index 0000000..caac1e1
--- /dev/null
@@ -0,0 +1,33 @@
+# 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
+# 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
+
+# obscured filename for mysqld-debug, libmysqld-debug.a and debug plugins
+debian/extra/server-binary
+debian/extra/embedded-server
+debian/extra/adt_null-plugin
+debian/extra/auth-plugin
+debian/extra/auth_socket-plugin
+debian/extra/auth_test_plugin-plugin
+debian/extra/innodb_engine-plugin
+debian/extra/libdaemon_example-plugin
+debian/extra/libmemcached-plugin
+debian/extra/mypluglib-plugin
+debian/extra/mysql_no_login-plugin
+debian/extra/qa_auth_client-plugin
+debian/extra/qa_auth_interface-plugin
+debian/extra/qa_auth_server-plugin
+debian/extra/semisync_master-plugin
+debian/extra/semisync_slave-plugin
+debian/extra/validate_password-plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/source/lintian-overrides b/mysql-wsrep-5.6/packaging/deb-jessie/source/lintian-overrides
new file mode 100644 (file)
index 0000000..9eefbb7
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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 provide our own versioning scheme so this warning is overridden
+mysql-community source: changelog-should-mention-nmu
+mysql-community source: source-nmu-has-incorrect-version-number
diff --git a/mysql-wsrep-5.6/packaging/deb-jessie/watch b/mysql-wsrep-5.6/packaging/deb-jessie/watch
new file mode 100644 (file)
index 0000000..c45c5e3
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://mysql.mirrors.pair.com/Downloads/MySQL-5.6/mysql-([\d\.]+).tar.gz
index cc3855f6d99d50e7ee7e55816c0b588c196e3624..3773713eafd49d28ae7c2e868c3cbd626766d539 100644 (file)
@@ -1,3 +1,52 @@
+mysql-community (5.6.25-1ubuntu12.04) precise; urgency=low
+
+  * new upstream release
+  * mysql-community-server now depends on perl, psmisc
+    mysql-community-test now depends on python, libmysqlclient-dev
+    (Closes: #20561621)
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 25 Feb 2014 22:52:19 +0530
+
+mysql-community (5.6.24-1ubuntu12.04) precise; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 16 Feb 2014 15:45:09 +0530
+
+mysql-community (5.6.23-1ubuntu12.04) precise; urgency=low
+
+  * new upstream release
+  * dh_apparmor to now run before dh_installinit in d/rules
+  * mysql-community-server now recommends mysql-client
+  * mysql-community-server now depends on apparmor
+  * removed template install-test-db; not installed by default
+  * d/compat incremented to 9 from 8
+  * d/control updated to build depend on debhelper 9
+  * added d/*.lintian-overrides and d/source/lintian-overrides
+  * d/rules updated to reflect correct file permissions
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 31 Dec 2014 10:51:07 +0530
+
+mysql-community (5.6.22-1ubuntu12.04) precise; urgency=low
+
+  * new upstream release
+  * fixed d/*server.postinst to allow dropping test db without
+    setting root password
+  * init script will now run my_i_db if data dir is not present or empty
+  * updated init script to read app armor profile on startup
+  * added more system resources to app armor profile
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 24 Sep 2014 14:48:07 +0530
+
+mysql-community (5.6.21-1ubuntu12.04) precise; urgency=low
+
+  * new upstream release
+  * updated d/rules to increment -j8 as make option
+  * updated d/source/include-binaries to add mysql_no_login plugin
+  * updated CMake option WITH_EXTRA_CHARSETS from complex to all
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 20 Aug 2014 19:12:30 +0530
+
 mysql-community (5.6.20-1ubuntu12.04) precise; urgency=low
 
   * new upstream release
@@ -5,8 +54,20 @@ mysql-community (5.6.20-1ubuntu12.04) precise; urgency=low
   * added d/*.dirs for bench, dev and test pkg
   * updated d/rules to make compilation verbose
   * removed default CFLAGS, CXXFLAGS in d/rules
+  * added patch for testsuite search paths under d/patches
+  * modified cmake option for testsuite in d/rules
+  * updated patch d/fix-mysql_install_db.patch
+  * enabled two patches in d/patches/series
+  * removed extra permissions check in d/rules when fixed in source
+  * modified d/mysql-*-server.postinst to stop removing /usr/my.cnf
+  * modified d/*-test.* for updated location of testsuite
+  * updated d/{mysql-*-server.install,rules} to include debug plugins
+  * updated d/rules to remove storage engine cmake options
+  * modified data dir permission in d/*server.{pre,post}inst
+  * updated d/source/include-binaries to add debug plugins
+  * updated d/rules to rename debug plugins
 
- -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 26 Jun 2014 16:13:30 +0530
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 02 Jul 2014 17:45:30 +0530
 
 mysql-community (5.6.19-1ubuntu12.04) precise; urgency=low
 
index 45a4fb75db864000d01701c0f7a51864bd4daabf..ec635144f60048986bc560c5576355344005e6e7 100644 (file)
@@ -1 +1 @@
-8
+9
index b6f6bb2cde9f9da0b7aad06764a4e24d767be610..c65f5371d340e414af168e55ca1f4bd0869148f5 100644 (file)
@@ -4,7 +4,7 @@ Section: database
 Priority: optional
 Standards-Version: 3.9.3
 Homepage: http://www.mysql.com/
-Build-Depends: debhelper (>= 8.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-apparmor, lsb-release, cmake, fakeroot
+Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-apparmor, lsb-release, cmake, fakeroot, libnuma-dev
 
 Package: mysql-server
 Architecture: any
@@ -20,21 +20,21 @@ Description: MySQL Server meta package depending on latest version
 Package: mysql-community-server
 Architecture: any
 Pre-depends: debconf (>= 0.2.17), adduser
-Depends: mysql-common (= ${binary:Version}),
+Depends: mysql-common (= ${binary:Version}), apparmor, perl, psmisc,
  ${shlibs:Depends}, ${misc:Depends}
-Recommends: mysql-community-client (= ${binary:Version})
+Recommends: mysql-client (= ${binary:Version})
 Conflicts: mysql,
  mysql-server-5.0, mysql-server-core-5.0,
  mysql-server-5.1, mysql-server-core-5.1,
  mysql-server-5.5, mysql-server-core-5.5,
  mysql-server-5.6, mysql-server-core-5.6,
- mysql-enterprise-server
+ mysql-commercial-server
 Replaces: mysql,
  mysql-server-5.0, mysql-server-core-5.0,
  mysql-server-5.1, mysql-server-core-5.1,
  mysql-server-5.5, mysql-server-core-5.5,
  mysql-server-5.6, mysql-server-core-5.6,
- mysql-enterprise-server
+ mysql-commercial-server
 Provides: virtual-mysql-server, virtual-mysql-server-core,
  mysql-server-5.6, mysql-server-core-5.6
 Description: MySQL Server
@@ -65,13 +65,13 @@ Conflicts: mysql,
  mysql-client-5.1, mysql-client-core-5.1,
  mysql-client-5.5, mysql-client-core-5.5,
  mysql-client-5.6, mysql-client-core-5.6,
- mysql-enterprise-client
+ mysql-commercial-client
 Replaces: mysql,
  mysql-client-5.0, mysql-client-core-5.0,
  mysql-client-5.1, mysql-client-core-5.1,
  mysql-client-5.5, mysql-client-core-5.5,
  mysql-client-5.6, mysql-client-core-5.6,
- mysql-enterprise-client
+ mysql-commercial-client
 Provides: virtual-mysql-client, virtual-mysql-client-core,
  mysql-client-5.6, mysql-client-core-5.6
 Description: MySQL Client
@@ -152,11 +152,11 @@ Description: MySQL Testsuite meta package depending on latest version
 Package: mysql-community-test
 Architecture: any
 Depends: mysql-community-server (= ${binary:Version}),
- mysql-community-client (= ${binary:Version}),
- ${shlibs:Depends}, ${misc:Depends}
+ mysql-community-client (= ${binary:Version}), python,
libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
 Conflicts: mysql,
  mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
- mysql-testsuite-5.6, mysql-enterprise-test
+ mysql-testsuite-5.6, mysql-commercial-test
 Description: MySQL Test Run MTR - The MySQL testsuite
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
@@ -169,7 +169,7 @@ Package: mysql-community-bench
 Architecture: any
 Depends: mysql-community-server (= ${binary:Version}),
  ${shlibs:Depends}, ${misc:Depends}
-Conflicts: mysql, mysql-enterprise-bench
+Conflicts: mysql, mysql-commercial-bench
 Description: MySQL Bench
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
index 4785613bd962aa69193fde06b4552f138dfbcef9..5370d9e496a0f510d727643fba22925e77603fb4 100644 (file)
@@ -7,6 +7,13 @@
   #include <abstractions/nameservice>
   #include <abstractions/user-tmp>
 
+# Allow system resource access
+  /sys/devices/system/cpu/ r,
+  capability sys_resource,
+  capability dac_override,
+  capability setuid,
+  capability setgid,
+
 # Allow config access
   /etc/mysql/conf.d/ r,
   /etc/mysql/conf.d/*.cnf r,
@@ -14,7 +21,7 @@
 
 # Allow pid and socket file access
   /run/mysqld/mysqld.pid rw,
-  /run/mysqld/mysqld.sock w,
+  /run/mysqld/mysqld.sock rw,
 
 # Allow read/ write to /tmp
   /tmp/ r,
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..09960eb
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/LICENSE.mysql
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/COPYING.gz
+libmysqlclient-dev: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient-dev: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient18.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient18.lintian-overrides
new file mode 100644 (file)
index 0000000..1f26511
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/LICENSE.mysql
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/COPYING.gz
+libmysqlclient18: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient18: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/libmysqld-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/libmysqld-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..35caaec
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/COPYING.gz
+libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/mysql-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5c4891c
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
+mysql-client: extra-license-file usr/share/doc/mysql-client/COPYING.gz
+mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
index f1cd29cce838dc934c4f8cecefca8c49bee77a9a..2a547a807a9d70aa5c702dae8da970bcd0582b89 100644 (file)
@@ -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
@@ -17,7 +17,6 @@ etc/mysql/my.cnf
 usr/share/aclocal/mysql.m4
 usr/share/mysql/docs/INFO_SRC
 usr/share/mysql/docs/INFO_BIN
-usr/share/mysql/INSTALL-BINARY
 usr/share/mysql/docs/ChangeLog
 # localized error msgs
 usr/share/mysql/*/errmsg.sys
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-common.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/mysql-common.lintian-overrides
new file mode 100644 (file)
index 0000000..70ddcdf
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
+mysql-common: extra-license-file usr/share/doc/mysql-common/COPYING.gz
+mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-bench.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-bench.lintian-overrides
new file mode 100644 (file)
index 0000000..04df14e
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/LICENSE.mysql
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/COPYING.gz
+mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5892935
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-client/LICENSE.mysql
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-clienti/COPYING.gz
+mysql-community-client: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-client: embedded-library
old mode 100644 (file)
new mode 100755 (executable)
index dd0cbc4..cb6c39c
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
@@ -22,7 +22,7 @@ then
 
        set -e
 
-       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-enterprise-server
+       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-commercial-server
        INSTALLED_PKG=none
        MYSQLDATA=/var/lib/mysql
 
@@ -78,14 +78,10 @@ then
                        db_set mysql-community-server/re-root-pass ""
                done
 
-               db_input high mysql-community-server/remove-test-db || true
-               db_go
-
        else
                db_fset mysql-community-server/data-dir seen true
                db_fset mysql-community-server/root-pass seen true
                db_fset mysql-community-server/re-root-pass seen true
-               db_fset mysql-community-server/remove-test-db seen true
        fi
 
        set +e
index e8e3c548070588883451cf887a3b25012c0966d3..a1f5d0535c47d7a25771d3e3cb5006dbf869d9a0 100644 (file)
@@ -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
@@ -66,11 +66,15 @@ usr/share/man/man1/replace.1
 usr/share/man/man1/resolveip.1
 usr/share/man/man1/resolve_stack_dump.1
 usr/share/man/man8/mysqld.8
+# app armor profile
+etc/apparmor.d/usr.sbin.mysqld
 # SQL files
 usr/share/mysql/*.sql
 # plugins
 usr/lib/mysql/plugin/*.so
+usr/lib/mysql/plugin/debug/*.so
 usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/debug/daemon_example.ini
 # support files
 usr/share/mysql/mysqld_multi.server
 usr/share/mysql/magic
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.lintian-overrides
new file mode 100644 (file)
index 0000000..08b3865
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/LICENSE.mysql
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/COPYING.gz
+mysql-community-server: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-server: embedded-library
+# Since we ship debug plugins so this error is overridden
+mysql-community-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
index 61d0a73b53225b8a9eb3029e518ccc35c5b9b6be..475ce0fe70920d72cf4a5f4bd36355ed4dbb980d 100755 (executable)
@@ -14,7 +14,7 @@
 ### END INIT INFO
 #
 
-# 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
@@ -37,18 +37,36 @@ umask 077
 MYSQLDATA=/var/lib/mysql
 VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
 
-get_pcount () {
-       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
-       echo "${PSCOUNT}"
+get_mysql_option() {
+       RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
+       if [ -z "$RESULT" ];
+       then
+               RESULT="$3"
+       fi
+       echo $RESULT
+}
+
+get_running () {
+       PIDFILE=$(get_mysql_option mysqld_safe pid-file "")
+       if [ -z "$PIDFILE" ];
+       then
+               PIDFILE=$(get_mysql_option mysqld pid-file "$MYSQLDATA/$(hostname).pid")
+       fi
+       if [ -e "$PIDFILE" ] && [ -d "/proc/$(cat "$PIDFILE")" ];
+       then
+               echo 1
+       else
+               echo 0
+       fi
 }
 
 server_stop () {
-       PSCOUNT=$(get_pcount)
+       RUNNING=$(get_running)
        COUNT=0
        while :; do
                COUNT=$(( COUNT+1 ))
                echo -n .
-               if [ "${PSCOUNT}" -eq 1 ];
+               if [ "${RUNNING}" -eq 0 ];
                then
                        echo
                        break
@@ -58,7 +76,7 @@ server_stop () {
                        echo
                        return 1
                fi
-               PSCOUNT=$(get_pcount)
+               RUNNING=$(get_running)
                sleep 1
        done
        return 0
@@ -66,27 +84,62 @@ server_stop () {
 
 case "$1" in
   'start')
-       PSCOUNT=$(get_pcount)
-       if [ "${PSCOUNT}" -gt 1 ];
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
        then
                log_action_msg "A MySQL Server is already started"
        else
                MYSQLRUN=/var/run/mysqld
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+               fi
+
+               if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+               then
+                       mysql_install_db --user=mysql > /dev/null
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
                if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
                then
                        mkdir ${MYSQLRUN}
                        chown mysql:mysql ${MYSQLRUN}
                        chmod 755 ${MYSQLRUN}
                fi
-               su - mysql -s /bin/bash -c "mysqld_safe --skip-syslog > /dev/null &"
+
+               /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+               su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
                for i in 1 2 3 4 5 6;
                do
                        sleep 1
                        echo -n .
                done
                echo
-               PSCOUNT=$(get_pcount)
-               if [ "${PSCOUNT}" -gt 1 ];
+               RUNNING=$(get_running)
+               if [ "${RUNNING}" -eq 1 ];
                then
                        log_action_msg "MySQL Community Server ${VERSION} is started"
                else
@@ -96,8 +149,8 @@ case "$1" in
        ;;
 
   'stop')
-       PSCOUNT=$(get_pcount)
-       if [ "${PSCOUNT}" -gt 1 ];
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
        then
                killall -15 mysqld
                server_stop
@@ -120,8 +173,8 @@ case "$1" in
        ;;
 
   'status')
-       PSCOUNT=$(get_pcount)
-       if [ ${PSCOUNT} -gt 1 ];
+       RUNNING=$(get_running)
+       if [ ${RUNNING} -eq 1 ];
        then
                log_action_msg "MySQL Community Server ${VERSION} is running"
        else
old mode 100644 (file)
new mode 100755 (executable)
index e9da0b7..2870337
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
@@ -37,45 +37,36 @@ case "$1" in
                then
                        mkdir ${MYSQLDATA}/mysql
                        chown mysql:mysql ${MYSQLDATA}/mysql
-                       chmod 700 ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
                        if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
                        then
                                mysql_install_db --user=mysql > /dev/null
-                               if [ -f "/usr/my.cnf" ];
-                               then
-                                       rm -f /usr/my.cnf
-                               fi
                        fi
                fi
 
-               db_get mysql-community-server/remove-test-db && RMTESTDB=${RET}
-               if [ -z "${RMTESTDB}" ] || [ "${RMTESTDB}" = "false" ];
-               then
-                       RMTESTDB="DROP DATABASE IF EXISTS test;"
-               else
-                       RMTESTDB=""
-               fi
-
                db_get mysql-community-server/root-pass && PASSWD=${RET}
                if [ ! -z "${PASSWD}" ];
                then
                        db_set mysql-community-server/root-pass ""
                        db_set mysql-community-server/re-root-pass ""
-                       SQL=`mktemp`
-                       if [ -f "${SQL}" ];
-                       then
-                               chmod 700 ${SQL}
-                               cat << EOF > ${SQL}
+                       PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
+               else
+                       PASSWD=""
+               fi
+
+               SQL=`mktemp`
+               if [ -f "${SQL}" ];
+               then
+                       chmod 700 ${SQL}
+                       cat << EOF > ${SQL}
 USE mysql;
-UPDATE user SET password=PASSWORD("${PASSWD}") WHERE user='root';
+${PASSWD}
 DELETE FROM user WHERE user='';
-${RMTESTDB}
 FLUSH PRIVILEGES;
 EOF
-                               mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
-                               PASSWD=""
-                               rm -f ${SQL}
-                       fi
+                       mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
+                       PASSWD=""
+                       rm -f ${SQL}
                fi
 
                set +e
old mode 100644 (file)
new mode 100755 (executable)
index f16ea32..c75743f
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
old mode 100644 (file)
new mode 100755 (executable)
index cfbfaa6..f1838b0
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
@@ -67,14 +67,14 @@ case "$1" in
 
                if ! getent passwd mysql >/dev/null;
                then
-                       adduser --ingroup mysql --system --disabled-login --no-create-home --home /nowhere --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
+                       adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
                fi
 
                if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
                then
                        mkdir ${MYSQLDATA}
                        chown mysql:mysql ${MYSQLDATA}
-                       chmod 700 ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
                fi
 
                if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
old mode 100644 (file)
new mode 100755 (executable)
index 40c5c55..7509de7
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
index 37468eb8494b1b276b94469932d70417f435e0c9..7b7e0ac33cdcef822ea82f7dc20df6aea8a564e8 100644 (file)
@@ -14,14 +14,6 @@ Type: error
 Description: The two passwords did not match
  Please try again. Make sure you type the exact same password twice.
 
-Template: mysql-community-server/remove-test-db
-Type: boolean
-Default: false
-Description: Do you wish to install/ keep test database ?
- The test database is created as part of a fresh installation which may be used for initial development and test environment.
- .
- It is highly recommended that you do not install the test database in a production environment.
-
 Template: mysql-community-server/remove-data-dir
 Type: boolean
 Default: false
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-source.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-source.lintian-overrides
new file mode 100644 (file)
index 0000000..9ca84e9
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/LICENSE.mysql
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/COPYING.gz
+mysql-community-source: copyright-should-refer-to-common-license-file-for-lgpl
index 4e6ba01a17da8543050414545bc99cdf17ac6a5f..f93ca25bd85b8318ab96be6c100b8789a3e4665e 100644 (file)
@@ -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
@@ -13,5 +13,4 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-usr/lib/mysql
-usr/lib/mysql/mysql-test
+usr/lib/mysql-test
index b685e83d5ed30c7217f2fea624d3cecb57dfcacf..d5f820dd6fc46868eadaa54cc219aef1f6e11f2f 100644 (file)
@@ -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
@@ -13,7 +13,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-usr/lib/mysql/mysql-test/*
+usr/lib/mysql-test/*
 usr/share/man/man1/mysql-test-run.pl.1
 # legal
 usr/share/doc/mysql-community-test/COPYING
index 585eaf60e96aa5481693ca4522595dc888f4e47f..aedf2db3b736e37e574af49341af1c97b07c0c4f 100644 (file)
@@ -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
@@ -13,5 +13,5 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-usr/lib/mysql/mysql-test/mysql-test-run.pl usr/lib/mysql/mysql-test/mysql-test-run
-usr/lib/mysql/mysql-test/mysql-test-run.pl usr/lib/mysql/mysql-test/mtr
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mysql-test-run
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mtr
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.lintian-overrides
new file mode 100644 (file)
index 0000000..ff273bb
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/LICENSE.mysql
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/COPYING.gz
+mysql-community-test: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/mysql-server.lintian-overrides
new file mode 100644 (file)
index 0000000..4877097
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-server: extra-license-file usr/share/doc/mysql-server/LICENSE.mysql
+mysql-server: extra-license-file usr/share/doc/mysql-server/COPYING.gz
+mysql-server: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-testsuite.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-precise/mysql-testsuite.lintian-overrides
new file mode 100644 (file)
index 0000000..37488fe
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/LICENSE.mysql
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/COPYING.gz
+mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-precise/patches/fix-mtr-search-paths.patch b/mysql-wsrep-5.6/packaging/deb-precise/patches/fix-mtr-search-paths.patch
new file mode 100644 (file)
index 0000000..8a27a09
--- /dev/null
@@ -0,0 +1,13 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Adding extra search path for testsuite.
+
+--- a/mysql-test/lib/mtr_cases.pm      2014-02-24 13:14:37 +0530
++++ b/mysql-test/lib/mtr_cases.pm      2014-07-02 11:46:24 +0530
+@@ -288,6 +288,7 @@
+     {
+       $suitedir= my_find_dir($::basedir,
+                            ["share/mysql-test/suite",
++                            "lib/mysql-test/suite",
+                             "mysql-test/suite",
+                             "internal/mysql-test/suite",
+                             "mysql-test",
index 6f036688a9256bd2b9630ab030182875511dd026..41311b2c8f9e2679cc27df30b581ed0f3ad10d08 100644 (file)
@@ -1,21 +1,12 @@
 From: Terje Røsten <terje.rosten@oracle.com>
-Description: Updates script to use existing my.cnf and not delete it if created from template
+Description: Maintains the pending --skip-my-cnf option in mainline
 Bug: <TODO>
 
 diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
 index 440a977..7d068fc 100644
 --- a/scripts/mysql_install_db.pl.in
 +++ b/scripts/mysql_install_db.pl.in
-@@ -75,6 +97,8 @@ Usage: $0 [OPTIONS]
-   --help               Display this help and exit.
-   --ldata=path         The path to the MySQL data directory. Same as --datadir.
-   --no-defaults        Don't read default options from any option file.
-+  --keep-my-cnf        Don't try to create my.cnf based on template.
-+                       Useful for systems with working, updated my.cnf.
- EOF1
-   if ( $^O !~ m/^(MSWin32|cygwin)$/ ) {
-     print <<EOF2;
-@@ -86,6 +110,7 @@ EOF2
+@@ -113,6 +113,7 @@ EOF2
    print <<EOF3;
    --rpm                For internal use.  This option is used by RPM files
                         during the MySQL installation process.
@@ -23,116 +14,16 @@ index 440a977..7d068fc 100644
    --skip-name-resolve  Use IP addresses rather than hostnames when creating
                         grant table entries.  This option can be useful if
                         your DNS does not work.
-@@ -149,6 +174,7 @@ sub parse_arguments
-              "skip-name-resolve",
-              "verbose",
-+             "keep-my-cnf",
-              "rpm",
-              "help",
-              "random-passwords",
-@@ -356,13 +382,19 @@ sub tell_root_password {
- ##############################################################################
-
- sub generate_random_password {
--  # On (at least) Linux and Solaris, a "random" device is available, use it:
--  # cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1
--  # Without LC_ALL, "tr" may not know the "alnum" character class -
--  # and there are user profiles which do not have this set.
--  #
--  my $password = `cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1`;
--  chomp ($password);
-+  # On Linux, Solaris, Max OS X and FreeBSD we have a random device available.
-+  my $randfile = "/dev/urandom";
-+  open(FD, $randfile) || die "Can't open $randfile for reading: $!";
-+  my $password = "";
-+  my $pass_len = 16;
-+  my $c;
-+  while (length($password) < $pass_len) {
-+    $c = getc(FD);
-+    if ($c =~ /\w/) {
-+      $password .= $c;
-+    }
-+  }
-+  close(FD);
-   return $password;
- }
-
-@@ -399,11 +431,16 @@ $basedir= "@prefix@" if ! $basedir;              # Default
- # ----------------------------------------------------------------------
-
- my $print_defaults;
-+my $keep_my_cnf = 0;
-
- if ( $opt->{srcdir} and $opt->{basedir} )
+@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} )
  {
    error($opt,"Specify either --basedir or --srcdir, not both");
  }
+-if ( $opt->{'keep-my-cnf'} )
 +if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
-+{
-+  $keep_my_cnf = 1;
-+}
- if ( $opt->{srcdir} )
  {
-   $opt->{builddir} = $opt->{srcdir} unless $opt->{builddir};
-@@ -425,7 +462,7 @@ my $config_file;
- my $copy_cfg_file;
-
- # ----------------------------------------------------------------------
--# This will be the default config file
-+# This will be the default config file (unless creation is unwanted)
- # ----------------------------------------------------------------------
-
- my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf";
-@@ -434,6 +471,11 @@ $config_file= "$basedir/my.$cnfext";
-
- my $cfg_template= find_in_basedir($opt,"file","my-default.$cnfext",
-                                 ".", "share","share/mysql","support-files");
-+# Distros might move files
-+if ((! -r $cfg_template) && (-r "@pkgdatadir@/my-default.cnf")) {
-+  $cfg_template = "@pkgdatadir@/my-default.cnf";
-+}
-+
- -e $cfg_template or cannot_find_file("my-default.$cnfext");
-
- $copy_cfg_file= $config_file;
-@@ -443,22 +485,21 @@ if (-e $copy_cfg_file)
-   $copy_cfg_file =~ s/my.$cnfext/my-new.$cnfext/;
-   # Too early to print warning here, the user may not notice
+   $keep_my_cnf = 1;
  }
--open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
--if (open (CFG, "> $copy_cfg_file"))
--{
--  while (<TEMPL>)
--  {
--    # Remove lines beginning with # *** which are template comments
--    print CFG $_ unless /^# \*\*\*/;
-+
-+if ( ! $keep_my_cnf ) {
-+  open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
-+  if (open (CFG, "> $copy_cfg_file")) {
-+    while (<TEMPL>) {
-+      # Remove lines beginning with # *** which are template comments
-+      print CFG $_ unless /^# \*\*\*/;
-+    }
-+    close CFG;
-+  } else {
-+    warning($opt,"Could not write to config file $copy_cfg_file: $!");
-+    $failed_write_cfg= 1;
-   }
--  close CFG;
-+  close TEMPL;
- }
--else
--{
--  warning($opt,"Could not write to config file $copy_cfg_file: $!");
--  $failed_write_cfg= 1;
--}
--close TEMPL;
-
- # ----------------------------------------------------------------------
- # Now we can get arguments from the groups [mysqld] and [mysql_install_db]
-@@ -621,7 +662,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
+@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
  }
 
  # ----------------------------------------------------------------------
@@ -141,7 +32,7 @@ index 440a977..7d068fc 100644
  # ----------------------------------------------------------------------
 
  # FIXME The shell variant uses "mkdir -p":
-@@ -654,7 +695,7 @@ if ($opt_user)
+@@ -697,7 +698,7 @@ if ($opt_user)
    }
  }
 
@@ -150,18 +41,3 @@ index 440a977..7d068fc 100644
  {
    mkdir($dir, 0700) unless -d $dir;
    if ($opt_user and -w "/")
-@@ -848,7 +889,13 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") )
-            "",
-            "Support MySQL by buying support/licenses at http://shop.mysql.com");
--    if ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-+    if ($keep_my_cnf)
-+    {
-+      report($opt,
-+           "Note: new default config file not created.",
-+           "Please make sure your config file is current");
-+    }
-+    elsif ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-     {
-       report($opt,
-               "New default config file was created as $config_file and",
index 82859623b1a9f05c2ea0083d1195b3eb90dfa721..31af2dc779ba00b5c2c2ce4b5890e1ebd23f6526 100644 (file)
@@ -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
@@ -14,4 +14,5 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 #fix-man-page-links.patch
-#fix-mysql_install_db.patch
+fix-mysql_install_db.patch
+fix-mtr-search-paths.patch
index bdd08b1c3cd75d29273259721c254a1d165e7107..8e4ab9490aeab5c6469085527ad262bd24562844 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/make -f
 
-# 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
@@ -34,7 +34,7 @@ override_dh_auto_configure:
                -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
                -DINSTALL_MANDIR=share/man \
                -DINSTALL_MYSQLSHAREDIR=share/mysql \
-               -DINSTALL_MYSQLTESTDIR=lib/mysql/mysql-test \
+               -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
                -DINSTALL_PLUGINDIR=lib/mysql/plugin \
                -DINSTALL_SBINDIR=sbin \
                -DINSTALL_SCRIPTDIR=bin \
@@ -45,12 +45,7 @@ override_dh_auto_configure:
                -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
                -DWITH_SSL=bundled \
                -DWITH_ZLIB=system \
-               -DWITH_EXTRA_CHARSETS=complex \
-               -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-               -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-               -DWITH_EXAMPLE_STORAGE_ENGINE=1 \
-               -DWITH_FEDERATED_STORAGE_ENGINE=1 \
-               -DWITH_INNOBASE_STORAGE_ENGINE=1 \
+               -DWITH_EXTRA_CHARSETS=all \
                -DWITH_INNODB_MEMCACHED=1 \
                -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
                -DINSTALL_LAYOUT=DEB
@@ -60,7 +55,7 @@ override_dh_auto_configure:
 
 override_dh_auto_build:
        @echo "RULES.$@"
-       $(MAKE) -j1 VERBOSE=1
+       $(MAKE) -j8 VERBOSE=1
        touch $@
 
 override_dh_auto_test:
@@ -73,117 +68,68 @@ override_dh_auto_install:
        @echo "RULES.$@"
        # complete install first
        $(MAKE) install DESTDIR=debian/tmp
-       # http://bugs.mysql.com/bug.php?id=68517 --- Some test and result files have executable bit set.
-       # remove execute bit from file permissions discussed in Bug#68517 and other files
-       chmod 0644 debian/tmp/usr/bin/mysqlaccess.conf
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb-wl5980-linux.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/r/lowercase_table4.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/shutdown_mysqld.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/have_QC_Disabled.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_3.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb_bug60196.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb_bug14169459.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb-wl5980-windows.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/r/named_pipe.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/t/lowercase_table4-master.opt
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb-wl5980-debug.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/r/shm.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/ndb/t/ndb_show_tables_result.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug57904.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/check_ipv4_mapped.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/start_mysqld.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_11.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/t/lowercase_table4.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb_bug57904.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/portability_wl5980_windows.zip
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug60196.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-debug.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-windows.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-linux.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug14169459.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_10.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_14.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-discard.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_6.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug60196-master.opt
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/portability_wl5980_linux.zip
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/memcache_config.inc
-       chmod 0644 debian/tmp/usr/share/mysql/innodb_memcached_config.sql
-       chmod 0644 debian/tmp/usr/share/mysql/mysql-log-rotate
-       chmod 0644 debian/tmp/usr/lib/mysql/sql-bench/graph-compare-results
        # remove all redundant files and links
        rm debian/tmp/usr/lib/*/*_r*
-       rm debian/tmp/usr/lib/mysql/mysql-test/cmake_install.cmake
-       rm debian/tmp/usr/lib/mysql/mysql-test/CTestTestfile.cmake
-       rm debian/tmp/usr/lib/mysql/mysql-test/Makefile
+       rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
+       rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
+       rm debian/tmp/usr/lib/mysql-test/Makefile
        # add missing man pages
-       install -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+       install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
        # add MySQL Server configuration file my.cnf to mysql-common package
-       mkdir -p debian/tmp/etc/mysql
-       install -o root -m 0644 debian/extra/my.cnf debian/tmp/etc/mysql
+       install -g root -o root -m 0644 -D debian/extra/my.cnf debian/tmp/etc/mysql/my.cnf
        # add MySQL Server debug binary and library to package
-       install -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
-       install -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+       install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       # add debug plugin libraries to package
+       install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
+       for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
+       install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+       install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
        # add apparmor profile
-       install -D -m 644 debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld
+       install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld
        # add directory for legal docs
-       mkdir -p debian/tmp/usr/share/doc/mysql-server
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-server
-       mkdir -p debian/tmp/usr/share/doc/mysql-client
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-client
-       mkdir -p debian/tmp/usr/share/doc/mysql-common
-       mkdir -p debian/tmp/usr/share/doc/libmysqlclient18
-       mkdir -p debian/tmp/usr/share/doc/libmysqlclient-dev
-       mkdir -p debian/tmp/usr/share/doc/libmysqld-dev
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-bench
-       mkdir -p debian/tmp/usr/share/doc/mysql-testsuite
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-test
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-source
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-bench
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-test
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-source
        # add COPYING file to each package
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
        # add README file to each package
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
        touch $@
 
 override_dh_installinit:
        @echo "RULES.$@"
-       dh_installinit --name=mysql -- defaults 19 21
        dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld
+       dh_installinit --name=mysql -- defaults 19 21
        touch $@
index ba9d2b4e84866a479f242a0014b3e5fbd57b65dd..caac1e13dad85aa1bb45586e8412ee37fbd02a7a 100644 (file)
@@ -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
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-# obscured filename for mysqld-debug and libmysqld-debug.a
+# obscured filename for mysqld-debug, libmysqld-debug.a and debug plugins
 debian/extra/server-binary
 debian/extra/embedded-server
+debian/extra/adt_null-plugin
+debian/extra/auth-plugin
+debian/extra/auth_socket-plugin
+debian/extra/auth_test_plugin-plugin
+debian/extra/innodb_engine-plugin
+debian/extra/libdaemon_example-plugin
+debian/extra/libmemcached-plugin
+debian/extra/mypluglib-plugin
+debian/extra/mysql_no_login-plugin
+debian/extra/qa_auth_client-plugin
+debian/extra/qa_auth_interface-plugin
+debian/extra/qa_auth_server-plugin
+debian/extra/semisync_master-plugin
+debian/extra/semisync_slave-plugin
+debian/extra/validate_password-plugin
index 384162138454f3f9e4fc5bff71f0ae5b06869533..16f83c935df3fe9db4bb2ab9dda4d97edaf192fb 100644 (file)
@@ -1,3 +1,59 @@
+mysql-community (5.6.25-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * mysql-community-server now depends on perl, psmisc
+    mysql-community-test now depends on python, libmysqlclient-dev
+    (Closes: #20561621)
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 25 Feb 2014 22:52:19 +0530
+
+mysql-community (5.6.24-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 16 Feb 2014 15:45:09 +0530
+
+mysql-community (5.6.23-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * dh_apparmor to now run before dh_installinit in d/rules
+  * mysql-community-server now recommends mysql-client
+  * mysql-community-server now depends on apparmor
+  * removed template install-test-db; not installed by default
+  * d/compat incremented to 9 from 8
+  * d/control updated to build depend on debhelper 9
+  * added d/*.lintian-overrides and d/source/lintian-overrides
+  * d/rules updated to reflect correct file permissions
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 31 Dec 2014 10:51:07 +0530
+
+mysql-community (5.6.22-2ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * mysql-common now replaces mysql-server-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 28 Nov 2014 15:18:07 +0530
+
+mysql-community (5.6.22-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * fixed d/*server.postinst to allow dropping test db without
+    setting root password
+  * init script will now run my_i_db if data dir is not present or empty
+  * updated init script to read app armor profile on startup
+  * added more system resources to app armor profile
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 24 Sep 2014 14:48:07 +0530
+
+mysql-community (5.6.21-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * updated d/rules to increment -j8 as make option
+  * updated d/source/include-binaries to add mysql_no_login plugin
+  * updated CMake option WITH_EXTRA_CHARSETS from complex to all
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 20 Aug 2014 19:12:30 +0530
+
 mysql-community (5.6.20-1ubuntu14.04) trusty; urgency=low
 
   * new upstream release
@@ -5,8 +61,20 @@ mysql-community (5.6.20-1ubuntu14.04) trusty; urgency=low
   * added d/*.dirs for bench, dev and test pkg
   * updated d/rules to make compilation verbose
   * removed default CFLAGS, CXXFLAGS in d/rules
+  * added patch for testsuite search paths under d/patches
+  * modified cmake option for testsuite in d/rules
+  * updated patch d/fix-mysql_install_db.patch
+  * enabled two patches in d/patches/series
+  * removed extra permissions check in d/rules when fixed in source
+  * modified d/mysql-*-server.postinst to stop removing /usr/my.cnf
+  * modified d/*-test.* for updated location of testsuite
+  * updated d/{mysql-*-server.install,rules} to include debug plugins
+  * updated d/rules to remove storage engine cmake options
+  * modified data dir permission in d/*server.{pre,post}inst
+  * updated d/source/include-binaries to add debug plugins
+  * updated d/rules to rename debug plugins
 
- -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 26 Jun 2014 16:13:30 +0530
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 02 Jul 2014 17:45:30 +0530
 
 mysql-community (5.6.19-1ubuntu14.04) trusty; urgency=low
 
index 45a4fb75db864000d01701c0f7a51864bd4daabf..ec635144f60048986bc560c5576355344005e6e7 100644 (file)
@@ -1 +1 @@
-8
+9
index f79a55922e8cddacd65601b9a207d95e2730eb72..c40f032d866ec19a29894532400b6ccfb9f26a1c 100644 (file)
@@ -4,7 +4,7 @@ Section: database
 Priority: optional
 Standards-Version: 3.9.5
 Homepage: http://www.mysql.com/
-Build-Depends: debhelper (>= 8.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-apparmor, lsb-release, cmake, fakeroot
+Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-apparmor, lsb-release, cmake, fakeroot, libnuma-dev
 
 Package: mysql-server
 Architecture: any
@@ -20,21 +20,21 @@ Description: MySQL Server meta package depending on latest version
 Package: mysql-community-server
 Architecture: any
 Pre-depends: debconf (>= 0.2.17), adduser
-Depends: mysql-common (= ${binary:Version}),
+Depends: mysql-common (= ${binary:Version}), apparmor, perl, psmisc,
  ${shlibs:Depends}, ${misc:Depends}
-Recommends: mysql-community-client (= ${binary:Version})
+Recommends: mysql-client (= ${binary:Version})
 Conflicts: mysql,
  mysql-server-5.0, mysql-server-core-5.0,
  mysql-server-5.1, mysql-server-core-5.1,
  mysql-server-5.5, mysql-server-core-5.5,
  mysql-server-5.6, mysql-server-core-5.6,
- mysql-enterprise-server
+ mysql-commercial-server
 Replaces: mysql,
  mysql-server-5.0, mysql-server-core-5.0,
  mysql-server-5.1, mysql-server-core-5.1,
  mysql-server-5.5, mysql-server-core-5.5,
  mysql-server-5.6, mysql-server-core-5.6,
- mysql-enterprise-server
+ mysql-commercial-server
 Provides: virtual-mysql-server, virtual-mysql-server-core,
  mysql-server-5.6, mysql-server-core-5.6
 Description: MySQL Server
@@ -65,13 +65,13 @@ Conflicts: mysql,
  mysql-client-5.1, mysql-client-core-5.1,
  mysql-client-5.5, mysql-client-core-5.5,
  mysql-client-5.6, mysql-client-core-5.6,
- mysql-enterprise-client
+ mysql-commercial-client
 Replaces: mysql,
  mysql-client-5.0, mysql-client-core-5.0,
  mysql-client-5.1, mysql-client-core-5.1,
  mysql-client-5.5, mysql-client-core-5.5,
  mysql-client-5.6, mysql-client-core-5.6,
- mysql-enterprise-client
+ mysql-commercial-client
 Provides: virtual-mysql-client, virtual-mysql-client-core,
  mysql-client-5.6, mysql-client-core-5.6
 Description: MySQL Client
@@ -103,7 +103,8 @@ Pre-depends: debconf (>= 0.2.17), ${misc:Pre-Depends}
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Conflicts: mysql
-Replaces: mysql, mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev
+Replaces: mysql, mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev,
+ mysql-server-5.6, mysql-server-core-5.6
 Provides: mysql-common
 Description: MySQL Common
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
@@ -152,11 +153,11 @@ Description: MySQL Testsuite meta package depending on latest version
 Package: mysql-community-test
 Architecture: any
 Depends: mysql-community-server (= ${binary:Version}),
- mysql-community-client (= ${binary:Version}),
- ${shlibs:Depends}, ${misc:Depends}
+ mysql-community-client (= ${binary:Version}), python,
libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
 Conflicts: mysql,
  mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
- mysql-testsuite-5.6, mysql-enterprise-test
+ mysql-testsuite-5.6, mysql-commercial-test
 Description: MySQL Test Run MTR - The MySQL testsuite
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
@@ -169,7 +170,7 @@ Package: mysql-community-bench
 Architecture: any
 Depends: mysql-community-server (= ${binary:Version}),
  ${shlibs:Depends}, ${misc:Depends}
-Conflicts: mysql, mysql-enterprise-bench
+Conflicts: mysql, mysql-commercial-bench
 Description: MySQL Bench
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
index 4785613bd962aa69193fde06b4552f138dfbcef9..5370d9e496a0f510d727643fba22925e77603fb4 100644 (file)
@@ -7,6 +7,13 @@
   #include <abstractions/nameservice>
   #include <abstractions/user-tmp>
 
+# Allow system resource access
+  /sys/devices/system/cpu/ r,
+  capability sys_resource,
+  capability dac_override,
+  capability setuid,
+  capability setgid,
+
 # Allow config access
   /etc/mysql/conf.d/ r,
   /etc/mysql/conf.d/*.cnf r,
@@ -14,7 +21,7 @@
 
 # Allow pid and socket file access
   /run/mysqld/mysqld.pid rw,
-  /run/mysqld/mysqld.sock w,
+  /run/mysqld/mysqld.sock rw,
 
 # Allow read/ write to /tmp
   /tmp/ r,
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..09960eb
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/LICENSE.mysql
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/COPYING.gz
+libmysqlclient-dev: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient-dev: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient18.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient18.lintian-overrides
new file mode 100644 (file)
index 0000000..1f26511
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/LICENSE.mysql
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/COPYING.gz
+libmysqlclient18: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient18: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/libmysqld-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/libmysqld-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..35caaec
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/COPYING.gz
+libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5c4891c
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
+mysql-client: extra-license-file usr/share/doc/mysql-client/COPYING.gz
+mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
index f1cd29cce838dc934c4f8cecefca8c49bee77a9a..2a547a807a9d70aa5c702dae8da970bcd0582b89 100644 (file)
@@ -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
@@ -17,7 +17,6 @@ etc/mysql/my.cnf
 usr/share/aclocal/mysql.m4
 usr/share/mysql/docs/INFO_SRC
 usr/share/mysql/docs/INFO_BIN
-usr/share/mysql/INSTALL-BINARY
 usr/share/mysql/docs/ChangeLog
 # localized error msgs
 usr/share/mysql/*/errmsg.sys
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.lintian-overrides
new file mode 100644 (file)
index 0000000..70ddcdf
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
+mysql-common: extra-license-file usr/share/doc/mysql-common/COPYING.gz
+mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-bench.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-bench.lintian-overrides
new file mode 100644 (file)
index 0000000..04df14e
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/LICENSE.mysql
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/COPYING.gz
+mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5892935
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-client/LICENSE.mysql
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-clienti/COPYING.gz
+mysql-community-client: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-client: embedded-library
old mode 100644 (file)
new mode 100755 (executable)
index dd0cbc4..cb6c39c
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
@@ -22,7 +22,7 @@ then
 
        set -e
 
-       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-enterprise-server
+       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-commercial-server
        INSTALLED_PKG=none
        MYSQLDATA=/var/lib/mysql
 
@@ -78,14 +78,10 @@ then
                        db_set mysql-community-server/re-root-pass ""
                done
 
-               db_input high mysql-community-server/remove-test-db || true
-               db_go
-
        else
                db_fset mysql-community-server/data-dir seen true
                db_fset mysql-community-server/root-pass seen true
                db_fset mysql-community-server/re-root-pass seen true
-               db_fset mysql-community-server/remove-test-db seen true
        fi
 
        set +e
index e8e3c548070588883451cf887a3b25012c0966d3..a1f5d0535c47d7a25771d3e3cb5006dbf869d9a0 100644 (file)
@@ -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
@@ -66,11 +66,15 @@ usr/share/man/man1/replace.1
 usr/share/man/man1/resolveip.1
 usr/share/man/man1/resolve_stack_dump.1
 usr/share/man/man8/mysqld.8
+# app armor profile
+etc/apparmor.d/usr.sbin.mysqld
 # SQL files
 usr/share/mysql/*.sql
 # plugins
 usr/lib/mysql/plugin/*.so
+usr/lib/mysql/plugin/debug/*.so
 usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/debug/daemon_example.ini
 # support files
 usr/share/mysql/mysqld_multi.server
 usr/share/mysql/magic
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.lintian-overrides
new file mode 100644 (file)
index 0000000..08b3865
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/LICENSE.mysql
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/COPYING.gz
+mysql-community-server: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-server: embedded-library
+# Since we ship debug plugins so this error is overridden
+mysql-community-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
index 61d0a73b53225b8a9eb3029e518ccc35c5b9b6be..475ce0fe70920d72cf4a5f4bd36355ed4dbb980d 100755 (executable)
@@ -14,7 +14,7 @@
 ### END INIT INFO
 #
 
-# 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
@@ -37,18 +37,36 @@ umask 077
 MYSQLDATA=/var/lib/mysql
 VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
 
-get_pcount () {
-       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
-       echo "${PSCOUNT}"
+get_mysql_option() {
+       RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
+       if [ -z "$RESULT" ];
+       then
+               RESULT="$3"
+       fi
+       echo $RESULT
+}
+
+get_running () {
+       PIDFILE=$(get_mysql_option mysqld_safe pid-file "")
+       if [ -z "$PIDFILE" ];
+       then
+               PIDFILE=$(get_mysql_option mysqld pid-file "$MYSQLDATA/$(hostname).pid")
+       fi
+       if [ -e "$PIDFILE" ] && [ -d "/proc/$(cat "$PIDFILE")" ];
+       then
+               echo 1
+       else
+               echo 0
+       fi
 }
 
 server_stop () {
-       PSCOUNT=$(get_pcount)
+       RUNNING=$(get_running)
        COUNT=0
        while :; do
                COUNT=$(( COUNT+1 ))
                echo -n .
-               if [ "${PSCOUNT}" -eq 1 ];
+               if [ "${RUNNING}" -eq 0 ];
                then
                        echo
                        break
@@ -58,7 +76,7 @@ server_stop () {
                        echo
                        return 1
                fi
-               PSCOUNT=$(get_pcount)
+               RUNNING=$(get_running)
                sleep 1
        done
        return 0
@@ -66,27 +84,62 @@ server_stop () {
 
 case "$1" in
   'start')
-       PSCOUNT=$(get_pcount)
-       if [ "${PSCOUNT}" -gt 1 ];
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
        then
                log_action_msg "A MySQL Server is already started"
        else
                MYSQLRUN=/var/run/mysqld
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+               fi
+
+               if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+               then
+                       mysql_install_db --user=mysql > /dev/null
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
                if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
                then
                        mkdir ${MYSQLRUN}
                        chown mysql:mysql ${MYSQLRUN}
                        chmod 755 ${MYSQLRUN}
                fi
-               su - mysql -s /bin/bash -c "mysqld_safe --skip-syslog > /dev/null &"
+
+               /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+               su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
                for i in 1 2 3 4 5 6;
                do
                        sleep 1
                        echo -n .
                done
                echo
-               PSCOUNT=$(get_pcount)
-               if [ "${PSCOUNT}" -gt 1 ];
+               RUNNING=$(get_running)
+               if [ "${RUNNING}" -eq 1 ];
                then
                        log_action_msg "MySQL Community Server ${VERSION} is started"
                else
@@ -96,8 +149,8 @@ case "$1" in
        ;;
 
   'stop')
-       PSCOUNT=$(get_pcount)
-       if [ "${PSCOUNT}" -gt 1 ];
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
        then
                killall -15 mysqld
                server_stop
@@ -120,8 +173,8 @@ case "$1" in
        ;;
 
   'status')
-       PSCOUNT=$(get_pcount)
-       if [ ${PSCOUNT} -gt 1 ];
+       RUNNING=$(get_running)
+       if [ ${RUNNING} -eq 1 ];
        then
                log_action_msg "MySQL Community Server ${VERSION} is running"
        else
old mode 100644 (file)
new mode 100755 (executable)
index e9da0b7..2870337
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
@@ -37,45 +37,36 @@ case "$1" in
                then
                        mkdir ${MYSQLDATA}/mysql
                        chown mysql:mysql ${MYSQLDATA}/mysql
-                       chmod 700 ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
                        if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
                        then
                                mysql_install_db --user=mysql > /dev/null
-                               if [ -f "/usr/my.cnf" ];
-                               then
-                                       rm -f /usr/my.cnf
-                               fi
                        fi
                fi
 
-               db_get mysql-community-server/remove-test-db && RMTESTDB=${RET}
-               if [ -z "${RMTESTDB}" ] || [ "${RMTESTDB}" = "false" ];
-               then
-                       RMTESTDB="DROP DATABASE IF EXISTS test;"
-               else
-                       RMTESTDB=""
-               fi
-
                db_get mysql-community-server/root-pass && PASSWD=${RET}
                if [ ! -z "${PASSWD}" ];
                then
                        db_set mysql-community-server/root-pass ""
                        db_set mysql-community-server/re-root-pass ""
-                       SQL=`mktemp`
-                       if [ -f "${SQL}" ];
-                       then
-                               chmod 700 ${SQL}
-                               cat << EOF > ${SQL}
+                       PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
+               else
+                       PASSWD=""
+               fi
+
+               SQL=`mktemp`
+               if [ -f "${SQL}" ];
+               then
+                       chmod 700 ${SQL}
+                       cat << EOF > ${SQL}
 USE mysql;
-UPDATE user SET password=PASSWORD("${PASSWD}") WHERE user='root';
+${PASSWD}
 DELETE FROM user WHERE user='';
-${RMTESTDB}
 FLUSH PRIVILEGES;
 EOF
-                               mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
-                               PASSWD=""
-                               rm -f ${SQL}
-                       fi
+                       mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
+                       PASSWD=""
+                       rm -f ${SQL}
                fi
 
                set +e
old mode 100644 (file)
new mode 100755 (executable)
index f16ea32..c75743f
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
old mode 100644 (file)
new mode 100755 (executable)
index cfbfaa6..f1838b0
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
@@ -67,14 +67,14 @@ case "$1" in
 
                if ! getent passwd mysql >/dev/null;
                then
-                       adduser --ingroup mysql --system --disabled-login --no-create-home --home /nowhere --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
+                       adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
                fi
 
                if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
                then
                        mkdir ${MYSQLDATA}
                        chown mysql:mysql ${MYSQLDATA}
-                       chmod 700 ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
                fi
 
                if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
old mode 100644 (file)
new mode 100755 (executable)
index 40c5c55..7509de7
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
index 37468eb8494b1b276b94469932d70417f435e0c9..7b7e0ac33cdcef822ea82f7dc20df6aea8a564e8 100644 (file)
@@ -14,14 +14,6 @@ Type: error
 Description: The two passwords did not match
  Please try again. Make sure you type the exact same password twice.
 
-Template: mysql-community-server/remove-test-db
-Type: boolean
-Default: false
-Description: Do you wish to install/ keep test database ?
- The test database is created as part of a fresh installation which may be used for initial development and test environment.
- .
- It is highly recommended that you do not install the test database in a production environment.
-
 Template: mysql-community-server/remove-data-dir
 Type: boolean
 Default: false
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-source.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-source.lintian-overrides
new file mode 100644 (file)
index 0000000..9ca84e9
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/LICENSE.mysql
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/COPYING.gz
+mysql-community-source: copyright-should-refer-to-common-license-file-for-lgpl
index b685e83d5ed30c7217f2fea624d3cecb57dfcacf..d5f820dd6fc46868eadaa54cc219aef1f6e11f2f 100644 (file)
@@ -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
@@ -13,7 +13,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-usr/lib/mysql/mysql-test/*
+usr/lib/mysql-test/*
 usr/share/man/man1/mysql-test-run.pl.1
 # legal
 usr/share/doc/mysql-community-test/COPYING
index 585eaf60e96aa5481693ca4522595dc888f4e47f..aedf2db3b736e37e574af49341af1c97b07c0c4f 100644 (file)
@@ -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
@@ -13,5 +13,5 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-usr/lib/mysql/mysql-test/mysql-test-run.pl usr/lib/mysql/mysql-test/mysql-test-run
-usr/lib/mysql/mysql-test/mysql-test-run.pl usr/lib/mysql/mysql-test/mtr
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mysql-test-run
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mtr
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.lintian-overrides
new file mode 100644 (file)
index 0000000..ff273bb
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/LICENSE.mysql
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/COPYING.gz
+mysql-community-test: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-server.lintian-overrides
new file mode 100644 (file)
index 0000000..4877097
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-server: extra-license-file usr/share/doc/mysql-server/LICENSE.mysql
+mysql-server: extra-license-file usr/share/doc/mysql-server/COPYING.gz
+mysql-server: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-testsuite.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-testsuite.lintian-overrides
new file mode 100644 (file)
index 0000000..37488fe
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/LICENSE.mysql
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/COPYING.gz
+mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-mtr-search-paths.patch b/mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-mtr-search-paths.patch
new file mode 100644 (file)
index 0000000..8a27a09
--- /dev/null
@@ -0,0 +1,13 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Adding extra search path for testsuite.
+
+--- a/mysql-test/lib/mtr_cases.pm      2014-02-24 13:14:37 +0530
++++ b/mysql-test/lib/mtr_cases.pm      2014-07-02 11:46:24 +0530
+@@ -288,6 +288,7 @@
+     {
+       $suitedir= my_find_dir($::basedir,
+                            ["share/mysql-test/suite",
++                            "lib/mysql-test/suite",
+                             "mysql-test/suite",
+                             "internal/mysql-test/suite",
+                             "mysql-test",
index 6f036688a9256bd2b9630ab030182875511dd026..41311b2c8f9e2679cc27df30b581ed0f3ad10d08 100644 (file)
@@ -1,21 +1,12 @@
 From: Terje Røsten <terje.rosten@oracle.com>
-Description: Updates script to use existing my.cnf and not delete it if created from template
+Description: Maintains the pending --skip-my-cnf option in mainline
 Bug: <TODO>
 
 diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
 index 440a977..7d068fc 100644
 --- a/scripts/mysql_install_db.pl.in
 +++ b/scripts/mysql_install_db.pl.in
-@@ -75,6 +97,8 @@ Usage: $0 [OPTIONS]
-   --help               Display this help and exit.
-   --ldata=path         The path to the MySQL data directory. Same as --datadir.
-   --no-defaults        Don't read default options from any option file.
-+  --keep-my-cnf        Don't try to create my.cnf based on template.
-+                       Useful for systems with working, updated my.cnf.
- EOF1
-   if ( $^O !~ m/^(MSWin32|cygwin)$/ ) {
-     print <<EOF2;
-@@ -86,6 +110,7 @@ EOF2
+@@ -113,6 +113,7 @@ EOF2
    print <<EOF3;
    --rpm                For internal use.  This option is used by RPM files
                         during the MySQL installation process.
@@ -23,116 +14,16 @@ index 440a977..7d068fc 100644
    --skip-name-resolve  Use IP addresses rather than hostnames when creating
                         grant table entries.  This option can be useful if
                         your DNS does not work.
-@@ -149,6 +174,7 @@ sub parse_arguments
-              "skip-name-resolve",
-              "verbose",
-+             "keep-my-cnf",
-              "rpm",
-              "help",
-              "random-passwords",
-@@ -356,13 +382,19 @@ sub tell_root_password {
- ##############################################################################
-
- sub generate_random_password {
--  # On (at least) Linux and Solaris, a "random" device is available, use it:
--  # cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1
--  # Without LC_ALL, "tr" may not know the "alnum" character class -
--  # and there are user profiles which do not have this set.
--  #
--  my $password = `cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1`;
--  chomp ($password);
-+  # On Linux, Solaris, Max OS X and FreeBSD we have a random device available.
-+  my $randfile = "/dev/urandom";
-+  open(FD, $randfile) || die "Can't open $randfile for reading: $!";
-+  my $password = "";
-+  my $pass_len = 16;
-+  my $c;
-+  while (length($password) < $pass_len) {
-+    $c = getc(FD);
-+    if ($c =~ /\w/) {
-+      $password .= $c;
-+    }
-+  }
-+  close(FD);
-   return $password;
- }
-
-@@ -399,11 +431,16 @@ $basedir= "@prefix@" if ! $basedir;              # Default
- # ----------------------------------------------------------------------
-
- my $print_defaults;
-+my $keep_my_cnf = 0;
-
- if ( $opt->{srcdir} and $opt->{basedir} )
+@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} )
  {
    error($opt,"Specify either --basedir or --srcdir, not both");
  }
+-if ( $opt->{'keep-my-cnf'} )
 +if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
-+{
-+  $keep_my_cnf = 1;
-+}
- if ( $opt->{srcdir} )
  {
-   $opt->{builddir} = $opt->{srcdir} unless $opt->{builddir};
-@@ -425,7 +462,7 @@ my $config_file;
- my $copy_cfg_file;
-
- # ----------------------------------------------------------------------
--# This will be the default config file
-+# This will be the default config file (unless creation is unwanted)
- # ----------------------------------------------------------------------
-
- my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf";
-@@ -434,6 +471,11 @@ $config_file= "$basedir/my.$cnfext";
-
- my $cfg_template= find_in_basedir($opt,"file","my-default.$cnfext",
-                                 ".", "share","share/mysql","support-files");
-+# Distros might move files
-+if ((! -r $cfg_template) && (-r "@pkgdatadir@/my-default.cnf")) {
-+  $cfg_template = "@pkgdatadir@/my-default.cnf";
-+}
-+
- -e $cfg_template or cannot_find_file("my-default.$cnfext");
-
- $copy_cfg_file= $config_file;
-@@ -443,22 +485,21 @@ if (-e $copy_cfg_file)
-   $copy_cfg_file =~ s/my.$cnfext/my-new.$cnfext/;
-   # Too early to print warning here, the user may not notice
+   $keep_my_cnf = 1;
  }
--open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
--if (open (CFG, "> $copy_cfg_file"))
--{
--  while (<TEMPL>)
--  {
--    # Remove lines beginning with # *** which are template comments
--    print CFG $_ unless /^# \*\*\*/;
-+
-+if ( ! $keep_my_cnf ) {
-+  open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
-+  if (open (CFG, "> $copy_cfg_file")) {
-+    while (<TEMPL>) {
-+      # Remove lines beginning with # *** which are template comments
-+      print CFG $_ unless /^# \*\*\*/;
-+    }
-+    close CFG;
-+  } else {
-+    warning($opt,"Could not write to config file $copy_cfg_file: $!");
-+    $failed_write_cfg= 1;
-   }
--  close CFG;
-+  close TEMPL;
- }
--else
--{
--  warning($opt,"Could not write to config file $copy_cfg_file: $!");
--  $failed_write_cfg= 1;
--}
--close TEMPL;
-
- # ----------------------------------------------------------------------
- # Now we can get arguments from the groups [mysqld] and [mysql_install_db]
-@@ -621,7 +662,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
+@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
  }
 
  # ----------------------------------------------------------------------
@@ -141,7 +32,7 @@ index 440a977..7d068fc 100644
  # ----------------------------------------------------------------------
 
  # FIXME The shell variant uses "mkdir -p":
-@@ -654,7 +695,7 @@ if ($opt_user)
+@@ -697,7 +698,7 @@ if ($opt_user)
    }
  }
 
@@ -150,18 +41,3 @@ index 440a977..7d068fc 100644
  {
    mkdir($dir, 0700) unless -d $dir;
    if ($opt_user and -w "/")
-@@ -848,7 +889,13 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") )
-            "",
-            "Support MySQL by buying support/licenses at http://shop.mysql.com");
--    if ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-+    if ($keep_my_cnf)
-+    {
-+      report($opt,
-+           "Note: new default config file not created.",
-+           "Please make sure your config file is current");
-+    }
-+    elsif ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-     {
-       report($opt,
-               "New default config file was created as $config_file and",
index 82859623b1a9f05c2ea0083d1195b3eb90dfa721..31af2dc779ba00b5c2c2ce4b5890e1ebd23f6526 100644 (file)
@@ -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
@@ -14,4 +14,5 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 #fix-man-page-links.patch
-#fix-mysql_install_db.patch
+fix-mysql_install_db.patch
+fix-mtr-search-paths.patch
index bdd08b1c3cd75d29273259721c254a1d165e7107..8e4ab9490aeab5c6469085527ad262bd24562844 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/make -f
 
-# 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
@@ -34,7 +34,7 @@ override_dh_auto_configure:
                -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
                -DINSTALL_MANDIR=share/man \
                -DINSTALL_MYSQLSHAREDIR=share/mysql \
-               -DINSTALL_MYSQLTESTDIR=lib/mysql/mysql-test \
+               -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
                -DINSTALL_PLUGINDIR=lib/mysql/plugin \
                -DINSTALL_SBINDIR=sbin \
                -DINSTALL_SCRIPTDIR=bin \
@@ -45,12 +45,7 @@ override_dh_auto_configure:
                -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
                -DWITH_SSL=bundled \
                -DWITH_ZLIB=system \
-               -DWITH_EXTRA_CHARSETS=complex \
-               -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-               -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-               -DWITH_EXAMPLE_STORAGE_ENGINE=1 \
-               -DWITH_FEDERATED_STORAGE_ENGINE=1 \
-               -DWITH_INNOBASE_STORAGE_ENGINE=1 \
+               -DWITH_EXTRA_CHARSETS=all \
                -DWITH_INNODB_MEMCACHED=1 \
                -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
                -DINSTALL_LAYOUT=DEB
@@ -60,7 +55,7 @@ override_dh_auto_configure:
 
 override_dh_auto_build:
        @echo "RULES.$@"
-       $(MAKE) -j1 VERBOSE=1
+       $(MAKE) -j8 VERBOSE=1
        touch $@
 
 override_dh_auto_test:
@@ -73,117 +68,68 @@ override_dh_auto_install:
        @echo "RULES.$@"
        # complete install first
        $(MAKE) install DESTDIR=debian/tmp
-       # http://bugs.mysql.com/bug.php?id=68517 --- Some test and result files have executable bit set.
-       # remove execute bit from file permissions discussed in Bug#68517 and other files
-       chmod 0644 debian/tmp/usr/bin/mysqlaccess.conf
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb-wl5980-linux.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/r/lowercase_table4.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/shutdown_mysqld.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/have_QC_Disabled.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_3.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb_bug60196.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb_bug14169459.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb-wl5980-windows.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/r/named_pipe.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/t/lowercase_table4-master.opt
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb-wl5980-debug.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/r/shm.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/ndb/t/ndb_show_tables_result.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug57904.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/check_ipv4_mapped.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/start_mysqld.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_11.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/t/lowercase_table4.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb_bug57904.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/portability_wl5980_windows.zip
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug60196.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-debug.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-windows.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-linux.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug14169459.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_10.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_14.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-discard.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_6.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug60196-master.opt
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/portability_wl5980_linux.zip
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/memcache_config.inc
-       chmod 0644 debian/tmp/usr/share/mysql/innodb_memcached_config.sql
-       chmod 0644 debian/tmp/usr/share/mysql/mysql-log-rotate
-       chmod 0644 debian/tmp/usr/lib/mysql/sql-bench/graph-compare-results
        # remove all redundant files and links
        rm debian/tmp/usr/lib/*/*_r*
-       rm debian/tmp/usr/lib/mysql/mysql-test/cmake_install.cmake
-       rm debian/tmp/usr/lib/mysql/mysql-test/CTestTestfile.cmake
-       rm debian/tmp/usr/lib/mysql/mysql-test/Makefile
+       rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
+       rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
+       rm debian/tmp/usr/lib/mysql-test/Makefile
        # add missing man pages
-       install -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+       install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
        # add MySQL Server configuration file my.cnf to mysql-common package
-       mkdir -p debian/tmp/etc/mysql
-       install -o root -m 0644 debian/extra/my.cnf debian/tmp/etc/mysql
+       install -g root -o root -m 0644 -D debian/extra/my.cnf debian/tmp/etc/mysql/my.cnf
        # add MySQL Server debug binary and library to package
-       install -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
-       install -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+       install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       # add debug plugin libraries to package
+       install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
+       for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
+       install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+       install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
        # add apparmor profile
-       install -D -m 644 debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld
+       install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld
        # add directory for legal docs
-       mkdir -p debian/tmp/usr/share/doc/mysql-server
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-server
-       mkdir -p debian/tmp/usr/share/doc/mysql-client
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-client
-       mkdir -p debian/tmp/usr/share/doc/mysql-common
-       mkdir -p debian/tmp/usr/share/doc/libmysqlclient18
-       mkdir -p debian/tmp/usr/share/doc/libmysqlclient-dev
-       mkdir -p debian/tmp/usr/share/doc/libmysqld-dev
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-bench
-       mkdir -p debian/tmp/usr/share/doc/mysql-testsuite
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-test
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-source
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-bench
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-test
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-source
        # add COPYING file to each package
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
        # add README file to each package
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
        touch $@
 
 override_dh_installinit:
        @echo "RULES.$@"
-       dh_installinit --name=mysql -- defaults 19 21
        dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld
+       dh_installinit --name=mysql -- defaults 19 21
        touch $@
index ba9d2b4e84866a479f242a0014b3e5fbd57b65dd..caac1e13dad85aa1bb45586e8412ee37fbd02a7a 100644 (file)
@@ -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
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-# obscured filename for mysqld-debug and libmysqld-debug.a
+# obscured filename for mysqld-debug, libmysqld-debug.a and debug plugins
 debian/extra/server-binary
 debian/extra/embedded-server
+debian/extra/adt_null-plugin
+debian/extra/auth-plugin
+debian/extra/auth_socket-plugin
+debian/extra/auth_test_plugin-plugin
+debian/extra/innodb_engine-plugin
+debian/extra/libdaemon_example-plugin
+debian/extra/libmemcached-plugin
+debian/extra/mypluglib-plugin
+debian/extra/mysql_no_login-plugin
+debian/extra/qa_auth_client-plugin
+debian/extra/qa_auth_interface-plugin
+debian/extra/qa_auth_server-plugin
+debian/extra/semisync_master-plugin
+debian/extra/semisync_slave-plugin
+debian/extra/validate_password-plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/changelog b/mysql-wsrep-5.6/packaging/deb-utopic/changelog
new file mode 100644 (file)
index 0000000..6c391b4
--- /dev/null
@@ -0,0 +1,96 @@
+mysql-community (5.6.25-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * mysql-community-server now depends on perl, psmisc
+    mysql-community-test now depends on python, libmysqlclient-dev
+    (Closes: #20561621)
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 25 Feb 2014 22:52:19 +0530
+
+mysql-community (5.6.24-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 16 Feb 2014 15:45:09 +0530
+
+mysql-community (5.6.23-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * mysql-community-server now recommends mysql-client
+  * mysql-community-server now depends on apparmor
+  * removed template install-test-db; not installed by default
+  * d/compat incremented to 9 from 8
+  * d/control updated to build depend on debhelper 9
+  * added d/*.lintian-overrides and d/source/lintian-overrides
+  * d/rules updated to reflect correct file permissions
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 31 Dec 2014 10:51:07 +0530
+
+mysql-community (5.6.22-2ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * mysql-common now replaces mysql-server-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 28 Nov 2014 15:18:07 +0530
+
+mysql-community (5.6.22-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * fixed d/*server.postinst to allow dropping test db without
+    setting root password
+  * init script will now run my_i_db if data dir is not present or empty
+  * updated init script to read app armor profile on startup
+  * forked packaging source from trusty and rebranded for utopic
+  * updated d/m-c-source.install to pack *.xz packaging source archive
+  * added more system resources to app armor profile
+  * dh_apparmor to now run before dh_installinit in d/rules
+  * libmysqlclient-dev now replaces mysql-client-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 05 Nov 2014 17:04:07 +0530
+
+mysql-community (5.6.21-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * updated d/rules to increment -j8 as make option
+  * updated d/source/include-binaries to add mysql_no_login plugin
+  * updated CMake option WITH_EXTRA_CHARSETS from complex to all
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 20 Aug 2014 19:12:30 +0530
+
+mysql-community (5.6.20-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * added fakeroot as build-dep in d/control
+  * added d/*.dirs for bench, dev and test pkg
+  * updated d/rules to make compilation verbose
+  * removed default CFLAGS, CXXFLAGS in d/rules
+  * added patch for testsuite search paths under d/patches
+  * modified cmake option for testsuite in d/rules
+  * updated patch d/fix-mysql_install_db.patch
+  * enabled two patches in d/patches/series
+  * removed extra permissions check in d/rules when fixed in source
+  * modified d/mysql-*-server.postinst to stop removing /usr/my.cnf
+  * modified d/*-test.* for updated location of testsuite
+  * updated d/{mysql-*-server.install,rules} to include debug plugins
+  * updated d/rules to remove storage engine cmake options
+  * modified data dir permission in d/*server.{pre,post}inst
+  * updated d/source/include-binaries to add debug plugins
+  * updated d/rules to rename debug plugins
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 02 Jul 2014 17:45:30 +0530
+
+mysql-community (5.6.19-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * d/rules updated to rid of files removed from source
+  * modified path for source tar in source pkg
+  * obscured actual filenames in d/source/include-binaries
+  * modified d/rules to handle obscured filenames
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 05 May 2014 15:45:10 +0530
+
+mysql-community (5.6.17-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Fri, 28 Feb 2014 18:06:30 +0530
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/compat b/mysql-wsrep-5.6/packaging/deb-utopic/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/control b/mysql-wsrep-5.6/packaging/deb-utopic/control
new file mode 100644 (file)
index 0000000..e04d753
--- /dev/null
@@ -0,0 +1,190 @@
+Source: mysql-community
+Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Section: database
+Priority: optional
+Standards-Version: 3.9.5
+Homepage: http://www.mysql.com/
+Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-apparmor, lsb-release, cmake, fakeroot, libnuma-dev
+
+Package: mysql-server
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Server meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql server
+ package available in the repository.
+
+Package: mysql-community-server
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), adduser
+Depends: mysql-common (= ${binary:Version}), apparmor, perl, psmisc,
+ ${shlibs:Depends}, ${misc:Depends}
+Recommends: mysql-client (= ${binary:Version})
+Conflicts: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server
+Replaces: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server
+Provides: virtual-mysql-server, virtual-mysql-server-core,
+ mysql-server-5.6, mysql-server-core-5.6
+Description: MySQL Server
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package includes the MySQL server binary as well as related
+ utilities to run and administer a MySQL server.
+
+Package: mysql-client
+Architecture: any
+Depends: mysql-community-client (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Client meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql client
+ package available in the repository.
+
+Package: mysql-community-client
+Architecture: any
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Replaces: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Provides: virtual-mysql-client, virtual-mysql-client-core,
+ mysql-client-5.6, mysql-client-core-5.6
+Description: MySQL Client
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the standard MySQL clients and
+ administration tools.
+
+Package: libmysqlclient18
+Architecture: any
+Section: libs
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL shared client libraries
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the shared libraries for MySQL client
+ applications.
+
+Package: mysql-common
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), ${misc:Pre-Depends}
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql
+Replaces: mysql, mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev,
+ mysql-server-5.6, mysql-server-core-5.6
+Provides: mysql-common
+Description: MySQL Common
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains common files needed by MySQL client
+ library, MySQL database server, and MySQL embedded server.
+
+Package: libmysqlclient-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient18 (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Replaces: mysql-client-5.6, mysql-client-core-5.6
+Description: MySQL development headers
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the development header files necessary
+ to develop MySQL client applications.
+
+Package: libmysqld-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient-dev (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL embedded server library
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL server as an embedded library.
+
+Package: mysql-testsuite
+Architecture: any
+Depends: mysql-community-test (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Testsuite meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql test
+ package available in the repository.
+
+Package: mysql-community-test
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ mysql-community-client (= ${binary:Version}), python,
+ libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
+ mysql-testsuite-5.6, mysql-commercial-test
+Description: MySQL Test Run MTR - The MySQL testsuite
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL regression test suite for MySQL
+ database server.
+
+Package: mysql-community-bench
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-commercial-bench
+Description: MySQL Bench
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
+
+Package: mysql-community-source
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: MySQL source
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/copyright b/mysql-wsrep-5.6/packaging/deb-utopic/copyright
new file mode 100644 (file)
index 0000000..2c31f24
--- /dev/null
@@ -0,0 +1,41 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: MySQL Server 5.6
+Upstream-Contact: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Source: http://dev.mysql.com/
+
+Copyright: 2000, 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+License:
+ This is a release of MySQL, a dual-license SQL database server.
+ For the avoidance of doubt, this particular copy of the software
+ is released under the version 2 of the GNU General Public License.
+ MySQL is brought to you by Oracle.
+ .
+ MySQL FOSS License Exception
+ We want free and open source software applications under certain
+ licenses to be able to use specified GPL-licensed MySQL client
+ libraries despite the fact that not all such FOSS licenses are
+ compatible with version 2 of the GNU General Public License.
+ Therefore there are special exceptions to the terms and conditions
+ of the GPLv2 as applied to these client libraries, which are
+ identified and described in more detail in the FOSS License
+ Exception at
+ <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
+ .
+ This distribution may include materials developed by third
+ parties. For license and attribution notices for these
+ materials, please refer to the documentation that accompanies
+ this distribution (see the "Licenses for Third-Party Components"
+ appendix) or view the online documentation at
+ <http://dev.mysql.com/doc/>.
+ .
+ GPLv2 Disclaimer
+ For the avoidance of doubt, except that if any license choice
+ other than GPL or LGPL is available it will apply instead,
+ Oracle elects to use only the General Public License version 2
+ (GPLv2) at this time for any software where a choice of GPL
+ license versions is made available with the language indicating
+ that GPLv2 or any later version may be used, or where a choice
+ .
+ The full text of the GNU General Public License version 2 can
+ be found in the file
+ `/usr/share/mysql/doc/COPYING'.
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/extra/apparmor-profile b/mysql-wsrep-5.6/packaging/deb-utopic/extra/apparmor-profile
new file mode 100644 (file)
index 0000000..5370d9e
--- /dev/null
@@ -0,0 +1,49 @@
+# vim:syntax=apparmor
+# Last Modified: Fri Feb 28 18:06:30 2014
+#include <tunables/global>
+
+/usr/sbin/mysqld {
+  #include <abstractions/base>
+  #include <abstractions/nameservice>
+  #include <abstractions/user-tmp>
+
+# Allow system resource access
+  /sys/devices/system/cpu/ r,
+  capability sys_resource,
+  capability dac_override,
+  capability setuid,
+  capability setgid,
+
+# Allow config access
+  /etc/mysql/conf.d/ r,
+  /etc/mysql/conf.d/*.cnf r,
+  /etc/mysql/*.cnf r,
+
+# Allow pid and socket file access
+  /run/mysqld/mysqld.pid rw,
+  /run/mysqld/mysqld.sock rw,
+
+# Allow read/ write to /tmp
+  /tmp/ r,
+  /tmp/* rw,
+
+# Allow execution of server binary
+  /usr/sbin/mysqld mr,
+  /usr/sbin/mysqld-debug mr,
+
+# Allow plugin access
+  /usr/lib/mysql/plugin/ r,
+  /usr/lib/mysql/plugin/*.so* mr,
+
+# Allow error msg and charset access
+  /usr/share/mysql/ r,
+  /usr/share/mysql/** r,
+
+# Allow data dir access
+  /var/lib/mysql/ r,
+  /var/lib/mysql/** rwk,
+
+# Allow log file access
+  /var/log/mysql/ r,
+  /var/log/mysql/** rw,
+}
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/extra/my.cnf b/mysql-wsrep-5.6/packaging/deb-utopic/extra/my.cnf
new file mode 100644 (file)
index 0000000..3a5445f
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Community Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[client]
+port           = 3306
+socket         = /var/run/mysqld/mysqld.sock
+
+[mysqld_safe]
+pid-file       = /var/run/mysqld/mysqld.pid
+socket         = /var/run/mysqld/mysqld.sock
+nice           = 0
+
+[mysqld]
+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
+explicit_defaults_for_timestamp
+
+# 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
+
+log-error      = /var/log/mysql/error.log
+
+# Recommended in standard MySQL setup
+sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
+
+# Disabling symbolic-links is recommended to prevent assorted security risks
+symbolic-links=0
+
+# * 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/mysql-wsrep-5.6/packaging/deb-utopic/extra/mysql_embedded.1 b/mysql-wsrep-5.6/packaging/deb-utopic/extra/mysql_embedded.1
new file mode 100644 (file)
index 0000000..735c4e0
--- /dev/null
@@ -0,0 +1 @@
+.so man1/mysql.1
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient-dev.install b/mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient-dev.install
new file mode 100644 (file)
index 0000000..e7e98c1
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (c) 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
+# 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
+
+usr/include/mysql/*.h
+usr/include/mysql/mysql/*.h
+usr/include/mysql/mysql/*.h.pp
+usr/include/mysql/mysql/psi/*.h
+usr/lib/*/libmysqlclient.a
+usr/lib/*/libmysqlclient.so
+usr/lib/*/libmysqlservices.a
+usr/bin/mysql_config
+usr/bin/mysql_config_editor
+usr/share/man/man1/mysql_config.1
+usr/share/man/man1/mysql_config_editor.1
+# legal
+usr/share/doc/libmysqlclient-dev/COPYING
+usr/share/doc/libmysqlclient-dev/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..09960eb
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/LICENSE.mysql
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/COPYING.gz
+libmysqlclient-dev: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient-dev: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient18.install b/mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient18.install
new file mode 100644 (file)
index 0000000..fe6aa56
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/*/libmysqlclient.so.*
+# legal
+usr/share/doc/libmysqlclient18/COPYING
+usr/share/doc/libmysqlclient18/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient18.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/libmysqlclient18.lintian-overrides
new file mode 100644 (file)
index 0000000..1f26511
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/LICENSE.mysql
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/COPYING.gz
+libmysqlclient18: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient18: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/libmysqld-dev.install b/mysql-wsrep-5.6/packaging/deb-utopic/libmysqld-dev.install
new file mode 100644 (file)
index 0000000..923f826
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/*/libmysqld.a
+usr/lib/*/libmysqld-debug.a
+# legal
+usr/share/doc/libmysqld-dev/COPYING
+usr/share/doc/libmysqld-dev/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/libmysqld-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/libmysqld-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..35caaec
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/COPYING.gz
+libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-client.install b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-client.install
new file mode 100644 (file)
index 0000000..13b877e
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-client/COPYING
+usr/share/doc/mysql-client/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5c4891c
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
+mysql-client: extra-license-file usr/share/doc/mysql-client/COPYING.gz
+mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-common.dirs b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-common.dirs
new file mode 100644 (file)
index 0000000..69265ef
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/conf.d
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-common.install b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-common.install
new file mode 100644 (file)
index 0000000..8a22acd
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/my.cnf
+usr/share/aclocal/mysql.m4
+usr/share/mysql/docs/INFO_SRC
+usr/share/mysql/docs/INFO_BIN
+usr/share/mysql/docs/ChangeLog
+# localized error msgs
+usr/share/mysql/*/errmsg.sys
+usr/share/mysql/errmsg-utf8.txt
+# charsets
+usr/share/mysql/charsets/*.xml
+usr/share/mysql/charsets/README
+# legal
+usr/share/doc/mysql-common/COPYING
+usr/share/doc/mysql-common/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-common.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-common.lintian-overrides
new file mode 100644 (file)
index 0000000..70ddcdf
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
+mysql-common: extra-license-file usr/share/doc/mysql-common/COPYING.gz
+mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-bench.install b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-bench.install
new file mode 100644 (file)
index 0000000..065124b
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql/sql-bench/*
+# legal
+usr/share/doc/mysql-community-bench/COPYING
+usr/share/doc/mysql-community-bench/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-bench.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-bench.lintian-overrides
new file mode 100644 (file)
index 0000000..04df14e
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/LICENSE.mysql
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/COPYING.gz
+mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-client.install b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-client.install
new file mode 100644 (file)
index 0000000..46cd07d
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright (c) 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
+# 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
+
+# binaries
+usr/bin/innochecksum
+usr/bin/myisam_ftdump
+usr/bin/mysql
+usr/bin/mysql_embedded
+usr/bin/mysqlaccess
+usr/bin/mysqlaccess.conf
+usr/bin/mysqladmin
+usr/bin/mysqlbug
+usr/bin/mysqlcheck
+usr/bin/mysql_client_test
+usr/bin/mysql_client_test_embedded
+usr/bin/mysqldump
+usr/bin/mysqldumpslow
+usr/bin/mysql_find_rows
+usr/bin/mysql_fix_extensions
+usr/bin/mysqlimport
+usr/bin/mysql_plugin
+usr/bin/mysqlshow
+usr/bin/mysqlslap
+usr/bin/mysql_waitpid
+# man pages
+usr/share/man/man1/innochecksum.1
+usr/share/man/man1/myisam_ftdump.1
+usr/share/man/man1/mysql.1
+usr/share/man/man1/mysql_embedded.1
+usr/share/man/man1/mysqlaccess.1
+usr/share/man/man1/mysqladmin.1
+usr/share/man/man1/mysqlbug.1
+usr/share/man/man1/mysqlcheck.1
+usr/share/man/man1/mysql_client_test.1
+usr/share/man/man1/mysql_client_test_embedded.1
+usr/share/man/man1/mysqldump.1
+usr/share/man/man1/mysqldumpslow.1
+usr/share/man/man1/mysql_find_rows.1
+usr/share/man/man1/mysql_fix_extensions.1
+usr/share/man/man1/mysqlimport.1
+usr/share/man/man1/mysqlman.1
+usr/share/man/man1/mysql_plugin.1
+usr/share/man/man1/mysqlshow.1
+usr/share/man/man1/mysqlslap.1
+usr/share/man/man1/mysql_waitpid.1
+# legal
+usr/share/doc/mysql-community-client/COPYING
+usr/share/doc/mysql-community-client/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5892935
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-client/LICENSE.mysql
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-clienti/COPYING.gz
+mysql-community-client: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-client: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.config b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.config
new file mode 100755 (executable)
index 0000000..ceb3373
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+. /usr/share/debconf/confmodule
+
+if [ "$1" = "configure" ] && [ -z "$2" ];
+then
+
+       set -e
+
+       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-commercial-server
+       INSTALLED_PKG=none
+       MYSQLDATA=/var/lib/mysql
+
+       IFS_BACKUP=${IFS}
+       IFS=":"
+       for PKG in ${PKG_LIST};
+       do
+               STATUS=$(dpkg -s ${PKG} 2> /dev/null | grep Status: | cut -d' ' -f4)
+               if [ "${STATUS}" = "installed" ];
+               then
+                       INSTALLED_PKG=${PKG}
+                       break
+               fi
+       done
+       IFS=${IFS_BACKUP}
+
+       if [ "${INSTALLED_PKG}" = "none" ];
+       then
+               if [ -d ${MYSQLDATA} -o -L ${MYSQLDATA} ];
+               then
+                       db_input high mysql-community-server/data-dir || true
+               else
+                       db_fset mysql-community-server/data-dir seen true
+               fi
+
+               while :; do
+                       PASSWD=""
+                       db_input high mysql-community-server/root-pass || true
+                       db_go
+
+                       db_get mysql-community-server/root-pass
+                       if [ -z "${RET}" ];
+                       then
+                               db_fset mysql-community-server/root-pass seen true
+                               db_fset mysql-community-server/re-root-pass seen true
+                               break
+                       fi
+                       PASSWD="${RET}"
+
+                       db_input high mysql-community-server/re-root-pass || true
+                       db_go
+
+                       db_get mysql-community-server/re-root-pass
+                       if [ "${RET}" == "${PASSWD}" ];
+                       then
+                               PASSWD=""
+                               break
+                       fi
+
+                       db_fset mysql-community-server/root-pass-mismatch seen false
+                       db_input critical mysql-community-server/root-pass-mismatch
+                       db_set mysql-community-server/root-pass ""
+                       db_set mysql-community-server/re-root-pass ""
+               done
+
+       else
+               db_fset mysql-community-server/data-dir seen true
+               db_fset mysql-community-server/root-pass seen true
+               db_fset mysql-community-server/re-root-pass seen true
+       fi
+
+       set +e
+fi
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.dirs b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.dirs
new file mode 100644 (file)
index 0000000..91e7185
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/conf.d
+etc/init.d
+usr/lib/mysql
+usr/lib/mysql/plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.install b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.install
new file mode 100644 (file)
index 0000000..589ea20
--- /dev/null
@@ -0,0 +1,86 @@
+# Copyright (c) 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
+# 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
+
+# binaries
+usr/bin/msql2mysql
+usr/bin/myisamchk
+usr/bin/myisamlog
+usr/bin/myisampack
+usr/bin/my_print_defaults
+usr/bin/mysqlbinlog
+usr/bin/mysql_convert_table_format
+usr/bin/mysqld_multi
+usr/bin/mysqld_safe
+usr/bin/mysqlhotcopy
+usr/bin/mysql_install_db
+usr/bin/mysql_secure_installation
+usr/bin/mysql_setpermission
+usr/bin/mysqltest
+usr/bin/mysqltest_embedded
+usr/bin/mysql_tzinfo_to_sql
+usr/bin/mysql_upgrade
+usr/bin/mysql_zap
+usr/bin/perror
+usr/bin/replace
+usr/bin/resolveip
+usr/bin/resolve_stack_dump
+usr/sbin/mysqld
+# debug binary
+usr/sbin/mysqld-debug
+# man pages
+usr/share/man/man1/comp_err.1
+usr/share/man/man1/msql2mysql.1
+usr/share/man/man1/myisamchk.1
+usr/share/man/man1/myisamlog.1
+usr/share/man/man1/myisampack.1
+usr/share/man/man1/my_print_defaults.1
+usr/share/man/man1/mysqlbinlog.1
+usr/share/man/man1/mysql_convert_table_format.1
+usr/share/man/man1/mysqld_multi.1
+usr/share/man/man1/mysqld_safe.1
+usr/share/man/man1/mysqlhotcopy.1
+usr/share/man/man1/mysql_install_db.1
+usr/share/man/man1/mysql_secure_installation.1
+usr/share/man/man1/mysql.server.1
+usr/share/man/man1/mysql_setpermission.1
+usr/share/man/man1/mysql-stress-test.pl.1
+usr/share/man/man1/mysqltest.1
+usr/share/man/man1/mysqltest_embedded.1
+usr/share/man/man1/mysql_tzinfo_to_sql.1
+usr/share/man/man1/mysql_upgrade.1
+usr/share/man/man1/mysql_zap.1
+usr/share/man/man1/perror.1
+usr/share/man/man1/replace.1
+usr/share/man/man1/resolveip.1
+usr/share/man/man1/resolve_stack_dump.1
+usr/share/man/man8/mysqld.8
+# app armor profile
+etc/apparmor.d/usr.sbin.mysqld
+# SQL files
+usr/share/mysql/*.sql
+# plugins
+usr/lib/mysql/plugin/*.so
+usr/lib/mysql/plugin/debug/*.so
+usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/debug/daemon_example.ini
+# support files
+usr/share/mysql/mysqld_multi.server
+usr/share/mysql/magic
+usr/share/mysql/mysql-log-rotate
+usr/share/mysql/my-default.cnf
+usr/share/mysql/dictionary.txt
+# legal
+usr/share/doc/mysql-community-server/COPYING
+usr/share/doc/mysql-community-server/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.lintian-overrides
new file mode 100644 (file)
index 0000000..08b3865
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/LICENSE.mysql
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/COPYING.gz
+mysql-community-server: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-server: embedded-library
+# Since we ship debug plugins so this error is overridden
+mysql-community-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.mysql.init b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.mysql.init
new file mode 100755 (executable)
index 0000000..67a0193
--- /dev/null
@@ -0,0 +1,192 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides:          mysql
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Should-Start:      $network $time
+# Should-Stop:       $network $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start/ Stop MySQL Community Server daemon
+# Description:       This service script facilitates startup and shutdown of
+#                    mysqld daemon throught its wrapper script mysqld_safe
+### END INIT INFO
+#
+
+# Copyright (c) 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
+# 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
+
+. /lib/lsb/init-functions
+
+cd /
+umask 077
+
+MYSQLDATA=/var/lib/mysql
+VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
+
+get_mysql_option() {
+       RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
+       if [ -z "$RESULT" ];
+       then
+               RESULT="$3"
+       fi
+       echo $RESULT
+}
+
+get_running () {
+       PIDFILE=$(get_mysql_option mysqld_safe pid-file "")
+       if [ -z "$PIDFILE" ];
+       then
+               PIDFILE=$(get_mysql_option mysqld pid-file "$MYSQLDATA/$(hostname).pid")
+       fi
+       if [ -e "$PIDFILE" ] && [ -d "/proc/$(cat "$PIDFILE")" ];
+       then
+               echo 1
+       else
+               echo 0
+       fi
+}
+
+server_stop () {
+       RUNNING=$(get_running)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${RUNNING}" -eq 0 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               RUNNING=$(get_running)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+  'start')
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
+       then
+               log_action_msg "A MySQL Server is already started"
+       else
+               MYSQLRUN=/var/run/mysqld
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+               fi
+
+               if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+               then
+                       mysql_install_db --user=mysql > /dev/null
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
+               if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+               then
+                       mkdir ${MYSQLRUN}
+                       chown mysql:mysql ${MYSQLRUN}
+                       chmod 755 ${MYSQLRUN}
+               fi
+
+               /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+               su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
+               for i in 1 2 3 4 5 6;
+               do
+                       sleep 1
+                       echo -n .
+               done
+               echo
+               RUNNING=$(get_running)
+               if [ "${RUNNING}" -eq 1 ];
+               then
+                       log_action_msg "MySQL Community Server ${VERSION} is started"
+               else
+                       log_action_msg "MySQL Community Server ${VERSION} did not start. Please check logs for more details."
+               fi
+       fi
+       ;;
+
+  'stop')
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
+       then
+               killall -15 mysqld
+               server_stop
+               if [ "$?" -eq 0 ];
+               then
+                       log_action_msg "MySQL Community Server ${VERSION} is stopped"
+               else
+                       log_action_msg "Attempt to shutdown MySQL Community Server ${VERSION} timed out"
+               fi
+       else
+               log_action_msg "MySQL Community Server ${VERSION} is already stopped"
+       fi
+       ;;
+
+  'restart'|'reload'|'force-reload')
+       log_action_msg "Stopping MySQL Community Server ${VERSION}"
+       $0 stop
+       log_action_msg "Re-starting MySQL Community Server ${VERSION}"
+       $0 start
+       ;;
+
+  'status')
+       RUNNING=$(get_running)
+       if [ ${RUNNING} -eq 1 ];
+       then
+               log_action_msg "MySQL Community Server ${VERSION} is running"
+       else
+               log_action_msg "MySQL Community Server ${VERSION} is not running"
+               exit 3
+       fi
+       ;;
+
+  *)
+       echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
+       exit 1
+       ;;
+esac
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.postinst b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.postinst
new file mode 100755 (executable)
index 0000000..ee72a0f
--- /dev/null
@@ -0,0 +1,93 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+. /usr/share/debconf/confmodule
+
+take_upstart_job_backup () {
+       if [ -e "/etc/init/mysql.conf" ] && [ -d "/var/lib/mysql" ];
+       then
+               mv /etc/init/mysql.conf /var/lib/mysql/.mysql.conf.backup
+       fi
+}
+
+case "$1" in
+       configure)
+
+       if [ -z "$2" ];
+       then
+               set -e
+
+               MYSQLDATA=/var/lib/mysql
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+                       if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+                       then
+                               mysql_install_db --user=mysql > /dev/null
+                       fi
+               fi
+
+               db_get mysql-community-server/root-pass && PASSWD=${RET}
+               if [ ! -z "${PASSWD}" ];
+               then
+                       db_set mysql-community-server/root-pass ""
+                       db_set mysql-community-server/re-root-pass ""
+                       PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
+               else
+                       PASSWD=""
+               fi
+
+               SQL=`mktemp`
+               if [ -f "${SQL}" ];
+               then
+                       chmod 700 ${SQL}
+                       cat << EOF > ${SQL}
+USE mysql;
+${PASSWD}
+DELETE FROM user WHERE user='';
+FLUSH PRIVILEGES;
+EOF
+                       mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
+                       PASSWD=""
+                       rm -f ${SQL}
+               fi
+
+               set +e
+
+       fi
+
+       ;;
+
+       abort-upgrade|abort-remove|abort-configure)
+
+       ;;
+
+       *)
+       exit 1
+       ;;
+esac
+
+db_stop
+
+take_upstart_job_backup
+
+#DEBHELPER#
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.postrm b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.postrm
new file mode 100755 (executable)
index 0000000..efdaeea
--- /dev/null
@@ -0,0 +1,154 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ];
+then
+. /usr/share/debconf/confmodule
+fi
+
+place_upstart_job_back () {
+       if [ -e "/var/lib/mysql/.mysql.conf.backup" ];
+       then
+               mv /var/lib/mysql/.mysql.conf.backup /etc/init/mysql.conf
+       fi
+}
+
+get_pcount () {
+       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+       echo "${PSCOUNT}"
+}
+
+server_stop () {
+       PSCOUNT=$(get_pcount)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${PSCOUNT}" -eq 1 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               PSCOUNT=$(get_pcount)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+       remove)
+
+       set -e
+
+       place_upstart_job_back
+
+       set +e
+
+       ;;
+
+       purge)
+
+       set -e
+
+       place_upstart_job_back
+
+       MYSQLDATA=/var/lib/mysql
+       MYSQLLOG=/var/log/mysql
+       MYSQLRUN=/var/run/mysqld
+
+       server_stop
+
+       db_input high mysql-community-server/remove-data-dir || true
+       db_go
+       db_get mysql-community-server/remove-data-dir && RMDATADIR=${RET}
+       if [ "${RMDATADIR}" = "true" ];
+       then
+               if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+               then
+                       rm -rf ${MYSQLRUN}
+               fi
+
+               if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+               then
+                       rm -rf ${MYSQLLOG}
+               fi
+
+               if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+               then
+                       rm -rf ${MYSQLDATA}
+               fi
+
+               if getent passwd mysql >/dev/null;
+               then
+                       userdel mysql
+               fi
+       fi
+
+       set +e
+       ;;
+
+       abort-install)
+
+       set -e
+
+       place_upstart_job_back
+
+       if [ -x "/etc/init.d/mysql" ];
+       then
+               invoke-rc.d mysql start || exit $?
+       else
+               if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+               then
+                       rm -rf ${MYSQLRUN}
+               fi
+
+               if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+               then
+                       rm -rf ${MYSQLLOG}
+               fi
+
+               if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+               then
+                       rm -rf ${MYSQLDATA}
+               fi
+
+               if getent passwd mysql >/dev/null;
+               then
+                       userdel mysql
+               fi
+       fi
+
+       set +e
+       ;;
+
+       upgrade|abort-upgrade)
+
+       ;;
+
+       *)
+       exit 1
+       ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.preinst b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.preinst
new file mode 100755 (executable)
index 0000000..c769885
--- /dev/null
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+get_pcount () {
+       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+       echo "${PSCOUNT}"
+}
+
+server_stop () {
+       PSCOUNT=$(get_pcount)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${PSCOUNT}" -eq 1 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               PSCOUNT=$(get_pcount)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+       install)
+
+       if [ -z "$2" ];
+       then
+
+               set -e
+
+               if [ -x "/etc/init.d/mysql" ];
+               then
+                       invoke-rc.d mysql stop || exit $?
+                       server_stop
+               fi
+
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+               MYSQLRUN=/var/run/mysqld
+
+               if ! getent group mysql >/dev/null;
+               then
+                       addgroup --system mysql >/dev/null
+               fi
+
+               if ! getent passwd mysql >/dev/null;
+               then
+                       adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
+               fi
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
+               if [ ! -d ${MYSQLRUN} -a ! -L ${MYSQLRUN} ];
+               then
+                       mkdir ${MYSQLRUN}
+                       chown mysql:mysql ${MYSQLRUN}
+                       chmod 755 ${MYSQLRUN}
+               fi
+
+               set +e
+
+       fi
+
+       ;;
+
+       upgrade)
+
+       set -e
+
+       #DEBHELPER#
+       server_stop
+
+       set +e
+
+       ;;
+
+       abort-upgrade)
+
+       ;;
+
+       *)
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.prerm b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.prerm
new file mode 100755 (executable)
index 0000000..1386b5d
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+set -e
+
+#DEBHELPER#
+
+set +e
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.templates b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-server.templates
new file mode 100644 (file)
index 0000000..7b7e0ac
--- /dev/null
@@ -0,0 +1,33 @@
+Template: mysql-community-server/root-pass
+Type: password
+Description: Enter root password:
+ Please provide a strong password that will be set for the root account of your MySQL database.
+ Leave it blank if you do not wish to set or change the root password at this time.
+
+Template: mysql-community-server/re-root-pass
+Type: password
+Description: Re-enter root password:
+ Now that you have selected a password for the root account, please confirm by typing it again. Do not share the password with anyone.
+
+Template: mysql-community-server/root-pass-mismatch
+Type: error
+Description: The two passwords did not match
+ Please try again. Make sure you type the exact same password twice.
+
+Template: mysql-community-server/remove-data-dir
+Type: boolean
+Default: false
+Description: Remove data directory at /var/lib/mysql ?
+ This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ It is highly recommended to take data backup before removing the data directory.
+
+Template: mysql-community-server/data-dir
+Type: note
+Description: Data directory found when no MySQL server package is installed
+ A data directory '/var/lib/mysql' is present on this system when no MySQL server 
+ package is currently installed on the system. The directory may be under control of
+ server package received from third-party vendors. It may also be an unclaimed data
+ directory from previous removal of mysql packages.
+ .
+ It is highly recommended to take data backup. If you have not done so, now would be
+ the time to take backup in another shell. Once completed, press 'Ok' to continue.
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-source.install b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-source.install
new file mode 100644 (file)
index 0000000..46a0f12
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+../*.dsc    usr/src/mysql/
+../*.tar.gz usr/src/mysql/
+../*.tar.xz usr/src/mysql/
+# legal
+usr/share/doc/mysql-community-source/COPYING
+usr/share/doc/mysql-community-source/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-source.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-source.lintian-overrides
new file mode 100644 (file)
index 0000000..9ca84e9
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/LICENSE.mysql
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/COPYING.gz
+mysql-community-source: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-test.install b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-test.install
new file mode 100644 (file)
index 0000000..e70086b
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql-test/*
+usr/share/man/man1/mysql-test-run.pl.1
+# legal
+usr/share/doc/mysql-community-test/COPYING
+usr/share/doc/mysql-community-test/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-test.links b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-test.links
new file mode 100644 (file)
index 0000000..bf66c98
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mysql-test-run
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mtr
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-test.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-community-test.lintian-overrides
new file mode 100644 (file)
index 0000000..ff273bb
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/LICENSE.mysql
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/COPYING.gz
+mysql-community-test: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-server.install b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-server.install
new file mode 100644 (file)
index 0000000..e3aa8de
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-server/COPYING
+usr/share/doc/mysql-server/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-server.lintian-overrides
new file mode 100644 (file)
index 0000000..4877097
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-server: extra-license-file usr/share/doc/mysql-server/LICENSE.mysql
+mysql-server: extra-license-file usr/share/doc/mysql-server/COPYING.gz
+mysql-server: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-testsuite.install b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-testsuite.install
new file mode 100644 (file)
index 0000000..dfc1733
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-testsuite/COPYING
+usr/share/doc/mysql-testsuite/README
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/mysql-testsuite.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-utopic/mysql-testsuite.lintian-overrides
new file mode 100644 (file)
index 0000000..37488fe
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/LICENSE.mysql
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/COPYING.gz
+mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/patches/fix-man-page-links.patch b/mysql-wsrep-5.6/packaging/deb-utopic/patches/fix-man-page-links.patch
new file mode 100644 (file)
index 0000000..004ccdf
--- /dev/null
@@ -0,0 +1,14 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Fix path in man page link.
+Bug: http://bugs.mysql.com/bug.php?id=70952
+
+--- a/man/mysql_client_test_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysql_client_test_embedded.1 2013-11-14 19:29:56.768315219 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysql_client_test.1
++.so man1/mysql_client_test.1
+--- a/man/mysqltest_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysqltest_embedded.1 2013-11-14 19:31:19.079280675 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysqltest.1
++.so man1/mysqltest.1
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/patches/fix-mtr-search-paths.patch b/mysql-wsrep-5.6/packaging/deb-utopic/patches/fix-mtr-search-paths.patch
new file mode 100644 (file)
index 0000000..8a27a09
--- /dev/null
@@ -0,0 +1,13 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Adding extra search path for testsuite.
+
+--- a/mysql-test/lib/mtr_cases.pm      2014-02-24 13:14:37 +0530
++++ b/mysql-test/lib/mtr_cases.pm      2014-07-02 11:46:24 +0530
+@@ -288,6 +288,7 @@
+     {
+       $suitedir= my_find_dir($::basedir,
+                            ["share/mysql-test/suite",
++                            "lib/mysql-test/suite",
+                             "mysql-test/suite",
+                             "internal/mysql-test/suite",
+                             "mysql-test",
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/patches/fix-mysql_install_db.patch b/mysql-wsrep-5.6/packaging/deb-utopic/patches/fix-mysql_install_db.patch
new file mode 100644 (file)
index 0000000..41311b2
--- /dev/null
@@ -0,0 +1,43 @@
+From: Terje Røsten <terje.rosten@oracle.com>
+Description: Maintains the pending --skip-my-cnf option in mainline
+Bug: <TODO>
+
+diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
+index 440a977..7d068fc 100644
+--- a/scripts/mysql_install_db.pl.in
++++ b/scripts/mysql_install_db.pl.in
+@@ -113,6 +113,7 @@ EOF2
+   print <<EOF3;
+   --rpm                For internal use.  This option is used by RPM files
+                        during the MySQL installation process.
++                       Implies --keep-my-cnf option.
+   --skip-name-resolve  Use IP addresses rather than hostnames when creating
+                        grant table entries.  This option can be useful if
+                        your DNS does not work.
+@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} )
+ {
+   error($opt,"Specify either --basedir or --srcdir, not both");
+ }
+-if ( $opt->{'keep-my-cnf'} )
++if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
+ {
+   $keep_my_cnf = 1;
+ }
+@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
+ }
+
+ # ----------------------------------------------------------------------
+-# Create database directories mysql & test
++# Create database directory mysql
+ # ----------------------------------------------------------------------
+
+ # FIXME The shell variant uses "mkdir -p":
+@@ -697,7 +698,7 @@ if ($opt_user)
+   }
+ }
+
+-foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
++foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql")
+ {
+   mkdir($dir, 0700) unless -d $dir;
+   if ($opt_user and -w "/")
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/patches/series b/mysql-wsrep-5.6/packaging/deb-utopic/patches/series
new file mode 100644 (file)
index 0000000..e3b20d6
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+#fix-man-page-links.patch
+fix-mysql_install_db.patch
+fix-mtr-search-paths.patch
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/rules b/mysql-wsrep-5.6/packaging/deb-utopic/rules
new file mode 100755 (executable)
index 0000000..8ffd861
--- /dev/null
@@ -0,0 +1,135 @@
+#!/usr/bin/make -f
+
+# Copyright (c) 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
+# 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
+
+%:
+       dh $@
+
+export DH_VERBOSE=1
+export CFLAGS=
+export CXXFLAGS=
+
+override_dh_auto_configure:
+       @echo "RULES.$@"
+       cmake . \
+               -DBUILD_CONFIG=mysql_release \
+               -DCMAKE_INSTALL_PREFIX=/usr \
+               -DINSTALL_DOCDIR=share/mysql/docs \
+               -DINSTALL_DOCREADMEDIR=share/mysql \
+               -DINSTALL_INCLUDEDIR=include/mysql \
+               -DINSTALL_INFODIR=share/mysql/docs \
+               -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
+               -DINSTALL_MANDIR=share/man \
+               -DINSTALL_MYSQLSHAREDIR=share/mysql \
+               -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
+               -DINSTALL_PLUGINDIR=lib/mysql/plugin \
+               -DINSTALL_SBINDIR=sbin \
+               -DINSTALL_SCRIPTDIR=bin \
+               -DINSTALL_SQLBENCHDIR=lib/mysql \
+               -DINSTALL_SUPPORTFILESDIR=share/mysql \
+               -DMYSQL_DATADIR=/var/lib/mysql \
+               -DSYSCONFDIR=/etc/mysql \
+               -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
+               -DWITH_SSL=bundled \
+               -DWITH_ZLIB=system \
+               -DWITH_EXTRA_CHARSETS=all \
+               -DWITH_INNODB_MEMCACHED=1 \
+               -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
+               -DINSTALL_LAYOUT=DEB
+
+       cat CMakeCache.txt
+       touch $@
+
+override_dh_auto_build:
+       @echo "RULES.$@"
+       $(MAKE) -j8 VERBOSE=1
+       touch $@
+
+override_dh_auto_test:
+       @echo "RULES.$@"
+       echo "No tests run because test 9: pfs_connect_attr is failing unreasonably"
+       touch $@
+
+override_dh_auto_install:
+
+       @echo "RULES.$@"
+       # complete install first
+       $(MAKE) install DESTDIR=debian/tmp
+       # remove all redundant files and links
+       rm debian/tmp/usr/lib/*/*_r*
+       rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
+       rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
+       rm debian/tmp/usr/lib/mysql-test/Makefile
+       # add missing man pages
+       install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+       # add MySQL Server configuration file my.cnf to mysql-common package
+       install -g root -o root -m 0644 -D debian/extra/my.cnf debian/tmp/etc/mysql/my.cnf
+       # add MySQL Server debug binary and library to package
+       install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+       install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       # add debug plugin libraries to package
+       install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
+       for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
+       install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+       install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
+       # add apparmor profile
+       install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld
+       # add directory for legal docs
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-bench
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-test
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-source
+       # add COPYING file to each package
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
+       # add README file to each package
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
+       touch $@
+
+override_dh_installinit:
+       @echo "RULES.$@"
+       dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld
+       dh_installinit --name=mysql -- defaults 19 21
+       touch $@
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/source/format b/mysql-wsrep-5.6/packaging/deb-utopic/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/source/include-binaries b/mysql-wsrep-5.6/packaging/deb-utopic/source/include-binaries
new file mode 100644 (file)
index 0000000..8ad88e4
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (c) 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
+# 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
+
+# obscured filename for mysqld-debug, libmysqld-debug.a and debug plugins
+debian/extra/server-binary
+debian/extra/embedded-server
+debian/extra/adt_null-plugin
+debian/extra/auth-plugin
+debian/extra/auth_socket-plugin
+debian/extra/auth_test_plugin-plugin
+debian/extra/innodb_engine-plugin
+debian/extra/libdaemon_example-plugin
+debian/extra/libmemcached-plugin
+debian/extra/mypluglib-plugin
+debian/extra/mysql_no_login-plugin
+debian/extra/qa_auth_client-plugin
+debian/extra/qa_auth_interface-plugin
+debian/extra/qa_auth_server-plugin
+debian/extra/semisync_master-plugin
+debian/extra/semisync_slave-plugin
+debian/extra/validate_password-plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-utopic/watch b/mysql-wsrep-5.6/packaging/deb-utopic/watch
new file mode 100644 (file)
index 0000000..c45c5e3
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://mysql.mirrors.pair.com/Downloads/MySQL-5.6/mysql-([\d\.]+).tar.gz
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/changelog b/mysql-wsrep-5.6/packaging/deb-vivid/changelog
new file mode 100644 (file)
index 0000000..6651421
--- /dev/null
@@ -0,0 +1,131 @@
+mysql-community (5.6.26-1ubuntu15.04) vivid; urgency=low
+
+  * new upstream release
+  * mysql-commercial-server now depends on perl, psmisc
+    mysql-commercial-test now depends on python, libmysqlclient-dev
+    (Closes: #20893836)
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Thu, 18 Jun 2015 16:34:10 +0530
+
+mysql-community (5.6.25-3ubuntu15.04) vivid; urgency=low
+
+  * new upstream release
+  * mysql-common now conflicts with
+    mysql-server-5.6, mysql-server-core-5.6
+    mysql-client-5.6, mysql-client-core-5.6
+  * mysql-*-server no more provides
+    mysql-server-5.6, mysql-server-core-5.6
+  * mysql-*-client no more provides
+    mysql-client-5.6, mysql-client-core-5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 15 Jun 2015 16:48:05 +0530
+
+mysql-community (5.6.24-3ubuntu15.04) vivid; urgency=low
+
+  * updated Standards-Version to 3.9.6 in d/control
+  * apparmor profile updated to allow read on all files under /etc/mysql
+  * added new conf files under d/extra/*.conf
+  * mysql_plugin moved from client to server pkg
+  * innochecksum moved from client to server pkg
+  * server pkg now replaces client pkg
+  * added systemd service profile and script
+  * new /etc/mysql/my.cnf management scheme added for Ubuntu 15.04
+    as discussed in Dec 2014 for native packaging source
+  * added dh "--with systemd" for enabling systemd
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 27 May 2015 11:35:35 +0530
+
+mysql-community (5.6.24-2ubuntu15.04) vivid; urgency=low
+
+  * new upstream release
+  * forked packaging source from utopic to vivid
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 15 Apr 2015 18:52:22 +0530
+
+mysql-community (5.6.24-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 16 Feb 2014 15:45:09 +0530
+
+mysql-community (5.6.23-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * mysql-community-server now recommends mysql-client
+  * mysql-community-server now depends on apparmor
+  * removed template install-test-db; not installed by default
+  * d/compat incremented to 9 from 8
+  * d/control updated to build depend on debhelper 9
+  * added d/*.lintian-overrides and d/source/lintian-overrides
+  * d/rules updated to reflect correct file permissions
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 31 Dec 2014 10:51:07 +0530
+
+mysql-community (5.6.22-2ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * mysql-common now replaces mysql-server-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 28 Nov 2014 15:18:07 +0530
+
+mysql-community (5.6.22-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * fixed d/*server.postinst to allow dropping test db without
+    setting root password
+  * init script will now run my_i_db if data dir is not present or empty
+  * updated init script to read app armor profile on startup
+  * forked packaging source from trusty and rebranded for utopic
+  * updated d/m-c-source.install to pack *.xz packaging source archive
+  * added more system resources to app armor profile
+  * dh_apparmor to now run before dh_installinit in d/rules
+  * libmysqlclient-dev now replaces mysql-client-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 05 Nov 2014 17:04:07 +0530
+
+mysql-community (5.6.21-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * updated d/rules to increment -j8 as make option
+  * updated d/source/include-binaries to add mysql_no_login plugin
+  * updated CMake option WITH_EXTRA_CHARSETS from complex to all
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 20 Aug 2014 19:12:30 +0530
+
+mysql-community (5.6.20-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * added fakeroot as build-dep in d/control
+  * added d/*.dirs for bench, dev and test pkg
+  * updated d/rules to make compilation verbose
+  * removed default CFLAGS, CXXFLAGS in d/rules
+  * added patch for testsuite search paths under d/patches
+  * modified cmake option for testsuite in d/rules
+  * updated patch d/fix-mysql_install_db.patch
+  * enabled two patches in d/patches/series
+  * removed extra permissions check in d/rules when fixed in source
+  * modified d/mysql-*-server.postinst to stop removing /usr/my.cnf
+  * modified d/*-test.* for updated location of testsuite
+  * updated d/{mysql-*-server.install,rules} to include debug plugins
+  * updated d/rules to remove storage engine cmake options
+  * modified data dir permission in d/*server.{pre,post}inst
+  * updated d/source/include-binaries to add debug plugins
+  * updated d/rules to rename debug plugins
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 02 Jul 2014 17:45:30 +0530
+
+mysql-community (5.6.19-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * d/rules updated to rid of files removed from source
+  * modified path for source tar in source pkg
+  * obscured actual filenames in d/source/include-binaries
+  * modified d/rules to handle obscured filenames
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 05 May 2014 15:45:10 +0530
+
+mysql-community (5.6.17-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Fri, 28 Feb 2014 18:06:30 +0530
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/compat b/mysql-wsrep-5.6/packaging/deb-vivid/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/control b/mysql-wsrep-5.6/packaging/deb-vivid/control
new file mode 100644 (file)
index 0000000..8bc5ecd
--- /dev/null
@@ -0,0 +1,192 @@
+Source: mysql-community
+Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Section: database
+Priority: optional
+Standards-Version: 3.9.6
+Homepage: http://www.mysql.com/
+Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-apparmor, dh-systemd (>= 1.5), lsb-release, cmake, fakeroot, libnuma-dev
+
+Package: mysql-server
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Server meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql server
+ package available in the repository.
+
+Package: mysql-community-server
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), adduser
+Depends: mysql-common (= ${binary:Version}), apparmor, perl, psmisc,
+ ${shlibs:Depends}, ${misc:Depends}
+Recommends: mysql-client (= ${binary:Version})
+Conflicts: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server
+Replaces: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server,
+ mysql-community-client
+Provides: virtual-mysql-server, virtual-mysql-server-core
+Description: MySQL Server
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package includes the MySQL server binary as well as related
+ utilities to run and administer a MySQL server.
+
+Package: mysql-client
+Architecture: any
+Depends: mysql-community-client (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Client meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql client
+ package available in the repository.
+
+Package: mysql-community-client
+Architecture: any
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Replaces: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Provides: virtual-mysql-client, virtual-mysql-client-core
+Description: MySQL Client
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the standard MySQL clients and
+ administration tools.
+
+Package: libmysqlclient18
+Architecture: any
+Section: libs
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL shared client libraries
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the shared libraries for MySQL client
+ applications.
+
+Package: mysql-common
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), ${misc:Pre-Depends}
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-server-5.6, mysql-server-core-5.6,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mariadb-server-5.5, percona-xtradb-cluster-common-5.5
+Replaces: mysql, mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mariadb-server-5.5, percona-xtradb-cluster-common-5.5
+Provides: mysql-common, mysql-common-5.6
+Description: MySQL Common
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains common files needed by MySQL client
+ library, MySQL database server, and MySQL embedded server.
+
+Package: libmysqlclient-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient18 (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Replaces: mysql-client-5.6, mysql-client-core-5.6
+Description: MySQL development headers
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the development header files necessary
+ to develop MySQL client applications.
+
+Package: libmysqld-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient-dev (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL embedded server library
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL server as an embedded library.
+
+Package: mysql-testsuite
+Architecture: any
+Depends: mysql-community-test (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Testsuite meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql test
+ package available in the repository.
+
+Package: mysql-community-test
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ mysql-community-client (= ${binary:Version}), python,
+ libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
+ mysql-testsuite-5.6, mysql-commercial-test
+Description: MySQL Test Run MTR - The MySQL testsuite
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL regression test suite for MySQL
+ database server.
+
+Package: mysql-community-bench
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-commercial-bench
+Description: MySQL Bench
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
+
+Package: mysql-community-source
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: MySQL source
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/copyright b/mysql-wsrep-5.6/packaging/deb-vivid/copyright
new file mode 100644 (file)
index 0000000..2c31f24
--- /dev/null
@@ -0,0 +1,41 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: MySQL Server 5.6
+Upstream-Contact: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Source: http://dev.mysql.com/
+
+Copyright: 2000, 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+License:
+ This is a release of MySQL, a dual-license SQL database server.
+ For the avoidance of doubt, this particular copy of the software
+ is released under the version 2 of the GNU General Public License.
+ MySQL is brought to you by Oracle.
+ .
+ MySQL FOSS License Exception
+ We want free and open source software applications under certain
+ licenses to be able to use specified GPL-licensed MySQL client
+ libraries despite the fact that not all such FOSS licenses are
+ compatible with version 2 of the GNU General Public License.
+ Therefore there are special exceptions to the terms and conditions
+ of the GPLv2 as applied to these client libraries, which are
+ identified and described in more detail in the FOSS License
+ Exception at
+ <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
+ .
+ This distribution may include materials developed by third
+ parties. For license and attribution notices for these
+ materials, please refer to the documentation that accompanies
+ this distribution (see the "Licenses for Third-Party Components"
+ appendix) or view the online documentation at
+ <http://dev.mysql.com/doc/>.
+ .
+ GPLv2 Disclaimer
+ For the avoidance of doubt, except that if any license choice
+ other than GPL or LGPL is available it will apply instead,
+ Oracle elects to use only the General Public License version 2
+ (GPLv2) at this time for any software where a choice of GPL
+ license versions is made available with the language indicating
+ that GPLv2 or any later version may be used, or where a choice
+ .
+ The full text of the GNU General Public License version 2 can
+ be found in the file
+ `/usr/share/mysql/doc/COPYING'.
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/extra/apparmor-profile b/mysql-wsrep-5.6/packaging/deb-vivid/extra/apparmor-profile
new file mode 100644 (file)
index 0000000..5cae3bf
--- /dev/null
@@ -0,0 +1,47 @@
+# vim:syntax=apparmor
+# Last Modified: Fri Feb 28 18:06:30 2014
+#include <tunables/global>
+
+/usr/sbin/mysqld {
+  #include <abstractions/base>
+  #include <abstractions/nameservice>
+  #include <abstractions/user-tmp>
+
+# Allow system resource access
+  /sys/devices/system/cpu/ r,
+  capability sys_resource,
+  capability dac_override,
+  capability setuid,
+  capability setgid,
+
+# Allow config access
+  /etc/mysql/** r,
+
+# Allow pid and socket file access
+  /run/mysqld/mysqld.pid rw,
+  /run/mysqld/mysqld.sock rw,
+
+# Allow read/ write to /tmp
+  /tmp/ r,
+  /tmp/* rw,
+
+# Allow execution of server binary
+  /usr/sbin/mysqld mr,
+  /usr/sbin/mysqld-debug mr,
+
+# Allow plugin access
+  /usr/lib/mysql/plugin/ r,
+  /usr/lib/mysql/plugin/*.so* mr,
+
+# Allow error msg and charset access
+  /usr/share/mysql/ r,
+  /usr/share/mysql/** r,
+
+# Allow data dir access
+  /var/lib/mysql/ r,
+  /var/lib/mysql/** rwk,
+
+# Allow log file access
+  /var/log/mysql/ r,
+  /var/log/mysql/** rw,
+}
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/extra/my.cnf.fallback b/mysql-wsrep-5.6/packaging/deb-vivid/extra/my.cnf.fallback
new file mode 100644 (file)
index 0000000..a7525ca
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Commercial Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# * 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/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql-systemd-start b/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql-systemd-start
new file mode 100644 (file)
index 0000000..f4aa9c9
--- /dev/null
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+# Scripts to run by MySQL systemd service
+#
+# Needed argument: pre | post
+#
+# pre mode  :  try to perform sanity check for configuration, log, data
+# post mode :  ping server until answer is received
+
+pinger () {
+       while /bin/true ; do
+               sleep 1
+               mysqladmin ping >/dev/null 2>&1 && break
+       done
+}
+
+sanity () {
+       MYSQLRUN=/var/run/mysqld
+       MYSQLDATA=/var/lib/mysql
+       MYSQLLOG=/var/log/mysql
+
+       if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+       then
+               mkdir ${MYSQLDATA}
+               chown mysql:mysql ${MYSQLDATA}
+               chmod 750 ${MYSQLDATA}
+       fi
+
+       if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+       then
+               mkdir ${MYSQLDATA}/mysql
+               chown mysql:mysql ${MYSQLDATA}/mysql
+               chmod 750 ${MYSQLDATA}/mysql
+       fi
+
+       if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+       then
+               mysql_install_db --user=mysql > /dev/null
+       fi
+
+       if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+       then
+               mkdir ${MYSQLLOG}
+               chown mysql:adm ${MYSQLLOG}
+               chmod 750 ${MYSQLLOG}
+               touch ${MYSQLLOG}/error.log
+               chmod 640 ${MYSQLLOG}/error.log
+               chown mysql:adm ${MYSQLLOG}/error.log
+       fi
+
+       if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+       then
+               mkdir ${MYSQLRUN}
+               chown mysql:mysql ${MYSQLRUN}
+               chmod 755 ${MYSQLRUN}
+       fi
+
+       /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+       if [ ! -r /etc/mysql/my.cnf ]; then
+               echo "MySQL configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives."
+               exit 1
+       fi
+}
+
+case $1 in
+       "pre")  sanity ;;
+       "post") pinger ;;
+esac
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql.cnf b/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql.cnf
new file mode 100644 (file)
index 0000000..8fa0138
--- /dev/null
@@ -0,0 +1,26 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Community Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# * 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/
+!includedir /etc/mysql/mysql.conf.d/
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql.conf.cnf b/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql.conf.cnf
new file mode 100644 (file)
index 0000000..a201d72
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Commercial Client configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[mysql]
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql_embedded.1 b/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysql_embedded.1
new file mode 100644 (file)
index 0000000..735c4e0
--- /dev/null
@@ -0,0 +1 @@
+.so man1/mysql.1
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysqld.cnf b/mysql-wsrep-5.6/packaging/deb-vivid/extra/mysqld.cnf
new file mode 100644 (file)
index 0000000..95ae6d8
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Commercial Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[mysqld_safe]
+pid-file = /var/run/mysqld/mysqld.pid
+socket   = /var/run/mysqld/mysqld.sock
+nice   = 0
+
+[mysqld]
+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
+explicit_defaults_for_timestamp
+
+# 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
+
+log-error    = /var/log/mysql/error.log
+
+# Recommended in standard MySQL setup
+sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
+
+# Disabling symbolic-links is recommended to prevent assorted security risks
+symbolic-links=0
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient-dev.install b/mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient-dev.install
new file mode 100644 (file)
index 0000000..e7e98c1
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (c) 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
+# 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
+
+usr/include/mysql/*.h
+usr/include/mysql/mysql/*.h
+usr/include/mysql/mysql/*.h.pp
+usr/include/mysql/mysql/psi/*.h
+usr/lib/*/libmysqlclient.a
+usr/lib/*/libmysqlclient.so
+usr/lib/*/libmysqlservices.a
+usr/bin/mysql_config
+usr/bin/mysql_config_editor
+usr/share/man/man1/mysql_config.1
+usr/share/man/man1/mysql_config_editor.1
+# legal
+usr/share/doc/libmysqlclient-dev/COPYING
+usr/share/doc/libmysqlclient-dev/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..09960eb
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/LICENSE.mysql
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/COPYING.gz
+libmysqlclient-dev: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient-dev: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient18.install b/mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient18.install
new file mode 100644 (file)
index 0000000..fe6aa56
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/*/libmysqlclient.so.*
+# legal
+usr/share/doc/libmysqlclient18/COPYING
+usr/share/doc/libmysqlclient18/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient18.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/libmysqlclient18.lintian-overrides
new file mode 100644 (file)
index 0000000..1f26511
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/LICENSE.mysql
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/COPYING.gz
+libmysqlclient18: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient18: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/libmysqld-dev.install b/mysql-wsrep-5.6/packaging/deb-vivid/libmysqld-dev.install
new file mode 100644 (file)
index 0000000..923f826
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/*/libmysqld.a
+usr/lib/*/libmysqld-debug.a
+# legal
+usr/share/doc/libmysqld-dev/COPYING
+usr/share/doc/libmysqld-dev/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/libmysqld-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/libmysqld-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..35caaec
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/COPYING.gz
+libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-client.install b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-client.install
new file mode 100644 (file)
index 0000000..13b877e
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-client/COPYING
+usr/share/doc/mysql-client/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5c4891c
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
+mysql-client: extra-license-file usr/share/doc/mysql-client/COPYING.gz
+mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.dirs b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.dirs
new file mode 100644 (file)
index 0000000..69265ef
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/conf.d
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.install b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.install
new file mode 100644 (file)
index 0000000..8e84e73
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright (c) 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
+# 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
+
+# configuration file and script
+debian/extra/my.cnf.fallback etc/mysql/
+debian/extra/mysql.conf.cnf  etc/mysql/conf.d/mysql.cnf
+
+usr/share/aclocal/mysql.m4
+usr/share/mysql/docs/INFO_SRC
+usr/share/mysql/docs/INFO_BIN
+usr/share/mysql/docs/ChangeLog
+# localized error msgs
+usr/share/mysql/*/errmsg.sys
+usr/share/mysql/errmsg-utf8.txt
+# charsets
+usr/share/mysql/charsets/*.xml
+usr/share/mysql/charsets/README
+# legal
+usr/share/doc/mysql-common/COPYING
+usr/share/doc/mysql-common/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.lintian-overrides
new file mode 100644 (file)
index 0000000..70ddcdf
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
+mysql-common: extra-license-file usr/share/doc/mysql-common/COPYING.gz
+mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.postinst b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.postinst
new file mode 100644 (file)
index 0000000..f53bfaa
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Copyright (c) 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
+# 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
+
+set -e
+
+if [ "$1" = "configure" ]; then
+    # Low priority fallback for client use when no server is installed.
+    update-alternatives --install /etc/mysql/my.cnf my.cnf /etc/mysql/my.cnf.fallback 100
+fi
+
+#DEBHELPER#
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.postrm b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-common.postrm
new file mode 100644 (file)
index 0000000..4698a98
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+set -e
+
+if [ "$1" = "purge" ]; then
+       rmdir /etc/mysql 2>/dev/null || true
+       update-alternatives --remove-all my.cnf
+fi
+
+#DEBHELPER#
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-bench.install b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-bench.install
new file mode 100644 (file)
index 0000000..065124b
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql/sql-bench/*
+# legal
+usr/share/doc/mysql-community-bench/COPYING
+usr/share/doc/mysql-community-bench/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-bench.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-bench.lintian-overrides
new file mode 100644 (file)
index 0000000..04df14e
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/LICENSE.mysql
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/COPYING.gz
+mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-client.install b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-client.install
new file mode 100644 (file)
index 0000000..aa4e612
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright (c) 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
+# 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
+
+# binaries
+usr/bin/myisam_ftdump
+usr/bin/mysql
+usr/bin/mysql_embedded
+usr/bin/mysqlaccess
+usr/bin/mysqlaccess.conf
+usr/bin/mysqladmin
+usr/bin/mysqlbug
+usr/bin/mysqlcheck
+usr/bin/mysql_client_test
+usr/bin/mysql_client_test_embedded
+usr/bin/mysqldump
+usr/bin/mysqldumpslow
+usr/bin/mysql_find_rows
+usr/bin/mysql_fix_extensions
+usr/bin/mysqlimport
+usr/bin/mysqlshow
+usr/bin/mysqlslap
+usr/bin/mysql_waitpid
+# man pages
+usr/share/man/man1/myisam_ftdump.1
+usr/share/man/man1/mysql.1
+usr/share/man/man1/mysql_embedded.1
+usr/share/man/man1/mysqlaccess.1
+usr/share/man/man1/mysqladmin.1
+usr/share/man/man1/mysqlbug.1
+usr/share/man/man1/mysqlcheck.1
+usr/share/man/man1/mysql_client_test.1
+usr/share/man/man1/mysql_client_test_embedded.1
+usr/share/man/man1/mysqldump.1
+usr/share/man/man1/mysqldumpslow.1
+usr/share/man/man1/mysql_find_rows.1
+usr/share/man/man1/mysql_fix_extensions.1
+usr/share/man/man1/mysqlimport.1
+usr/share/man/man1/mysqlman.1
+usr/share/man/man1/mysqlshow.1
+usr/share/man/man1/mysqlslap.1
+usr/share/man/man1/mysql_waitpid.1
+# legal
+usr/share/doc/mysql-community-client/COPYING
+usr/share/doc/mysql-community-client/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5892935
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-client/LICENSE.mysql
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-clienti/COPYING.gz
+mysql-community-client: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-client: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.config b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.config
new file mode 100755 (executable)
index 0000000..ceb3373
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+. /usr/share/debconf/confmodule
+
+if [ "$1" = "configure" ] && [ -z "$2" ];
+then
+
+       set -e
+
+       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-commercial-server
+       INSTALLED_PKG=none
+       MYSQLDATA=/var/lib/mysql
+
+       IFS_BACKUP=${IFS}
+       IFS=":"
+       for PKG in ${PKG_LIST};
+       do
+               STATUS=$(dpkg -s ${PKG} 2> /dev/null | grep Status: | cut -d' ' -f4)
+               if [ "${STATUS}" = "installed" ];
+               then
+                       INSTALLED_PKG=${PKG}
+                       break
+               fi
+       done
+       IFS=${IFS_BACKUP}
+
+       if [ "${INSTALLED_PKG}" = "none" ];
+       then
+               if [ -d ${MYSQLDATA} -o -L ${MYSQLDATA} ];
+               then
+                       db_input high mysql-community-server/data-dir || true
+               else
+                       db_fset mysql-community-server/data-dir seen true
+               fi
+
+               while :; do
+                       PASSWD=""
+                       db_input high mysql-community-server/root-pass || true
+                       db_go
+
+                       db_get mysql-community-server/root-pass
+                       if [ -z "${RET}" ];
+                       then
+                               db_fset mysql-community-server/root-pass seen true
+                               db_fset mysql-community-server/re-root-pass seen true
+                               break
+                       fi
+                       PASSWD="${RET}"
+
+                       db_input high mysql-community-server/re-root-pass || true
+                       db_go
+
+                       db_get mysql-community-server/re-root-pass
+                       if [ "${RET}" == "${PASSWD}" ];
+                       then
+                               PASSWD=""
+                               break
+                       fi
+
+                       db_fset mysql-community-server/root-pass-mismatch seen false
+                       db_input critical mysql-community-server/root-pass-mismatch
+                       db_set mysql-community-server/root-pass ""
+                       db_set mysql-community-server/re-root-pass ""
+               done
+
+       else
+               db_fset mysql-community-server/data-dir seen true
+               db_fset mysql-community-server/root-pass seen true
+               db_fset mysql-community-server/re-root-pass seen true
+       fi
+
+       set +e
+fi
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.dirs b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.dirs
new file mode 100644 (file)
index 0000000..95711c4
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/mysql.conf.d
+etc/init.d
+usr/lib/mysql
+usr/lib/mysql/plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.install b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.install
new file mode 100644 (file)
index 0000000..229a816
--- /dev/null
@@ -0,0 +1,94 @@
+# Copyright (c) 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
+# 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
+
+# binaries
+usr/bin/innochecksum
+usr/bin/msql2mysql
+usr/bin/myisamchk
+usr/bin/myisamlog
+usr/bin/myisampack
+usr/bin/my_print_defaults
+usr/bin/mysqlbinlog
+usr/bin/mysql_convert_table_format
+usr/bin/mysqld_multi
+usr/bin/mysqld_safe
+usr/bin/mysqlhotcopy
+usr/bin/mysql_install_db
+usr/bin/mysql_plugin
+usr/bin/mysql_secure_installation
+usr/bin/mysql_setpermission
+usr/bin/mysqltest
+usr/bin/mysqltest_embedded
+usr/bin/mysql_tzinfo_to_sql
+usr/bin/mysql_upgrade
+usr/bin/mysql_zap
+usr/bin/perror
+usr/bin/replace
+usr/bin/resolveip
+usr/bin/resolve_stack_dump
+usr/sbin/mysqld
+# debug binary
+usr/sbin/mysqld-debug
+# man pages
+usr/share/man/man1/innochecksum.1
+usr/share/man/man1/comp_err.1
+usr/share/man/man1/msql2mysql.1
+usr/share/man/man1/myisamchk.1
+usr/share/man/man1/myisamlog.1
+usr/share/man/man1/myisampack.1
+usr/share/man/man1/my_print_defaults.1
+usr/share/man/man1/mysqlbinlog.1
+usr/share/man/man1/mysql_convert_table_format.1
+usr/share/man/man1/mysqld_multi.1
+usr/share/man/man1/mysqld_safe.1
+usr/share/man/man1/mysqlhotcopy.1
+usr/share/man/man1/mysql_install_db.1
+usr/share/man/man1/mysql_plugin.1
+usr/share/man/man1/mysql_secure_installation.1
+usr/share/man/man1/mysql.server.1
+usr/share/man/man1/mysql_setpermission.1
+usr/share/man/man1/mysql-stress-test.pl.1
+usr/share/man/man1/mysqltest.1
+usr/share/man/man1/mysqltest_embedded.1
+usr/share/man/man1/mysql_tzinfo_to_sql.1
+usr/share/man/man1/mysql_upgrade.1
+usr/share/man/man1/mysql_zap.1
+usr/share/man/man1/perror.1
+usr/share/man/man1/replace.1
+usr/share/man/man1/resolveip.1
+usr/share/man/man1/resolve_stack_dump.1
+usr/share/man/man8/mysqld.8
+# confguration files
+debian/extra/mysql.cnf  etc/mysql/
+debian/extra/mysqld.cnf etc/mysql/mysql.conf.d/
+# app armor profile
+etc/apparmor.d/usr.sbin.mysqld
+# SQL files
+usr/share/mysql/*.sql
+# plugins
+usr/lib/mysql/plugin/*.so
+usr/lib/mysql/plugin/debug/*.so
+usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/debug/daemon_example.ini
+# support files
+usr/share/mysql/mysqld_multi.server
+usr/share/mysql/magic
+usr/share/mysql/mysql-log-rotate
+usr/share/mysql/mysql-systemd-start
+usr/share/mysql/my-default.cnf
+usr/share/mysql/dictionary.txt
+# legal
+usr/share/doc/mysql-community-server/COPYING
+usr/share/doc/mysql-community-server/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.lintian-overrides
new file mode 100644 (file)
index 0000000..08b3865
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/LICENSE.mysql
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/COPYING.gz
+mysql-community-server: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-server: embedded-library
+# Since we ship debug plugins so this error is overridden
+mysql-community-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.mysql.init b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.mysql.init
new file mode 100755 (executable)
index 0000000..67a0193
--- /dev/null
@@ -0,0 +1,192 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides:          mysql
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Should-Start:      $network $time
+# Should-Stop:       $network $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start/ Stop MySQL Community Server daemon
+# Description:       This service script facilitates startup and shutdown of
+#                    mysqld daemon throught its wrapper script mysqld_safe
+### END INIT INFO
+#
+
+# Copyright (c) 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
+# 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
+
+. /lib/lsb/init-functions
+
+cd /
+umask 077
+
+MYSQLDATA=/var/lib/mysql
+VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
+
+get_mysql_option() {
+       RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
+       if [ -z "$RESULT" ];
+       then
+               RESULT="$3"
+       fi
+       echo $RESULT
+}
+
+get_running () {
+       PIDFILE=$(get_mysql_option mysqld_safe pid-file "")
+       if [ -z "$PIDFILE" ];
+       then
+               PIDFILE=$(get_mysql_option mysqld pid-file "$MYSQLDATA/$(hostname).pid")
+       fi
+       if [ -e "$PIDFILE" ] && [ -d "/proc/$(cat "$PIDFILE")" ];
+       then
+               echo 1
+       else
+               echo 0
+       fi
+}
+
+server_stop () {
+       RUNNING=$(get_running)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${RUNNING}" -eq 0 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               RUNNING=$(get_running)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+  'start')
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
+       then
+               log_action_msg "A MySQL Server is already started"
+       else
+               MYSQLRUN=/var/run/mysqld
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+               fi
+
+               if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+               then
+                       mysql_install_db --user=mysql > /dev/null
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
+               if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+               then
+                       mkdir ${MYSQLRUN}
+                       chown mysql:mysql ${MYSQLRUN}
+                       chmod 755 ${MYSQLRUN}
+               fi
+
+               /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+               su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
+               for i in 1 2 3 4 5 6;
+               do
+                       sleep 1
+                       echo -n .
+               done
+               echo
+               RUNNING=$(get_running)
+               if [ "${RUNNING}" -eq 1 ];
+               then
+                       log_action_msg "MySQL Community Server ${VERSION} is started"
+               else
+                       log_action_msg "MySQL Community Server ${VERSION} did not start. Please check logs for more details."
+               fi
+       fi
+       ;;
+
+  'stop')
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
+       then
+               killall -15 mysqld
+               server_stop
+               if [ "$?" -eq 0 ];
+               then
+                       log_action_msg "MySQL Community Server ${VERSION} is stopped"
+               else
+                       log_action_msg "Attempt to shutdown MySQL Community Server ${VERSION} timed out"
+               fi
+       else
+               log_action_msg "MySQL Community Server ${VERSION} is already stopped"
+       fi
+       ;;
+
+  'restart'|'reload'|'force-reload')
+       log_action_msg "Stopping MySQL Community Server ${VERSION}"
+       $0 stop
+       log_action_msg "Re-starting MySQL Community Server ${VERSION}"
+       $0 start
+       ;;
+
+  'status')
+       RUNNING=$(get_running)
+       if [ ${RUNNING} -eq 1 ];
+       then
+               log_action_msg "MySQL Community Server ${VERSION} is running"
+       else
+               log_action_msg "MySQL Community Server ${VERSION} is not running"
+               exit 3
+       fi
+       ;;
+
+  *)
+       echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
+       exit 1
+       ;;
+esac
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.mysql.service b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.mysql.service
new file mode 100644 (file)
index 0000000..b3e3305
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (c) 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
+# 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
+
+# MySQL systemd service file
+
+[Unit]
+Description=MySQL Community Server
+After=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+User=mysql
+Group=mysql
+PermissionsStartOnly=true
+ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
+ExecStart=/usr/bin/mysqld_safe
+ExecStartPost=/usr/share/mysql/mysql-systemd-start post
+TimeoutSec=600
+Restart=on-failure
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.postinst b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.postinst
new file mode 100755 (executable)
index 0000000..ad164e5
--- /dev/null
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+. /usr/share/debconf/confmodule
+
+take_upstart_job_backup () {
+       if [ -e "/etc/init/mysql.conf" ] && [ -d "/var/lib/mysql" ];
+       then
+               mv /etc/init/mysql.conf /var/lib/mysql/.mysql.conf.backup
+       fi
+}
+
+case "$1" in
+       configure)
+
+       if [ -z "$2" ];
+       then
+               set -e
+
+               update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mysql.cnf" 200
+
+               MYSQLDATA=/var/lib/mysql
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+                       if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+                       then
+                               mysql_install_db --user=mysql > /dev/null
+                       fi
+               fi
+
+               db_get mysql-community-server/root-pass && PASSWD=${RET}
+               if [ ! -z "${PASSWD}" ];
+               then
+                       db_set mysql-community-server/root-pass ""
+                       db_set mysql-community-server/re-root-pass ""
+                       PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
+               else
+                       PASSWD=""
+               fi
+
+               SQL=`mktemp`
+               if [ -f "${SQL}" ];
+               then
+                       chmod 700 ${SQL}
+                       cat << EOF > ${SQL}
+USE mysql;
+${PASSWD}
+DELETE FROM user WHERE user='';
+FLUSH PRIVILEGES;
+EOF
+                       mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
+                       PASSWD=""
+                       rm -f ${SQL}
+               fi
+
+               set +e
+
+       fi
+
+       ;;
+
+       abort-upgrade|abort-remove|abort-configure)
+
+       ;;
+
+       *)
+       exit 1
+       ;;
+esac
+
+db_stop
+
+take_upstart_job_backup
+
+#DEBHELPER#
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.postrm b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.postrm
new file mode 100755 (executable)
index 0000000..5d4a7b4
--- /dev/null
@@ -0,0 +1,155 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ];
+then
+. /usr/share/debconf/confmodule
+fi
+
+place_upstart_job_back () {
+       if [ -e "/var/lib/mysql/.mysql.conf.backup" ];
+       then
+               mv /var/lib/mysql/.mysql.conf.backup /etc/init/mysql.conf
+       fi
+}
+
+get_pcount () {
+       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+       echo "${PSCOUNT}"
+}
+
+server_stop () {
+       PSCOUNT=$(get_pcount)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${PSCOUNT}" -eq 1 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               PSCOUNT=$(get_pcount)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+       remove)
+
+       set -e
+
+       place_upstart_job_back
+       update-alternatives --remove my.cnf "/etc/mysql/mysql.cnf"
+
+       set +e
+
+       ;;
+
+       purge)
+
+       set -e
+
+       place_upstart_job_back
+
+       MYSQLDATA=/var/lib/mysql
+       MYSQLLOG=/var/log/mysql
+       MYSQLRUN=/var/run/mysqld
+
+       server_stop
+
+       db_input high mysql-community-server/remove-data-dir || true
+       db_go
+       db_get mysql-community-server/remove-data-dir && RMDATADIR=${RET}
+       if [ "${RMDATADIR}" = "true" ];
+       then
+               if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+               then
+                       rm -rf ${MYSQLRUN}
+               fi
+
+               if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+               then
+                       rm -rf ${MYSQLLOG}
+               fi
+
+               if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+               then
+                       rm -rf ${MYSQLDATA}
+               fi
+
+               if getent passwd mysql >/dev/null;
+               then
+                       userdel mysql
+               fi
+       fi
+
+       set +e
+       ;;
+
+       abort-install)
+
+       set -e
+
+       place_upstart_job_back
+
+       if [ -x "/etc/init.d/mysql" ];
+       then
+               invoke-rc.d mysql start || exit $?
+       else
+               if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+               then
+                       rm -rf ${MYSQLRUN}
+               fi
+
+               if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+               then
+                       rm -rf ${MYSQLLOG}
+               fi
+
+               if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+               then
+                       rm -rf ${MYSQLDATA}
+               fi
+
+               if getent passwd mysql >/dev/null;
+               then
+                       userdel mysql
+               fi
+       fi
+
+       set +e
+       ;;
+
+       upgrade|abort-upgrade)
+
+       ;;
+
+       *)
+       exit 1
+       ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.preinst b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.preinst
new file mode 100755 (executable)
index 0000000..c769885
--- /dev/null
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+get_pcount () {
+       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+       echo "${PSCOUNT}"
+}
+
+server_stop () {
+       PSCOUNT=$(get_pcount)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${PSCOUNT}" -eq 1 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               PSCOUNT=$(get_pcount)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+       install)
+
+       if [ -z "$2" ];
+       then
+
+               set -e
+
+               if [ -x "/etc/init.d/mysql" ];
+               then
+                       invoke-rc.d mysql stop || exit $?
+                       server_stop
+               fi
+
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+               MYSQLRUN=/var/run/mysqld
+
+               if ! getent group mysql >/dev/null;
+               then
+                       addgroup --system mysql >/dev/null
+               fi
+
+               if ! getent passwd mysql >/dev/null;
+               then
+                       adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
+               fi
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
+               if [ ! -d ${MYSQLRUN} -a ! -L ${MYSQLRUN} ];
+               then
+                       mkdir ${MYSQLRUN}
+                       chown mysql:mysql ${MYSQLRUN}
+                       chmod 755 ${MYSQLRUN}
+               fi
+
+               set +e
+
+       fi
+
+       ;;
+
+       upgrade)
+
+       set -e
+
+       #DEBHELPER#
+       server_stop
+
+       set +e
+
+       ;;
+
+       abort-upgrade)
+
+       ;;
+
+       *)
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.prerm b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.prerm
new file mode 100755 (executable)
index 0000000..1386b5d
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+set -e
+
+#DEBHELPER#
+
+set +e
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.templates b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-server.templates
new file mode 100644 (file)
index 0000000..7b7e0ac
--- /dev/null
@@ -0,0 +1,33 @@
+Template: mysql-community-server/root-pass
+Type: password
+Description: Enter root password:
+ Please provide a strong password that will be set for the root account of your MySQL database.
+ Leave it blank if you do not wish to set or change the root password at this time.
+
+Template: mysql-community-server/re-root-pass
+Type: password
+Description: Re-enter root password:
+ Now that you have selected a password for the root account, please confirm by typing it again. Do not share the password with anyone.
+
+Template: mysql-community-server/root-pass-mismatch
+Type: error
+Description: The two passwords did not match
+ Please try again. Make sure you type the exact same password twice.
+
+Template: mysql-community-server/remove-data-dir
+Type: boolean
+Default: false
+Description: Remove data directory at /var/lib/mysql ?
+ This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ It is highly recommended to take data backup before removing the data directory.
+
+Template: mysql-community-server/data-dir
+Type: note
+Description: Data directory found when no MySQL server package is installed
+ A data directory '/var/lib/mysql' is present on this system when no MySQL server 
+ package is currently installed on the system. The directory may be under control of
+ server package received from third-party vendors. It may also be an unclaimed data
+ directory from previous removal of mysql packages.
+ .
+ It is highly recommended to take data backup. If you have not done so, now would be
+ the time to take backup in another shell. Once completed, press 'Ok' to continue.
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-source.install b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-source.install
new file mode 100644 (file)
index 0000000..46a0f12
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+../*.dsc    usr/src/mysql/
+../*.tar.gz usr/src/mysql/
+../*.tar.xz usr/src/mysql/
+# legal
+usr/share/doc/mysql-community-source/COPYING
+usr/share/doc/mysql-community-source/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-source.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-source.lintian-overrides
new file mode 100644 (file)
index 0000000..9ca84e9
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/LICENSE.mysql
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/COPYING.gz
+mysql-community-source: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-test.install b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-test.install
new file mode 100644 (file)
index 0000000..e70086b
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql-test/*
+usr/share/man/man1/mysql-test-run.pl.1
+# legal
+usr/share/doc/mysql-community-test/COPYING
+usr/share/doc/mysql-community-test/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-test.links b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-test.links
new file mode 100644 (file)
index 0000000..bf66c98
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mysql-test-run
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mtr
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-test.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-community-test.lintian-overrides
new file mode 100644 (file)
index 0000000..ff273bb
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/LICENSE.mysql
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/COPYING.gz
+mysql-community-test: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-server.install b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-server.install
new file mode 100644 (file)
index 0000000..e3aa8de
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-server/COPYING
+usr/share/doc/mysql-server/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-server.lintian-overrides
new file mode 100644 (file)
index 0000000..4877097
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-server: extra-license-file usr/share/doc/mysql-server/LICENSE.mysql
+mysql-server: extra-license-file usr/share/doc/mysql-server/COPYING.gz
+mysql-server: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-testsuite.install b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-testsuite.install
new file mode 100644 (file)
index 0000000..dfc1733
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-testsuite/COPYING
+usr/share/doc/mysql-testsuite/README
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/mysql-testsuite.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-vivid/mysql-testsuite.lintian-overrides
new file mode 100644 (file)
index 0000000..37488fe
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/LICENSE.mysql
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/COPYING.gz
+mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/patches/fix-man-page-links.patch b/mysql-wsrep-5.6/packaging/deb-vivid/patches/fix-man-page-links.patch
new file mode 100644 (file)
index 0000000..004ccdf
--- /dev/null
@@ -0,0 +1,14 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Fix path in man page link.
+Bug: http://bugs.mysql.com/bug.php?id=70952
+
+--- a/man/mysql_client_test_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysql_client_test_embedded.1 2013-11-14 19:29:56.768315219 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysql_client_test.1
++.so man1/mysql_client_test.1
+--- a/man/mysqltest_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysqltest_embedded.1 2013-11-14 19:31:19.079280675 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysqltest.1
++.so man1/mysqltest.1
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/patches/fix-mtr-search-paths.patch b/mysql-wsrep-5.6/packaging/deb-vivid/patches/fix-mtr-search-paths.patch
new file mode 100644 (file)
index 0000000..8a27a09
--- /dev/null
@@ -0,0 +1,13 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Adding extra search path for testsuite.
+
+--- a/mysql-test/lib/mtr_cases.pm      2014-02-24 13:14:37 +0530
++++ b/mysql-test/lib/mtr_cases.pm      2014-07-02 11:46:24 +0530
+@@ -288,6 +288,7 @@
+     {
+       $suitedir= my_find_dir($::basedir,
+                            ["share/mysql-test/suite",
++                            "lib/mysql-test/suite",
+                             "mysql-test/suite",
+                             "internal/mysql-test/suite",
+                             "mysql-test",
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/patches/fix-mysql_install_db.patch b/mysql-wsrep-5.6/packaging/deb-vivid/patches/fix-mysql_install_db.patch
new file mode 100644 (file)
index 0000000..41311b2
--- /dev/null
@@ -0,0 +1,43 @@
+From: Terje Røsten <terje.rosten@oracle.com>
+Description: Maintains the pending --skip-my-cnf option in mainline
+Bug: <TODO>
+
+diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
+index 440a977..7d068fc 100644
+--- a/scripts/mysql_install_db.pl.in
++++ b/scripts/mysql_install_db.pl.in
+@@ -113,6 +113,7 @@ EOF2
+   print <<EOF3;
+   --rpm                For internal use.  This option is used by RPM files
+                        during the MySQL installation process.
++                       Implies --keep-my-cnf option.
+   --skip-name-resolve  Use IP addresses rather than hostnames when creating
+                        grant table entries.  This option can be useful if
+                        your DNS does not work.
+@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} )
+ {
+   error($opt,"Specify either --basedir or --srcdir, not both");
+ }
+-if ( $opt->{'keep-my-cnf'} )
++if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
+ {
+   $keep_my_cnf = 1;
+ }
+@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
+ }
+
+ # ----------------------------------------------------------------------
+-# Create database directories mysql & test
++# Create database directory mysql
+ # ----------------------------------------------------------------------
+
+ # FIXME The shell variant uses "mkdir -p":
+@@ -697,7 +698,7 @@ if ($opt_user)
+   }
+ }
+
+-foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
++foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql")
+ {
+   mkdir($dir, 0700) unless -d $dir;
+   if ($opt_user and -w "/")
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/patches/series b/mysql-wsrep-5.6/packaging/deb-vivid/patches/series
new file mode 100644 (file)
index 0000000..e3b20d6
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+#fix-man-page-links.patch
+fix-mysql_install_db.patch
+fix-mtr-search-paths.patch
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/rules b/mysql-wsrep-5.6/packaging/deb-vivid/rules
new file mode 100755 (executable)
index 0000000..b9cd814
--- /dev/null
@@ -0,0 +1,137 @@
+#!/usr/bin/make -f
+
+# Copyright (c) 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
+# 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
+
+%:
+       dh $@
+
+export DH_VERBOSE=1
+export CFLAGS=
+export CXXFLAGS=
+
+override_dh_auto_configure:
+       @echo "RULES.$@"
+       cmake . \
+               -DBUILD_CONFIG=mysql_release \
+               -DCMAKE_INSTALL_PREFIX=/usr \
+               -DINSTALL_DOCDIR=share/mysql/docs \
+               -DINSTALL_DOCREADMEDIR=share/mysql \
+               -DINSTALL_INCLUDEDIR=include/mysql \
+               -DINSTALL_INFODIR=share/mysql/docs \
+               -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
+               -DINSTALL_MANDIR=share/man \
+               -DINSTALL_MYSQLSHAREDIR=share/mysql \
+               -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
+               -DINSTALL_PLUGINDIR=lib/mysql/plugin \
+               -DINSTALL_SBINDIR=sbin \
+               -DINSTALL_SCRIPTDIR=bin \
+               -DINSTALL_SQLBENCHDIR=lib/mysql \
+               -DINSTALL_SUPPORTFILESDIR=share/mysql \
+               -DMYSQL_DATADIR=/var/lib/mysql \
+               -DSYSCONFDIR=/etc/mysql \
+               -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
+               -DWITH_SSL=bundled \
+               -DWITH_ZLIB=system \
+               -DWITH_EXTRA_CHARSETS=all \
+               -DWITH_INNODB_MEMCACHED=1 \
+               -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
+               -DINSTALL_LAYOUT=DEB
+
+       cat CMakeCache.txt
+       touch $@
+
+override_dh_auto_build:
+       @echo "RULES.$@"
+       $(MAKE) -j8 VERBOSE=1
+       touch $@
+
+override_dh_auto_test:
+       @echo "RULES.$@"
+       echo "No tests run because test 9: pfs_connect_attr is failing unreasonably"
+       touch $@
+
+override_dh_auto_install:
+
+       @echo "RULES.$@"
+       # complete install first
+       $(MAKE) install DESTDIR=debian/tmp
+       # remove all redundant files and links
+       rm debian/tmp/usr/lib/*/*_r*
+       rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
+       rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
+       rm debian/tmp/usr/lib/mysql-test/Makefile
+       # add missing man pages
+       install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+       # add MySQL Server debug binary and library to package
+       install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+       install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       # add debug plugin libraries to package
+       install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
+       for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
+       install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+       install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
+       # add apparmor profile
+       install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld
+       # add systemd script
+       install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/
+       # add directory for legal docs
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-bench
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-test
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-source
+       # add COPYING file to each package
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
+       # add README file to each package
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
+       touch $@
+
+override_dh_installinit:
+       @echo "RULES.$@"
+       dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld
+       dh_systemd_enable --name=mysql
+       dh_installinit --name=mysql -- defaults 19 21
+       dh_systemd_start --restart-after-upgrade
+       touch $@
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/source/format b/mysql-wsrep-5.6/packaging/deb-vivid/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/source/include-binaries b/mysql-wsrep-5.6/packaging/deb-vivid/source/include-binaries
new file mode 100644 (file)
index 0000000..8ad88e4
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (c) 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
+# 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
+
+# obscured filename for mysqld-debug, libmysqld-debug.a and debug plugins
+debian/extra/server-binary
+debian/extra/embedded-server
+debian/extra/adt_null-plugin
+debian/extra/auth-plugin
+debian/extra/auth_socket-plugin
+debian/extra/auth_test_plugin-plugin
+debian/extra/innodb_engine-plugin
+debian/extra/libdaemon_example-plugin
+debian/extra/libmemcached-plugin
+debian/extra/mypluglib-plugin
+debian/extra/mysql_no_login-plugin
+debian/extra/qa_auth_client-plugin
+debian/extra/qa_auth_interface-plugin
+debian/extra/qa_auth_server-plugin
+debian/extra/semisync_master-plugin
+debian/extra/semisync_slave-plugin
+debian/extra/validate_password-plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-vivid/watch b/mysql-wsrep-5.6/packaging/deb-vivid/watch
new file mode 100644 (file)
index 0000000..c45c5e3
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://mysql.mirrors.pair.com/Downloads/MySQL-5.6/mysql-([\d\.]+).tar.gz
index 36b9849e7c8e940d7de5e5c643e83cef83fb2697..87855edb89fbe20d5d925c63b579670e8b583901 100644 (file)
@@ -1,3 +1,48 @@
+mysql-community (5.6.25-1debian7) wheezy; urgency=low
+
+  * new upstream release
+  * mysql-community-server now depends on perl, psmisc
+    mysql-community-test now depends on python, libmysqlclient-dev
+    (Closes: #20561621)
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 25 Feb 2014 22:52:19 +0530
+
+mysql-community (5.6.24-1debian7) wheezy; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 16 Feb 2014 15:45:09 +0530
+
+mysql-community (5.6.23-1debian7) wheezy; urgency=low
+
+  * new upstream release
+  * mysql-community-server now recommends mysql-client
+  * removed template install-test-db; not installed by default
+  * d/compat incremented to 9 from 8
+  * d/control updated to build depend on debhelper 9
+  * added d/*.lintian-overrides and d/source/lintian-overrides
+  * d/rules updated to reflect correct file permissions
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 31 Dec 2014 10:51:07 +0530
+
+mysql-community (5.6.22-1debian7) wheezy; urgency=low
+
+  * new upstream release
+  * fixed d/*server.postinst to allow dropping test db without
+    setting root password
+  * init script will now run my_i_db if data dir is not present or empty
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 24 Sep 2014 14:48:07 +0530
+
+mysql-community (5.6.21-1debian7) wheezy; urgency=low
+
+  * new upstream release
+  * updated d/rules to increment -j8 as make option
+  * updated d/source/include-binaries to add mysql_no_login plugin
+  * updated CMake option WITH_EXTRA_CHARSETS from complex to all
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 20 Aug 2014 19:12:30 +0530
+
 mysql-community (5.6.20-1debian7) wheezy; urgency=low
 
   * new upstream release
@@ -5,8 +50,20 @@ mysql-community (5.6.20-1debian7) wheezy; urgency=low
   * added d/*.dirs for bench, dev and test pkg
   * updated d/rules to make compilation verbose
   * removed default CFLAGS, CXXFLAGS in d/rules
+  * added patch for testsuite search paths under d/patches
+  * modified cmake option for testsuite in d/rules
+  * updated patch d/fix-mysql_install_db.patch
+  * enabled two patches in d/patches/series
+  * removed extra permissions check in d/rules when fixed in source
+  * modified d/mysql-*-server.postinst to stop removing /usr/my.cnf
+  * modified d/*-test.* for updated location of testsuite
+  * updated d/{mysql-*-server.install,rules} to include debug plugins
+  * updated d/rules to remove storage engine cmake options
+  * modified data dir permission in d/*server.{pre,post}inst
+  * updated d/source/include-binaries to add debug plugins
+  * updated d/rules to rename debug plugins
 
- -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 26 Jun 2014 16:13:30 +0530
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 02 Jul 2014 17:45:30 +0530
 
 mysql-community (5.6.19-1debian7) wheezy; urgency=low
 
index 45a4fb75db864000d01701c0f7a51864bd4daabf..ec635144f60048986bc560c5576355344005e6e7 100644 (file)
@@ -1 +1 @@
-8
+9
index 16a256340bb40da0ecceedddc485947c10029979..4bac0012e4821eb6650dfd53944a5f3c4c1732d0 100644 (file)
@@ -4,7 +4,7 @@ Section: database
 Priority: optional
 Standards-Version: 3.9.3
 Homepage: http://www.mysql.com/
-Build-Depends: debhelper (>= 8.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, lsb-release, cmake, fakeroot
+Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, lsb-release, cmake, fakeroot, libnuma-dev
 
 Package: mysql-server
 Architecture: any
@@ -20,21 +20,21 @@ Description: MySQL Server meta package depending on latest version
 Package: mysql-community-server
 Architecture: any
 Pre-depends: debconf (>= 0.2.17), adduser
-Depends: mysql-common (= ${binary:Version}),
+Depends: mysql-common (= ${binary:Version}), perl, psmisc,
  ${shlibs:Depends}, ${misc:Depends}
-Recommends: mysql-community-client (= ${binary:Version})
+Recommends: mysql-client (= ${binary:Version})
 Conflicts: mysql,
  mysql-server-5.0, mysql-server-core-5.0,
  mysql-server-5.1, mysql-server-core-5.1,
  mysql-server-5.5, mysql-server-core-5.5,
  mysql-server-5.6, mysql-server-core-5.6,
- mysql-enterprise-server
+ mysql-commercial-server
 Replaces: mysql,
  mysql-server-5.0, mysql-server-core-5.0,
  mysql-server-5.1, mysql-server-core-5.1,
  mysql-server-5.5, mysql-server-core-5.5,
  mysql-server-5.6, mysql-server-core-5.6,
- mysql-enterprise-server
+ mysql-commercial-server
 Provides: virtual-mysql-server, virtual-mysql-server-core,
  mysql-server-5.6, mysql-server-core-5.6
 Description: MySQL Server
@@ -65,13 +65,13 @@ Conflicts: mysql,
  mysql-client-5.1, mysql-client-core-5.1,
  mysql-client-5.5, mysql-client-core-5.5,
  mysql-client-5.6, mysql-client-core-5.6,
- mysql-enterprise-client
+ mysql-commercial-client
 Replaces: mysql,
  mysql-client-5.0, mysql-client-core-5.0,
  mysql-client-5.1, mysql-client-core-5.1,
  mysql-client-5.5, mysql-client-core-5.5,
  mysql-client-5.6, mysql-client-core-5.6,
- mysql-enterprise-client
+ mysql-commercial-client
 Provides: virtual-mysql-client, virtual-mysql-client-core,
  mysql-client-5.6, mysql-client-core-5.6
 Description: MySQL Client
@@ -152,11 +152,11 @@ Description: MySQL Testsuite meta package depending on latest version
 Package: mysql-community-test
 Architecture: any
 Depends: mysql-community-server (= ${binary:Version}),
- mysql-community-client (= ${binary:Version}),
- ${shlibs:Depends}, ${misc:Depends}
+ mysql-community-client (= ${binary:Version}), python,
libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
 Conflicts: mysql,
  mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
- mysql-testsuite-5.6, mysql-enterprise-test
+ mysql-testsuite-5.6, mysql-commercial-test
 Description: MySQL Test Run MTR - The MySQL testsuite
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
@@ -169,7 +169,7 @@ Package: mysql-community-bench
 Architecture: any
 Depends: mysql-community-server (= ${binary:Version}),
  ${shlibs:Depends}, ${misc:Depends}
-Conflicts: mysql, mysql-enterprise-bench
+Conflicts: mysql, mysql-commercial-bench
 Description: MySQL Bench
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..09960eb
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/LICENSE.mysql
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/COPYING.gz
+libmysqlclient-dev: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient-dev: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient18.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient18.lintian-overrides
new file mode 100644 (file)
index 0000000..1f26511
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/LICENSE.mysql
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/COPYING.gz
+libmysqlclient18: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient18: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqld-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqld-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..35caaec
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/COPYING.gz
+libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5c4891c
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
+mysql-client: extra-license-file usr/share/doc/mysql-client/COPYING.gz
+mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
index f1cd29cce838dc934c4f8cecefca8c49bee77a9a..2a547a807a9d70aa5c702dae8da970bcd0582b89 100644 (file)
@@ -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
@@ -17,7 +17,6 @@ etc/mysql/my.cnf
 usr/share/aclocal/mysql.m4
 usr/share/mysql/docs/INFO_SRC
 usr/share/mysql/docs/INFO_BIN
-usr/share/mysql/INSTALL-BINARY
 usr/share/mysql/docs/ChangeLog
 # localized error msgs
 usr/share/mysql/*/errmsg.sys
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.lintian-overrides
new file mode 100644 (file)
index 0000000..70ddcdf
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
+mysql-common: extra-license-file usr/share/doc/mysql-common/COPYING.gz
+mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-bench.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-bench.lintian-overrides
new file mode 100644 (file)
index 0000000..04df14e
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/LICENSE.mysql
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/COPYING.gz
+mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5892935
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-client/LICENSE.mysql
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-clienti/COPYING.gz
+mysql-community-client: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-client: embedded-library
old mode 100644 (file)
new mode 100755 (executable)
index dd0cbc4..cb6c39c
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
@@ -22,7 +22,7 @@ then
 
        set -e
 
-       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-enterprise-server
+       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-commercial-server
        INSTALLED_PKG=none
        MYSQLDATA=/var/lib/mysql
 
@@ -78,14 +78,10 @@ then
                        db_set mysql-community-server/re-root-pass ""
                done
 
-               db_input high mysql-community-server/remove-test-db || true
-               db_go
-
        else
                db_fset mysql-community-server/data-dir seen true
                db_fset mysql-community-server/root-pass seen true
                db_fset mysql-community-server/re-root-pass seen true
-               db_fset mysql-community-server/remove-test-db seen true
        fi
 
        set +e
index e8e3c548070588883451cf887a3b25012c0966d3..f311000c7ee8ce59a5eee0fdd2aff7f778ea0281 100644 (file)
@@ -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
@@ -70,7 +70,9 @@ usr/share/man/man8/mysqld.8
 usr/share/mysql/*.sql
 # plugins
 usr/lib/mysql/plugin/*.so
+usr/lib/mysql/plugin/debug/*.so
 usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/debug/daemon_example.ini
 # support files
 usr/share/mysql/mysqld_multi.server
 usr/share/mysql/magic
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.lintian-overrides
new file mode 100644 (file)
index 0000000..08b3865
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/LICENSE.mysql
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/COPYING.gz
+mysql-community-server: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-server: embedded-library
+# Since we ship debug plugins so this error is overridden
+mysql-community-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
index 61d0a73b53225b8a9eb3029e518ccc35c5b9b6be..d8c08082f55039f32df89554df731b5c889ddd5f 100755 (executable)
@@ -14,7 +14,7 @@
 ### END INIT INFO
 #
 
-# 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
@@ -37,18 +37,36 @@ umask 077
 MYSQLDATA=/var/lib/mysql
 VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
 
-get_pcount () {
-       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
-       echo "${PSCOUNT}"
+get_mysql_option() {
+       RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
+       if [ -z "$RESULT" ];
+       then
+               RESULT="$3"
+       fi
+       echo $RESULT
+}
+
+get_running () {
+       PIDFILE=$(get_mysql_option mysqld_safe pid-file "")
+       if [ -z "$PIDFILE" ];
+       then
+               PIDFILE=$(get_mysql_option mysqld pid-file "$MYSQLDATA/$(hostname).pid")
+       fi
+       if [ -e "$PIDFILE" ] && [ -d "/proc/$(cat "$PIDFILE")" ];
+       then
+               echo 1
+       else
+               echo 0
+       fi
 }
 
 server_stop () {
-       PSCOUNT=$(get_pcount)
+       RUNNING=$(get_running)
        COUNT=0
        while :; do
                COUNT=$(( COUNT+1 ))
                echo -n .
-               if [ "${PSCOUNT}" -eq 1 ];
+               if [ "${RUNNING}" -eq 0 ];
                then
                        echo
                        break
@@ -58,7 +76,7 @@ server_stop () {
                        echo
                        return 1
                fi
-               PSCOUNT=$(get_pcount)
+               RUNNING=$(get_running)
                sleep 1
        done
        return 0
@@ -66,27 +84,60 @@ server_stop () {
 
 case "$1" in
   'start')
-       PSCOUNT=$(get_pcount)
-       if [ "${PSCOUNT}" -gt 1 ];
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
        then
                log_action_msg "A MySQL Server is already started"
        else
                MYSQLRUN=/var/run/mysqld
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+               fi
+
+               if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+               then
+                       mysql_install_db --user=mysql > /dev/null
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
                if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
                then
                        mkdir ${MYSQLRUN}
                        chown mysql:mysql ${MYSQLRUN}
                        chmod 755 ${MYSQLRUN}
                fi
-               su - mysql -s /bin/bash -c "mysqld_safe --skip-syslog > /dev/null &"
+
+               su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
                for i in 1 2 3 4 5 6;
                do
                        sleep 1
                        echo -n .
                done
                echo
-               PSCOUNT=$(get_pcount)
-               if [ "${PSCOUNT}" -gt 1 ];
+               RUNNING=$(get_running)
+               if [ "${RUNNING}" -eq 1 ];
                then
                        log_action_msg "MySQL Community Server ${VERSION} is started"
                else
@@ -96,8 +147,8 @@ case "$1" in
        ;;
 
   'stop')
-       PSCOUNT=$(get_pcount)
-       if [ "${PSCOUNT}" -gt 1 ];
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
        then
                killall -15 mysqld
                server_stop
@@ -120,8 +171,8 @@ case "$1" in
        ;;
 
   'status')
-       PSCOUNT=$(get_pcount)
-       if [ ${PSCOUNT} -gt 1 ];
+       RUNNING=$(get_running)
+       if [ ${RUNNING} -eq 1 ];
        then
                log_action_msg "MySQL Community Server ${VERSION} is running"
        else
old mode 100644 (file)
new mode 100755 (executable)
index e9da0b7..2870337
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
@@ -37,45 +37,36 @@ case "$1" in
                then
                        mkdir ${MYSQLDATA}/mysql
                        chown mysql:mysql ${MYSQLDATA}/mysql
-                       chmod 700 ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
                        if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
                        then
                                mysql_install_db --user=mysql > /dev/null
-                               if [ -f "/usr/my.cnf" ];
-                               then
-                                       rm -f /usr/my.cnf
-                               fi
                        fi
                fi
 
-               db_get mysql-community-server/remove-test-db && RMTESTDB=${RET}
-               if [ -z "${RMTESTDB}" ] || [ "${RMTESTDB}" = "false" ];
-               then
-                       RMTESTDB="DROP DATABASE IF EXISTS test;"
-               else
-                       RMTESTDB=""
-               fi
-
                db_get mysql-community-server/root-pass && PASSWD=${RET}
                if [ ! -z "${PASSWD}" ];
                then
                        db_set mysql-community-server/root-pass ""
                        db_set mysql-community-server/re-root-pass ""
-                       SQL=`mktemp`
-                       if [ -f "${SQL}" ];
-                       then
-                               chmod 700 ${SQL}
-                               cat << EOF > ${SQL}
+                       PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
+               else
+                       PASSWD=""
+               fi
+
+               SQL=`mktemp`
+               if [ -f "${SQL}" ];
+               then
+                       chmod 700 ${SQL}
+                       cat << EOF > ${SQL}
 USE mysql;
-UPDATE user SET password=PASSWORD("${PASSWD}") WHERE user='root';
+${PASSWD}
 DELETE FROM user WHERE user='';
-${RMTESTDB}
 FLUSH PRIVILEGES;
 EOF
-                               mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
-                               PASSWD=""
-                               rm -f ${SQL}
-                       fi
+                       mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
+                       PASSWD=""
+                       rm -f ${SQL}
                fi
 
                set +e
old mode 100644 (file)
new mode 100755 (executable)
index f16ea32..c75743f
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
old mode 100644 (file)
new mode 100755 (executable)
index cfbfaa6..f1838b0
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
@@ -67,14 +67,14 @@ case "$1" in
 
                if ! getent passwd mysql >/dev/null;
                then
-                       adduser --ingroup mysql --system --disabled-login --no-create-home --home /nowhere --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
+                       adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
                fi
 
                if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
                then
                        mkdir ${MYSQLDATA}
                        chown mysql:mysql ${MYSQLDATA}
-                       chmod 700 ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
                fi
 
                if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
old mode 100644 (file)
new mode 100755 (executable)
index 40c5c55..7509de7
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# 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
index 37468eb8494b1b276b94469932d70417f435e0c9..7b7e0ac33cdcef822ea82f7dc20df6aea8a564e8 100644 (file)
@@ -14,14 +14,6 @@ Type: error
 Description: The two passwords did not match
  Please try again. Make sure you type the exact same password twice.
 
-Template: mysql-community-server/remove-test-db
-Type: boolean
-Default: false
-Description: Do you wish to install/ keep test database ?
- The test database is created as part of a fresh installation which may be used for initial development and test environment.
- .
- It is highly recommended that you do not install the test database in a production environment.
-
 Template: mysql-community-server/remove-data-dir
 Type: boolean
 Default: false
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-source.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-source.lintian-overrides
new file mode 100644 (file)
index 0000000..9ca84e9
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/LICENSE.mysql
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/COPYING.gz
+mysql-community-source: copyright-should-refer-to-common-license-file-for-lgpl
index 4e6ba01a17da8543050414545bc99cdf17ac6a5f..f93ca25bd85b8318ab96be6c100b8789a3e4665e 100644 (file)
@@ -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
@@ -13,5 +13,4 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-usr/lib/mysql
-usr/lib/mysql/mysql-test
+usr/lib/mysql-test
index b685e83d5ed30c7217f2fea624d3cecb57dfcacf..d5f820dd6fc46868eadaa54cc219aef1f6e11f2f 100644 (file)
@@ -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
@@ -13,7 +13,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-usr/lib/mysql/mysql-test/*
+usr/lib/mysql-test/*
 usr/share/man/man1/mysql-test-run.pl.1
 # legal
 usr/share/doc/mysql-community-test/COPYING
index 585eaf60e96aa5481693ca4522595dc888f4e47f..aedf2db3b736e37e574af49341af1c97b07c0c4f 100644 (file)
@@ -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
@@ -13,5 +13,5 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-usr/lib/mysql/mysql-test/mysql-test-run.pl usr/lib/mysql/mysql-test/mysql-test-run
-usr/lib/mysql/mysql-test/mysql-test-run.pl usr/lib/mysql/mysql-test/mtr
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mysql-test-run
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mtr
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.lintian-overrides
new file mode 100644 (file)
index 0000000..ff273bb
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/LICENSE.mysql
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/COPYING.gz
+mysql-community-test: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-server.lintian-overrides
new file mode 100644 (file)
index 0000000..4877097
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-server: extra-license-file usr/share/doc/mysql-server/LICENSE.mysql
+mysql-server: extra-license-file usr/share/doc/mysql-server/COPYING.gz
+mysql-server: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-testsuite.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-testsuite.lintian-overrides
new file mode 100644 (file)
index 0000000..37488fe
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/LICENSE.mysql
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/COPYING.gz
+mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-mtr-search-paths.patch b/mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-mtr-search-paths.patch
new file mode 100644 (file)
index 0000000..8a27a09
--- /dev/null
@@ -0,0 +1,13 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Adding extra search path for testsuite.
+
+--- a/mysql-test/lib/mtr_cases.pm      2014-02-24 13:14:37 +0530
++++ b/mysql-test/lib/mtr_cases.pm      2014-07-02 11:46:24 +0530
+@@ -288,6 +288,7 @@
+     {
+       $suitedir= my_find_dir($::basedir,
+                            ["share/mysql-test/suite",
++                            "lib/mysql-test/suite",
+                             "mysql-test/suite",
+                             "internal/mysql-test/suite",
+                             "mysql-test",
index 6f036688a9256bd2b9630ab030182875511dd026..41311b2c8f9e2679cc27df30b581ed0f3ad10d08 100644 (file)
@@ -1,21 +1,12 @@
 From: Terje Røsten <terje.rosten@oracle.com>
-Description: Updates script to use existing my.cnf and not delete it if created from template
+Description: Maintains the pending --skip-my-cnf option in mainline
 Bug: <TODO>
 
 diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
 index 440a977..7d068fc 100644
 --- a/scripts/mysql_install_db.pl.in
 +++ b/scripts/mysql_install_db.pl.in
-@@ -75,6 +97,8 @@ Usage: $0 [OPTIONS]
-   --help               Display this help and exit.
-   --ldata=path         The path to the MySQL data directory. Same as --datadir.
-   --no-defaults        Don't read default options from any option file.
-+  --keep-my-cnf        Don't try to create my.cnf based on template.
-+                       Useful for systems with working, updated my.cnf.
- EOF1
-   if ( $^O !~ m/^(MSWin32|cygwin)$/ ) {
-     print <<EOF2;
-@@ -86,6 +110,7 @@ EOF2
+@@ -113,6 +113,7 @@ EOF2
    print <<EOF3;
    --rpm                For internal use.  This option is used by RPM files
                         during the MySQL installation process.
@@ -23,116 +14,16 @@ index 440a977..7d068fc 100644
    --skip-name-resolve  Use IP addresses rather than hostnames when creating
                         grant table entries.  This option can be useful if
                         your DNS does not work.
-@@ -149,6 +174,7 @@ sub parse_arguments
-              "skip-name-resolve",
-              "verbose",
-+             "keep-my-cnf",
-              "rpm",
-              "help",
-              "random-passwords",
-@@ -356,13 +382,19 @@ sub tell_root_password {
- ##############################################################################
-
- sub generate_random_password {
--  # On (at least) Linux and Solaris, a "random" device is available, use it:
--  # cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1
--  # Without LC_ALL, "tr" may not know the "alnum" character class -
--  # and there are user profiles which do not have this set.
--  #
--  my $password = `cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1`;
--  chomp ($password);
-+  # On Linux, Solaris, Max OS X and FreeBSD we have a random device available.
-+  my $randfile = "/dev/urandom";
-+  open(FD, $randfile) || die "Can't open $randfile for reading: $!";
-+  my $password = "";
-+  my $pass_len = 16;
-+  my $c;
-+  while (length($password) < $pass_len) {
-+    $c = getc(FD);
-+    if ($c =~ /\w/) {
-+      $password .= $c;
-+    }
-+  }
-+  close(FD);
-   return $password;
- }
-
-@@ -399,11 +431,16 @@ $basedir= "@prefix@" if ! $basedir;              # Default
- # ----------------------------------------------------------------------
-
- my $print_defaults;
-+my $keep_my_cnf = 0;
-
- if ( $opt->{srcdir} and $opt->{basedir} )
+@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} )
  {
    error($opt,"Specify either --basedir or --srcdir, not both");
  }
+-if ( $opt->{'keep-my-cnf'} )
 +if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
-+{
-+  $keep_my_cnf = 1;
-+}
- if ( $opt->{srcdir} )
  {
-   $opt->{builddir} = $opt->{srcdir} unless $opt->{builddir};
-@@ -425,7 +462,7 @@ my $config_file;
- my $copy_cfg_file;
-
- # ----------------------------------------------------------------------
--# This will be the default config file
-+# This will be the default config file (unless creation is unwanted)
- # ----------------------------------------------------------------------
-
- my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf";
-@@ -434,6 +471,11 @@ $config_file= "$basedir/my.$cnfext";
-
- my $cfg_template= find_in_basedir($opt,"file","my-default.$cnfext",
-                                 ".", "share","share/mysql","support-files");
-+# Distros might move files
-+if ((! -r $cfg_template) && (-r "@pkgdatadir@/my-default.cnf")) {
-+  $cfg_template = "@pkgdatadir@/my-default.cnf";
-+}
-+
- -e $cfg_template or cannot_find_file("my-default.$cnfext");
-
- $copy_cfg_file= $config_file;
-@@ -443,22 +485,21 @@ if (-e $copy_cfg_file)
-   $copy_cfg_file =~ s/my.$cnfext/my-new.$cnfext/;
-   # Too early to print warning here, the user may not notice
+   $keep_my_cnf = 1;
  }
--open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
--if (open (CFG, "> $copy_cfg_file"))
--{
--  while (<TEMPL>)
--  {
--    # Remove lines beginning with # *** which are template comments
--    print CFG $_ unless /^# \*\*\*/;
-+
-+if ( ! $keep_my_cnf ) {
-+  open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
-+  if (open (CFG, "> $copy_cfg_file")) {
-+    while (<TEMPL>) {
-+      # Remove lines beginning with # *** which are template comments
-+      print CFG $_ unless /^# \*\*\*/;
-+    }
-+    close CFG;
-+  } else {
-+    warning($opt,"Could not write to config file $copy_cfg_file: $!");
-+    $failed_write_cfg= 1;
-   }
--  close CFG;
-+  close TEMPL;
- }
--else
--{
--  warning($opt,"Could not write to config file $copy_cfg_file: $!");
--  $failed_write_cfg= 1;
--}
--close TEMPL;
-
- # ----------------------------------------------------------------------
- # Now we can get arguments from the groups [mysqld] and [mysql_install_db]
-@@ -621,7 +662,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
+@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
  }
 
  # ----------------------------------------------------------------------
@@ -141,7 +32,7 @@ index 440a977..7d068fc 100644
  # ----------------------------------------------------------------------
 
  # FIXME The shell variant uses "mkdir -p":
-@@ -654,7 +695,7 @@ if ($opt_user)
+@@ -697,7 +698,7 @@ if ($opt_user)
    }
  }
 
@@ -150,18 +41,3 @@ index 440a977..7d068fc 100644
  {
    mkdir($dir, 0700) unless -d $dir;
    if ($opt_user and -w "/")
-@@ -848,7 +889,13 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") )
-            "",
-            "Support MySQL by buying support/licenses at http://shop.mysql.com");
--    if ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-+    if ($keep_my_cnf)
-+    {
-+      report($opt,
-+           "Note: new default config file not created.",
-+           "Please make sure your config file is current");
-+    }
-+    elsif ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-     {
-       report($opt,
-               "New default config file was created as $config_file and",
index 82859623b1a9f05c2ea0083d1195b3eb90dfa721..31af2dc779ba00b5c2c2ce4b5890e1ebd23f6526 100644 (file)
@@ -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
@@ -14,4 +14,5 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 #fix-man-page-links.patch
-#fix-mysql_install_db.patch
+fix-mysql_install_db.patch
+fix-mtr-search-paths.patch
index 3bdc3312038e09d2be6dffe8adb8b8f2ef846356..386ee62c3d35dca93130018f61ba32d73049b534 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/make -f
 
-# 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
@@ -34,7 +34,7 @@ override_dh_auto_configure:
                -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
                -DINSTALL_MANDIR=share/man \
                -DINSTALL_MYSQLSHAREDIR=share/mysql \
-               -DINSTALL_MYSQLTESTDIR=lib/mysql/mysql-test \
+               -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
                -DINSTALL_PLUGINDIR=lib/mysql/plugin \
                -DINSTALL_SBINDIR=sbin \
                -DINSTALL_SCRIPTDIR=bin \
@@ -45,12 +45,7 @@ override_dh_auto_configure:
                -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
                -DWITH_SSL=bundled \
                -DWITH_ZLIB=system \
-               -DWITH_EXTRA_CHARSETS=complex \
-               -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-               -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-               -DWITH_EXAMPLE_STORAGE_ENGINE=1 \
-               -DWITH_FEDERATED_STORAGE_ENGINE=1 \
-               -DWITH_INNOBASE_STORAGE_ENGINE=1 \
+               -DWITH_EXTRA_CHARSETS=all \
                -DWITH_INNODB_MEMCACHED=1 \
                -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
                -DINSTALL_LAYOUT=DEB
@@ -60,7 +55,7 @@ override_dh_auto_configure:
 
 override_dh_auto_build:
        @echo "RULES.$@"
-       $(MAKE) -j1 VERBOSE=1
+       $(MAKE) -j8 VERBOSE=1
        touch $@
 
 override_dh_auto_test:
@@ -73,111 +68,62 @@ override_dh_auto_install:
        @echo "RULES.$@"
        # complete install first
        $(MAKE) install DESTDIR=debian/tmp
-       # http://bugs.mysql.com/bug.php?id=68517 --- Some test and result files have executable bit set.
-       # remove execute bit from file permissions discussed in Bug#68517 and other files
-       chmod 0644 debian/tmp/usr/bin/mysqlaccess.conf
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb-wl5980-linux.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/r/lowercase_table4.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/shutdown_mysqld.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/have_QC_Disabled.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_3.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb_bug60196.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb_bug14169459.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb-wl5980-windows.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/r/named_pipe.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/t/lowercase_table4-master.opt
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb-wl5980-debug.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/r/shm.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/ndb/t/ndb_show_tables_result.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug57904.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/check_ipv4_mapped.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/start_mysqld.inc
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_11.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/t/lowercase_table4.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/r/innodb_bug57904.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/portability_wl5980_windows.zip
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug60196.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-debug.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-windows.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-linux.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug14169459.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_10.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_14.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb-wl5980-discard.test
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/parts/r/partition_exch_qa_6.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/innodb_bug60196-master.opt
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/suite/innodb/t/portability_wl5980_linux.zip
-       chmod 0644 debian/tmp/usr/lib/mysql/mysql-test/include/memcache_config.inc
-       chmod 0644 debian/tmp/usr/share/mysql/innodb_memcached_config.sql
-       chmod 0644 debian/tmp/usr/share/mysql/mysql-log-rotate
-       chmod 0644 debian/tmp/usr/lib/mysql/sql-bench/graph-compare-results
        # remove all redundant files and links
        rm debian/tmp/usr/lib/*/*_r*
-       rm debian/tmp/usr/lib/mysql/mysql-test/cmake_install.cmake
-       rm debian/tmp/usr/lib/mysql/mysql-test/CTestTestfile.cmake
-       rm debian/tmp/usr/lib/mysql/mysql-test/Makefile
+       rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
+       rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
+       rm debian/tmp/usr/lib/mysql-test/Makefile
        # add missing man pages
-       install -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+       install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
        # add MySQL Server configuration file my.cnf to mysql-common package
-       mkdir -p debian/tmp/etc/mysql
-       install -o root -m 0644 debian/extra/my.cnf debian/tmp/etc/mysql
+       install -g root -o root -m 0644 -D debian/extra/my.cnf debian/tmp/etc/mysql/my.cnf
        # add MySQL Server debug binary and library to package
-       install -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
-       install -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+       install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       # add debug plugin libraries to package
+       install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
+       for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
+       install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+       install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
        # add directory for legal docs
-       mkdir -p debian/tmp/usr/share/doc/mysql-server
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-server
-       mkdir -p debian/tmp/usr/share/doc/mysql-client
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-client
-       mkdir -p debian/tmp/usr/share/doc/mysql-common
-       mkdir -p debian/tmp/usr/share/doc/libmysqlclient18
-       mkdir -p debian/tmp/usr/share/doc/libmysqlclient-dev
-       mkdir -p debian/tmp/usr/share/doc/libmysqld-dev
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-bench
-       mkdir -p debian/tmp/usr/share/doc/mysql-testsuite
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-test
-       mkdir -p debian/tmp/usr/share/doc/mysql-community-source
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-bench
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-test
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-source
        # add COPYING file to each package
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
-       install -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
        # add README file to each package
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
-       install -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
        touch $@
 
 override_dh_installinit:
index ba9d2b4e84866a479f242a0014b3e5fbd57b65dd..caac1e13dad85aa1bb45586e8412ee37fbd02a7a 100644 (file)
@@ -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
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-# obscured filename for mysqld-debug and libmysqld-debug.a
+# obscured filename for mysqld-debug, libmysqld-debug.a and debug plugins
 debian/extra/server-binary
 debian/extra/embedded-server
+debian/extra/adt_null-plugin
+debian/extra/auth-plugin
+debian/extra/auth_socket-plugin
+debian/extra/auth_test_plugin-plugin
+debian/extra/innodb_engine-plugin
+debian/extra/libdaemon_example-plugin
+debian/extra/libmemcached-plugin
+debian/extra/mypluglib-plugin
+debian/extra/mysql_no_login-plugin
+debian/extra/qa_auth_client-plugin
+debian/extra/qa_auth_interface-plugin
+debian/extra/qa_auth_server-plugin
+debian/extra/semisync_master-plugin
+debian/extra/semisync_slave-plugin
+debian/extra/validate_password-plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/source/lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wheezy/source/lintian-overrides
new file mode 100644 (file)
index 0000000..9eefbb7
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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 provide our own versioning scheme so this warning is overridden
+mysql-community source: changelog-should-mention-nmu
+mysql-community source: source-nmu-has-incorrect-version-number
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/changelog b/mysql-wsrep-5.6/packaging/deb-wily/changelog
new file mode 100644 (file)
index 0000000..5d94ab2
--- /dev/null
@@ -0,0 +1,137 @@
+mysql-community (5.6.28-1ubuntu15.10) wily; urgency=low
+
+  * New upstream release
+
+ -- Lars Tangvald <lars.tangvald@oracle.com>  Thu, 12 Nov 2015 10:34:23 +0100
+
+mysql-community (5.6.26-1ubuntu15.04) vivid; urgency=low
+
+  * new upstream release
+  * mysql-commercial-server now depends on perl, psmisc
+    mysql-commercial-test now depends on python, libmysqlclient-dev
+    (Closes: #20893836)
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Thu, 18 Jun 2015 16:34:10 +0530
+
+mysql-community (5.6.25-3ubuntu15.04) vivid; urgency=low
+
+  * new upstream release
+  * mysql-common now conflicts with
+    mysql-server-5.6, mysql-server-core-5.6
+    mysql-client-5.6, mysql-client-core-5.6
+  * mysql-*-server no more provides
+    mysql-server-5.6, mysql-server-core-5.6
+  * mysql-*-client no more provides
+    mysql-client-5.6, mysql-client-core-5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 15 Jun 2015 16:48:05 +0530
+
+mysql-community (5.6.24-3ubuntu15.04) vivid; urgency=low
+
+  * updated Standards-Version to 3.9.6 in d/control
+  * apparmor profile updated to allow read on all files under /etc/mysql
+  * added new conf files under d/extra/*.conf
+  * mysql_plugin moved from client to server pkg
+  * innochecksum moved from client to server pkg
+  * server pkg now replaces client pkg
+  * added systemd service profile and script
+  * new /etc/mysql/my.cnf management scheme added for Ubuntu 15.04
+    as discussed in Dec 2014 for native packaging source
+  * added dh "--with systemd" for enabling systemd
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 27 May 2015 11:35:35 +0530
+
+mysql-community (5.6.24-2ubuntu15.04) vivid; urgency=low
+
+  * new upstream release
+  * forked packaging source from utopic to vivid
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 15 Apr 2015 18:52:22 +0530
+
+mysql-community (5.6.24-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 16 Feb 2014 15:45:09 +0530
+
+mysql-community (5.6.23-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * mysql-community-server now recommends mysql-client
+  * mysql-community-server now depends on apparmor
+  * removed template install-test-db; not installed by default
+  * d/compat incremented to 9 from 8
+  * d/control updated to build depend on debhelper 9
+  * added d/*.lintian-overrides and d/source/lintian-overrides
+  * d/rules updated to reflect correct file permissions
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 31 Dec 2014 10:51:07 +0530
+
+mysql-community (5.6.22-2ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * mysql-common now replaces mysql-server-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 28 Nov 2014 15:18:07 +0530
+
+mysql-community (5.6.22-1ubuntu14.10) utopic; urgency=low
+
+  * new upstream release
+  * fixed d/*server.postinst to allow dropping test db without
+    setting root password
+  * init script will now run my_i_db if data dir is not present or empty
+  * updated init script to read app armor profile on startup
+  * forked packaging source from trusty and rebranded for utopic
+  * updated d/m-c-source.install to pack *.xz packaging source archive
+  * added more system resources to app armor profile
+  * dh_apparmor to now run before dh_installinit in d/rules
+  * libmysqlclient-dev now replaces mysql-client-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 05 Nov 2014 17:04:07 +0530
+
+mysql-community (5.6.21-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * updated d/rules to increment -j8 as make option
+  * updated d/source/include-binaries to add mysql_no_login plugin
+  * updated CMake option WITH_EXTRA_CHARSETS from complex to all
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 20 Aug 2014 19:12:30 +0530
+
+mysql-community (5.6.20-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * added fakeroot as build-dep in d/control
+  * added d/*.dirs for bench, dev and test pkg
+  * updated d/rules to make compilation verbose
+  * removed default CFLAGS, CXXFLAGS in d/rules
+  * added patch for testsuite search paths under d/patches
+  * modified cmake option for testsuite in d/rules
+  * updated patch d/fix-mysql_install_db.patch
+  * enabled two patches in d/patches/series
+  * removed extra permissions check in d/rules when fixed in source
+  * modified d/mysql-*-server.postinst to stop removing /usr/my.cnf
+  * modified d/*-test.* for updated location of testsuite
+  * updated d/{mysql-*-server.install,rules} to include debug plugins
+  * updated d/rules to remove storage engine cmake options
+  * modified data dir permission in d/*server.{pre,post}inst
+  * updated d/source/include-binaries to add debug plugins
+  * updated d/rules to rename debug plugins
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Wed, 02 Jul 2014 17:45:30 +0530
+
+mysql-community (5.6.19-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+  * d/rules updated to rid of files removed from source
+  * modified path for source tar in source pkg
+  * obscured actual filenames in d/source/include-binaries
+  * modified d/rules to handle obscured filenames
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Mon, 05 May 2014 15:45:10 +0530
+
+mysql-community (5.6.17-1ubuntu14.04) trusty; urgency=low
+
+  * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com>  Fri, 28 Feb 2014 18:06:30 +0530
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/compat b/mysql-wsrep-5.6/packaging/deb-wily/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/control b/mysql-wsrep-5.6/packaging/deb-wily/control
new file mode 100644 (file)
index 0000000..8bc5ecd
--- /dev/null
@@ -0,0 +1,192 @@
+Source: mysql-community
+Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Section: database
+Priority: optional
+Standards-Version: 3.9.6
+Homepage: http://www.mysql.com/
+Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-apparmor, dh-systemd (>= 1.5), lsb-release, cmake, fakeroot, libnuma-dev
+
+Package: mysql-server
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Server meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql server
+ package available in the repository.
+
+Package: mysql-community-server
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), adduser
+Depends: mysql-common (= ${binary:Version}), apparmor, perl, psmisc,
+ ${shlibs:Depends}, ${misc:Depends}
+Recommends: mysql-client (= ${binary:Version})
+Conflicts: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server
+Replaces: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server,
+ mysql-community-client
+Provides: virtual-mysql-server, virtual-mysql-server-core
+Description: MySQL Server
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package includes the MySQL server binary as well as related
+ utilities to run and administer a MySQL server.
+
+Package: mysql-client
+Architecture: any
+Depends: mysql-community-client (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Client meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql client
+ package available in the repository.
+
+Package: mysql-community-client
+Architecture: any
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Replaces: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Provides: virtual-mysql-client, virtual-mysql-client-core
+Description: MySQL Client
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the standard MySQL clients and
+ administration tools.
+
+Package: libmysqlclient18
+Architecture: any
+Section: libs
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL shared client libraries
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the shared libraries for MySQL client
+ applications.
+
+Package: mysql-common
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), ${misc:Pre-Depends}
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-server-5.6, mysql-server-core-5.6,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mariadb-server-5.5, percona-xtradb-cluster-common-5.5
+Replaces: mysql, mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mariadb-server-5.5, percona-xtradb-cluster-common-5.5
+Provides: mysql-common, mysql-common-5.6
+Description: MySQL Common
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains common files needed by MySQL client
+ library, MySQL database server, and MySQL embedded server.
+
+Package: libmysqlclient-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient18 (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Replaces: mysql-client-5.6, mysql-client-core-5.6
+Description: MySQL development headers
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the development header files necessary
+ to develop MySQL client applications.
+
+Package: libmysqld-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient-dev (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL embedded server library
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL server as an embedded library.
+
+Package: mysql-testsuite
+Architecture: any
+Depends: mysql-community-test (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Testsuite meta package depending on latest version
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql test
+ package available in the repository.
+
+Package: mysql-community-test
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ mysql-community-client (= ${binary:Version}), python,
+ libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
+ mysql-testsuite-5.6, mysql-commercial-test
+Description: MySQL Test Run MTR - The MySQL testsuite
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL regression test suite for MySQL
+ database server.
+
+Package: mysql-community-bench
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-commercial-bench
+Description: MySQL Bench
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
+
+Package: mysql-community-source
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: MySQL source
+ 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
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/copyright b/mysql-wsrep-5.6/packaging/deb-wily/copyright
new file mode 100644 (file)
index 0000000..2c31f24
--- /dev/null
@@ -0,0 +1,41 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: MySQL Server 5.6
+Upstream-Contact: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Source: http://dev.mysql.com/
+
+Copyright: 2000, 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+License:
+ This is a release of MySQL, a dual-license SQL database server.
+ For the avoidance of doubt, this particular copy of the software
+ is released under the version 2 of the GNU General Public License.
+ MySQL is brought to you by Oracle.
+ .
+ MySQL FOSS License Exception
+ We want free and open source software applications under certain
+ licenses to be able to use specified GPL-licensed MySQL client
+ libraries despite the fact that not all such FOSS licenses are
+ compatible with version 2 of the GNU General Public License.
+ Therefore there are special exceptions to the terms and conditions
+ of the GPLv2 as applied to these client libraries, which are
+ identified and described in more detail in the FOSS License
+ Exception at
+ <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
+ .
+ This distribution may include materials developed by third
+ parties. For license and attribution notices for these
+ materials, please refer to the documentation that accompanies
+ this distribution (see the "Licenses for Third-Party Components"
+ appendix) or view the online documentation at
+ <http://dev.mysql.com/doc/>.
+ .
+ GPLv2 Disclaimer
+ For the avoidance of doubt, except that if any license choice
+ other than GPL or LGPL is available it will apply instead,
+ Oracle elects to use only the General Public License version 2
+ (GPLv2) at this time for any software where a choice of GPL
+ license versions is made available with the language indicating
+ that GPLv2 or any later version may be used, or where a choice
+ .
+ The full text of the GNU General Public License version 2 can
+ be found in the file
+ `/usr/share/mysql/doc/COPYING'.
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/extra/apparmor-profile b/mysql-wsrep-5.6/packaging/deb-wily/extra/apparmor-profile
new file mode 100644 (file)
index 0000000..5cae3bf
--- /dev/null
@@ -0,0 +1,47 @@
+# vim:syntax=apparmor
+# Last Modified: Fri Feb 28 18:06:30 2014
+#include <tunables/global>
+
+/usr/sbin/mysqld {
+  #include <abstractions/base>
+  #include <abstractions/nameservice>
+  #include <abstractions/user-tmp>
+
+# Allow system resource access
+  /sys/devices/system/cpu/ r,
+  capability sys_resource,
+  capability dac_override,
+  capability setuid,
+  capability setgid,
+
+# Allow config access
+  /etc/mysql/** r,
+
+# Allow pid and socket file access
+  /run/mysqld/mysqld.pid rw,
+  /run/mysqld/mysqld.sock rw,
+
+# Allow read/ write to /tmp
+  /tmp/ r,
+  /tmp/* rw,
+
+# Allow execution of server binary
+  /usr/sbin/mysqld mr,
+  /usr/sbin/mysqld-debug mr,
+
+# Allow plugin access
+  /usr/lib/mysql/plugin/ r,
+  /usr/lib/mysql/plugin/*.so* mr,
+
+# Allow error msg and charset access
+  /usr/share/mysql/ r,
+  /usr/share/mysql/** r,
+
+# Allow data dir access
+  /var/lib/mysql/ r,
+  /var/lib/mysql/** rwk,
+
+# Allow log file access
+  /var/log/mysql/ r,
+  /var/log/mysql/** rw,
+}
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/extra/my.cnf.fallback b/mysql-wsrep-5.6/packaging/deb-wily/extra/my.cnf.fallback
new file mode 100644 (file)
index 0000000..a7525ca
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Commercial Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# * 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/mysql-wsrep-5.6/packaging/deb-wily/extra/mysql-systemd-start b/mysql-wsrep-5.6/packaging/deb-wily/extra/mysql-systemd-start
new file mode 100644 (file)
index 0000000..f4aa9c9
--- /dev/null
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+# Scripts to run by MySQL systemd service
+#
+# Needed argument: pre | post
+#
+# pre mode  :  try to perform sanity check for configuration, log, data
+# post mode :  ping server until answer is received
+
+pinger () {
+       while /bin/true ; do
+               sleep 1
+               mysqladmin ping >/dev/null 2>&1 && break
+       done
+}
+
+sanity () {
+       MYSQLRUN=/var/run/mysqld
+       MYSQLDATA=/var/lib/mysql
+       MYSQLLOG=/var/log/mysql
+
+       if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+       then
+               mkdir ${MYSQLDATA}
+               chown mysql:mysql ${MYSQLDATA}
+               chmod 750 ${MYSQLDATA}
+       fi
+
+       if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+       then
+               mkdir ${MYSQLDATA}/mysql
+               chown mysql:mysql ${MYSQLDATA}/mysql
+               chmod 750 ${MYSQLDATA}/mysql
+       fi
+
+       if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+       then
+               mysql_install_db --user=mysql > /dev/null
+       fi
+
+       if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+       then
+               mkdir ${MYSQLLOG}
+               chown mysql:adm ${MYSQLLOG}
+               chmod 750 ${MYSQLLOG}
+               touch ${MYSQLLOG}/error.log
+               chmod 640 ${MYSQLLOG}/error.log
+               chown mysql:adm ${MYSQLLOG}/error.log
+       fi
+
+       if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+       then
+               mkdir ${MYSQLRUN}
+               chown mysql:mysql ${MYSQLRUN}
+               chmod 755 ${MYSQLRUN}
+       fi
+
+       /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+       if [ ! -r /etc/mysql/my.cnf ]; then
+               echo "MySQL configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives."
+               exit 1
+       fi
+}
+
+case $1 in
+       "pre")  sanity ;;
+       "post") pinger ;;
+esac
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/extra/mysql.cnf b/mysql-wsrep-5.6/packaging/deb-wily/extra/mysql.cnf
new file mode 100644 (file)
index 0000000..8fa0138
--- /dev/null
@@ -0,0 +1,26 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Community Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# * 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/
+!includedir /etc/mysql/mysql.conf.d/
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/extra/mysql.conf.cnf b/mysql-wsrep-5.6/packaging/deb-wily/extra/mysql.conf.cnf
new file mode 100644 (file)
index 0000000..a201d72
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Commercial Client configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[mysql]
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/extra/mysql_embedded.1 b/mysql-wsrep-5.6/packaging/deb-wily/extra/mysql_embedded.1
new file mode 100644 (file)
index 0000000..735c4e0
--- /dev/null
@@ -0,0 +1 @@
+.so man1/mysql.1
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/extra/mysqld.cnf b/mysql-wsrep-5.6/packaging/deb-wily/extra/mysqld.cnf
new file mode 100644 (file)
index 0000000..95ae6d8
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright (c) 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
+# 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
+
+#
+# The MySQL Commercial Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[mysqld_safe]
+pid-file = /var/run/mysqld/mysqld.pid
+socket   = /var/run/mysqld/mysqld.sock
+nice   = 0
+
+[mysqld]
+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
+explicit_defaults_for_timestamp
+
+# 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
+
+log-error    = /var/log/mysql/error.log
+
+# Recommended in standard MySQL setup
+sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
+
+# Disabling symbolic-links is recommended to prevent assorted security risks
+symbolic-links=0
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient-dev.install b/mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient-dev.install
new file mode 100644 (file)
index 0000000..e7e98c1
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (c) 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
+# 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
+
+usr/include/mysql/*.h
+usr/include/mysql/mysql/*.h
+usr/include/mysql/mysql/*.h.pp
+usr/include/mysql/mysql/psi/*.h
+usr/lib/*/libmysqlclient.a
+usr/lib/*/libmysqlclient.so
+usr/lib/*/libmysqlservices.a
+usr/bin/mysql_config
+usr/bin/mysql_config_editor
+usr/share/man/man1/mysql_config.1
+usr/share/man/man1/mysql_config_editor.1
+# legal
+usr/share/doc/libmysqlclient-dev/COPYING
+usr/share/doc/libmysqlclient-dev/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..09960eb
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/LICENSE.mysql
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/COPYING.gz
+libmysqlclient-dev: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient-dev: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient18.install b/mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient18.install
new file mode 100644 (file)
index 0000000..fe6aa56
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/*/libmysqlclient.so.*
+# legal
+usr/share/doc/libmysqlclient18/COPYING
+usr/share/doc/libmysqlclient18/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient18.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/libmysqlclient18.lintian-overrides
new file mode 100644 (file)
index 0000000..1f26511
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/LICENSE.mysql
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/COPYING.gz
+libmysqlclient18: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient18: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/libmysqld-dev.install b/mysql-wsrep-5.6/packaging/deb-wily/libmysqld-dev.install
new file mode 100644 (file)
index 0000000..923f826
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/*/libmysqld.a
+usr/lib/*/libmysqld-debug.a
+# legal
+usr/share/doc/libmysqld-dev/COPYING
+usr/share/doc/libmysqld-dev/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/libmysqld-dev.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/libmysqld-dev.lintian-overrides
new file mode 100644 (file)
index 0000000..35caaec
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/COPYING.gz
+libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-client.install b/mysql-wsrep-5.6/packaging/deb-wily/mysql-client.install
new file mode 100644 (file)
index 0000000..13b877e
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-client/COPYING
+usr/share/doc/mysql-client/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/mysql-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5c4891c
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
+mysql-client: extra-license-file usr/share/doc/mysql-client/COPYING.gz
+mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.dirs b/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.dirs
new file mode 100644 (file)
index 0000000..69265ef
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/conf.d
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.install b/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.install
new file mode 100644 (file)
index 0000000..8e84e73
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright (c) 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
+# 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
+
+# configuration file and script
+debian/extra/my.cnf.fallback etc/mysql/
+debian/extra/mysql.conf.cnf  etc/mysql/conf.d/mysql.cnf
+
+usr/share/aclocal/mysql.m4
+usr/share/mysql/docs/INFO_SRC
+usr/share/mysql/docs/INFO_BIN
+usr/share/mysql/docs/ChangeLog
+# localized error msgs
+usr/share/mysql/*/errmsg.sys
+usr/share/mysql/errmsg-utf8.txt
+# charsets
+usr/share/mysql/charsets/*.xml
+usr/share/mysql/charsets/README
+# legal
+usr/share/doc/mysql-common/COPYING
+usr/share/doc/mysql-common/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.lintian-overrides
new file mode 100644 (file)
index 0000000..70ddcdf
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
+mysql-common: extra-license-file usr/share/doc/mysql-common/COPYING.gz
+mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.postinst b/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.postinst
new file mode 100644 (file)
index 0000000..f53bfaa
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Copyright (c) 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
+# 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
+
+set -e
+
+if [ "$1" = "configure" ]; then
+    # Low priority fallback for client use when no server is installed.
+    update-alternatives --install /etc/mysql/my.cnf my.cnf /etc/mysql/my.cnf.fallback 100
+fi
+
+#DEBHELPER#
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.postrm b/mysql-wsrep-5.6/packaging/deb-wily/mysql-common.postrm
new file mode 100644 (file)
index 0000000..4698a98
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+set -e
+
+if [ "$1" = "purge" ]; then
+       rmdir /etc/mysql 2>/dev/null || true
+       update-alternatives --remove-all my.cnf
+fi
+
+#DEBHELPER#
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-bench.install b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-bench.install
new file mode 100644 (file)
index 0000000..065124b
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql/sql-bench/*
+# legal
+usr/share/doc/mysql-community-bench/COPYING
+usr/share/doc/mysql-community-bench/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-bench.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-bench.lintian-overrides
new file mode 100644 (file)
index 0000000..04df14e
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/LICENSE.mysql
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/COPYING.gz
+mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-client.install b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-client.install
new file mode 100644 (file)
index 0000000..aa4e612
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright (c) 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
+# 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
+
+# binaries
+usr/bin/myisam_ftdump
+usr/bin/mysql
+usr/bin/mysql_embedded
+usr/bin/mysqlaccess
+usr/bin/mysqlaccess.conf
+usr/bin/mysqladmin
+usr/bin/mysqlbug
+usr/bin/mysqlcheck
+usr/bin/mysql_client_test
+usr/bin/mysql_client_test_embedded
+usr/bin/mysqldump
+usr/bin/mysqldumpslow
+usr/bin/mysql_find_rows
+usr/bin/mysql_fix_extensions
+usr/bin/mysqlimport
+usr/bin/mysqlshow
+usr/bin/mysqlslap
+usr/bin/mysql_waitpid
+# man pages
+usr/share/man/man1/myisam_ftdump.1
+usr/share/man/man1/mysql.1
+usr/share/man/man1/mysql_embedded.1
+usr/share/man/man1/mysqlaccess.1
+usr/share/man/man1/mysqladmin.1
+usr/share/man/man1/mysqlbug.1
+usr/share/man/man1/mysqlcheck.1
+usr/share/man/man1/mysql_client_test.1
+usr/share/man/man1/mysql_client_test_embedded.1
+usr/share/man/man1/mysqldump.1
+usr/share/man/man1/mysqldumpslow.1
+usr/share/man/man1/mysql_find_rows.1
+usr/share/man/man1/mysql_fix_extensions.1
+usr/share/man/man1/mysqlimport.1
+usr/share/man/man1/mysqlman.1
+usr/share/man/man1/mysqlshow.1
+usr/share/man/man1/mysqlslap.1
+usr/share/man/man1/mysql_waitpid.1
+# legal
+usr/share/doc/mysql-community-client/COPYING
+usr/share/doc/mysql-community-client/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-client.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-client.lintian-overrides
new file mode 100644 (file)
index 0000000..5892935
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-client/LICENSE.mysql
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-clienti/COPYING.gz
+mysql-community-client: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-client: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.config b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.config
new file mode 100755 (executable)
index 0000000..ceb3373
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+. /usr/share/debconf/confmodule
+
+if [ "$1" = "configure" ] && [ -z "$2" ];
+then
+
+       set -e
+
+       PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-commercial-server
+       INSTALLED_PKG=none
+       MYSQLDATA=/var/lib/mysql
+
+       IFS_BACKUP=${IFS}
+       IFS=":"
+       for PKG in ${PKG_LIST};
+       do
+               STATUS=$(dpkg -s ${PKG} 2> /dev/null | grep Status: | cut -d' ' -f4)
+               if [ "${STATUS}" = "installed" ];
+               then
+                       INSTALLED_PKG=${PKG}
+                       break
+               fi
+       done
+       IFS=${IFS_BACKUP}
+
+       if [ "${INSTALLED_PKG}" = "none" ];
+       then
+               if [ -d ${MYSQLDATA} -o -L ${MYSQLDATA} ];
+               then
+                       db_input high mysql-community-server/data-dir || true
+               else
+                       db_fset mysql-community-server/data-dir seen true
+               fi
+
+               while :; do
+                       PASSWD=""
+                       db_input high mysql-community-server/root-pass || true
+                       db_go
+
+                       db_get mysql-community-server/root-pass
+                       if [ -z "${RET}" ];
+                       then
+                               db_fset mysql-community-server/root-pass seen true
+                               db_fset mysql-community-server/re-root-pass seen true
+                               break
+                       fi
+                       PASSWD="${RET}"
+
+                       db_input high mysql-community-server/re-root-pass || true
+                       db_go
+
+                       db_get mysql-community-server/re-root-pass
+                       if [ "${RET}" == "${PASSWD}" ];
+                       then
+                               PASSWD=""
+                               break
+                       fi
+
+                       db_fset mysql-community-server/root-pass-mismatch seen false
+                       db_input critical mysql-community-server/root-pass-mismatch
+                       db_set mysql-community-server/root-pass ""
+                       db_set mysql-community-server/re-root-pass ""
+               done
+
+       else
+               db_fset mysql-community-server/data-dir seen true
+               db_fset mysql-community-server/root-pass seen true
+               db_fset mysql-community-server/re-root-pass seen true
+       fi
+
+       set +e
+fi
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.dirs b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.dirs
new file mode 100644 (file)
index 0000000..95711c4
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+etc/mysql/mysql.conf.d
+etc/init.d
+usr/lib/mysql
+usr/lib/mysql/plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.install b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.install
new file mode 100644 (file)
index 0000000..229a816
--- /dev/null
@@ -0,0 +1,94 @@
+# Copyright (c) 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
+# 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
+
+# binaries
+usr/bin/innochecksum
+usr/bin/msql2mysql
+usr/bin/myisamchk
+usr/bin/myisamlog
+usr/bin/myisampack
+usr/bin/my_print_defaults
+usr/bin/mysqlbinlog
+usr/bin/mysql_convert_table_format
+usr/bin/mysqld_multi
+usr/bin/mysqld_safe
+usr/bin/mysqlhotcopy
+usr/bin/mysql_install_db
+usr/bin/mysql_plugin
+usr/bin/mysql_secure_installation
+usr/bin/mysql_setpermission
+usr/bin/mysqltest
+usr/bin/mysqltest_embedded
+usr/bin/mysql_tzinfo_to_sql
+usr/bin/mysql_upgrade
+usr/bin/mysql_zap
+usr/bin/perror
+usr/bin/replace
+usr/bin/resolveip
+usr/bin/resolve_stack_dump
+usr/sbin/mysqld
+# debug binary
+usr/sbin/mysqld-debug
+# man pages
+usr/share/man/man1/innochecksum.1
+usr/share/man/man1/comp_err.1
+usr/share/man/man1/msql2mysql.1
+usr/share/man/man1/myisamchk.1
+usr/share/man/man1/myisamlog.1
+usr/share/man/man1/myisampack.1
+usr/share/man/man1/my_print_defaults.1
+usr/share/man/man1/mysqlbinlog.1
+usr/share/man/man1/mysql_convert_table_format.1
+usr/share/man/man1/mysqld_multi.1
+usr/share/man/man1/mysqld_safe.1
+usr/share/man/man1/mysqlhotcopy.1
+usr/share/man/man1/mysql_install_db.1
+usr/share/man/man1/mysql_plugin.1
+usr/share/man/man1/mysql_secure_installation.1
+usr/share/man/man1/mysql.server.1
+usr/share/man/man1/mysql_setpermission.1
+usr/share/man/man1/mysql-stress-test.pl.1
+usr/share/man/man1/mysqltest.1
+usr/share/man/man1/mysqltest_embedded.1
+usr/share/man/man1/mysql_tzinfo_to_sql.1
+usr/share/man/man1/mysql_upgrade.1
+usr/share/man/man1/mysql_zap.1
+usr/share/man/man1/perror.1
+usr/share/man/man1/replace.1
+usr/share/man/man1/resolveip.1
+usr/share/man/man1/resolve_stack_dump.1
+usr/share/man/man8/mysqld.8
+# confguration files
+debian/extra/mysql.cnf  etc/mysql/
+debian/extra/mysqld.cnf etc/mysql/mysql.conf.d/
+# app armor profile
+etc/apparmor.d/usr.sbin.mysqld
+# SQL files
+usr/share/mysql/*.sql
+# plugins
+usr/lib/mysql/plugin/*.so
+usr/lib/mysql/plugin/debug/*.so
+usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/debug/daemon_example.ini
+# support files
+usr/share/mysql/mysqld_multi.server
+usr/share/mysql/magic
+usr/share/mysql/mysql-log-rotate
+usr/share/mysql/mysql-systemd-start
+usr/share/mysql/my-default.cnf
+usr/share/mysql/dictionary.txt
+# legal
+usr/share/doc/mysql-community-server/COPYING
+usr/share/doc/mysql-community-server/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.lintian-overrides
new file mode 100644 (file)
index 0000000..08b3865
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/LICENSE.mysql
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/COPYING.gz
+mysql-community-server: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-server: embedded-library
+# Since we ship debug plugins so this error is overridden
+mysql-community-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.mysql.init b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.mysql.init
new file mode 100755 (executable)
index 0000000..67a0193
--- /dev/null
@@ -0,0 +1,192 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides:          mysql
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Should-Start:      $network $time
+# Should-Stop:       $network $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start/ Stop MySQL Community Server daemon
+# Description:       This service script facilitates startup and shutdown of
+#                    mysqld daemon throught its wrapper script mysqld_safe
+### END INIT INFO
+#
+
+# Copyright (c) 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
+# 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
+
+. /lib/lsb/init-functions
+
+cd /
+umask 077
+
+MYSQLDATA=/var/lib/mysql
+VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
+
+get_mysql_option() {
+       RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
+       if [ -z "$RESULT" ];
+       then
+               RESULT="$3"
+       fi
+       echo $RESULT
+}
+
+get_running () {
+       PIDFILE=$(get_mysql_option mysqld_safe pid-file "")
+       if [ -z "$PIDFILE" ];
+       then
+               PIDFILE=$(get_mysql_option mysqld pid-file "$MYSQLDATA/$(hostname).pid")
+       fi
+       if [ -e "$PIDFILE" ] && [ -d "/proc/$(cat "$PIDFILE")" ];
+       then
+               echo 1
+       else
+               echo 0
+       fi
+}
+
+server_stop () {
+       RUNNING=$(get_running)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${RUNNING}" -eq 0 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               RUNNING=$(get_running)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+  'start')
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
+       then
+               log_action_msg "A MySQL Server is already started"
+       else
+               MYSQLRUN=/var/run/mysqld
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+               fi
+
+               if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+               then
+                       mysql_install_db --user=mysql > /dev/null
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
+               if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+               then
+                       mkdir ${MYSQLRUN}
+                       chown mysql:mysql ${MYSQLRUN}
+                       chmod 755 ${MYSQLRUN}
+               fi
+
+               /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+               su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
+               for i in 1 2 3 4 5 6;
+               do
+                       sleep 1
+                       echo -n .
+               done
+               echo
+               RUNNING=$(get_running)
+               if [ "${RUNNING}" -eq 1 ];
+               then
+                       log_action_msg "MySQL Community Server ${VERSION} is started"
+               else
+                       log_action_msg "MySQL Community Server ${VERSION} did not start. Please check logs for more details."
+               fi
+       fi
+       ;;
+
+  'stop')
+       RUNNING=$(get_running)
+       if [ "${RUNNING}" -eq 1 ];
+       then
+               killall -15 mysqld
+               server_stop
+               if [ "$?" -eq 0 ];
+               then
+                       log_action_msg "MySQL Community Server ${VERSION} is stopped"
+               else
+                       log_action_msg "Attempt to shutdown MySQL Community Server ${VERSION} timed out"
+               fi
+       else
+               log_action_msg "MySQL Community Server ${VERSION} is already stopped"
+       fi
+       ;;
+
+  'restart'|'reload'|'force-reload')
+       log_action_msg "Stopping MySQL Community Server ${VERSION}"
+       $0 stop
+       log_action_msg "Re-starting MySQL Community Server ${VERSION}"
+       $0 start
+       ;;
+
+  'status')
+       RUNNING=$(get_running)
+       if [ ${RUNNING} -eq 1 ];
+       then
+               log_action_msg "MySQL Community Server ${VERSION} is running"
+       else
+               log_action_msg "MySQL Community Server ${VERSION} is not running"
+               exit 3
+       fi
+       ;;
+
+  *)
+       echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
+       exit 1
+       ;;
+esac
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.mysql.service b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.mysql.service
new file mode 100644 (file)
index 0000000..b3e3305
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (c) 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
+# 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
+
+# MySQL systemd service file
+
+[Unit]
+Description=MySQL Community Server
+After=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+User=mysql
+Group=mysql
+PermissionsStartOnly=true
+ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
+ExecStart=/usr/bin/mysqld_safe
+ExecStartPost=/usr/share/mysql/mysql-systemd-start post
+TimeoutSec=600
+Restart=on-failure
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.postinst b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.postinst
new file mode 100755 (executable)
index 0000000..ad164e5
--- /dev/null
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+. /usr/share/debconf/confmodule
+
+take_upstart_job_backup () {
+       if [ -e "/etc/init/mysql.conf" ] && [ -d "/var/lib/mysql" ];
+       then
+               mv /etc/init/mysql.conf /var/lib/mysql/.mysql.conf.backup
+       fi
+}
+
+case "$1" in
+       configure)
+
+       if [ -z "$2" ];
+       then
+               set -e
+
+               update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mysql.cnf" 200
+
+               MYSQLDATA=/var/lib/mysql
+
+               if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+               then
+                       mkdir ${MYSQLDATA}/mysql
+                       chown mysql:mysql ${MYSQLDATA}/mysql
+                       chmod 750 ${MYSQLDATA}/mysql
+                       if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+                       then
+                               mysql_install_db --user=mysql > /dev/null
+                       fi
+               fi
+
+               db_get mysql-community-server/root-pass && PASSWD=${RET}
+               if [ ! -z "${PASSWD}" ];
+               then
+                       db_set mysql-community-server/root-pass ""
+                       db_set mysql-community-server/re-root-pass ""
+                       PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
+               else
+                       PASSWD=""
+               fi
+
+               SQL=`mktemp`
+               if [ -f "${SQL}" ];
+               then
+                       chmod 700 ${SQL}
+                       cat << EOF > ${SQL}
+USE mysql;
+${PASSWD}
+DELETE FROM user WHERE user='';
+FLUSH PRIVILEGES;
+EOF
+                       mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
+                       PASSWD=""
+                       rm -f ${SQL}
+               fi
+
+               set +e
+
+       fi
+
+       ;;
+
+       abort-upgrade|abort-remove|abort-configure)
+
+       ;;
+
+       *)
+       exit 1
+       ;;
+esac
+
+db_stop
+
+take_upstart_job_backup
+
+#DEBHELPER#
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.postrm b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.postrm
new file mode 100755 (executable)
index 0000000..5d4a7b4
--- /dev/null
@@ -0,0 +1,155 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ];
+then
+. /usr/share/debconf/confmodule
+fi
+
+place_upstart_job_back () {
+       if [ -e "/var/lib/mysql/.mysql.conf.backup" ];
+       then
+               mv /var/lib/mysql/.mysql.conf.backup /etc/init/mysql.conf
+       fi
+}
+
+get_pcount () {
+       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+       echo "${PSCOUNT}"
+}
+
+server_stop () {
+       PSCOUNT=$(get_pcount)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${PSCOUNT}" -eq 1 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               PSCOUNT=$(get_pcount)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+       remove)
+
+       set -e
+
+       place_upstart_job_back
+       update-alternatives --remove my.cnf "/etc/mysql/mysql.cnf"
+
+       set +e
+
+       ;;
+
+       purge)
+
+       set -e
+
+       place_upstart_job_back
+
+       MYSQLDATA=/var/lib/mysql
+       MYSQLLOG=/var/log/mysql
+       MYSQLRUN=/var/run/mysqld
+
+       server_stop
+
+       db_input high mysql-community-server/remove-data-dir || true
+       db_go
+       db_get mysql-community-server/remove-data-dir && RMDATADIR=${RET}
+       if [ "${RMDATADIR}" = "true" ];
+       then
+               if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+               then
+                       rm -rf ${MYSQLRUN}
+               fi
+
+               if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+               then
+                       rm -rf ${MYSQLLOG}
+               fi
+
+               if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+               then
+                       rm -rf ${MYSQLDATA}
+               fi
+
+               if getent passwd mysql >/dev/null;
+               then
+                       userdel mysql
+               fi
+       fi
+
+       set +e
+       ;;
+
+       abort-install)
+
+       set -e
+
+       place_upstart_job_back
+
+       if [ -x "/etc/init.d/mysql" ];
+       then
+               invoke-rc.d mysql start || exit $?
+       else
+               if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+               then
+                       rm -rf ${MYSQLRUN}
+               fi
+
+               if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+               then
+                       rm -rf ${MYSQLLOG}
+               fi
+
+               if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+               then
+                       rm -rf ${MYSQLDATA}
+               fi
+
+               if getent passwd mysql >/dev/null;
+               then
+                       userdel mysql
+               fi
+       fi
+
+       set +e
+       ;;
+
+       upgrade|abort-upgrade)
+
+       ;;
+
+       *)
+       exit 1
+       ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.preinst b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.preinst
new file mode 100755 (executable)
index 0000000..c769885
--- /dev/null
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+get_pcount () {
+       PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+       echo "${PSCOUNT}"
+}
+
+server_stop () {
+       PSCOUNT=$(get_pcount)
+       COUNT=0
+       while :; do
+               COUNT=$(( COUNT+1 ))
+               echo -n .
+               if [ "${PSCOUNT}" -eq 1 ];
+               then
+                       echo
+                       break
+               fi
+               if [ "${COUNT}" -gt 15 ];
+               then
+                       echo
+                       return 1
+               fi
+               PSCOUNT=$(get_pcount)
+               sleep 1
+       done
+       return 0
+}
+
+case "$1" in
+       install)
+
+       if [ -z "$2" ];
+       then
+
+               set -e
+
+               if [ -x "/etc/init.d/mysql" ];
+               then
+                       invoke-rc.d mysql stop || exit $?
+                       server_stop
+               fi
+
+               MYSQLDATA=/var/lib/mysql
+               MYSQLLOG=/var/log/mysql
+               MYSQLRUN=/var/run/mysqld
+
+               if ! getent group mysql >/dev/null;
+               then
+                       addgroup --system mysql >/dev/null
+               fi
+
+               if ! getent passwd mysql >/dev/null;
+               then
+                       adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
+               fi
+
+               if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+               then
+                       mkdir ${MYSQLDATA}
+                       chown mysql:mysql ${MYSQLDATA}
+                       chmod 750 ${MYSQLDATA}
+               fi
+
+               if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+               then
+                       mkdir ${MYSQLLOG}
+                       chown mysql:adm ${MYSQLLOG}
+                       chmod 750 ${MYSQLLOG}
+                       touch ${MYSQLLOG}/error.log
+                       chmod 640 ${MYSQLLOG}/error.log
+                       chown mysql:adm ${MYSQLLOG}/error.log
+               fi
+
+               if [ ! -d ${MYSQLRUN} -a ! -L ${MYSQLRUN} ];
+               then
+                       mkdir ${MYSQLRUN}
+                       chown mysql:mysql ${MYSQLRUN}
+                       chmod 755 ${MYSQLRUN}
+               fi
+
+               set +e
+
+       fi
+
+       ;;
+
+       upgrade)
+
+       set -e
+
+       #DEBHELPER#
+       server_stop
+
+       set +e
+
+       ;;
+
+       abort-upgrade)
+
+       ;;
+
+       *)
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.prerm b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.prerm
new file mode 100755 (executable)
index 0000000..1386b5d
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Copyright (c) 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
+# 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
+
+set -e
+
+#DEBHELPER#
+
+set +e
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.templates b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-server.templates
new file mode 100644 (file)
index 0000000..7b7e0ac
--- /dev/null
@@ -0,0 +1,33 @@
+Template: mysql-community-server/root-pass
+Type: password
+Description: Enter root password:
+ Please provide a strong password that will be set for the root account of your MySQL database.
+ Leave it blank if you do not wish to set or change the root password at this time.
+
+Template: mysql-community-server/re-root-pass
+Type: password
+Description: Re-enter root password:
+ Now that you have selected a password for the root account, please confirm by typing it again. Do not share the password with anyone.
+
+Template: mysql-community-server/root-pass-mismatch
+Type: error
+Description: The two passwords did not match
+ Please try again. Make sure you type the exact same password twice.
+
+Template: mysql-community-server/remove-data-dir
+Type: boolean
+Default: false
+Description: Remove data directory at /var/lib/mysql ?
+ This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ It is highly recommended to take data backup before removing the data directory.
+
+Template: mysql-community-server/data-dir
+Type: note
+Description: Data directory found when no MySQL server package is installed
+ A data directory '/var/lib/mysql' is present on this system when no MySQL server 
+ package is currently installed on the system. The directory may be under control of
+ server package received from third-party vendors. It may also be an unclaimed data
+ directory from previous removal of mysql packages.
+ .
+ It is highly recommended to take data backup. If you have not done so, now would be
+ the time to take backup in another shell. Once completed, press 'Ok' to continue.
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-source.install b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-source.install
new file mode 100644 (file)
index 0000000..46a0f12
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (c) 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
+# 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
+
+../*.dsc    usr/src/mysql/
+../*.tar.gz usr/src/mysql/
+../*.tar.xz usr/src/mysql/
+# legal
+usr/share/doc/mysql-community-source/COPYING
+usr/share/doc/mysql-community-source/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-source.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-source.lintian-overrides
new file mode 100644 (file)
index 0000000..9ca84e9
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/LICENSE.mysql
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/COPYING.gz
+mysql-community-source: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-test.install b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-test.install
new file mode 100644 (file)
index 0000000..e70086b
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql-test/*
+usr/share/man/man1/mysql-test-run.pl.1
+# legal
+usr/share/doc/mysql-community-test/COPYING
+usr/share/doc/mysql-community-test/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-test.links b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-test.links
new file mode 100644 (file)
index 0000000..bf66c98
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (c) 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
+# 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
+
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mysql-test-run
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mtr
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-test.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/mysql-community-test.lintian-overrides
new file mode 100644 (file)
index 0000000..ff273bb
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/LICENSE.mysql
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/COPYING.gz
+mysql-community-test: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-server.install b/mysql-wsrep-5.6/packaging/deb-wily/mysql-server.install
new file mode 100644 (file)
index 0000000..e3aa8de
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-server/COPYING
+usr/share/doc/mysql-server/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-server.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/mysql-server.lintian-overrides
new file mode 100644 (file)
index 0000000..4877097
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-server: extra-license-file usr/share/doc/mysql-server/LICENSE.mysql
+mysql-server: extra-license-file usr/share/doc/mysql-server/COPYING.gz
+mysql-server: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-testsuite.install b/mysql-wsrep-5.6/packaging/deb-wily/mysql-testsuite.install
new file mode 100644 (file)
index 0000000..dfc1733
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+# legal
+usr/share/doc/mysql-testsuite/COPYING
+usr/share/doc/mysql-testsuite/README
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/mysql-testsuite.lintian-overrides b/mysql-wsrep-5.6/packaging/deb-wily/mysql-testsuite.lintian-overrides
new file mode 100644 (file)
index 0000000..37488fe
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 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
+# 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
+
+# Additional license file is needed so overriding this warning
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/LICENSE.mysql
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/COPYING.gz
+mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/patches/fix-man-page-links.patch b/mysql-wsrep-5.6/packaging/deb-wily/patches/fix-man-page-links.patch
new file mode 100644 (file)
index 0000000..004ccdf
--- /dev/null
@@ -0,0 +1,14 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Fix path in man page link.
+Bug: http://bugs.mysql.com/bug.php?id=70952
+
+--- a/man/mysql_client_test_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysql_client_test_embedded.1 2013-11-14 19:29:56.768315219 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysql_client_test.1
++.so man1/mysql_client_test.1
+--- a/man/mysqltest_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysqltest_embedded.1 2013-11-14 19:31:19.079280675 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysqltest.1
++.so man1/mysqltest.1
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/patches/fix-mtr-search-paths.patch b/mysql-wsrep-5.6/packaging/deb-wily/patches/fix-mtr-search-paths.patch
new file mode 100644 (file)
index 0000000..8a27a09
--- /dev/null
@@ -0,0 +1,13 @@
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Adding extra search path for testsuite.
+
+--- a/mysql-test/lib/mtr_cases.pm      2014-02-24 13:14:37 +0530
++++ b/mysql-test/lib/mtr_cases.pm      2014-07-02 11:46:24 +0530
+@@ -288,6 +288,7 @@
+     {
+       $suitedir= my_find_dir($::basedir,
+                            ["share/mysql-test/suite",
++                            "lib/mysql-test/suite",
+                             "mysql-test/suite",
+                             "internal/mysql-test/suite",
+                             "mysql-test",
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/patches/fix-mysql_install_db.patch b/mysql-wsrep-5.6/packaging/deb-wily/patches/fix-mysql_install_db.patch
new file mode 100644 (file)
index 0000000..41311b2
--- /dev/null
@@ -0,0 +1,43 @@
+From: Terje Røsten <terje.rosten@oracle.com>
+Description: Maintains the pending --skip-my-cnf option in mainline
+Bug: <TODO>
+
+diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
+index 440a977..7d068fc 100644
+--- a/scripts/mysql_install_db.pl.in
++++ b/scripts/mysql_install_db.pl.in
+@@ -113,6 +113,7 @@ EOF2
+   print <<EOF3;
+   --rpm                For internal use.  This option is used by RPM files
+                        during the MySQL installation process.
++                       Implies --keep-my-cnf option.
+   --skip-name-resolve  Use IP addresses rather than hostnames when creating
+                        grant table entries.  This option can be useful if
+                        your DNS does not work.
+@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} )
+ {
+   error($opt,"Specify either --basedir or --srcdir, not both");
+ }
+-if ( $opt->{'keep-my-cnf'} )
++if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
+ {
+   $keep_my_cnf = 1;
+ }
+@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
+ }
+
+ # ----------------------------------------------------------------------
+-# Create database directories mysql & test
++# Create database directory mysql
+ # ----------------------------------------------------------------------
+
+ # FIXME The shell variant uses "mkdir -p":
+@@ -697,7 +698,7 @@ if ($opt_user)
+   }
+ }
+
+-foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
++foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql")
+ {
+   mkdir($dir, 0700) unless -d $dir;
+   if ($opt_user and -w "/")
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/patches/series b/mysql-wsrep-5.6/packaging/deb-wily/patches/series
new file mode 100644 (file)
index 0000000..e3b20d6
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 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
+# 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
+
+#fix-man-page-links.patch
+fix-mysql_install_db.patch
+fix-mtr-search-paths.patch
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/rules b/mysql-wsrep-5.6/packaging/deb-wily/rules
new file mode 100755 (executable)
index 0000000..b9cd814
--- /dev/null
@@ -0,0 +1,137 @@
+#!/usr/bin/make -f
+
+# Copyright (c) 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
+# 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
+
+%:
+       dh $@
+
+export DH_VERBOSE=1
+export CFLAGS=
+export CXXFLAGS=
+
+override_dh_auto_configure:
+       @echo "RULES.$@"
+       cmake . \
+               -DBUILD_CONFIG=mysql_release \
+               -DCMAKE_INSTALL_PREFIX=/usr \
+               -DINSTALL_DOCDIR=share/mysql/docs \
+               -DINSTALL_DOCREADMEDIR=share/mysql \
+               -DINSTALL_INCLUDEDIR=include/mysql \
+               -DINSTALL_INFODIR=share/mysql/docs \
+               -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
+               -DINSTALL_MANDIR=share/man \
+               -DINSTALL_MYSQLSHAREDIR=share/mysql \
+               -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
+               -DINSTALL_PLUGINDIR=lib/mysql/plugin \
+               -DINSTALL_SBINDIR=sbin \
+               -DINSTALL_SCRIPTDIR=bin \
+               -DINSTALL_SQLBENCHDIR=lib/mysql \
+               -DINSTALL_SUPPORTFILESDIR=share/mysql \
+               -DMYSQL_DATADIR=/var/lib/mysql \
+               -DSYSCONFDIR=/etc/mysql \
+               -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
+               -DWITH_SSL=bundled \
+               -DWITH_ZLIB=system \
+               -DWITH_EXTRA_CHARSETS=all \
+               -DWITH_INNODB_MEMCACHED=1 \
+               -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
+               -DINSTALL_LAYOUT=DEB
+
+       cat CMakeCache.txt
+       touch $@
+
+override_dh_auto_build:
+       @echo "RULES.$@"
+       $(MAKE) -j8 VERBOSE=1
+       touch $@
+
+override_dh_auto_test:
+       @echo "RULES.$@"
+       echo "No tests run because test 9: pfs_connect_attr is failing unreasonably"
+       touch $@
+
+override_dh_auto_install:
+
+       @echo "RULES.$@"
+       # complete install first
+       $(MAKE) install DESTDIR=debian/tmp
+       # remove all redundant files and links
+       rm debian/tmp/usr/lib/*/*_r*
+       rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
+       rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
+       rm debian/tmp/usr/lib/mysql-test/Makefile
+       # add missing man pages
+       install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+       # add MySQL Server debug binary and library to package
+       install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+       install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       # add debug plugin libraries to package
+       install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
+       for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
+       install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+       install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
+       # add apparmor profile
+       install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld
+       # add systemd script
+       install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/
+       # add directory for legal docs
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-client
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-bench
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-test
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-source
+       # add COPYING file to each package
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
+       # add README file to each package
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
+       touch $@
+
+override_dh_installinit:
+       @echo "RULES.$@"
+       dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld
+       dh_systemd_enable --name=mysql
+       dh_installinit --name=mysql -- defaults 19 21
+       dh_systemd_start --restart-after-upgrade
+       touch $@
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/source/format b/mysql-wsrep-5.6/packaging/deb-wily/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/source/include-binaries b/mysql-wsrep-5.6/packaging/deb-wily/source/include-binaries
new file mode 100644 (file)
index 0000000..8ad88e4
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (c) 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
+# 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
+
+# obscured filename for mysqld-debug, libmysqld-debug.a and debug plugins
+debian/extra/server-binary
+debian/extra/embedded-server
+debian/extra/adt_null-plugin
+debian/extra/auth-plugin
+debian/extra/auth_socket-plugin
+debian/extra/auth_test_plugin-plugin
+debian/extra/innodb_engine-plugin
+debian/extra/libdaemon_example-plugin
+debian/extra/libmemcached-plugin
+debian/extra/mypluglib-plugin
+debian/extra/mysql_no_login-plugin
+debian/extra/qa_auth_client-plugin
+debian/extra/qa_auth_interface-plugin
+debian/extra/qa_auth_server-plugin
+debian/extra/semisync_master-plugin
+debian/extra/semisync_slave-plugin
+debian/extra/validate_password-plugin
diff --git a/mysql-wsrep-5.6/packaging/deb-wily/watch b/mysql-wsrep-5.6/packaging/deb-wily/watch
new file mode 100644 (file)
index 0000000..c45c5e3
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://mysql.mirrors.pair.com/Downloads/MySQL-5.6/mysql-([\d\.]+).tar.gz
similarity index 51%
rename from mysql-wsrep-5.6/packaging/rpm-uln/CMakeLists.txt
rename to mysql-wsrep-5.6/packaging/rpm-docker/CMakeLists.txt
index de1c74319f3cabfc499e37a7d677c571b2fe34f5..980cb2b4dcbf0070af4455ae032dedc9945b0033 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2012, 2013, 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
 IF(UNIX)
   SET(prefix ${CMAKE_INSTALL_PREFIX})
 
-  SET(SPECFILENAME "mysql.${VERSION}.spec")
-  IF("${VERSION}" MATCHES "-ndb-")
-    STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}")
-    SET(SPECFILENAME "mysql-cluster-${NDBVERSION}.spec")
-  ENDIF()
+  SET(SPECFILENAME "mysql.spec")
 
   # Left in current directory, to be taken during build
-  CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME} @ONLY)
+  CONFIGURE_FILE(mysql.spec.in ${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME} @ONLY)
 
-  FOREACH(ulnfile filter-requires-mysql.sh generate-tarball.sh my.cnf my_config.h
-          mysql-5.5-fix-tests.patch mysql-5.5-libdir.patch
-          mysql-5.5-mtr1.patch mysql-5.5-testing.patch
-          mysql-chain-certs.patch mysql-embedded-check.c mysql-expired-certs.patch
-          mysql.init mysql-install-test.patch mysql-strmov.patch scriptstub.c
-          README.mysql-docs)
-    CONFIGURE_FILE(${ulnfile} ${CMAKE_CURRENT_BINARY_DIR}/${ulnfile} COPYONLY)
+  FOREACH(fedfile my.cnf)
+    CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY)
   ENDFOREACH()
 ENDIF()
 
diff --git a/mysql-wsrep-5.6/packaging/rpm-docker/my.cnf b/mysql-wsrep-5.6/packaging/rpm-docker/my.cnf
new file mode 100644 (file)
index 0000000..c1c03c1
--- /dev/null
@@ -0,0 +1,32 @@
+# For advice on how to change settings please see
+# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
+
+[mysqld]
+#
+# Remove leading # and set to the amount of RAM for the most important data
+# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
+# innodb_buffer_pool_size = 128M
+#
+# Remove leading # to turn on a very important data integrity option: logging
+# changes to the binary log between backups.
+# log_bin
+#
+# Remove leading # to set options mainly useful for reporting servers.
+# The server defaults are faster for transactions and fast SELECTs.
+# Adjust sizes as needed, experiment to find the optimal values.
+# join_buffer_size = 128M
+# sort_buffer_size = 2M
+# read_rnd_buffer_size = 2M
+skip-host-cache
+skip-name-resolve
+datadir=/var/lib/mysql
+socket=/var/lib/mysql/mysql.sock
+secure-file-priv=/var/lib/mysql-files
+user=mysql
+
+# Disabling symbolic-links is recommended to prevent assorted security risks
+symbolic-links=0
+
+log-error=/var/log/mysqld.log
+pid-file=/var/run/mysqld/mysqld.pid
+
diff --git a/mysql-wsrep-5.6/packaging/rpm-docker/mysql.spec.in b/mysql-wsrep-5.6/packaging/rpm-docker/mysql.spec.in
new file mode 100644 (file)
index 0000000..47498f3
--- /dev/null
@@ -0,0 +1,1171 @@
+# 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
+# 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.
+
+%global mysql_vendor Oracle and/or its affiliates
+%global mysqldatadir /var/lib/mysql
+
+# Regression tests may take a long time, override the default to skip them
+%{!?runselftest:%global runselftest 0}
+
+%{!?product_suffix:              %global product_suffix community}
+%{!?feature_set:                 %global feature_set community}
+%{!?compilation_comment_release: %global compilation_comment_release MySQL Community Server - (GPL)}
+%{!?compilation_comment_debug:   %global compilation_comment_debug MySQL Community Server - Debug (GPL)}
+%{!?src_base:                    %global src_base mysql}
+
+%global src_dir               %{src_base}-%{version}
+
+%if 0%{?commercial}
+%global license_files_server  %{src_dir}/LICENSE.mysql
+%global license_type          Commercial
+%else
+%global license_files_server  %{src_dir}/COPYING %{src_dir}/README
+%global license_type          GPLv2
+%endif
+
+Name:           mysql-%{product_suffix}-minimal
+Summary:        A very fast and reliable SQL database server
+Group:          Applications/Databases
+Version:        @VERSION@
+Release:        2%{?commercial:.1}%{?dist}
+License:        Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field.
+URL:            http://www.mysql.com/
+Packager:       MySQL Release Engineering <mysql-build@oss.oracle.com>
+Vendor:         %{mysql_vendor}
+Source0:        https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
+BuildRequires:  cmake
+BuildRequires:  perl
+BuildRequires:  perl(Time::HiRes)
+BuildRequires:  perl(Env)
+BuildRequires:  time
+BuildRequires:  libaio-devel
+BuildRequires:  ncurses-devel
+BuildRequires:  numactl-devel
+BuildRequires:  openssl-devel
+BuildRequires:  zlib-devel
+BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+
+# For rpm => 4.9 only: https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering
+%global __requires_exclude ^perl\\((GD|hostnames|lib::mtr|lib::v1|mtr_|My::)
+%global __provides_exclude_from ^(/usr/share/(mysql|mysql-test)/.*|%{_libdir}/mysql/plugin/.*\\.so)$
+
+%description
+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
+as for embedding into mass-deployed software. MySQL is a trademark of
+%{mysql_vendor}
+
+The MySQL software has Dual Licensing, which means you can use the MySQL
+software free of charge under the GNU General Public License
+(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
+the GPL. See the chapter "Licensing and Support" in the manual for
+further info.
+
+The MySQL web site (http://www.mysql.com/) provides the latest
+news and information about the MySQL software. Also please see the
+documentation and the manual for more information.
+
+%package -n     mysql-%{product_suffix}-server-minimal
+Summary:        A very fast and reliable SQL database server
+Group:          Applications/Databases
+Requires:       shadow-utils
+Requires:       perl(Data::Dumper)
+Provides:       mysql-server = %{version}-%{release}
+Provides:       mysql-server%{?_isa} = %{version}-%{release}
+Provides:       mysql-compat-server = %{version}-%{release}
+Provides:       mysql-compat-server%{?_isa} = %{version}-%{release}
+
+%description -n mysql-%{product_suffix}-server-minimal
+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
+as for embedding into mass-deployed software. MySQL is a trademark of
+%{mysql_vendor}
+
+The MySQL software has Dual Licensing, which means you can use the MySQL
+software free of charge under the GNU General Public License
+(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
+the GPL. See the chapter "Licensing and Support" in the manual for
+further info.
+
+The MySQL web site (http://www.mysql.com/) provides the latest news and
+information about the MySQL software.  Also please see the documentation
+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.
+%prep
+%setup -q -T -a 0 -c -n %{src_dir}
+
+%build
+# Fail quickly and obviously if user tries to build as root
+%if 0%{?runselftest}
+if [ "x$(id -u)" = "x0" ] ; then
+   echo "The MySQL regression tests may fail if run as root."
+   echo "If you really need to build the RPM as root, use"
+   echo "--define='runselftest 0' to skip the regression tests."
+   exit 1
+fi
+%endif
+
+# Build full release
+mkdir release
+(
+  cd release
+  cmake ../%{src_dir} \
+           -DBUILD_CONFIG=mysql_release \
+           -DINSTALL_LAYOUT=RPM \
+           -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+           -DCMAKE_C_FLAGS="%{optflags}" \
+           -DCMAKE_CXX_FLAGS="%{optflags}" \
+           -DWITH_INNODB_MEMCACHED=1 \
+           -DINSTALL_LIBDIR="%{_lib}/mysql" \
+           -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
+           -DINSTALL_SQLBENCHDIR="" \
+           -DINSTALL_MYSQLTESTDIR="" \
+           -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
+           -DFEATURE_SET="%{feature_set}" \
+           -DWITH_EMBEDDED_SERVER=0 \
+           -DWITH_EMBEDDED_SHARED_LIBRARY=0 \
+           -DWITH_SSL=system \
+           -DCOMPILATION_COMMENT="%{compilation_comment_release}" \
+           -DMYSQL_SERVER_SUFFIX="%{?server_suffix}"
+  echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
+  make %{?_smp_mflags} VERBOSE=1
+)
+
+%install
+MBD=$RPM_BUILD_DIR/%{src_dir}
+
+# Ensure that needed directories exists
+install -d -m 0750 %{buildroot}/var/lib/mysql
+install -d -m 0755 %{buildroot}/var/run/mysqld
+install -d -m 0750 %{buildroot}/var/lib/mysql-files
+
+# Install all binaries
+cd $MBD/release
+make DESTDIR=%{buildroot} install
+
+# TODO: move to rpm-docker
+install -D -m 0644 $MBD/release/packaging/rpm-docker/my.cnf %{buildroot}%{_sysconfdir}/my.cnf
+install -d %{buildroot}%{_sysconfdir}/my.cnf.d
+
+# Remove man, sql-bench, include, and libs
+for f in %{_mandir} %{_datadir}/sql-bench %{_includedir} %{_datadir}/aclocal/mysql.m4 ; do
+    rm -rf %{buildroot}$f
+done
+rm -rf %{buildroot}%{_libdir}/mysql/libmysql*
+
+# Removing some tools
+for f in msql2mysql mysqlaccess mysqlaccess.conf mysqlbug mysql_convert_table_format \
+         mysql_find_rows mysql_fix_extensions mysqlhotcopy mysql_setpermission \
+         mysql_waitpid mysql_zap; do
+    rm -f %{buildroot}%{_bindir}/$f
+done
+
+for f in innochecksum myisamchk myisam_ftdump myisamlog myisampack mysqladmin \
+         mysqlbinlog mysqlcheck mysql_client_test mysql_config_editor \
+         mysqld_multi mysqld_safe mysqldumpslow mysql_embedded mysqlimport \
+         mysql_plugin mysql_secure_installation mysqlshow mysqlslap  mysqltest \
+         perror replace  resolveip  resolve_stack_dump; do
+    rm -f %{buildroot}%{_bindir}/$f
+done
+
+#  Remove test plugins
+for p in auth.so auth_test_plugin.so daemon_example.ini libdaemon_example.so qa_auth_client.so \
+    qa_auth_interface.so qa_auth_server.so replication_observers_example_plugin.so ha_example.so ; do
+    rm -f %{buildroot}%{_libdir}/mysql/plugin/$p
+done
+
+# No need for these scripts
+rm -f %{buildroot}%{_datadir}/mysql/{mysql.server,mysqld_multi.server,mysql-log-rotate,binary-configure}
+
+%check
+%if 0%{?runselftest}
+pushd release
+make test VERBOSE=1
+export MTR_BUILD_THREAD=auto
+pushd mysql-test
+./mtr \
+    --mem --parallel=auto --force --retry=0 \
+    --mysqld=--binlog-format=mixed \
+    --suite-timeout=720 --testcase-timeout=30 \
+    --clean-vardir
+rm -r $(readlink var) var
+%endif
+
+%pre -n mysql-%{product_suffix}-server-minimal
+/usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || :
+/usr/sbin/useradd -M -N -g mysql -o -r -d /var/lib/mysql -s /bin/false \
+    -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
+
+%post -n mysql-%{product_suffix}-server-minimal
+/bin/touch /var/log/mysqld.log >/dev/null 2>&1 || :
+/bin/chmod 0640 /var/log/mysqld.log >/dev/null 2>&1 || :
+/bin/chown mysql:mysql /var/log/mysqld.log >/dev/null 2>&1 || :
+
+%files -n mysql-%{product_suffix}-server-minimal
+%defattr(-, root, root, -)
+%doc %{?license_files_server}
+%doc %{src_dir}/Docs/INFO_SRC*
+%doc release/Docs/INFO_BIN*
+%config(noreplace) %{_sysconfdir}/my.cnf
+%dir %{_sysconfdir}/my.cnf.d
+%attr(755, root, root) %{_sbindir}/mysqld
+%attr(755, root, root) %{_bindir}/mysql
+%attr(755, root, root) %{_bindir}/mysqldump
+%attr(755, root, root) %{_bindir}/mysql_config
+%attr(755, root, root) %{_bindir}/mysql_install_db
+%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql
+%attr(755, root, root) %{_bindir}/mysql_upgrade
+%attr(755, root, root) %{_bindir}/my_print_defaults
+%dir %{_libdir}/mysql/plugin
+%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/validate_password.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/mysql_no_login.so
+%dir %{_datadir}/mysql/
+%{_datadir}/mysql/charsets/
+%{_datadir}/mysql/bulgarian/
+%{_datadir}/mysql/czech/
+%{_datadir}/mysql/danish/
+%{_datadir}/mysql/dutch/
+%{_datadir}/mysql/english/
+%{_datadir}/mysql/estonian/
+%{_datadir}/mysql/french/
+%{_datadir}/mysql/german/
+%{_datadir}/mysql/greek/
+%{_datadir}/mysql/hungarian/
+%{_datadir}/mysql/italian/
+%{_datadir}/mysql/japanese/
+%{_datadir}/mysql/korean/
+%{_datadir}/mysql/norwegian-ny/
+%{_datadir}/mysql/norwegian/
+%{_datadir}/mysql/polish/
+%{_datadir}/mysql/portuguese/
+%{_datadir}/mysql/romanian/
+%{_datadir}/mysql/russian/
+%{_datadir}/mysql/serbian/
+%{_datadir}/mysql/slovak/
+%{_datadir}/mysql/spanish/
+%{_datadir}/mysql/swedish/
+%{_datadir}/mysql/ukrainian/
+%attr(644, root, root) %{_datadir}/mysql/errmsg-utf8.txt
+%attr(644, root, root) %{_datadir}/mysql/my-default.cnf
+%attr(644, root, root) %{_datadir}/mysql/fill_help_tables.sql
+%attr(644, root, root) %{_datadir}/mysql/mysql_system_tables.sql
+%attr(644, root, root) %{_datadir}/mysql/mysql_system_tables_data.sql
+%attr(644, root, root) %{_datadir}/mysql/mysql_test_data_timezone.sql
+%attr(644, root, root) %{_datadir}/mysql/mysql_security_commands.sql
+%attr(644, root, root) %{_datadir}/mysql/dictionary.txt
+%attr(644, root, root) %{_datadir}/mysql/innodb_memcached_config.sql
+%attr(644, root, root) %{_datadir}/mysql/magic
+%dir %attr(750, mysql, mysql) /var/lib/mysql
+%dir %attr(755, mysql, mysql) /var/run/mysqld
+%dir %attr(750, mysql, mysql) /var/lib/mysql-files
+
+%changelog
+* Thu Jun 25 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.26-1
+- Update package names
+
+* Mon Feb 16 2015 Terje Rosten <terje.rosten@oracle.com> - 5.6.23-1
+- Port to 5.6.
+
+* Mon Feb 16 2015 Terje Rosten <terje.rosten@oracle.com> - 5.7.6-0.3.m16
+- Introduce minimal server for docker
+
+* Tue Feb 3 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.6-0.2.m16
+- Include boost sources
+- Fix cmake buildrequires
+- Fix build on el5 with gcc44
+- Add license info in each subpackage
+- Soname bump, more compat packages
+- Updated default shell for mysql user
+- Added mysql_ssl_rsa_setup
+- Include mysql-files directory
+
+* Thu Sep 18 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.6-0.2.m16
+- Provide replication_observers_example_plugin.so plugin
+
+* Tue Sep 2 2014 Bjorn Munch <bjorn.munch@oracle.com> - 5.7.6-0.1.m16
+- Updated for 5.7.6
+
+* Fri Aug 08 2014 Erlend Dahl <erlend.dahl@oracle.com> - 5.7.5-0.6.m15
+- Provide mysql_no_login.so plugin
+
+* Wed Aug 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.5-0.5.m15
+- Provide mysql-compat-server dependencies 
+
+* Wed Jul 09 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.5-0.4.m15
+- Remove perl(GD) and dtrace dependencies
+
+* Thu Jun 26 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.5-0.3.m15
+- Resolve embedded-devel conflict issue
+
+* Wed Jun 25 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.5-0.2.m15
+- Add bench package
+- Enable dtrace 
+
+* Thu Apr 24 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.5-0.1.m15
+- Updated for 5.7.5
+
+* Mon Apr 07 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.4-0.5.m14
+- Fix Cflags for el7 
+
+* Mon Mar 31 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.4-0.4.m14
+- Support for enterprise packages
+- Upgrade from MySQL-* packages
+
+* Wed Mar 12 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.4-0.3.m14
+- Resolve conflict with mysql-libs-compat 
+
+* Thu Mar 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.4-0.2.m14
+- Resolve conflict issues during upgrade
+- Add ha_example.so plugin which is now included
+
+* Fri Feb 07 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.4-0.1.m14
+- 5.7.4
+- Enable shared libmysqld by cmake option
+- Move mysqltest and test plugins to test subpackage
+
+* Mon Nov 18 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.3-0.3.m13
+- Fixed isa_bits error 
+
+* Fri Oct 25 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.3-0.1.m13
+- Initial 5.7 port
+
+* Fri Oct 25 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.15-1
+- Fixed uln advanced rpm libyassl.a error
+- Updated to 5.6.15
+
+* Wed Oct 16 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.14-3
+- Fixed mysql_install_db usage 
+- Improved handling of plugin directory 
+
+* Fri Sep 27 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.14-2
+- Refresh mysql-install patch and service renaming
+
+* Mon Sep 16 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.14-1
+- Updated to 5.6.14
+
+* Wed Sep 04 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-5
+- Support upgrade from 5.5 ULN packages to 5.6 
+
+* Tue Aug 27 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-4
+- Enhanced perl filtering 
+- Added openssl-devel to buildreq 
+
+* Wed Aug 21 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-3
+- Removed mysql_embedded binary to resolve multilib conflict issue
+
+* Fri Aug 16 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-2 
+- Fixed Provides and Obsoletes issues in server, test packages 
+
+* Wed Aug 14 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-1
+- Updated to 5.6.13
+
+* Mon Aug 05 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-9
+- Added files list to embedded packages 
+
+* Thu Aug 01 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-8
+- Updated libmysqld.a with libmysqld.so in embedded package
+
+* Mon Jul 29 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-7
+- Updated test package dependency from client to server
+
+* Wed Jul 24 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-6
+- Added libs-compat dependency under libs package to resolve server
+  installation conflicts issue.
+* Wed Jul 17 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-5
+- Removed libmysqlclient.so.16 from libs package
+* Fri Jul 05 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-4
+- Adjusted to work on OEL6
+
+* Wed Jun 26 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-3
+- Move libs to mysql/
+- Basic multi arch support
+- Fix changelog dates
+
+* Thu Jun 20 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-2
+- Major cleanup
+
+* Tue Jun 04 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-1
+- Updated to 5.6.12
+
+* Mon Nov 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Allow to override the default to use the bundled yaSSL by an option like
+      --define="with_ssl /path/to/ssl"
+
+* Wed Oct 10 2012 Bjorn Munch <bjorn.munch@oracle.com>
+
+- Replace old my-*.cnf config file examples with template my-default.cnf
+
+* Fri Oct 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Let the installation use the new option "--random-passwords" of "mysql_install_db".
+  (Bug# 12794345 Ensure root password)
+- Fix an inconsistency: "new install" vs "upgrade" are told from the (non)existence
+  of "$mysql_datadir/mysql" (holding table "mysql.user" and other system stuff).
+
+* Tue Jul 24 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Add a macro "runselftest":
+  if set to 1 (default), the test suite will be run during the RPM build;
+  this can be oveeridden via the command line by adding
+      --define "runselftest 0"
+  Failures of the test suite will NOT make the RPM build fail!
+
+* Mon Jul 16 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Add the man page for the "mysql_config_editor".
+
+* Mon Jun 11 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging.
+
+* Wed Feb 29 2012 Brajmohan Saxena <brajmohan.saxena@oracle.com>
+
+- Removal all traces of the readline library from mysql (BUG 13738013)
+
+* Wed Sep 28 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Fix duplicate mentioning of "mysql_plugin" and its manual page,
+  it is better to keep alphabetic order in the files list (merging!).
+
+* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace
+  the RPMs of any configuration (of the current or the preceding release series)
+  by the new ones. This is done by not using the implicitly generated capabilities
+  (which include the configuration name) and relying on more generic ones which
+  just list the function ("server", "client", ...).
+  The implicit generation cannot be prevented, so all these capabilities must be
+  explicitly listed in "Obsoletes:"
+
+* Tue Sep 13 2011 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6.  Due to
+  changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install)
+  this necessitated a move of the libmygcc.a installation to the install
+  phase, which is probably where it belonged in the first place.
+
+* Tue Sep 13 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- "make_win_bin_dist" and its manual are dropped, cmake does it different.
+
+* Thu Sep 08 2011 Daniel Fischer <daniel.fischer@oracle.com>
+
+- Add mysql_plugin man page.
+
+* Tue Aug 30 2011 Tor Didriksen <tor.didriksen@oracle.com>
+
+- Set CXX=g++ by default to add a dependency on libgcc/libstdc++.
+  Also, remove the use of the -fno-exceptions and -fno-rtti flags.
+  TODO: update distro_buildreq/distro_requires
+
+* Tue Aug 30 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Add the manual page for "mysql_plugin" to the server package.
+
+* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Null-upmerge the fix of bug#37165: This spec file is not affected.
+- Replace "/var/lib/mysql" by the spec file variable "%%{mysqldatadir}".
+
+* Fri Aug 12 2011 Daniel Fischer <daniel.fischer@oracle.com>
+
+- Source plugin library files list from cmake-generated file.
+
+* Mon Jul 25 2011 Chuck Bell <chuck.bell@oracle.com>
+
+- Added the mysql_plugin client - enables or disables plugins.
+
+* Thu Jul 21 2011 Sunanda Menon <sunanda.menon@oracle.com>
+
+- Fix bug#12561297: Added the MySQL embedded binary
+
+* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Fix bug#45415: "rpm upgrade recreates test database"
+  Let the creation of the "test" database happen only during a new installation,
+  not in an RPM upgrade.
+  This affects both the "mkdir" and the call of "mysql_install_db".
+
+* Wed Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- 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)
+  should still work, and use these locations.
+  The problem was that the fix for bug#27072 did not check for local settings.
+
+* Mon Jan 31 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Install the new "manifest" files: "INFO_SRC" and "INFO_BIN".
+
+* Tue Nov 23 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- EXCEPTIONS-CLIENT has been deleted, remove it from here too
+- Support MYSQL_BUILD_MAKE_JFLAG environment variable for passing
+  a '-j' argument to make.
+
+* Mon Nov 1 2010 Georgi Kodinov <georgi.godinov@oracle.com>
+
+- Added test authentication (WL#1054) plugin binaries
+
+* Wed Oct 6 2010 Georgi Kodinov <georgi.godinov@oracle.com>
+
+- Added example external authentication (WL#1054) plugin binaries
+
+* Wed Aug 11 2010 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- With a recent spec file cleanup, names have changed: A "-community" part was dropped.
+  Reflect that in the "Obsoletes" specifications.
+- Add a "triggerpostun" to handle the uninstall of the "-community" server RPM.
+- This fixes bug#55015 "MySQL server is not restarted properly after RPM upgrade".
+
+* Tue Jun 15 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Change the behaviour on installation and upgrade:
+  On installation, do not autostart the server.
+  *Iff* the server was stopped before the upgrade is started, this is taken as a
+  sign the administrator is handling that manually, and so the new server will
+  not be started automatically at the end of the upgrade.
+  The start/stop scripts will still be installed, so the server will be started
+  on the next machine boot.
+  This is the 5.5 version of fixing bug#27072 (RPM autostarting the server).
+
+* Tue Jun 1 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- Implement SELinux checks from distribution-specific spec file.
+
+* Wed May 12 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- Large number of changes to build using CMake
+- Introduce distribution-specific RPMs
+- Drop debuginfo, build all binaries with debug/symbols
+- Remove __os_install_post, use native macro
+- Remove _unpackaged_files_terminate_build, make it an error to have
+  unpackaged files
+- Remove cluster RPMs
+
+* Wed Mar 24 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Add "--with-perfschema" to the configure options.
+
+* Mon Mar 22 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- User "usr/lib*" to allow for both "usr/lib" and "usr/lib64",
+  mask "rmdir" return code 1.
+- Remove "ha_example.*" files from the list, they aren't built.
+
+* Wed Mar 17 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Fix a wrong path name in handling the debug plugins.
+
+* Wed Mar 10 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Take the result of the debug plugin build and put it into the optimized tree,
+  so that it becomes part of the final installation;
+  include the files in the packlist. Part of the fixes for bug#49022.
+
+* Mon Mar 01 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Set "Oracle and/or its affiliates" as the vendor and copyright owner,
+  accept upgrading from packages showing MySQL or Sun as vendor.
+
+* Fri Feb 12 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Formatting changes:
+  Have a consistent structure of separator lines and of indentation
+  (8 leading blanks => tab).
+- Introduce the variable "src_dir".
+- Give the environment variables "MYSQL_BUILD_CC(CXX)" precedence
+  over "CC" ("CXX").
+- Drop the old "with_static" argument analysis, this is not supported
+  in 5.1 since ages.
+- Introduce variables to control the handlers individually, as well
+  as other options.
+- Use the new "--with-plugin" notation for the table handlers.
+- Drop handling "/etc/rc.d/init.d/mysql", the switch to "/etc/init.d/mysql"
+  was done back in 2002 already.
+- Make "--with-zlib-dir=bundled" the default, add an option to disable it.
+- Add missing manual pages to the file list.
+- Improve the runtime check for "libgcc.a", protect it against being tried
+  with the Intel compiler "icc".
+
+* Mon Jan 11 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Change RPM file naming:
+  - Suffix like "-m2", "-rc" becomes part of version as "_m2", "_rc".
+  - Release counts from 1, not 0.
+
+* Wed Dec 23 2009 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- The "semisync" plugin file name has lost its introductory "lib",
+  adapt the file lists for the subpackages.
+  This is a part missing from the fix for bug#48351.
+- Remove the "fix_privilege_tables" manual, it does not exist in 5.5
+  (and likely, the whole script will go, too).
+
+* Mon Nov 16 2009 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- 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 <mvensson@mysql.com>
+
+- Removed mysql_fix_privilege_tables
+
+* Fri Oct 02 2009 Alexander Nozdrin <alexander.nozdrin@sun.com>
+
+- "mysqlmanager" got removed from version 5.4, all references deleted.
+
+* Fri Aug 28 2009 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Merge up from 5.1 to 5.4: Remove handling for the InnoDB plugin.
+
+* Thu Aug 27 2009 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- This version does not contain the "Instance manager", "mysqlmanager":
+  Remove it from the spec file so that packaging succeeds.
+
+* Mon Aug 24 2009 Jonathan Perkin <jperkin@sun.com>
+
+- Add conditionals for bundled zlib and innodb plugin
+
+* Fri Aug 21 2009 Jonathan Perkin <jperkin@sun.com>
+
+- Install plugin libraries in appropriate packages.
+- Disable libdaemon_example and ftexample plugins.
+
+* Thu Aug 20 2009 Jonathan Perkin <jperkin@sun.com>
+
+- Update variable used for mysql-test suite location to match source.
+
+* Fri Nov 07 2008 Joerg Bruehe <joerg@mysql.com>
+
+- Correct yesterday's fix, so that it also works for the last flag,
+  and fix a wrong quoting: un-quoted quote marks must not be escaped.
+
+* Thu Nov 06 2008 Kent Boortz <kent.boortz@sun.com>
+
+- Removed "mysql_upgrade_shell"
+- Removed some copy/paste between debug and normal build
+
+* Thu Nov 06 2008 Joerg Bruehe <joerg@mysql.com>
+
+- Modify CFLAGS and CXXFLAGS such that a debug build is not optimized.
+  This should cover both gcc and icc flags.  Fixes bug#40546.
+
+* Fri Aug 29 2008 Kent Boortz <kent@mysql.com>
+
+- Removed the "Federated" storage engine option, and enabled in all
+
+* Tue Aug 26 2008 Joerg Bruehe <joerg@mysql.com>
+
+- Get rid of the "warning: Installed (but unpackaged) file(s) found:"
+  Some generated files aren't needed in RPMs:
+  - the "sql-bench/" subdirectory
+  Some files were missing:
+  - /usr/share/aclocal/mysql.m4  ("devel" subpackage)
+  - Manual "mysqlbug" ("server" subpackage)
+  - Program "innochecksum" and its manual ("server" subpackage)
+  - Manual "mysql_find_rows" ("client" subpackage)
+  - Script "mysql_upgrade_shell" ("client" subpackage)
+  - Program "ndb_cpcd" and its manual ("ndb-extra" subpackage)
+  - Manuals "ndb_mgm" + "ndb_restore" ("ndb-tools" subpackage)
+
+* Mon Mar 31 2008 Kent Boortz <kent@mysql.com>
+
+- Made the "Federated" storage engine an option
+- Made the "Cluster" storage engine and sub packages an option
+
+* Wed Mar 19 2008 Joerg Bruehe <joerg@mysql.com>
+
+- Add the man pages for "ndbd" and "ndb_mgmd".
+
+* Mon Feb 18 2008 Timothy Smith <tim@mysql.com>
+
+- Require a manual upgrade if the alread-installed mysql-server is
+  from another vendor, or is of a different major version.
+
+* Wed May 02 2007 Joerg Bruehe <joerg@mysql.com>
+
+- "ndb_size.tmpl" is not needed any more,
+  "man1/mysql_install_db.1" lacked the trailing '*'.
+
+* Sat Apr 07 2007 Kent Boortz <kent@mysql.com>
+
+- Removed man page for "mysql_create_system_tables"
+
+* Wed Mar 21 2007 Daniel Fischer <df@mysql.com>
+
+- Add debug server.
+
+* Mon Mar 19 2007 Daniel Fischer <df@mysql.com>
+
+- Remove Max RPMs; the server RPMs contain a mysqld compiled with all
+  features that previously only were built into Max.
+
+* Fri Mar 02 2007 Joerg Bruehe <joerg@mysql.com>
+
+- Add several man pages for NDB which are now created.
+
+* Fri Jan 05 2007 Kent Boortz <kent@mysql.com>
+
+- Put back "libmygcc.a", found no real reason it was removed.
+
+- Add CFLAGS to gcc call with --print-libgcc-file, to make sure the
+  correct "libgcc.a" path is returned for the 32/64 bit architecture.
+
+* Mon Dec 18 2006 Joerg Bruehe <joerg@mysql.com>
+
+- Fix the move of "mysqlmanager" to section 8: Directory name was wrong.
+
+* Thu Dec 14 2006 Joerg Bruehe <joerg@mysql.com>
+
+- Include the new man pages for "my_print_defaults" and "mysql_tzinfo_to_sql"
+  in the server RPM.
+- The "mysqlmanager" man page got moved from section 1 to 8.
+
+* Thu Nov 30 2006 Joerg Bruehe <joerg@mysql.com>
+
+- Call "make install" using "benchdir_root=%%{_datadir}",
+  because that is affecting the regression test suite as well.
+
+* Thu Nov 16 2006 Joerg Bruehe <joerg@mysql.com>
+
+- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB)
+  replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading
+  (bug#22081).
+
+* Mon Nov 13 2006 Joerg Bruehe <joerg@mysql.com>
+
+- Add "--with-partition" t 2006 Joerg Bruehe <joerg@mysql.com>
+
+- Use the Perl script to run the tests, because it will automatically check
+  whether the server is configured with SSL.
+
+* Tue Jun 27 2006 Joerg Bruehe <joerg@mysql.com>
+
+- move "mysqldumpslow" from the client RPM to the server RPM (bug#20216)
+
+- Revert all previous attempts to call "mysql_upgrade" during RPM upgrade,
+  there are some more aspects which need to be solved before this is possible.
+  For now, just ensure the binary "mysql_upgrade" is delivered and installysql.com>
+
+- To run "mysql_upgrade", we need a running server;
+  start it in isolation and skip password checks.
+
+* Sat May 20 2006 Kent Boortz <kent@mysql.com>
+
+- Always compile for PIC, position independent code.
+
+* Wed May 10 2006 Kent Boortz <kent@mysql.com>
+
+- Use character set "all" when compiling with Cluster, to make Cluster
+  nodes independent on the character set directory, and the problem
+  that two RPM sub packages both wants to install this directory.
+
+* Mon May 01 2006 Kent Boortz <kent@mysql.com>
+
+- Use "./libtool --mode=execute" instead of searching for the
+  executable in current directory and ".libs".
+
+* Fri Apr 28 2006 Kent Boortz <kent@mysql.com>
+
+- Install and run "mysql_upgrade"
+
+* Wed Apr 12 2006 Jim Winstead <jimw@mysql.com>
+
+- Remove sql-bench, and MySQL-bench RPM (will be built as an independent
+  project from the mysql-bench repository)
+
+* Tue Apr 11 2006 Jim Winstead <jimw@mysql.com>
+
+- Remove old mysqltestmanager and related programs
+* Sat Apr 01 2006 Kent Boortz <kent@mysql.com>
+
+- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS
+
+* Tue Mar 07 2006 Kent Boortz <kent@mysql.com>
+
+- Changed product name from "Community Edition" to "Community Server"
+
+* Mon Mar 06 2006 Kent Boortz <kent@mysql.com>
+
+- Fast mutexes is now disabled by default, but should be
+  used in Linux builds.
+
+* Mon Feb 20 2006 Kent Boortz <kent@mysql.com>
+
+- Reintroduced a max build
+- Limited testing of 'debug' and 'max' servers
+- Berkeley DB only in 'max'
+
+* Mon Feb 13 2006 Joerg Bruehe <joerg@mysql.com>
+
+- Use "-i" on "make test-force";
+  this is essential for later evaluation of this log file.
+
+* Thu Feb 09 2006 Kent Boortz <kent@mysql.com>
+
+- Pass '-static' to libtool, link static with our own libraries, dynamic
+  with system libraries.  Link with the bundled zlib.
+
+* Wed Feb 08 2006 Kristian Nielsen <knielsen@mysql.com>
+
+- Modified RPM spec to match new 5.1 debug+max combined community packaging.
+
+* Sun Dec 18 2005 Kent Boortz <kent@mysql.com>
+
+- Added "client/mysqlslap"
+
+* Mon Dec 12 2005 Rodrigo Novo <rodrigo@mysql.com>
+
+- Added zlib to the list of (static) libraries installed
+- Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld)
+- Compile MySQL with bundled zlib
+- Fixed %%packager name to "MySQL Production Engineering Team"
+
+* Mon Dec 05 2005 Joerg Bruehe <joerg@mysql.com>
+
+- Avoid using the "bundled" zlib on "shared" builds:
+  As it is not installed (on the build system), this gives dependency
+  problems with "libtool" causing the build to fail.
+  (Change was done on Nov 11, but left uncommented.)
+
+* Tue Nov 22 2005 Joerg Bruehe <joerg@mysql.com>
+
+- Extend the file existence check for "init.d/mysql" on un-install
+  to also guard the call to "insserv"/"chkconfig".
+
+* Thu Oct 27 2005 Lenz Grimmer <lenz@grimmer.com>
+
+- added more man pages
+
+* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
+
+- Made yaSSL support an option (off by default)
+
+* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
+
+- Enabled yaSSL support
+
+* Sat Oct 15 2005 Kent Boortz <kent@mysql.com>
+
+- Give mode arguments the same way in all places
+lenz@mysql.com>
+
+- 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 <lenz@mysql.com>
+
+- Fixed the creation of the mysql user group account in the postinstall
+  section (BUG 12348)
+- Fixed enabling the Archive storage engine in the Max binary
+
+* Tue Aug 02 2005 Lenz Grimmer <lenz@mysql.com>
+
+- Fixed the Requires: tag for the server RPM (BUG 12233)
+
+* Fri Jul 15 2005 Lenz Grimmer <lenz@mysql.com>
+
+- create a "mysql" user group and assign the mysql user account to that group
+  in the server postinstall section. (BUG 10984)
+
+* Tue Jun 14 2005 Lenz Grimmer <lenz@mysql.com>
+
+- Do not build statically on i386 by default, only when adding either "--with
+  static" or "--define '_with_static 1'" to the RPM build options. Static
+  linking really only makes sense when linking against the specially patched
+  glibc 2.2.5.
+
+* Mon Jun 06 2005 Lenz Grimmer <lenz@mysql.com>
+
+- added mysql_client_test to the "bench" subpackage (BUG 10676)
+- added the libndbclient static and shared libraries (BUG 10676)
+
+* Wed Jun 01 2005 Lenz Grimmer <lenz@mysql.com>
+
+- use "mysqldatadir" variable instead of hard-coding the path multiple times
+- use the "mysqld_user" variable on all occasions a user name is referenced
+- removed (incomplete) Brazilian translations
+- removed redundant release tags from the subpackage descriptions
+
+* Wed May 25 2005 Joerg Bruehe <joerg@mysql.com>
+
+- Added a "make clean" between separate calls to "BuildMySQL".
+
+* Thu May 12 2005 Guilhem Bichot <guilhem@mysql.com>
+
+- Removed the mysql_tableinfo script made obsolete by the information schema
+
+* Wed Apr 20 2005 Lenz Grimmer <lenz@mysql.com>
+
+- Enabled the "blackhole" storage engine for the Max RPM
+
+* Wed Apr 13 2005 Lenz Grimmer <lenz@mysql.com>
+
+- removed the MySQL manual files (html/ps/texi) - they have been removed
+  from the MySQL sources and are now available seperately.
+
+* Mon Apr 4 2005 Petr Chardin <petr@mysql.com>
+
+- old mysqlmanager, mysq* Mon Feb 7 2005 Tomas Ulin <tomas@mysql.com>
+
+- enabled the "Ndbcluster" storage engine for the max binary
+- added extra make install in ndb subdir after Max build to get ndb binaries
+- added packages for ndbcluster storage engine
+
+* Fri Jan 14 2005 Lenz Grimmer <lenz@mysql.com>
+
+- replaced obsoleted "BuildPrereq" with "BuildRequires" instead
+
+* Thu Jan 13 2005 Lenz Grimmer <lenz@mysql.com>
+
+- enabled the "Federated" storage engine for the max binary
+
+* Tue Jan 04 2005 Petr Chardin <petr@mysql.com>
+
+- ISAM and merge storage engines were purged. As well as appropriate
+  tools and manpages (isamchk and isamlog)
+
+* Fri Dec 31 2004 Lenz Grimmer <lenz@mysql.com>
+
+- enabled the "Archive" storage engine for the max binary
+- enabled the "CSV" storage engine for the max binary
+- enabled the "Example" storage engine for the max binary
+
+* Thu Aug 26 2004 Lenz Grimmer <lenz@mysql.com>
+
+- MySQL-Max now requires MySQL-server instead of MySQL (BUG 3860)
+
+* Fri Aug 20 2004 Lenz Grimmer <lenz@mysql.com>
+
+- do not link statically on IA64/AMD64 as these systems do not have
+  a patched glibc installed
+
+* Tue Aug 10 2004 Lenz Grimmer <lenz@mysql.com>
+
+- Added libmygcc.a to the devel subpackage (required to link applications
+  against the the embedded server libmysqld.a) (BUG 4921)
+
+* Mon Aug 09 2004 Lenz Grimmer <lenz@mysql.com>
+
+- Added EXCEPTIONS-CLIENT to the "devel" package
+
+* Thu Jul 29 2004 Lenz Grimmer <lenz@mysql.com>
+
+- disabled OpenSSL in the Max binaries again (the RPM packages were the
+  only exception to this anyway) (BUG 1043)
+
+* Wed Jun 30 2004 Lenz Grimmer <lenz@mysql.com>
+
+- fixed server postinstall (mysql_install_db was called with the wrong
+  parameter)
+
+* Thu Jun 24 2004 Lenz Grimmer <lenz@mysql.com>
+
+- added mysql_tzinfo_to_sql to the server subpackage
+- run "make clean" instead of "make distclean"
+
+* Mon Apr 05 2004 Lenz Grimmer <lenz@mysql.com>
+
+- added ncurses-devel to the build prerequisites (BUG 3377)
+
+* Thu Feb 12 2004 Lenz Grimmer <lenz@mysql.com>
+
+- when using gcc, _always_ use CXX=gcc
+- replaced Copyright with License field (Copyright is obsolete)
+
+* Tue Feb 03 2004 Lenz Grimmer <lenz@mysql.com>
+
+- added myisam_ftdump to the Server package
+
+* Tue Jan 13 2004 Lenz Grimmer <lenz@mysql.com>
+
+- link the mysql client against libreadline instead of libedit (BUG 2289)
+
+* Mon Dec 22 2003 Lenz Grimmer <lenz@mysql.com>
+
+- marked /etc/logrotate.d/mysql as a config file (BUG 2156)
+
+* Sat Dec 13 2003 Lenz Grimmer <lenz@mysql.com>
+
+- fixed file permissions (BUG 1672)
+
+* Thu Dec 11 2003 Lenz Grimmer <lenz@mysql.com>
+
+- made testing for gcc3 a bit more robust
+
+* Fri Dec 05 2003 Lenz Grimmer <lenz@mysql.com>
+
+- added missing file mysql_create_system_tables to the server subpackage
+
+* Fri Nov 21 2003 Lenz Grimmer <lenz@mysql.com>
+
+- removed dependency on MySQL-client from the MySQL-devel subpackage
+  as it is not really required. (BUG 1610)
+
+* Fri Aug 29 2003 Lenz Grimmer <lenz@mysql.com>
+
+- Fixed BUG 1162 (removed macro names from the changelog)
+- Really fixed BUG 998 (disable the checking for installed but
+  unpackaged files)
+
+* Tue Aug 05 2003 Lenz Grimmer <lenz@mysql.com>
+
+- Fixed BUG 959 (libmysqld not being compiled properly)
+- Fixed BUG 998 (RPM build errors): added missing files to the
+  distribution (mysql_fix_extensions, mysql_tableinfo, mysqldumpslow,
+  mysql_fix_privilege_tables.1), removed "-n" from install section.
+
+* Wed Jul 09 2003 Lenz Grimmer <lenz@mysql.com>
+
+- removed the GIF Icon (file was not included in the sources anyway)
+- removed unused variable shared_lib_version
+- do not run automake before building the standard binary
+  (should not be necessary)
+- add server suffix '-standard' to standard binary (to be in line
+  with the binary tarball distributions)
+- Use more RPM macros (_exec_prefix, _sbindir, _libdir, _sysconfdir,
+  _datadir, _includedir) throughout the spec file.
+- allow overriding CC and CXX (required when building with other compilers)
+
+* Fri May 16 2003 Lenz Grimmer <lenz@mysql.com>
+
+- re-enabled RAID again
+
+* Wed Apr 30 2003 Lenz Grimmer <lenz@mysql.com>
+
+- disabled MyISAM RAID (--with-raid)- it throws an assertion which
+  needs to be investigated first.
+
+* Mon Mar 10 2003 Lenz Grimmer <lenz@mysql.com>
+
+- added missing file mysql_secure_installation to server subpackage
+  (BUG 141)
+
+* Tue Feb 11 2003 Lenz Grimmer <lenz@mysql.com>
+
+- re-added missing pre- and post(un)install scripts to server subpackage
+- added config file /etc/my.cnf to the file list (just for completeness)
+- make sure to create the datadir with 755 permissions
+
+* Mon Jan 27 2003 Lenz Grimmer <lenz@mysql.com>
+
+- removed unusedql.com>
+
+- Reworked the build steps a little bit: the Max binary is supposed
+  to include OpenSSL, which cannot be linked statically, thus trying
+  to statically link against a special glibc is futile anyway
+- because of this, it is not required to make yet another build run
+  just to compile the shared libs (saves a lot of time)
+- updated package description of the Max subpackage
+- clean up the BuildRoot directory afterwards
+
+* Mon Jul 15 2002 Lenz Grimmer <lenz@mysql.com>
+
+- Updated Packager information
+- Fixed the build options: the regular package is supposed to
+  include InnoDB and linked statically, while the Max package
+  should include BDB and SSL support
+
+* Fri May 03 2002 Lenz Grimmer <lenz@mysql.com>
+
+- Use more RPM macros (e.g. infodir, mandir) to make the spec
+  file more portable
+- reorganized the installation of documentation files: let RPM
+  take care of this
+- reorganized the file list: actually install man pages along
+  with the binaries of the respective subpackage
+- do not include libmysqld.a in the devel subpackage as well, if we
+  have a special "embedded" subpackage
+- reworked the package descriptions
+
+* Mon Oct  8 2001 Monty
+
+- Added embedded server as a separate RPM
+
+* Fri Apr 13 2001 Monty
+
+- Added mysqld-max to the distribution
+
+* Tue Jan 2  2001  Monty
+
+- Added mysql-test to the bench package
+
+* Fri Aug 18 2000 Tim Smith <tim@mysql.com>
+
+- Added separate libmysql_r directory; now both a threaded
+  and non-threaded library is shipped.
+
+* Tue Sep 28 1999 David Axmark <davida@mysql.com>
+
+- Added the support-files/my-example.cnf to the docs directory.
+
+- Removed devel dependency on base since it is about client
+  development.
+
+* Wed Sep 8 1999 David Axmark <davida@mysql.com>
+
+- Cleaned up some for 3.23.
+
+* Thu Jul 1 1999 David Axmark <davida@mysql.com>
+
+- Added support for shared libraries in a separate sub
+  package. Original fix by David Fox (dsfox@cogsci.ucsd.edu)
+
+- The --enable-assembler switch is now automatically disables on
+  platforms there assembler code is unavailable. This should allow
+  building this RPM on non i386 systems.
+
+* Mon Feb 22 1999 David Axmark <david@detron.se>
+
+- Removed unportable cc switches from the spec file. The defaults can
+  now be overridden with environment variables. This feature is used
+  to compile the official RPM with optimal (but compiler version
+  specific) switches.
+
+- Removed the repetitive description parts for the sub rpms. Maybe add
+  again if RPM gets a multiline macro capability.
+
+- Added support for a pt_BR translation. Translation contributed by
+  Jorge Godoy <jorge@bestway.com.br>.
+
+* Wed Nov 4 1998 David Axmark <david@detron.se>
+
+- A lot of changes in all the rpm and install scripts. This may even
+  be a working RPM :-)
+
+* Sun Aug 16 1998 David Axmark <david@detron.se>
+
+- A developers changelog for MySQL is available in the source RPM. And
+  there is a history of major user visible changed in the Reference
+  Manual.  Only RPM specific changes will be documented here.
diff --git a/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6.14-mysql-install.patch b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6.14-mysql-install.patch
deleted file mode 100644 (file)
index 95a5277..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
-index 440a977..7d068fc 100644
---- a/scripts/mysql_install_db.pl.in
-+++ b/scripts/mysql_install_db.pl.in
-@@ -34,13 +34,35 @@
- #
- ##############################################################################
--use Fcntl;
--use File::Basename;
--use File::Copy;
--use Getopt::Long;
--use Sys::Hostname;
--use Data::Dumper;
- use strict;
-+use warnings;
-+
-+##############################################################################
-+# Check if all needed modules are available, exit if something is missing.
-+##############################################################################
-+
-+BEGIN {
-+  my @req_mods = ('Fcntl', 'File::Basename', 'File::Copy', 'Getopt::Long',
-+                  'Sys::Hostname', 'Data::Dumper');
-+  my @missing_mods;
-+  my $req;
-+  foreach $req (@req_mods) {
-+    eval 'require ' . $req;
-+    if ($@) {
-+      push(@missing_mods, $req);
-+    } else {
-+      $req->import();
-+    }
-+  }
-+  # this avoids the confusing "BEGIN failed--compilation aborted" message
-+  local $SIG{__DIE__} = sub {warn @_; exit 1};
-+
-+  if (@missing_mods) {
-+    my $msg = "FATAL ERROR: please install the following Perl modules " .
-+              "before executing $0:\n" . join("\n",@missing_mods)."\n";
-+    die $msg;
-+  }
-+}
- Getopt::Long::Configure("pass_through");
-@@ -75,6 +97,8 @@ Usage: $0 [OPTIONS]
-   --help               Display this help and exit.                     
-   --ldata=path         The path to the MySQL data directory. Same as --datadir.
-   --no-defaults        Don't read default options from any option file.
-+  --keep-my-cnf        Don't try to create my.cnf based on template. 
-+                       Useful for systems with working, updated my.cnf.
- EOF1
-   if ( $^O !~ m/^(MSWin32|cygwin)$/ ) {
-     print <<EOF2;
-@@ -86,6 +110,7 @@ EOF2
-   print <<EOF3;
-   --rpm                For internal use.  This option is used by RPM files
-                        during the MySQL installation process.
-+                       Implies --keep-my-cnf option.
-   --skip-name-resolve  Use IP addresses rather than hostnames when creating
-                        grant table entries.  This option can be useful if
-                        your DNS does not work.
-@@ -149,6 +174,7 @@ sub parse_arguments
-              "skip-name-resolve",
-              "verbose",
-+             "keep-my-cnf",
-              "rpm",
-              "help",
-              "random-passwords",
-@@ -356,13 +382,19 @@ sub tell_root_password {
- ##############################################################################
- sub generate_random_password {
--  # On (at least) Linux and Solaris, a "random" device is available, use it:
--  # cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1
--  # Without LC_ALL, "tr" may not know the "alnum" character class -
--  # and there are user profiles which do not have this set.
--  #
--  my $password = `cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1`;
--  chomp ($password);
-+  # On Linux, Solaris, Max OS X and FreeBSD we have a random device available.
-+  my $randfile = "/dev/urandom";
-+  open(FD, $randfile) || die "Can't open $randfile for reading: $!";
-+  my $password = "";
-+  my $pass_len = 16;
-+  my $c;
-+  while (length($password) < $pass_len) {
-+    $c = getc(FD);
-+    if ($c =~ /\w/) {
-+      $password .= $c;
-+    }
-+  }
-+  close(FD);
-   return $password;
- }
-@@ -399,11 +431,16 @@ $basedir= "@prefix@" if ! $basedir;              # Default
- # ----------------------------------------------------------------------
- my $print_defaults;
-+my $keep_my_cnf = 0;
- if ( $opt->{srcdir} and $opt->{basedir} )
- {
-   error($opt,"Specify either --basedir or --srcdir, not both");
- }
-+if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
-+{
-+  $keep_my_cnf = 1;
-+}
- if ( $opt->{srcdir} )
- {
-   $opt->{builddir} = $opt->{srcdir} unless $opt->{builddir};
-@@ -425,13 +462,18 @@ my $config_file;
- my $copy_cfg_file;
- # ----------------------------------------------------------------------
--# This will be the default config file
-+# This will be the default config file (unless creation is unwanted)
- # ----------------------------------------------------------------------
- $config_file= "$basedir/my.cnf";
- my $cfg_template= find_in_basedir($opt,"file","my-default.cnf",
-                                 "share","share/mysql","support-files");
-+# Distros might move files
-+if ((! -r $cfg_template) && (-r "@pkgdatadir@/my-default.cnf")) {
-+  $cfg_template = "@pkgdatadir@/my-default.cnf";
-+}
-+
- -e $cfg_template or cannot_find_file("my-default.cnf");
- $copy_cfg_file= $config_file;
-@@ -441,22 +483,21 @@ if (-e $copy_cfg_file)
-   $copy_cfg_file =~ s/my.cnf/my-new.cnf/;
-   # Too early to print warning here, the user may not notice
- }
--open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
--if (open (CFG, "> $copy_cfg_file"))
--{
--  while (<TEMPL>)
--  {
--    # Remove lines beginning with # *** which are template comments
--    print CFG $_ unless /^# \*\*\*/;
-+
-+if ( ! $keep_my_cnf ) {
-+  open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
-+  if (open (CFG, "> $copy_cfg_file")) {
-+    while (<TEMPL>) {
-+      # Remove lines beginning with # *** which are template comments
-+      print CFG $_ unless /^# \*\*\*/;
-+    }
-+    close CFG;
-+  } else {
-+    warning($opt,"Could not write to config file $copy_cfg_file: $!");
-+    $failed_write_cfg= 1;
-   }
--  close CFG;
-+  close TEMPL;
- }
--else
--{
--  warning($opt,"Could not write to config file $copy_cfg_file: $!");
--  $failed_write_cfg= 1;
--}
--close TEMPL;
- # ----------------------------------------------------------------------
- # Now we can get arguments from the groups [mysqld] and [mysql_install_db]
-@@ -619,7 +660,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
- }
- # ----------------------------------------------------------------------
--# Create database directories mysql & test
-+# Create database directory mysql
- # ----------------------------------------------------------------------
- # FIXME The shell variant uses "mkdir -p":
-@@ -652,7 +693,7 @@ if ($opt_user)
-   }
- }
--foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
-+foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql")
- {
-   mkdir($dir, 0700) unless -d $dir;
-   if ($opt_user and -w "/")
-@@ -846,7 +887,13 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") )
-            "",
-            "Support MySQL by buying support/licenses at http://shop.mysql.com");
--    if ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-+    if ($keep_my_cnf)
-+    {
-+      report($opt,
-+           "Note: new default config file not created.",
-+           "Please make sure your config file is current");
-+    }
-+    elsif ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-     {
-       report($opt,
-            "New default config file was created as $config_file and",
diff --git a/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-embedded-check.c b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-embedded-check.c
deleted file mode 100644 (file)
index 8bf8ca5..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* simple test program to see if we can link the embedded server library */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include "mysql.h"
-
-MYSQL *mysql;
-
-static char *server_options[] = \
-       { "mysql_test", "--defaults-file=my.cnf", NULL };
-int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
-
-static char *server_groups[] = { "libmysqld_server", 
-                                 "libmysqld_client", NULL };
-
-int main(int argc, char **argv)
-{
-   mysql_library_init(num_elements, server_options, server_groups);
-   mysql = mysql_init(NULL);
-   mysql_close(mysql);
-   mysql_library_end();
-
-   return 0;
-}
index 8670f889574ef252dbbb32f9470c747d0e75d6fa..fab7b3627b31a4b2629677f591c6748aae10e435 100644 (file)
@@ -12,8 +12,8 @@ get_option () {
     local section=$1
     local option=$2
     local default=$3
-    ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
-    [ -z $ret ] && ret=$default
+    ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2- | tail -n 1)
+    [ -z "$ret" ] && ret=$default
     echo $ret
 }
 
index f8bbd148d7439e63972cebc84df378c5e0da5b9a..2f571ac455b02338fbd31cce6e7bd2ba2edca90f 100644 (file)
@@ -1,4 +1,4 @@
-# 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
@@ -76,6 +76,7 @@ BuildRequires:  perl
 BuildRequires:  time
 BuildRequires:  libaio-devel
 BuildRequires:  ncurses-devel
+BuildRequires:  numactl-devel
 BuildRequires:  openssl-devel
 BuildRequires:  zlib-devel
 BuildRequires:  systemd
@@ -281,7 +282,7 @@ Obsoletes:      mariadb-embedded
 Obsoletes:      community-mysql-embedded < %{version}-%{release}
 Obsoletes:      mysql-embedded < %{version}-%{release}
 Provides:       mysql-embedded = %{version}-%{release}
-Provides:       mysql-emdedded%{?_isa} = %{version}-%{release}
+Provides:       mysql-embedded%{?_isa} = %{version}-%{release}
 
 %description    embedded
 This package contains the MySQL server as an embedded library.
@@ -454,7 +455,7 @@ rm -r $(readlink var) var
     -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
 
 %post server
-datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
+datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
 /bin/chmod 0755 "$datadir" >/dev/null 2>&1 || :
 /bin/touch /var/log/mysqld.log >/dev/null 2>&1 || :
 %systemd_post mysqld.service
@@ -544,6 +545,7 @@ datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n
 %attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/mysql_no_login.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/validate_password.so
@@ -553,6 +555,7 @@ datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mysql_no_login.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/validate_password.so
@@ -713,6 +716,9 @@ datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n
 %attr(755, root, root) %{_libdir}/mysql/libmysqld.so
 
 %changelog
+* Wed Jan 14 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.24-1
+- Add mysql_no_login.so plugin
+
 * Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.22-1
 - Add license info in each subpackage
 - Remove systemd conditional
diff --git a/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5.5-libmysqlclient-symbols.patch b/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5.5-libmysqlclient-symbols.patch
new file mode 100644 (file)
index 0000000..ce5455e
--- /dev/null
@@ -0,0 +1,982 @@
+diff -rup old/libmysql/CMakeLists.txt new/libmysql/CMakeLists.txt
+--- old/libmysql/CMakeLists.txt        2013-11-05 08:19:26.000000000 +0100
++++ new/libmysql/CMakeLists.txt        2014-01-10 15:41:30.530068723 +0100
+@@ -205,13 +205,14 @@ IF(NOT DISABLE_SHARED)
+       OUTPUT_NAME mysqlclient 
+       VERSION "${OS_SHARED_LIB_VERSION}" 
+       SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
++    CONFIGURE_FILE(libmysql.ver.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver)
+     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_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS 
+-        "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED}")
++        "${libmysql_link_flags} -Wl,--version-script=libmysql.ver ${LINK_FLAG_NO_UNDEFINED}")
+     ENDIF() 
+     # clean direct output needs to be set several targets have the same name
+     #(mysqlclient in this case)
+diff -rup old/libmysql/libmysql.c new/libmysql/libmysql.c
+--- old/libmysql/libmysql.c    2013-11-05 08:19:26.000000000 +0100
++++ new/libmysql/libmysql.c    2014-01-10 15:46:35.708928462 +0100
+@@ -4870,3 +4870,612 @@ my_bool STDCALL mysql_read_query_result(
+   return (*mysql->methods->read_query_result)(mysql);
+ }
++#ifndef EMBEDDED_LIBRARY
++
++// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
++
++#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
++
++void STDCALL symver16_myodbc_remove_escape(MYSQL *mysql,char *name)
++{
++  return myodbc_remove_escape(mysql, name);
++}
++SYM_16(myodbc_remove_escape);
++
++
++my_ulonglong STDCALL symver16_mysql_affected_rows(MYSQL *mysql)
++{
++  return mysql_affected_rows(mysql);
++}
++SYM_16(mysql_affected_rows);
++
++
++my_bool STDCALL symver16_mysql_autocommit(MYSQL * mysql, my_bool auto_mode)
++{
++  return mysql_autocommit(mysql, auto_mode);
++}
++SYM_16(mysql_autocommit);
++
++
++my_bool STDCALL symver16_mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db)
++{
++  return mysql_change_user(mysql, user, passwd, db);
++}
++SYM_16(mysql_change_user);
++
++
++const char * STDCALL symver16_mysql_character_set_name(MYSQL *mysql)
++{
++  return mysql_character_set_name(mysql);
++}
++SYM_16(mysql_character_set_name);
++
++
++my_bool STDCALL symver16_mysql_commit(MYSQL * mysql)
++{
++  return mysql_commit(mysql);
++}
++SYM_16(mysql_commit);
++
++
++void STDCALL symver16_mysql_data_seek(MYSQL_RES *result, my_ulonglong row)
++{
++  return mysql_data_seek(result, row);
++}
++SYM_16(mysql_data_seek);
++
++
++void STDCALL symver16_mysql_debug(const char *debug __attribute__((unused)))
++{
++  return mysql_debug(debug);
++}
++SYM_16(mysql_debug);
++
++
++int STDCALL symver16_mysql_dump_debug_info(MYSQL *mysql)
++{
++  return mysql_dump_debug_info(mysql);
++}
++SYM_16(mysql_dump_debug_info);
++
++
++my_bool STDCALL symver16_mysql_embedded(void)
++{
++  return mysql_embedded();
++}
++SYM_16(mysql_embedded);
++
++
++my_bool STDCALL symver16_mysql_eof(MYSQL_RES *res)
++{
++  return mysql_eof(res);
++}
++SYM_16(mysql_eof);
++
++
++ulong STDCALL symver16_mysql_escape_string(char *to,const char *from,ulong length)
++{
++  return mysql_escape_string(to, from, length);
++}
++SYM_16(mysql_escape_string);
++
++
++MYSQL_FIELD * STDCALL symver16_mysql_fetch_field(MYSQL_RES *result)
++{
++  return mysql_fetch_field(result);
++}
++SYM_16(mysql_fetch_field);
++
++
++MYSQL_FIELD * STDCALL symver16_mysql_fetch_field_direct(MYSQL_RES *res,uint fieldnr)
++{
++  return mysql_fetch_field_direct(res, fieldnr);
++}
++SYM_16(mysql_fetch_field_direct);
++
++
++MYSQL_FIELD * STDCALL symver16_mysql_fetch_fields(MYSQL_RES *res)
++{
++  return mysql_fetch_fields(res);
++}
++SYM_16(mysql_fetch_fields);
++
++
++unsigned int STDCALL symver16_mysql_field_count(MYSQL *mysql)
++{
++  return mysql_field_count(mysql);
++}
++SYM_16(mysql_field_count);
++
++
++MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset)
++{
++  return mysql_field_seek(result, field_offset);
++}
++SYM_16(mysql_field_seek);
++
++
++MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_tell(MYSQL_RES *res)
++{
++  return mysql_field_tell(res);
++}
++SYM_16(mysql_field_tell);
++
++
++void STDCALL symver16_mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
++{
++  return mysql_get_character_set_info(mysql, csinfo);
++}
++SYM_16(mysql_get_character_set_info);
++
++
++const char * STDCALL symver16_mysql_get_client_info(void)
++{
++  return mysql_get_client_info();
++}
++SYM_16(mysql_get_client_info);
++
++ulong STDCALL symver16_mysql_get_client_version(void)
++{
++  return mysql_get_client_version();
++}
++SYM_16(mysql_get_client_version);
++
++
++const char * STDCALL symver16_mysql_get_host_info(MYSQL *mysql)
++{
++  return mysql_get_host_info(mysql);
++}
++SYM_16(mysql_get_host_info);
++
++
++MYSQL_PARAMETERS *STDCALL symver16_mysql_get_parameters(void)
++{
++  return mysql_get_parameters();
++}
++SYM_16(mysql_get_parameters);
++
++
++uint STDCALL symver16_mysql_get_proto_info(MYSQL *mysql)
++{
++  return mysql_get_proto_info(mysql);
++}
++SYM_16(mysql_get_proto_info);
++
++
++const char * STDCALL symver16_mysql_get_server_info(MYSQL *mysql)
++{
++  return mysql_get_server_info(mysql);
++}
++SYM_16(mysql_get_server_info);
++
++
++ulong STDCALL symver16_mysql_hex_string(char *to, const char *from, ulong length)
++{
++  return mysql_hex_string(to, from, length);
++}
++SYM_16(mysql_hex_string);
++
++
++const char *STDCALL symver16_mysql_info(MYSQL *mysql)
++{
++  return mysql_info(mysql);
++}
++SYM_16(mysql_info);
++
++
++my_ulonglong STDCALL symver16_mysql_insert_id(MYSQL *mysql)
++{
++  return mysql_insert_id(mysql);
++}
++SYM_16(mysql_insert_id);
++
++
++int STDCALL symver16_mysql_kill(MYSQL *mysql,ulong pid)
++{
++  return mysql_kill(mysql, pid);
++}
++SYM_16(mysql_kill);
++
++
++MYSQL_RES * STDCALL symver16_mysql_list_dbs(MYSQL *mysql, const char *wild)
++{
++  return mysql_list_dbs(mysql, wild);
++}
++SYM_16(mysql_list_dbs);
++
++
++MYSQL_RES * STDCALL symver16_mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
++{
++  return mysql_list_fields(mysql, table, wild);
++}
++SYM_16(mysql_list_fields);
++
++
++MYSQL_RES * STDCALL symver16_mysql_list_processes(MYSQL *mysql)
++{
++  return mysql_list_processes(mysql);
++}
++SYM_16(mysql_list_processes);
++
++
++MYSQL_RES * STDCALL symver16_mysql_list_tables(MYSQL *mysql, const char *wild)
++{
++  return mysql_list_tables(mysql, wild);
++}
++SYM_16(mysql_list_tables);
++
++
++my_bool STDCALL symver16_mysql_more_results(MYSQL *mysql)
++{
++  return mysql_more_results(mysql);
++}
++SYM_16(mysql_more_results);
++
++
++int STDCALL symver16_mysql_next_result(MYSQL *mysql)
++{
++  return mysql_next_result(mysql);
++}
++SYM_16(mysql_next_result);
++
++
++int STDCALL symver16_mysql_ping(MYSQL *mysql)
++{
++  return mysql_ping(mysql);
++}
++SYM_16(mysql_ping);
++
++
++int STDCALL symver16_mysql_query(MYSQL *mysql, const char *query)
++{
++  return mysql_query(mysql, query);
++}
++SYM_16(mysql_query);
++
++
++my_bool STDCALL symver16_mysql_read_query_result(MYSQL *mysql)
++{
++  return mysql_read_query_result(mysql);
++}
++SYM_16(mysql_read_query_result);
++
++
++ulong STDCALL symver16_mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length)
++{
++  return mysql_real_escape_string(mysql, to, from, length);
++}
++SYM_16(mysql_real_escape_string);
++
++
++int STDCALL symver16_mysql_refresh(MYSQL *mysql,uint options)
++{
++  return mysql_refresh(mysql, options);
++}
++SYM_16(mysql_refresh);
++
++
++my_bool STDCALL symver16_mysql_rollback(MYSQL * mysql)
++{
++  return mysql_rollback(mysql);
++}
++SYM_16(mysql_rollback);
++
++
++MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET row)
++{
++  return mysql_row_seek(result, row);
++}
++SYM_16(mysql_row_seek);
++
++
++MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_tell(MYSQL_RES *res)
++{
++  return mysql_row_tell(res);
++}
++SYM_16(mysql_row_tell);
++
++
++void STDCALL symver16_mysql_server_end()
++{
++  return mysql_server_end();
++}
++SYM_16(mysql_server_end);
++
++
++int STDCALL symver16_mysql_server_init(int argc __attribute__((unused)), char **argv __attribute__((unused)), char **groups __attribute__((unused)))
++{
++  return mysql_server_init(argc, argv, groups);
++}
++SYM_16(mysql_server_init);
++
++
++void symver16_mysql_set_local_infile_default(MYSQL *mysql)
++{
++  return mysql_set_local_infile_default(mysql);
++}
++SYM_16(mysql_set_local_infile_default);
++
++
++void symver16_mysql_set_local_infile_handler(MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char *, uint), void *userdata)
++{
++  return mysql_set_local_infile_handler(mysql, local_infile_init, local_infile_read, local_infile_end, local_infile_error, userdata);
++}
++SYM_16(mysql_set_local_infile_handler);
++
++
++int STDCALL symver16_mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option)
++{
++  return mysql_set_server_option(mysql, option);
++}
++SYM_16(mysql_set_server_option);
++
++
++int STDCALL symver16_mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
++{
++  return mysql_shutdown(mysql, shutdown_level);
++}
++SYM_16(mysql_shutdown);
++
++
++const char *STDCALL symver16_mysql_sqlstate(MYSQL *mysql)
++{
++  return mysql_sqlstate(mysql);
++}
++SYM_16(mysql_sqlstate);
++
++
++const char * STDCALL symver16_mysql_stat(MYSQL *mysql)
++{
++  return mysql_stat(mysql);
++}
++SYM_16(mysql_stat);
++
++
++my_ulonglong STDCALL symver16_mysql_stmt_affected_rows(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_affected_rows(stmt);
++}
++SYM_16(mysql_stmt_affected_rows);
++
++
++my_bool STDCALL symver16_mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *value)
++{
++  return mysql_stmt_attr_get(stmt, attr_type, value);
++}
++SYM_16(mysql_stmt_attr_get);
++
++
++my_bool STDCALL symver16_mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *value)
++{
++  return mysql_stmt_attr_set(stmt, attr_type, value);
++}
++SYM_16(mysql_stmt_attr_set);
++
++
++my_bool STDCALL symver16_mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
++{
++  return mysql_stmt_bind_param(stmt, my_bind);
++}
++SYM_16(mysql_stmt_bind_param);
++
++
++my_bool STDCALL symver16_mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
++{
++  return mysql_stmt_bind_result(stmt, my_bind);
++}
++SYM_16(mysql_stmt_bind_result);
++
++
++my_bool STDCALL symver16_mysql_stmt_close(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_close(stmt);
++}
++SYM_16(mysql_stmt_close);
++
++
++void STDCALL symver16_mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
++{
++  return mysql_stmt_data_seek(stmt, row);
++}
++SYM_16(mysql_stmt_data_seek);
++
++
++uint STDCALL symver16_mysql_stmt_errno(MYSQL_STMT * stmt)
++{
++  return mysql_stmt_errno(stmt);
++}
++SYM_16(mysql_stmt_errno);
++
++
++const char *STDCALL symver16_mysql_stmt_error(MYSQL_STMT * stmt)
++{
++  return mysql_stmt_error(stmt);
++}
++SYM_16(mysql_stmt_error);
++
++
++int STDCALL symver16_mysql_stmt_execute(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_execute(stmt);
++}
++SYM_16(mysql_stmt_execute);
++
++
++int STDCALL symver16_mysql_stmt_fetch(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_fetch(stmt);
++}
++SYM_16(mysql_stmt_fetch);
++
++
++int STDCALL symver16_mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *my_bind, uint column, ulong offset)  
++{
++  return mysql_stmt_fetch_column(stmt, my_bind, column, offset);
++}
++SYM_16(mysql_stmt_fetch_column);
++
++
++unsigned int STDCALL symver16_mysql_stmt_field_count(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_field_count(stmt);
++}
++SYM_16(mysql_stmt_field_count);
++
++
++my_bool STDCALL symver16_mysql_stmt_free_result(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_free_result(stmt);
++}
++SYM_16(mysql_stmt_free_result);
++
++
++MYSQL_STMT * STDCALL symver16_mysql_stmt_init(MYSQL *mysql)
++{
++  return mysql_stmt_init(mysql);
++}
++SYM_16(mysql_stmt_init);
++
++
++my_ulonglong STDCALL symver16_mysql_stmt_insert_id(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_insert_id(stmt);
++}
++SYM_16(mysql_stmt_insert_id);
++
++
++my_ulonglong STDCALL symver16_mysql_stmt_num_rows(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_num_rows(stmt);
++}
++SYM_16(mysql_stmt_num_rows);
++
++
++ulong STDCALL symver16_mysql_stmt_param_count(MYSQL_STMT * stmt)
++{
++  return mysql_stmt_param_count(stmt);
++}
++SYM_16(mysql_stmt_param_count);
++
++
++MYSQL_RES * STDCALL symver16_mysql_stmt_param_metadata(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_param_metadata(stmt);
++}
++SYM_16(mysql_stmt_param_metadata);
++
++
++int STDCALL symver16_mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
++{
++  return mysql_stmt_prepare(stmt, query, length);
++}
++SYM_16(mysql_stmt_prepare);
++
++
++my_bool STDCALL symver16_mysql_stmt_reset(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_reset(stmt);
++}
++SYM_16(mysql_stmt_reset);
++
++
++MYSQL_RES * STDCALL symver16_mysql_stmt_result_metadata(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_result_metadata(stmt);
++}
++SYM_16(mysql_stmt_result_metadata);
++
++
++MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row)
++{
++  return mysql_stmt_row_seek(stmt, row);
++}
++SYM_16(mysql_stmt_row_seek);
++
++
++MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_tell(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_row_tell(stmt);
++}
++SYM_16(mysql_stmt_row_tell);
++
++
++my_bool STDCALL symver16_mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, const char *data, ulong length)
++{
++  return mysql_stmt_send_long_data(stmt, param_number, data, length);
++}
++SYM_16(mysql_stmt_send_long_data);
++
++
++const char *STDCALL symver16_mysql_stmt_sqlstate(MYSQL_STMT * stmt)
++{
++  return mysql_stmt_sqlstate(stmt);
++}
++SYM_16(mysql_stmt_sqlstate);
++
++
++int STDCALL symver16_mysql_stmt_store_result(MYSQL_STMT *stmt)
++{
++  return mysql_stmt_store_result(stmt);
++}
++SYM_16(mysql_stmt_store_result);
++
++
++void STDCALL symver16_mysql_thread_end()
++{
++  return mysql_thread_end();
++}
++SYM_16(mysql_thread_end);
++
++
++ulong STDCALL symver16_mysql_thread_id(MYSQL *mysql)
++{
++  return mysql_thread_id(mysql);
++}
++SYM_16(mysql_thread_id);
++
++
++my_bool STDCALL symver16_mysql_thread_init()
++{
++  return mysql_thread_init();
++}
++SYM_16(mysql_thread_init);
++
++
++uint STDCALL symver16_mysql_thread_safe(void)
++{
++  return mysql_thread_safe();
++}
++SYM_16(mysql_thread_safe);
++
++
++MYSQL_RES * STDCALL symver16_mysql_use_result(MYSQL *mysql)
++{
++  return mysql_use_result(mysql);
++}
++SYM_16(mysql_use_result);
++
++
++uint STDCALL symver16_mysql_warning_count(MYSQL *mysql)
++{
++  return mysql_warning_count(mysql);
++}
++SYM_16(mysql_warning_count);
++
++/*****/
++
++MYSQL * STDCALL symver16_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag)
++{
++  return mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, client_flag);
++}
++SYM_16(mysql_real_connect);
++
++/*****/
++
++my_bool symver16_my_init(void)
++{
++  return my_init();
++}
++SYM_16(my_init);
++
++#endif
+diff -rup old/libmysql/libmysql.ver.in new/libmysql/libmysql.ver.in
+--- old/libmysql/libmysql.ver.in       2013-11-05 08:19:26.000000000 +0100
++++ new/libmysql/libmysql.ver.in       2014-01-10 15:41:30.545182782 +0100
+@@ -1 +1,136 @@
+-libmysqlclient_@SHARED_LIB_MAJOR_VERSION@ { global: *; };
++libmysqlclient_16
++{
++  local:
++    symver16_*;
++};
++
++libmysqlclient_18
++{
++  global:
++    my_init;
++    myodbc_remove_escape;
++    mysql_affected_rows;
++    mysql_autocommit;
++    mysql_change_user;
++    mysql_character_set_name;
++    mysql_close;
++    mysql_commit;
++    mysql_data_seek;
++    mysql_debug;
++    mysql_dump_debug_info;
++    mysql_embedded;
++    mysql_eof;
++    mysql_errno;
++    mysql_error;
++    mysql_escape_string;
++    mysql_fetch_field;
++    mysql_fetch_field_direct;
++    mysql_fetch_fields;
++    mysql_fetch_lengths;
++    mysql_fetch_row;
++    mysql_field_count;
++    mysql_field_seek;
++    mysql_field_tell;
++    mysql_free_result;
++    mysql_get_character_set_info;
++    mysql_get_client_info;
++    mysql_get_client_version;
++    mysql_get_host_info;
++    mysql_get_parameters;
++    mysql_get_proto_info;
++    mysql_get_server_info;
++    mysql_get_server_version;
++    mysql_get_ssl_cipher;
++    mysql_hex_string;
++    mysql_info;
++    mysql_init;
++    mysql_insert_id;
++    mysql_kill;
++    mysql_list_dbs;
++    mysql_list_fields;
++    mysql_list_processes;
++    mysql_list_tables;
++    mysql_more_results;
++    mysql_next_result;
++    mysql_num_fields;
++    mysql_num_rows;
++    mysql_options;
++    mysql_ping;
++    mysql_query;
++    mysql_read_query_result;
++    mysql_real_connect;
++    mysql_real_escape_string;
++    mysql_real_query;
++    mysql_refresh;
++    mysql_rollback;
++    mysql_row_seek;
++    mysql_row_tell;
++    mysql_select_db;
++    mysql_send_query;
++    mysql_server_end;
++    mysql_server_init;
++    mysql_set_character_set;
++    mysql_set_local_infile_default;
++    mysql_set_local_infile_handler;
++    mysql_set_server_option;
++    mysql_shutdown;
++    mysql_sqlstate;
++    mysql_ssl_set;
++    mysql_stat;
++    mysql_stmt_affected_rows;
++    mysql_stmt_attr_get;
++    mysql_stmt_attr_set;
++    mysql_stmt_bind_param;
++    mysql_stmt_bind_result;
++    mysql_stmt_close;
++    mysql_stmt_data_seek;
++    mysql_stmt_errno;
++    mysql_stmt_error;
++    mysql_stmt_execute;
++    mysql_stmt_fetch;
++    mysql_stmt_fetch_column;
++    mysql_stmt_field_count;
++    mysql_stmt_free_result;
++    mysql_stmt_init;
++    mysql_stmt_insert_id;
++    mysql_stmt_num_rows;
++    mysql_stmt_param_count;
++    mysql_stmt_param_metadata;
++    mysql_stmt_prepare;
++    mysql_stmt_reset;
++    mysql_stmt_result_metadata;
++    mysql_stmt_row_seek;
++    mysql_stmt_row_tell;
++    mysql_stmt_send_long_data;
++    mysql_stmt_sqlstate;
++    mysql_stmt_store_result;
++    mysql_store_result;
++    mysql_thread_end;
++    mysql_thread_id;
++    mysql_thread_init;
++    mysql_thread_safe;
++    mysql_use_result;
++    mysql_warning_count;
++
++    free_defaults;
++    handle_options;
++    load_defaults;
++    my_print_help;
++
++    #my_make_scrambled_password;
++    THR_KEY_mysys;
++
++    mysql_client_find_plugin;
++    mysql_client_register_plugin;
++    mysql_load_plugin;
++    mysql_load_plugin_v;
++    mysql_plugin_options;
++    mysql_stmt_next_result;
++
++    #mysql_default_charset_info;
++    mysql_get_charset;
++    mysql_get_charset_by_csname;
++    mysql_net_realloc;
++    #mysql_client_errors;
++    *;
++} libmysqlclient_16;
+diff -rup old/mysys/charset.c new/mysys/charset.c
+--- old/mysys/charset.c        2013-11-05 08:19:26.000000000 +0100
++++ new/mysys/charset.c        2014-01-10 15:41:30.552919678 +0100
+@@ -941,3 +941,20 @@ size_t escape_quotes_for_mysql(CHARSET_I
+   *to= 0;
+   return overflow ? (ulong)~0 : (ulong) (to - to_start);
+ }
++
++#ifndef EMBEDDED_LIBRARY
++
++// Hack to provide Fedora symbols
++
++CHARSET_INFO *mysql_get_charset(uint cs_number, myf flags)
++{
++  return get_charset(cs_number, flags);
++}
++
++
++CHARSET_INFO * mysql_get_charset_by_csname(const char *cs_name, uint cs_flags, myf flags)
++{
++  return get_charset_by_csname(cs_name, cs_flags, flags);
++}
++
++#endif
+diff -rup old/sql/net_serv.cc new/sql/net_serv.cc
+--- old/sql/net_serv.cc        2013-11-05 08:19:26.000000000 +0100
++++ new/sql/net_serv.cc        2014-01-10 15:41:30.563377346 +0100
+@@ -1190,3 +1190,17 @@ void my_net_set_write_timeout(NET *net,
+ #endif
+   DBUG_VOID_RETURN;
+ }
++
++#ifndef EMBEDDED_LIBRARY
++C_MODE_START
++
++// Hack to provide Fedora symbols
++
++my_bool mysql_net_realloc(NET *net, size_t length)
++{
++  return net_realloc(net, length);
++}
++
++C_MODE_END
++#endif
++
+diff -rup old/sql/password.c new/sql/password.c
+--- old/sql/password.c 2013-11-05 08:19:26.000000000 +0100
++++ new/sql/password.c 2014-01-10 15:41:30.567134663 +0100
+@@ -563,3 +563,17 @@ void make_password_from_salt(char *to, c
+   *to++= PVERSION41_CHAR;
+   octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
+ }
++
++#ifndef EMBEDDED_LIBRARY
++
++// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
++
++#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
++
++void symver16_my_make_scrambled_password(char *to, const char *password, size_t pass_len)
++{
++  my_make_scrambled_password(to, password, pass_len);
++}
++SYM_16(my_make_scrambled_password);
++
++#endif
+diff -rup old/sql-common/client.c new/sql-common/client.c
+--- old/sql-common/client.c    2013-11-05 08:19:26.000000000 +0100
++++ new/sql-common/client.c    2014-01-10 15:41:30.574151024 +0100
+@@ -4399,3 +4399,136 @@ static int clear_password_auth_client(MY
+   return res ? CR_ERROR : CR_OK;
+ }
++
++#ifndef EMBEDDED_LIBRARY
++
++// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
++
++#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
++
++void STDCALL symver16_mysql_close(MYSQL *mysql)
++{
++  return mysql_close(mysql);
++}
++SYM_16(mysql_close);
++
++
++uint STDCALL symver16_mysql_errno(MYSQL *mysql)
++{
++  return mysql_errno(mysql);
++}
++SYM_16(mysql_errno);
++
++
++const char * STDCALL symver16_mysql_error(MYSQL *mysql)
++{
++  return mysql_error(mysql);
++}
++SYM_16(mysql_error);
++
++
++ulong * STDCALL symver16_mysql_fetch_lengths(MYSQL_RES *res)
++{
++  return mysql_fetch_lengths(res);
++}
++SYM_16(mysql_fetch_lengths);
++
++
++MYSQL_ROW STDCALL symver16_mysql_fetch_row(MYSQL_RES *res)
++{
++  return mysql_fetch_row(res);
++}
++SYM_16(mysql_fetch_row);
++
++
++void STDCALL symver16_mysql_free_result(MYSQL_RES *result)
++{
++  return mysql_free_result(result);
++}
++SYM_16(mysql_free_result);
++
++
++ulong STDCALL symver16_mysql_get_server_version(MYSQL *mysql)
++{
++  return mysql_get_server_version(mysql);
++}
++SYM_16(mysql_get_server_version);
++
++
++const char * STDCALL symver16_mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
++{
++  return mysql_get_ssl_cipher(mysql);
++}
++SYM_16(mysql_get_ssl_cipher);
++
++
++MYSQL * STDCALL symver16_mysql_init(MYSQL *mysql)
++{
++  return mysql_init(mysql);
++}
++SYM_16(mysql_init);
++
++
++unsigned int STDCALL symver16_mysql_num_fields(MYSQL_RES *res)
++{
++  return mysql_num_fields(res);
++}
++SYM_16(mysql_num_fields);
++
++
++my_ulonglong STDCALL symver16_mysql_num_rows(MYSQL_RES *res)
++{
++  return mysql_num_rows(res);
++}
++SYM_16(mysql_num_rows);
++
++
++int STDCALL symver16_mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
++{
++  return mysql_options(mysql, option, arg);
++}
++SYM_16(mysql_options);
++
++
++int STDCALL symver16_mysql_real_query(MYSQL *mysql, const char *query, ulong length)
++{
++  return mysql_real_query(mysql, query, length);
++}
++SYM_16(mysql_real_query);
++
++
++int STDCALL symver16_mysql_select_db(MYSQL *mysql, const char *db)
++{
++  return mysql_select_db(mysql, db);
++}
++SYM_16(mysql_select_db);
++
++
++int STDCALL symver16_mysql_send_query(MYSQL* mysql, const char* query, ulong length)
++{
++  return mysql_send_query(mysql, query, length);
++}
++SYM_16(mysql_send_query);
++
++
++int STDCALL symver16_mysql_set_character_set(MYSQL *mysql, const char *cs_name)
++{
++  return mysql_set_character_set(mysql, cs_name);
++}
++SYM_16(mysql_set_character_set);
++
++
++my_bool STDCALL symver16_mysql_ssl_set(MYSQL *mysql __attribute__((unused)), const char *key __attribute__((unused)), const char *cert __attribute__((unused)), const char *ca __attribute__((unused)), const char *capath __attribute__((unused)), const char *cipher __attribute__((unused)))
++{
++  return mysql_ssl_set(mysql, key, cert, ca, capath, cipher);
++}
++SYM_16(mysql_ssl_set);
++
++
++MYSQL_RES * STDCALL symver16_mysql_store_result(MYSQL *mysql)
++{
++  return mysql_store_result(mysql);
++}
++SYM_16(mysql_store_result);
++
++#endif
diff --git a/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5096-charset-dir.patch b/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5096-charset-dir.patch
new file mode 100644 (file)
index 0000000..da4548e
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ur a/include/m_ctype.h b/include/m_ctype.h
+--- a/include/m_ctype.h        2015-03-10 12:35:31.499107653 +0100
++++ b/include/m_ctype.h        2015-03-10 12:35:59.357103239 +0100
+@@ -36,7 +36,7 @@
+ #define MY_CS_SORT_ORDER_TABLE_SIZE   256
+ #define MY_CS_TO_UNI_TABLE_SIZE               256
+-#define CHARSET_DIR   "charsets/"
++#define CHARSET_DIR   "charsets-5.0.96/"
+ #define my_wc_t ulong
diff --git a/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5172-charset-dir.patch b/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5172-charset-dir.patch
new file mode 100644 (file)
index 0000000..708df34
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ur a/include/m_ctype.h b/include/m_ctype.h
+--- a/include/m_ctype.h        2015-03-10 12:35:31.499107653 +0100
++++ b/include/m_ctype.h        2015-03-10 12:35:59.357103239 +0100
+@@ -36,7 +36,7 @@
+ #define MY_CS_SORT_ORDER_TABLE_SIZE   256
+ #define MY_CS_TO_UNI_TABLE_SIZE               256
+-#define CHARSET_DIR   "charsets/"
++#define CHARSET_DIR   "charsets-5.1.72/"
+ #define my_wc_t ulong
diff --git a/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5173-charset-dir.patch b/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5173-charset-dir.patch
new file mode 100644 (file)
index 0000000..606af39
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ur a/include/m_ctype.h b/include/m_ctype.h
+--- a/include/m_ctype.h        2015-03-10 12:35:31.499107653 +0100
++++ b/include/m_ctype.h        2015-03-10 12:35:59.357103239 +0100
+@@ -36,7 +36,7 @@
+ #define MY_CS_SORT_ORDER_TABLE_SIZE   256
+ #define MY_CS_TO_UNI_TABLE_SIZE               256
+-#define CHARSET_DIR   "charsets/"
++#define CHARSET_DIR   "charsets-5.1.73/"
+ #define my_wc_t ulong
diff --git a/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5545-charset-dir.patch b/mysql-wsrep-5.6/packaging/rpm-libs-compat/mysql-5545-charset-dir.patch
new file mode 100644 (file)
index 0000000..0844b75
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ur a/include/m_ctype.h b/include/m_ctype.h
+--- a/include/m_ctype.h        2015-09-08 12:35:31.499107653 +0100
++++ b/include/m_ctype.h        2015-09-08 12:35:59.357103239 +0100
+@@ -36,7 +36,7 @@
+ #define MY_CS_SORT_ORDER_TABLE_SIZE   256
+ #define MY_CS_TO_UNI_TABLE_SIZE               256
+-#define CHARSET_DIR   "charsets/"
++#define CHARSET_DIR   "charsets-5.5.45/"
+ #define my_wc_t ulong
diff --git a/mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6.14-mysql-install.patch b/mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6.14-mysql-install.patch
deleted file mode 100644 (file)
index 95a5277..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
-index 440a977..7d068fc 100644
---- a/scripts/mysql_install_db.pl.in
-+++ b/scripts/mysql_install_db.pl.in
-@@ -34,13 +34,35 @@
- #
- ##############################################################################
--use Fcntl;
--use File::Basename;
--use File::Copy;
--use Getopt::Long;
--use Sys::Hostname;
--use Data::Dumper;
- use strict;
-+use warnings;
-+
-+##############################################################################
-+# Check if all needed modules are available, exit if something is missing.
-+##############################################################################
-+
-+BEGIN {
-+  my @req_mods = ('Fcntl', 'File::Basename', 'File::Copy', 'Getopt::Long',
-+                  'Sys::Hostname', 'Data::Dumper');
-+  my @missing_mods;
-+  my $req;
-+  foreach $req (@req_mods) {
-+    eval 'require ' . $req;
-+    if ($@) {
-+      push(@missing_mods, $req);
-+    } else {
-+      $req->import();
-+    }
-+  }
-+  # this avoids the confusing "BEGIN failed--compilation aborted" message
-+  local $SIG{__DIE__} = sub {warn @_; exit 1};
-+
-+  if (@missing_mods) {
-+    my $msg = "FATAL ERROR: please install the following Perl modules " .
-+              "before executing $0:\n" . join("\n",@missing_mods)."\n";
-+    die $msg;
-+  }
-+}
- Getopt::Long::Configure("pass_through");
-@@ -75,6 +97,8 @@ Usage: $0 [OPTIONS]
-   --help               Display this help and exit.                     
-   --ldata=path         The path to the MySQL data directory. Same as --datadir.
-   --no-defaults        Don't read default options from any option file.
-+  --keep-my-cnf        Don't try to create my.cnf based on template. 
-+                       Useful for systems with working, updated my.cnf.
- EOF1
-   if ( $^O !~ m/^(MSWin32|cygwin)$/ ) {
-     print <<EOF2;
-@@ -86,6 +110,7 @@ EOF2
-   print <<EOF3;
-   --rpm                For internal use.  This option is used by RPM files
-                        during the MySQL installation process.
-+                       Implies --keep-my-cnf option.
-   --skip-name-resolve  Use IP addresses rather than hostnames when creating
-                        grant table entries.  This option can be useful if
-                        your DNS does not work.
-@@ -149,6 +174,7 @@ sub parse_arguments
-              "skip-name-resolve",
-              "verbose",
-+             "keep-my-cnf",
-              "rpm",
-              "help",
-              "random-passwords",
-@@ -356,13 +382,19 @@ sub tell_root_password {
- ##############################################################################
- sub generate_random_password {
--  # On (at least) Linux and Solaris, a "random" device is available, use it:
--  # cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1
--  # Without LC_ALL, "tr" may not know the "alnum" character class -
--  # and there are user profiles which do not have this set.
--  #
--  my $password = `cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1`;
--  chomp ($password);
-+  # On Linux, Solaris, Max OS X and FreeBSD we have a random device available.
-+  my $randfile = "/dev/urandom";
-+  open(FD, $randfile) || die "Can't open $randfile for reading: $!";
-+  my $password = "";
-+  my $pass_len = 16;
-+  my $c;
-+  while (length($password) < $pass_len) {
-+    $c = getc(FD);
-+    if ($c =~ /\w/) {
-+      $password .= $c;
-+    }
-+  }
-+  close(FD);
-   return $password;
- }
-@@ -399,11 +431,16 @@ $basedir= "@prefix@" if ! $basedir;              # Default
- # ----------------------------------------------------------------------
- my $print_defaults;
-+my $keep_my_cnf = 0;
- if ( $opt->{srcdir} and $opt->{basedir} )
- {
-   error($opt,"Specify either --basedir or --srcdir, not both");
- }
-+if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
-+{
-+  $keep_my_cnf = 1;
-+}
- if ( $opt->{srcdir} )
- {
-   $opt->{builddir} = $opt->{srcdir} unless $opt->{builddir};
-@@ -425,13 +462,18 @@ my $config_file;
- my $copy_cfg_file;
- # ----------------------------------------------------------------------
--# This will be the default config file
-+# This will be the default config file (unless creation is unwanted)
- # ----------------------------------------------------------------------
- $config_file= "$basedir/my.cnf";
- my $cfg_template= find_in_basedir($opt,"file","my-default.cnf",
-                                 "share","share/mysql","support-files");
-+# Distros might move files
-+if ((! -r $cfg_template) && (-r "@pkgdatadir@/my-default.cnf")) {
-+  $cfg_template = "@pkgdatadir@/my-default.cnf";
-+}
-+
- -e $cfg_template or cannot_find_file("my-default.cnf");
- $copy_cfg_file= $config_file;
-@@ -441,22 +483,21 @@ if (-e $copy_cfg_file)
-   $copy_cfg_file =~ s/my.cnf/my-new.cnf/;
-   # Too early to print warning here, the user may not notice
- }
--open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
--if (open (CFG, "> $copy_cfg_file"))
--{
--  while (<TEMPL>)
--  {
--    # Remove lines beginning with # *** which are template comments
--    print CFG $_ unless /^# \*\*\*/;
-+
-+if ( ! $keep_my_cnf ) {
-+  open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template");
-+  if (open (CFG, "> $copy_cfg_file")) {
-+    while (<TEMPL>) {
-+      # Remove lines beginning with # *** which are template comments
-+      print CFG $_ unless /^# \*\*\*/;
-+    }
-+    close CFG;
-+  } else {
-+    warning($opt,"Could not write to config file $copy_cfg_file: $!");
-+    $failed_write_cfg= 1;
-   }
--  close CFG;
-+  close TEMPL;
- }
--else
--{
--  warning($opt,"Could not write to config file $copy_cfg_file: $!");
--  $failed_write_cfg= 1;
--}
--close TEMPL;
- # ----------------------------------------------------------------------
- # Now we can get arguments from the groups [mysqld] and [mysql_install_db]
-@@ -619,7 +660,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
- }
- # ----------------------------------------------------------------------
--# Create database directories mysql & test
-+# Create database directory mysql
- # ----------------------------------------------------------------------
- # FIXME The shell variant uses "mkdir -p":
-@@ -652,7 +693,7 @@ if ($opt_user)
-   }
- }
--foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
-+foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql")
- {
-   mkdir($dir, 0700) unless -d $dir;
-   if ($opt_user and -w "/")
-@@ -846,7 +887,13 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") )
-            "",
-            "Support MySQL by buying support/licenses at http://shop.mysql.com");
--    if ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-+    if ($keep_my_cnf)
-+    {
-+      report($opt,
-+           "Note: new default config file not created.",
-+           "Please make sure your config file is current");
-+    }
-+    elsif ($copy_cfg_file eq $config_file and !$failed_write_cfg)
-     {
-       report($opt,
-            "New default config file was created as $config_file and",
diff --git a/mysql-wsrep-5.6/packaging/rpm-oel/mysql-embedded-check.c b/mysql-wsrep-5.6/packaging/rpm-oel/mysql-embedded-check.c
deleted file mode 100644 (file)
index 8bf8ca5..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* simple test program to see if we can link the embedded server library */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include "mysql.h"
-
-MYSQL *mysql;
-
-static char *server_options[] = \
-       { "mysql_test", "--defaults-file=my.cnf", NULL };
-int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
-
-static char *server_groups[] = { "libmysqld_server", 
-                                 "libmysqld_client", NULL };
-
-int main(int argc, char **argv)
-{
-   mysql_library_init(num_elements, server_options, server_groups);
-   mysql = mysql_init(NULL);
-   mysql_close(mysql);
-   mysql_library_end();
-
-   return 0;
-}
index 8670f889574ef252dbbb32f9470c747d0e75d6fa..fab7b3627b31a4b2629677f591c6748aae10e435 100644 (file)
@@ -12,8 +12,8 @@ get_option () {
     local section=$1
     local option=$2
     local default=$3
-    ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
-    [ -z $ret ] && ret=$default
+    ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2- | tail -n 1)
+    [ -z "$ret" ] && ret=$default
     echo $ret
 }
 
index 79c8a8daa7d89b4b841dfc34889af1ecf6ab0505..bfd4a4c84886f342fa523af80c41a459ffa3695a 100644 (file)
@@ -3,7 +3,7 @@
 # mysqld       This shell script takes care of starting and stopping
 #              the MySQL subsystem (mysqld).
 #
-# chkconfig: - 64 36
+# chkconfig: 345 64 36
 # description: MySQL database server.
 # processname: mysqld
 # config: /etc/my.cnf
@@ -34,7 +34,7 @@ lockfile=/var/lock/subsys/$prog
 # We use my_print_defaults which prints all options from multiple files,
 # with the more specific ones later; hence take the last match.
 get_mysql_option(){
-       result=`/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1`
+       result=$(/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
        if [ -z "$result" ]; then
            # not found, use default
            result="$3"
index f14e754030527fea20320e320ff757b2ab1f291f..6e442564c746ba7b1191f19de69c723142f33179 100644 (file)
@@ -1,4 +1,4 @@
-# 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
@@ -110,6 +110,9 @@ BuildRequires:  perl
 BuildRequires:  time
 BuildRequires:  libaio-devel
 BuildRequires:  ncurses-devel
+%if 0%{?rhel} > 5
+BuildRequires:  numactl-devel
+%endif
 BuildRequires:  openssl-devel
 BuildRequires:  zlib-devel
 %if 0%{?systemd}
@@ -301,6 +304,7 @@ Obsoletes:      mysql-devel < %{version}-%{release}
 Obsoletes:      mariadb-devel
 Provides:       mysql-devel = %{version}-%{release}
 Provides:       mysql-devel%{?_isa} = %{version}-%{release}
+Conflicts:      mysql-connector-c-devel < 6.2
 
 %description    devel
 This package contains the development header files and libraries necessary
@@ -321,6 +325,7 @@ Requires:       mysql-community-common%{?_isa} = %{version}-%{release}
 Obsoletes:      MySQL-shared < %{version}-%{release}
 Obsoletes:      mysql-libs < %{version}-%{release}
 Obsoletes:      mariadb-libs
+Conflicts:      mysql-connector-c-shared < 6.2
 Provides:       mysql-libs = %{version}-%{release}
 Provides:       mysql-libs%{?_isa} = %{version}-%{release}
 
@@ -370,7 +375,7 @@ Obsoletes:      mariadb-embedded
 Obsoletes:      MySQL-embedded < %{version}-%{release}
 Obsoletes:      mysql-embedded < %{version}-%{release}
 Provides:       mysql-embedded = %{version}-%{release}
-Provides:       mysql-emdedded%{?_isa} = %{version}-%{release}
+Provides:       mysql-embedded%{?_isa} = %{version}-%{release}
 
 %description    embedded
 This package contains the MySQL server as an embedded library.
@@ -597,6 +602,7 @@ rm -rf %{buildroot}%{_infodir}/mysql.info*
 rm -rf %{buildroot}%{_datadir}/mysql/binary-configure
 rm -rf %{buildroot}%{_datadir}/mysql/mysql.server
 rm -rf %{buildroot}%{_datadir}/mysql/mysqld_multi.server
+rm -f %{buildroot}%{_datadir}/mysql/win_install_firewall.sql 
 %if 0%{?systemd}
 rm -rf %{buildroot}%{_sysconfdir}/init.d/mysqld
 %endif
@@ -620,11 +626,11 @@ rm -r $(readlink var) var
 
 %pre server
 /usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || :
-/usr/sbin/useradd -M -N -g mysql -o -r -d /var/lib/mysql -s /bin/bash \
+/usr/sbin/useradd -M %{!?el5:-N} -g mysql -o -r -d /var/lib/mysql -s /bin/bash \
     -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
 
 %post server
-datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
+datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
 /bin/chmod 0755 "$datadir" >/dev/null 2>&1 || :
 /bin/touch /var/log/mysqld.log >/dev/null 2>&1 || :
 %if 0%{?systemd}
@@ -740,6 +746,7 @@ fi
 %attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/mysql_no_login.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/validate_password.so
@@ -749,6 +756,7 @@ fi
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mysql_no_login.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/validate_password.so
@@ -772,10 +780,13 @@ fi
 %attr(755, root, root) %{_libdir}/mysql/plugin/authentication_pam.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/thread_pool.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/openssl_udf.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/firewall.so 
+%attr(644, root, root) %{_datadir}/mysql/linux_install_firewall.sql 
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/audit_log.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/authentication_pam.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/thread_pool.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/openssl_udf.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/firewall.so 
 %endif
 %attr(644, root, root) %{_datadir}/mysql/fill_help_tables.sql
 %attr(644, root, root) %{_datadir}/mysql/mysql_system_tables.sql
@@ -938,6 +949,12 @@ fi
 %endif
 
 %changelog
+* Tue Sep 29 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.28-1
+- Added conflicts to mysql-connector-c-shared dependencies
+
+* Wed Jan 14 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.24-1
+- Add mysql_no_login.so plugin
+
 * Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.22-1
 - Add license info in each subpackage
 
index dc151e0322c4f48252298ec34867ee44b1e27625..d3a79202e749d7cbb212ee5b279837c0754345c2 100644 (file)
 
 install_db () {    
     # Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
-    datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
+    datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
     
     # Restore log, dir, perms and SELinux contexts
     [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
-    log=/var/log/mysqld.log
+    log=/var/log/mysql/mysqld.log
     [ -e $log ] || touch $log
     chmod 0640 $log
     chown mysql:mysql $log || exit 1
@@ -27,13 +27,7 @@ install_db () {
     [ -d "$datadir/mysql" ] && exit 0
 
     # Create initial db
-    /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql
-
-    # Create a file to trigger execution of mysql_secure_installation
-    # after server has started
-    touch  "$datadir"/.phase_two_required
-
-    exit 0
+    /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql --keep-my-cnf
 }
 
 pinger () {
@@ -46,13 +40,6 @@ pinger () {
         mysqladmin ping >/dev/null 2>&1 && ret=0 && break
     done
 
-    # If server has been started successfully and file created in
-    # install_db step is present we run mysql_secure_installation
-    if [ $ret -eq 0 -a -e "$datadir"/.phase_two_required -a -x /usr/bin/mysql_secure_installation ] ; then
-       /usr/bin/mysql_secure_installation --use-default --defaults-file=/etc/my.cnf
-       rm -f "$datadir"/.phase_two_required
-    fi
-
     exit 0
 }
 
index 74cd5f836e76fffb5ff7c2d1e1f3c2307141e02a..473d4935761979a01d5fe8d7a4f2ec5729771af6 100644 (file)
@@ -1 +1 @@
-d /var/run/mysqld 0755 mysql mysql -
+d /var/run/mysql 0755 mysql mysql -
index b44637c82981a72d8c3cac42a5c0a2f856a7cb46..749aa200e52a26ae020018a635c013e976295984 100644 (file)
@@ -57,7 +57,7 @@ get_option () {
     local section=$1
     local option=$2
     local default=$3
-    ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
+    ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2- | tail -n 1)
     [ -z $ret ] && ret=$default
     echo $ret
 }
index 77d23b33dedc058fbb86a4ecba09df1f2885c54d..2fed2da793b055e063c39f4dedaba8aa94a1c791 100644 (file)
@@ -1,4 +1,4 @@
-# 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
 %global license_type          GPLv2
 %endif
 
-%if 0%{?sles_version} == 011
+%if 0%{?suse_version} == 1110
 %global dist                  .sles11
 %global sles11                1
 %endif
 
+%if 0%{?suse_version} == 1315
+%global dist                  .sles12
+%global sles12                1
+%endif
+
+# https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines
+%{?sles12:                %global systemd 1}
+%{!?_tmpfilesdir:         %global _tmpfilesdir /usr/lib/tmpfiles.d}
+
 Name:           mysql-%{product_suffix}
 Summary:        A very fast and reliable SQL database server
 Group:          Applications/Databases
@@ -76,11 +85,14 @@ Source91:       filter-requires.sh
 BuildRequires:  cmake
 BuildRequires:  perl
 BuildRequires:  libaio-devel
+BuildRequires:  libnuma-devel
 BuildRequires:  ncurses-devel
 BuildRequires:  openssl-devel
 BuildRequires:  zlib-devel
 %if 0%{?systemd}
 BuildRequires:  systemd
+BuildRequires:  pkgconfig(systemd)
+BuildRequires:  systemd-rpm-macros
 %endif
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
@@ -118,7 +130,6 @@ Group:          Applications/Databases
 Requires:       coreutils
 Requires:       grep
 Requires:       procps
-Requires:       shadow-utils
 Requires:       net-tools
 Requires:       perl-base
 %if 0%{?commercial}
@@ -140,14 +151,12 @@ Obsoletes:      mariadb-galera-server
 Provides:       mysql = %{version}-%{release}
 Provides:       mysql-tools = %{version}-%{release}
 %if 0%{?systemd}
-Requires(post):   systemd
-Requires(preun):  systemd
-Requires(postun): systemd
+%{?systemd_requires}
 %else
 PreReq:         insserv
+%endif
 PreReq:         sed
 PreReq:         pwdutils
-%endif
 Conflicts:      otherproviders(mysql)
 Conflicts:      otherproviders(mysql-debug)
 Conflicts:      otherproviders(mysql-tools)
@@ -265,9 +274,10 @@ Requires:       mysql-community-libs = %{version}-%{release}
 Obsoletes:      MySQL-devel < %{version}-%{release}
 Obsoletes:      mysql-devel < %{version}-%{release}
 Obsoletes:      mariadb-devel
-Obsoletes:      libmysqlclient-devel < %{version}-%{release}
+Obsoletes:      libmysqlclient-devel
 Provides:       mysql-devel = %{version}-%{release}
 Provides:       libmysqlclient-devel = %{version}-%{release}
+Conflicts:      mysql-connector-c-devel < 6.2
 
 %description    devel
 This package contains the development header files and libraries necessary
@@ -293,6 +303,7 @@ Obsoletes:      libmysqlclient_r18 < %{version}-%{release}
 Provides:       mysql-libs = %{version}-%{release}
 Provides:       libmysqlclient18 = %{version}-%{release}
 Provides:       libmysqlclient_r18 = %{version}-%{release}
+Conflicts:      mysql-connector-c-shared < 6.2
 
 %description    libs
 This package contains the shared libraries for MySQL client
@@ -367,7 +378,7 @@ mkdir debug
 (
   cd debug
   # Attempt to remove any optimisation flags from the debug build
-  optflags=$(echo "%{optflags}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /')
+  optflags=$(echo "%{optflags}" | sed -e 's/-O2 / /' -e 's/-D_FORTIFY_SOURCE=2/ /' -e 's/-Wp, / /')
   cmake ../%{src_dir} \
            -DBUILD_CONFIG=mysql_release \
            -DINSTALL_LAYOUT=RPM \
@@ -420,7 +431,7 @@ MBD=$RPM_BUILD_DIR/%{src_dir}
 # Ensure that needed directories exists
 install -d -m 0755 %{buildroot}/var/lib/mysql
 install -d -m 0755 %{buildroot}/var/run/mysql
-install -d -m 0660 %{buildroot}/var/log/mysql
+install -d -m 0750 %{buildroot}/var/log/mysql
 
 # Install all binaries
 cd $MBD/release
@@ -432,7 +443,7 @@ install -D -m 0644 $MBD/release/packaging/rpm-sles/my.cnf %{buildroot}%{_sysconf
 install -d %{buildroot}%{_sysconfdir}/my.cnf.d
 %if 0%{?systemd}
 install -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/mysql-systemd-start
-install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/mysqld.service
+install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/mysql.service
 %else
 install -D -m 0755 $MBD/release/packaging/rpm-sles/mysql.init %{buildroot}%{_sysconfdir}/init.d/mysql
 %endif
@@ -460,10 +471,15 @@ rm -rf %{buildroot}%{_sysconfdir}/init.d/mysql
 rm -rf %{buildroot}%{_bindir}/mysql_embedded
 rm -rf %{buildroot}%{_bindir}/mysql_setpermission
 rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1*
+rm -f %{buildroot}%{_datadir}/mysql/win_install_firewall.sql 
 
 # rcmysql symlink
 install -d %{buildroot}%{_sbindir}
+%if 0%{?systemd}
+ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcmysql
+%else
 ln -sf %{_initrddir}/mysql %{buildroot}%{_sbindir}/rcmysql
+%endif
 
 %check
 %if 0%{?runselftest}
@@ -483,21 +499,25 @@ rm -r $(readlink var) var
 /usr/sbin/groupadd -r mysql >/dev/null 2>&1 || :
 /usr/sbin/useradd -g mysql -o -r -d /var/lib/mysql -s /bin/false \
     -c "MySQL Server" -u 60 mysql >/dev/null 2>&1 || :
+%if 0%{?systemd}
+%service_add_pre mysql.service
+%endif
 
 %post server
-datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
+datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
 /bin/chmod 0755 "$datadir"
 /bin/touch /var/log/mysql/mysqld.log
 %if 0%{?systemd}
-%systemd_post mysqld.service
-/sbin/service mysqld enable >/dev/null 2>&1 || :
+%service_add_post mysql.service
+/usr/bin/systemd-tmpfiles --create %{_tmpfilesdir}/mysql.conf >/dev/null 2>&1 || :
+/bin/systemctl enable mysql.service >/dev/null 2>&1 || :
 %else
 /sbin/insserv /etc/init.d/mysql
 %endif
 
 %preun server
 %if 0%{?systemd}
-%systemd_preun mysqld.service
+%service_del_preun mysql.service
 %else
 if [ "$1" -eq 0 ]; then
     /usr/sbin/rcmysql stop >/dev/null 2>&1 || :
@@ -507,7 +527,7 @@ fi
 
 %postun server
 %if 0%{?systemd}
-%systemd_postun_with_restart mysqld.service
+%service_del_postun mysql.service
 %else
 if [ $1 -ge 1 ]; then
     /usr/sbin/rcmysql condrestart >/dev/null 2>&1 || :
@@ -602,6 +622,7 @@ fi
 %attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/mysql_no_login.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/validate_password.so
@@ -611,6 +632,7 @@ fi
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mysql_no_login.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/validate_password.so
@@ -619,10 +641,13 @@ fi
 %attr(755, root, root) %{_libdir}/mysql/plugin/authentication_pam.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/thread_pool.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/openssl_udf.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/firewall.so 
+%attr(644, root, root) %{_datadir}/mysql/linux_install_firewall.sql 
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/audit_log.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/authentication_pam.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/thread_pool.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/debug/openssl_udf.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/firewall.so 
 %endif
 %attr(644, root, root) %{_datadir}/mysql/fill_help_tables.sql
 %attr(644, root, root) %{_datadir}/mysql/mysql_system_tables.sql
@@ -636,14 +661,14 @@ fi
 %attr(644, root, root) %{_datadir}/mysql/magic
 %attr(644, root, root) %{_prefix}/lib/tmpfiles.d/mysql.conf
 %if 0%{?systemd}
-%attr(644, root, root) %{_unitdir}/mysqld.service
+%attr(644, root, root) %{_unitdir}/mysql.service
 %else
 %attr(755, root, root) %{_sysconfdir}/init.d/mysql
 %endif
 %attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
 %dir %attr(755, mysql, mysql) /var/lib/mysql
 %dir %attr(755, mysql, mysql) /var/run/mysql
-%dir %attr(660, mysql, mysql) /var/log/mysql
+%dir %attr(750, mysql, mysql) /var/log/mysql
 
 %files common
 %defattr(-, root, root, -)
@@ -793,6 +818,12 @@ fi
 %attr(755, root, root) %{_libdir}/mysql/libmysqld.so
 
 %changelog
+* Tue Sep 29 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.28-1
+- Added conflicts to mysql-connector-c-shared dependencies
+
+* Wed Jan 14 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.24-1
+- Add mysql_no_login.so plugin
+
 * Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.22-1
 - Backport to 5.6.22
 
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/README-ULN b/mysql-wsrep-5.6/packaging/rpm-uln/README-ULN
deleted file mode 100644 (file)
index 8ae44a1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-In order to have RPMs of MySQL which are distributed via ULN for Oracle Linux
-to be as closely compatible to such RPMs built and distributed by RedHat,
-this directory contains additional files which originated at RedHat
-and are used only for such RPMs intended for distribution via ULN.
-
-Especially, this directory contains the spec file used to build these RPMs,
-named "mysql.spec".  Please regard the following note:
-
-    You are receiving a copy of the Red Hat spec file.
-    The terms of the Oracle license do NOT apply to the Red Hat spec file;
-    it is licensed under the
-          GNU GENERAL PUBLIC LICENSE Version 2, June 1991
-    separately from the Oracle programs you receive.
-
-
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/README.mysql-docs b/mysql-wsrep-5.6/packaging/rpm-uln/README.mysql-docs
deleted file mode 100644 (file)
index dd894a7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-The official MySQL documentation is not freely redistributable, so we cannot
-include it in RHEL or Fedora.  You can find it on-line at
-
-http://dev.mysql.com/doc/
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/filter-requires-mysql.sh b/mysql-wsrep-5.6/packaging/rpm-uln/filter-requires-mysql.sh
deleted file mode 100755 (executable)
index d435062..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-/usr/lib/rpm/perl.req $* | grep -v -e "perl(th" -e "perl(lib::mtr" -e "perl(mtr"
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/generate-tarball.sh b/mysql-wsrep-5.6/packaging/rpm-uln/generate-tarball.sh
deleted file mode 100755 (executable)
index 2ff4bff..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-VERSION=$1
-
-rm -rf mysql-$VERSION
-
-tar xfz mysql-$VERSION.tar.gz || exit 1
-
-rm mysql-$VERSION/Docs/mysql.info
-
-tar cfz mysql-$VERSION-nodocs.tar.gz mysql-$VERSION || exit 1
-
-rm -rf mysql-$VERSION
-
-exit 0
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/my.cnf b/mysql-wsrep-5.6/packaging/rpm-uln/my.cnf
deleted file mode 100644 (file)
index fae0fa2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-[mysqld]
-datadir=/var/lib/mysql
-socket=/var/lib/mysql/mysql.sock
-user=mysql
-# Disabling symbolic-links is recommended to prevent assorted security risks
-symbolic-links=0
-
-[mysqld_safe]
-log-error=/var/log/mysqld.log
-pid-file=/var/run/mysqld/mysqld.pid
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/my_config.h b/mysql-wsrep-5.6/packaging/rpm-uln/my_config.h
deleted file mode 100644 (file)
index 435a126..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Kluge to support multilib installation of both 32- and 64-bit RPMS:
- * we need to arrange that header files that appear in both RPMs are
- * identical.  Hence, this file is architecture-independent and calls
- * in an arch-dependent file that will appear in just one RPM.
- *
- * To avoid breaking arches not explicitly supported by Red Hat, we
- * use this indirection file *only* on known multilib arches.
- *
- * Note: this may well fail if user tries to use gcc's -I- option.
- * But that option is deprecated anyway.
- */
-#if defined(__x86_64__)
-#include "my_config_x86_64.h"
-#elif defined(__i386__)
-#include "my_config_i386.h"
-#elif defined(__ppc64__) || defined(__powerpc64__)
-#include "my_config_ppc64.h"
-#elif defined(__ppc__) || defined(__powerpc__)
-#include "my_config_ppc.h"
-#elif defined(__s390x__)
-#include "my_config_s390x.h"
-#elif defined(__s390__)
-#include "my_config_s390.h"
-#elif defined(__sparc__) && defined(__arch64__)
-#include "my_config_sparc64.h"
-#elif defined(__sparc__)
-#include "my_config_sparc.h"
-#endif
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-fix-tests.patch b/mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-fix-tests.patch
deleted file mode 100644 (file)
index a1ab7a8..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-Adapt tests (where needed) to RedHat conventions.
-
-1) The RedHat convention uses the package name "mysql*" whereas upstream uses "MySQL*".
-   Test "file_contents" constructs path names and needs to be adapted.
-
-=== modified file 'mysql-test/t/file_contents.test'
---- mysql-5.5.17-orig/mysql-test/t/file_contents.test  2011-10-10 12:03:29 +0000
-+++ mysql-5.5.17/mysql-test/t/file_contents.test       2011-11-16 18:07:55 +0000
-@@ -17,20 +17,20 @@ if ($dir_bin =~ m|/usr/|) {
-   $dir_docs =~ s|/lib|/share/doc|;
-   if(-d "$dir_docs/packages") {
-     # SuSE: "packages/" in the documentation path
--    $dir_docs = glob "$dir_docs/packages/MySQL-server*";
-+    $dir_docs = glob "$dir_docs/packages/mysql-server*";
-   } else {
-     # RedHat: version number in directory name
--    $dir_docs = glob "$dir_docs/MySQL-server*";
-+    $dir_docs = glob "$dir_docs/mysql-server*";
-   }
- } elsif ($dir_bin =~ m|/usr$|) {
-   # RPM build during development
-   $dir_docs = "$dir_bin/share/doc";
-   if(-d "$dir_docs/packages") {
-     # SuSE: "packages/" in the documentation path
--    $dir_docs = glob "$dir_docs/packages/MySQL-server*";
-+    $dir_docs = glob "$dir_docs/packages/mysql-server*";
-   } else {
-     # RedHat: version number in directory name
--    $dir_docs = glob "$dir_docs/MySQL-server*";
-+    $dir_docs = glob "$dir_docs/mysql-server*";
-   }
- } else {
-   # tar.gz package, Windows, or developer work (in BZR)
-
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-libdir.patch b/mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-libdir.patch
deleted file mode 100644 (file)
index 2ab3e9e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-The RPMs built by MySQL AB (-> Sun -> Oracle) put the libraries into "/usr/lib".
-Those built by RedHat put them into "/usr/lib/mysql".
-This patch is to modify the cmake files to follow the RedHat convention.
-Similar, the server is now in "/usr/libexec" (formerly "/usr/sbin").
-
-
-diff -Naur mysql-5.5.17.orig/cmake/install_layout.cmake mysql-5.5.17/cmake/install_layout.cmake
---- mysql-5.5.17.orig/cmake/install_layout.cmake       2011-06-30 15:46:53 +0000
-+++ mysql-5.5.17/cmake/install_layout.cmake    2011-10-27 16:40:10 +0000
-@@ -140,14 +140,14 @@ SET(INSTALL_SBINDIR_RPM                 
- # be applied at build time via "rpmbuild".
- #
- SET(INSTALL_BINDIR_RPM                  "bin")
--SET(INSTALL_SBINDIR_RPM                 "sbin")
-+SET(INSTALL_SBINDIR_RPM                 "libexec")
- SET(INSTALL_SCRIPTDIR_RPM               "bin")
- #
- IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
--  SET(INSTALL_LIBDIR_RPM                "lib64")
-+  SET(INSTALL_LIBDIR_RPM                "lib64/mysql")
-   SET(INSTALL_PLUGINDIR_RPM             "lib64/mysql/plugin")
- ELSE()
--  SET(INSTALL_LIBDIR_RPM                "lib")
-+  SET(INSTALL_LIBDIR_RPM                "lib/mysql")
-   SET(INSTALL_PLUGINDIR_RPM             "lib/mysql/plugin")
- ENDIF()
- #
-
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-mtr1.patch b/mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-mtr1.patch
deleted file mode 100644 (file)
index 7a7dc85..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-Drop support for version 1 of "mysql-test-run.pl" from the RPMs:
-
-1) The auto-generation of Perl dependencies will mishandle that code,
-   probably because its run directory differs from its storage location.
-2) It does not provide several variables which are used in tests of MySQL 5.5
-
-If you really need it, take it from the source tarball.
-
-=== modified file 'mysql-test/mysql-test-run.pl'
---- mysql-5.5.17-orig/mysql-test/mysql-test-run.pl     2011-10-03 11:16:40 +0000
-+++ mysql-5.5.17/mysql-test/mysql-test-run.pl  2011-11-16 19:06:38 +0000
-@@ -58,10 +58,9 @@ BEGIN {
-   if ( $version == 1 )
-   {
-     print "=======================================================\n";
--    print "  WARNING: Using mysql-test-run.pl version 1!  \n";
-+    print "  ERROR: Support for version 1 is dropped in this distribution!  \n";
-     print "=======================================================\n";
--    # Should use exec() here on *nix but this appears not to work on Windows
--    exit(system($^X, "lib/v1/mysql-test-run.pl", @ARGV) >> 8);
-+    exit(1);
-   }
-   elsif ( $version == 2 )
-   {
-
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-testing.patch b/mysql-wsrep-5.6/packaging/rpm-uln/mysql-5.5-testing.patch
deleted file mode 100644 (file)
index 7438713..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Hack the top-level Makefile to enable the openssl regression tests.
-(Why doesn't this happen automatically given the configure option??)
-
-Also, increase the overall timeout for the regression tests to 12 hours,
-because on a slow or heavily-loaded build machine sometimes the default of
-5 hours isn't enough.  (This has been demonstrated to fail in mass-rebuild
-scenarios, which aren't that uncommon for Fedora.)  Similarly increase the
-per-testcase timeout to 30 minutes, since the default of 15 hasn't got a
-great deal of headroom either.
-
-
-diff -Naur mysql-5.1.32.orig/Makefile.am mysql-5.1.32/Makefile.am
---- mysql-5.1.32.orig/Makefile.am      2009-02-13 19:51:56.000000000 -0500
-+++ mysql-5.1.32/Makefile.am   2009-03-04 18:12:36.000000000 -0500
-@@ -98,7 +98,7 @@
- test-ns:
-       cd mysql-test ; \
--          @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed
-+          @PERL@ ./mysql-test-run.pl $(force) $(mem) --ssl --mysqld=--binlog-format=mixed --suite-timeout=720 --testcase-timeout=30
- test-binlog-statement:
-       cd mysql-test ; \
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql-chain-certs.patch b/mysql-wsrep-5.6/packaging/rpm-uln/mysql-chain-certs.patch
deleted file mode 100644 (file)
index 4e26af1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-Fix things so that chains of certificates work in the server and client
-certificate files.
-
-This only really works for OpenSSL-based builds, as yassl is unable to read
-multiple certificates from a file.  The patch below to yassl/src/ssl.cpp
-doesn't fix that, but just arranges that the viosslfactories.c patch won't
-have any ill effects in a yassl build.  Since we don't use yassl in Red Hat/
-Fedora builds, I'm not feeling motivated to try to fix yassl for this.
-
-See RH bug #598656.  Filed upstream at http://bugs.mysql.com/bug.php?id=54158
-
-   ===
-
-Joerg Bruehe, MySQL Build Team at Oracle: First patch adapted to code changes in MySQL 5.5
-
-
-diff -Naur mysql-5.5.29.orig/vio/viosslfactories.c mysql-5.5.29/vio/viosslfactories.c
---- mysql-5.5.29.orig/vio/viosslfactories.c    2010-05-06 11:28:07.000000000 -0400
-+++ mysql-5.5.29/vio/viosslfactories.c 2010-05-26 23:23:46.000000000 -0400
-@@ -106,7 +106,7 @@
-     key_file= cert_file;
-   if (cert_file &&
--      SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0)
-+      SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0)
-   {
-     *error= SSL_INITERR_CERT;
-     DBUG_PRINT("error",("%s from file '%s'", sslGetErrString(*error), cert_file));
-diff -Naur mysql-5.1.47.orig/extra/yassl/src/ssl.cpp mysql-5.1.47/extra/yassl/src/ssl.cpp
---- mysql-5.1.47.orig/extra/yassl/src/ssl.cpp  2010-05-06 11:24:26.000000000 -0400
-+++ mysql-5.1.47/extra/yassl/src/ssl.cpp       2010-05-26 23:29:13.000000000 -0400
-@@ -1606,10 +1606,10 @@
-     }
--    int SSL_CTX_use_certificate_chain_file(SSL_CTX*, const char*)
-+    int SSL_CTX_use_certificate_chain_file(SSL_CTX* ctx, const char* file)
-     {
--        // TDOD:
--        return SSL_SUCCESS;
-+        // For the moment, treat like use_certificate_file
-+        return read_file(ctx, file, SSL_FILETYPE_PEM, Cert);
-     }
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql-embedded-check.c b/mysql-wsrep-5.6/packaging/rpm-uln/mysql-embedded-check.c
deleted file mode 100644 (file)
index 8bf8ca5..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* simple test program to see if we can link the embedded server library */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include "mysql.h"
-
-MYSQL *mysql;
-
-static char *server_options[] = \
-       { "mysql_test", "--defaults-file=my.cnf", NULL };
-int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
-
-static char *server_groups[] = { "libmysqld_server", 
-                                 "libmysqld_client", NULL };
-
-int main(int argc, char **argv)
-{
-   mysql_library_init(num_elements, server_options, server_groups);
-   mysql = mysql_init(NULL);
-   mysql_close(mysql);
-   mysql_library_end();
-
-   return 0;
-}
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql-expired-certs.patch b/mysql-wsrep-5.6/packaging/rpm-uln/mysql-expired-certs.patch
deleted file mode 100644 (file)
index acd3a78..0000000
+++ /dev/null
@@ -1,555 +0,0 @@
-Upstream insists on generating SSL testing certificates with relatively short
-lifespan, which has repeatedly caused problems (ie, one day the regression
-tests suddenly stop working).  Replace them with certificates with 20-year
-lifespan.  We should periodically regenerate these, too, but at least not
-very often.
-
-
-diff -Naur mysql-5.1.50.orig/mysql-test/std_data/cacert.pem mysql-5.1.50/mysql-test/std_data/cacert.pem
---- mysql-5.1.50.orig/mysql-test/std_data/cacert.pem   2010-08-03 13:55:04.000000000 -0400
-+++ mysql-5.1.50/mysql-test/std_data/cacert.pem        2010-08-27 23:42:05.751428144 -0400
-@@ -1,17 +1,22 @@
- -----BEGIN CERTIFICATE-----
--MIICrTCCAhagAwIBAgIJAMI7xZKjhrDbMA0GCSqGSIb3DQEBBAUAMEQxCzAJBgNV
-+MIIDsjCCApqgAwIBAgIJAL5YrUwfPSWVMA0GCSqGSIb3DQEBBQUAMEQxCzAJBgNV
- BAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxhMREwDwYD
--VQQKEwhNeVNRTCBBQjAeFw0xMDAxMjkxMTQ3MTBaFw0xNTAxMjgxMTQ3MTBaMEQx
-+VQQKEwhNeVNRTCBBQjAeFw0xMDAxMjkwNTU5NTNaFw0xNTAxMjgwNTU5NTNaMEQx
- CzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxh
--MREwDwYDVQQKEwhNeVNRTCBBQjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
--wQYsOEfrN4ESP3FjsI8cghE+tZVuyK2gck61lwieVxjgFMtBd65mI5a1y9pmlOI1
--yM4SB2Ppqcuw7/e1CdV1y7lvHrGNt5yqEHbN4QX1gvsN8TQauP/2WILturk4R4Hq
--rKg0ZySu7f1Xhl0ed9a48LpaEHD17IcxWEGMMJwAxF0CAwEAAaOBpjCBozAMBgNV
--HRMEBTADAQH/MB0GA1UdDgQWBBSvktYQ0ahLnyxyVKqty+WpBbBrDTB0BgNVHSME
--bTBrgBSvktYQ0ahLnyxyVKqty+WpBbBrDaFIpEYwRDELMAkGA1UEBhMCU0UxEDAO
--BgNVBAgTB1VwcHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FM
--IEFCggkAwjvFkqOGsNswDQYJKoZIhvcNAQEEBQADgYEAdKN1PjwMHAKG2Ww1145g
--JQGBnKxSFOUaoSvkBi/4ntTM+ysnViWh7WvxyWjR9zU9arfr7aqsDeQxm0XDOqzj
--AQ/cQIla2/Li8tXyfc06bisH/IHRaSc2zWqioTKbEwMdVOdrvq4a8V8ic3xYyIWn
--7F4WeS07J8LKardSvM0+hOA=
-+MREwDwYDVQQKEwhNeVNRTCBBQjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-+ggEBAL6kNN4peX7uhK9rb06W/QbPEpVuejmdWdl2PqMshP/eSuXXw7kwVgfpxx9R
-+vC000CKQQSG9MCoZjtqPnFRsetmWLZgApRpEalGXTXJqq9sEbCfoFizg94U8G7d2
-+u5XJjLVmcG34ru36KoBgVx1zeH1puBAf8dOzrE4L7Y+ZQBFzFohjh8C2LqWC4nM5
-+qsLmOkDWMipGqYU5DvkKjIbTbwTyRNRgZHWSPfVDDPUIUOsY4BGUp2DpgeGY9aEv
-+lIs57Ev9JqlIUCV65lOhhDkG+xwmkHKHA+ECEU9cALI8+uXbh48MB9XpMOuk408X
-+/lX89aZwD0/G9kmObVGnE2G+H5UCAwEAAaOBpjCBozAdBgNVHQ4EFgQUsft+d7VA
-+jWgRftkR5cPG2k2sUbAwdAYDVR0jBG0wa4AUsft+d7VAjWgRftkR5cPG2k2sUbCh
-+SKRGMEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdV
-+cHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAL5YrUwfPSWVMAwGA1UdEwQFMAMB
-+Af8wDQYJKoZIhvcNAQEFBQADggEBALRUOAmdL8R8sl1y8kiEiFgDatdXK5RDqWai
-+8yZChfmwTIToHhmQsOEshJe2e8hky3huUj+33VyXjINoMbebIwMuXPwEkbJal8RZ
-+nSJmF0jN1Qz7J/jFffwK9xmejWZJx49Kt2+Qwrwp6kDeq9TLFqQOoVczgyJPYsTL
-+NAOib5WqTud3XWvCwxrhqmWu7JZq6sp1fomP/uunprb8y2miWfLESZN2mKAhm44Q
-+Lws867LT8v2lskEjq2dT1LutD5+R66XcdjgSr0uDziDs64jZwCD6ea94hVFM7ej0
-+ZOXYeSEZJ56FjUxu632e9fY8NyMh30yKjjmQf1mM9PuGJvdvsWU=
- -----END CERTIFICATE-----
-diff -Naur mysql-5.1.50.orig/mysql-test/std_data/client-cert.pem mysql-5.1.50/mysql-test/std_data/client-cert.pem
---- mysql-5.1.50.orig/mysql-test/std_data/client-cert.pem      2010-08-03 13:55:04.000000000 -0400
-+++ mysql-5.1.50/mysql-test/std_data/client-cert.pem   2010-08-27 23:42:05.752428395 -0400
-@@ -1,46 +1,69 @@
- Certificate:
-     Data:
--        Version: 1 (0x0)
--        Serial Number: 1048577 (0x100001)
--        Signature Algorithm: md5WithRSAEncryption
-+        Version: 3 (0x2)
-+        Serial Number: 6 (0x6)
-+        Signature Algorithm: sha1WithRSAEncryption
-         Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
-         Validity
--            Not Before: Jan 29 11:50:22 2010 GMT
--            Not After : Jan 28 11:50:22 2015 GMT
-+            Not Before: Feb 20 03:03:26 2010 GMT
-+            Not After : Sep  3 03:03:26 2030 GMT
-         Subject: C=SE, ST=Uppsala, O=MySQL AB
-         Subject Public Key Info:
-             Public Key Algorithm: rsaEncryption
--                Public-Key: (1024 bit)
--                Modulus:
--                    00:cc:9a:37:49:13:66:dc:cf:e3:0b:13:a1:23:ed:
--                    78:db:4e:bd:11:f6:8c:0d:76:f9:a3:32:56:9a:f8:
--                    a1:21:6a:55:4e:4d:3f:e6:67:9d:26:99:b2:cd:a4:
--                    9a:d2:2b:59:5c:d7:8a:d3:60:68:f8:18:bd:c5:be:
--                    15:e1:2a:3c:a3:d4:61:cb:f5:11:94:17:81:81:f7:
--                    87:8c:f6:6a:d2:ee:d8:e6:77:f6:62:66:4d:2e:16:
--                    8d:08:81:4a:c9:c6:4b:31:e5:b9:c7:8a:84:96:48:
--                    a7:47:8c:0d:26:90:56:4e:e6:a5:6e:8c:b3:f2:9f:
--                    fc:3d:78:9b:49:6e:86:83:77
-+            RSA Public Key: (1024 bit)
-+                Modulus (1024 bit):
-+                    00:c2:e7:20:cf:89:59:2f:67:cb:4c:9f:e8:11:f2:
-+                    23:e5:f1:b1:ee:3f:66:5f:c3:f5:fd:1e:31:ee:8f:
-+                    4c:2a:bd:c0:4a:a5:9f:c8:44:d5:77:8f:15:1b:4d:
-+                    78:6e:b2:a2:48:a5:24:33:05:40:02:b3:c1:87:8d:
-+                    59:3c:1a:07:aa:86:f0:04:e1:9c:20:4b:22:32:c4:
-+                    51:9e:40:e4:31:c3:57:f5:98:bf:2e:b1:fd:2c:56:
-+                    bf:49:d9:9b:e7:17:cc:95:5f:b5:08:19:5e:9d:df:
-+                    65:22:39:2c:48:fb:69:96:31:7a:35:4d:de:60:b4:
-+                    c1:60:19:5f:96:56:7e:55:19
-                 Exponent: 65537 (0x10001)
--    Signature Algorithm: md5WithRSAEncryption
--        5e:1f:a3:53:5f:24:13:1c:f8:28:32:b0:7f:69:69:f3:0e:c0:
--        34:87:10:03:7d:da:15:8b:bd:19:b8:1a:56:31:e7:85:49:81:
--        c9:7f:45:20:74:3e:89:c0:e0:26:84:51:cc:04:16:ce:69:99:
--        01:e1:26:99:b3:e3:f5:bd:ec:5f:a0:84:e4:38:da:75:78:7b:
--        89:9c:d2:cd:60:95:20:ba:8e:e3:7c:e6:df:76:3a:7c:89:77:
--        02:94:86:11:3a:c4:61:7d:6f:71:83:21:8a:17:fb:17:e2:ee:
--        02:6b:61:c1:b4:52:63:d7:d8:46:b2:c5:9c:6f:38:91:8a:35:
--        32:0b
-+        X509v3 extensions:
-+            X509v3 Basic Constraints: 
-+                CA:FALSE
-+            X509v3 Subject Key Identifier: 
-+                8D:10:67:91:33:76:9C:02:E5:78:5D:D8:C5:EF:25:96:B2:D7:FA:1F
-+            X509v3 Authority Key Identifier: 
-+                keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0
-+                DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
-+                serial:BE:58:AD:4C:1F:3D:25:95
-+
-+    Signature Algorithm: sha1WithRSAEncryption
-+        a9:88:10:3e:5d:2a:47:29:c8:03:27:7a:31:5a:8e:10:03:bc:
-+        b5:4e:37:1d:12:7b:eb:5f:50:71:70:b1:a3:8e:93:0e:77:17:
-+        6c:47:b6:c9:a4:4d:2a:c4:38:f0:61:55:b2:7f:28:ba:06:79:
-+        ee:67:11:7d:d4:c9:7f:0a:18:c8:c1:cb:d0:2c:f9:63:0f:bb:
-+        45:ca:de:ea:bb:ac:00:01:52:48:36:2b:07:2b:c8:46:c7:b1:
-+        21:81:bd:77:39:e7:4c:39:aa:bd:ac:60:d8:a7:bf:cf:14:98:
-+        4a:0b:a1:40:55:06:8d:6f:35:a9:39:a0:71:a9:97:ba:7c:73:
-+        3c:41:ba:c5:1c:11:4b:2b:43:1d:2d:ba:7b:5f:14:b5:3d:64:
-+        62:15:36:b4:16:bd:78:c8:43:8d:f9:1c:a5:d2:ac:a1:58:74:
-+        e1:99:de:ad:04:19:43:a8:bd:0a:fd:19:9b:50:44:46:6d:18:
-+        55:4d:bf:b4:5b:a4:93:62:c7:64:91:6c:54:34:d1:f8:f3:ff:
-+        12:6d:5f:85:e7:35:9e:5c:42:81:5e:fb:c8:bb:44:51:98:b2:
-+        ef:1b:9f:5a:22:77:28:7d:da:fb:08:c2:94:9a:0f:42:08:93:
-+        54:10:1e:ad:f2:4f:fc:62:98:51:e9:9b:b9:3a:93:d9:e4:1f:
-+        1d:c4:76:d0
- -----BEGIN CERTIFICATE-----
--MIIB5zCCAVACAxAAATANBgkqhkiG9w0BAQQFADBEMQswCQYDVQQGEwJTRTEQMA4G
--A1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwg
--QUIwHhcNMTAwMTI5MTE1MDIyWhcNMTUwMTI4MTE1MDIyWjAyMQswCQYDVQQGEwJT
--RTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIwgZ8wDQYJKoZI
--hvcNAQEBBQADgY0AMIGJAoGBAMyaN0kTZtzP4wsToSPteNtOvRH2jA12+aMyVpr4
--oSFqVU5NP+ZnnSaZss2kmtIrWVzXitNgaPgYvcW+FeEqPKPUYcv1EZQXgYH3h4z2
--atLu2OZ39mJmTS4WjQiBSsnGSzHluceKhJZIp0eMDSaQVk7mpW6Ms/Kf/D14m0lu
--hoN3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAXh+jU18kExz4KDKwf2lp8w7ANIcQ
--A33aFYu9GbgaVjHnhUmByX9FIHQ+icDgJoRRzAQWzmmZAeEmmbPj9b3sX6CE5Dja
--dXh7iZzSzWCVILqO43zm33Y6fIl3ApSGETrEYX1vcYMhihf7F+LuAmthwbRSY9fY
--RrLFnG84kYo1Mgs=
-+MIIDETCCAfmgAwIBAgIBBjANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ
-+MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
-+UUwgQUIwHhcNMTAwMjIwMDMwMzI2WhcNMzAwOTAzMDMwMzI2WjAyMQswCQYDVQQG
-+EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIwgZ8wDQYJ
-+KoZIhvcNAQEBBQADgY0AMIGJAoGBAMLnIM+JWS9ny0yf6BHyI+Xxse4/Zl/D9f0e
-+Me6PTCq9wEqln8hE1XePFRtNeG6yokilJDMFQAKzwYeNWTwaB6qG8AThnCBLIjLE
-+UZ5A5DHDV/WYvy6x/SxWv0nZm+cXzJVftQgZXp3fZSI5LEj7aZYxejVN3mC0wWAZ
-+X5ZWflUZAgMBAAGjgaMwgaAwCQYDVR0TBAIwADAdBgNVHQ4EFgQUjRBnkTN2nALl
-+eF3Yxe8llrLX+h8wdAYDVR0jBG0wa4AUsft+d7VAjWgRftkR5cPG2k2sUbChSKRG
-+MEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBz
-+YWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAL5YrUwfPSWVMA0GCSqGSIb3DQEBBQUA
-+A4IBAQCpiBA+XSpHKcgDJ3oxWo4QA7y1TjcdEnvrX1BxcLGjjpMOdxdsR7bJpE0q
-+xDjwYVWyfyi6BnnuZxF91Ml/ChjIwcvQLPljD7tFyt7qu6wAAVJINisHK8hGx7Eh
-+gb13OedMOaq9rGDYp7/PFJhKC6FAVQaNbzWpOaBxqZe6fHM8QbrFHBFLK0MdLbp7
-+XxS1PWRiFTa0Fr14yEON+Ryl0qyhWHThmd6tBBlDqL0K/RmbUERGbRhVTb+0W6ST
-+YsdkkWxUNNH48/8SbV+F5zWeXEKBXvvIu0RRmLLvG59aIncofdr7CMKUmg9CCJNU
-+EB6t8k/8YphR6Zu5OpPZ5B8dxHbQ
- -----END CERTIFICATE-----
-diff -Naur mysql-5.1.50.orig/mysql-test/std_data/client-key.pem mysql-5.1.50/mysql-test/std_data/client-key.pem
---- mysql-5.1.50.orig/mysql-test/std_data/client-key.pem       2010-08-03 13:55:05.000000000 -0400
-+++ mysql-5.1.50/mysql-test/std_data/client-key.pem    2010-08-27 23:42:05.752428395 -0400
-@@ -1,15 +1,15 @@
- -----BEGIN RSA PRIVATE KEY-----
--MIICXQIBAAKBgQDMmjdJE2bcz+MLE6Ej7XjbTr0R9owNdvmjMlaa+KEhalVOTT/m
--Z50mmbLNpJrSK1lc14rTYGj4GL3FvhXhKjyj1GHL9RGUF4GB94eM9mrS7tjmd/Zi
--Zk0uFo0IgUrJxksx5bnHioSWSKdHjA0mkFZO5qVujLPyn/w9eJtJboaDdwIDAQAB
--AoGASqk/4We2En+93y3jkIO4pXafIe3w/3zZ7caRue1ehx4RUQh5d+95djuB9u7J
--HEZ7TpjM7QNyao5EueL6gvbxt0LXFvqAMni7yM9tt/HUYtHHPqYiRtUny9bKYFTm
--l8szCCMal/wD9GZU9ByHDNHm7tHUMyMhARNTYSgx+SERFmECQQD/6jJocC4SXf6f
--T3LqimWR02lbJ7qCoDgRglsUXh0zjrG+IIiAyE+QOCCx1GMe3Uw6bsIuYwdHT6as
--WcdPs04xAkEAzKulvEvLVvN5zfa/DTYRTV7jh6aDleOxjsD5oN/oJXoACnPzVuUL
--qQQMNtuAXm6Q1QItrRxpQsSKbY0UQka6JwJBAOSgoNoG5lIIYTKIMvzwGV+XBLeo
--HYsXgh+6Wo4uql3mLErUG78ZtWL9kc/tE4R+ZdyKGLaCR/1gXmH5bwN4B/ECQEBb
--uUH8k3REG4kojesZlVc+/00ojzgS4UKCa/yqa9VdB6ZBz8MDQydinnShkTwgiGpy
--xOoqhO753o2UT0qH8wECQQC99IEJWUnwvExVMkLaZH5NjAFJkb22sjkmuT11tAgU
--RQgOMoDOm6driojnOnDWOkx1r1Gy9NgMLooduja4v6cx
-+MIICWwIBAAKBgQDC5yDPiVkvZ8tMn+gR8iPl8bHuP2Zfw/X9HjHuj0wqvcBKpZ/I
-+RNV3jxUbTXhusqJIpSQzBUACs8GHjVk8GgeqhvAE4ZwgSyIyxFGeQOQxw1f1mL8u
-+sf0sVr9J2ZvnF8yVX7UIGV6d32UiOSxI+2mWMXo1Td5gtMFgGV+WVn5VGQIDAQAB
-+AoGARXcXLKDpVooJ3W+IyQyiWsw//IhANpWjUOm4JiyQmxMyO+i4ACr4Yjpu7WI5
-+MEseqAGj20NdwxjKO0PXsCIe5LmrGZ+SI8+CSERFOWXWRtCWz7y7SG30i1k6suvM
-+mwqWom0tJLwn93uA1lm/WSwKQwUrJRahRQd3EaZqrl7DP5kCQQD/8gbuYAT5pxQe
-+ULLGM0RvEsXxDYbEDxNbY5wrBazfklBwpumxZpFl6jEAT++7Kh2Ns3A7kB1oUNlA
-+FPYr+dYPAkEAwvHEwRtoyUr8jqoqVVJWI76CDmBjEOzVeMKW97ztqbs2LxZW8dYI
-+iOh/myFGpdoUwgu0U8w9MmXcj3ZeZCYKVwJALyQ+AJPw9qa+fuLwOq9gsHCtwrty
-+EhSQxSlwrz/pWniRll439vPkXfgntF4E0t1r+hiN2Hqv3/HcQgBaYzkuIwJAG023
-+bACFxaOuCeFFepvEms8E8jSHy4gQQhCnCl24v8wLw76SQN7kZSCDNtwLRBFuVNtE
-+z3PMonFn2eQPRmGZkwJAP1c1BHprMQx/ruafdscROILv3JrH40C1bR6KVVBKt1dK
-+Qpnpgi7hK5rUQjDF8k3bn9ugTt06jyeHe/QhAml0kg==
- -----END RSA PRIVATE KEY-----
-diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server-cert.pem mysql-5.1.50/mysql-test/std_data/server-cert.pem
---- mysql-5.1.50.orig/mysql-test/std_data/server-cert.pem      2010-08-03 13:55:08.000000000 -0400
-+++ mysql-5.1.50/mysql-test/std_data/server-cert.pem   2010-08-27 23:42:05.753428361 -0400
-@@ -1,41 +1,69 @@
- Certificate:
-     Data:
--        Version: 1 (0x0)
--        Serial Number: 1048578 (0x100002)
--        Signature Algorithm: md5WithRSAEncryption
-+        Version: 3 (0x2)
-+        Serial Number: 4 (0x4)
-+        Signature Algorithm: sha1WithRSAEncryption
-         Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
-         Validity
--            Not Before: Jan 29 11:56:49 2010 GMT
--            Not After : Jan 28 11:56:49 2015 GMT
-+            Not Before: Feb 20 02:55:06 2010 GMT
-+            Not After : Sep  3 02:55:06 2030 GMT
-         Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=localhost
-         Subject Public Key Info:
-             Public Key Algorithm: rsaEncryption
--                Public-Key: (512 bit)
--                Modulus:
--                    00:cd:e4:87:51:9d:72:11:a0:d1:fa:f3:92:8b:13:
--                    1c:eb:f7:e2:9a:2f:72:a8:d6:65:48:d1:69:af:1b:
--                    c0:4c:13:e5:60:60:51:41:e9:ab:a6:bc:13:bb:0c:
--                    5e:32:7c:d9:6c:9e:cd:05:24:84:78:db:80:91:2e:
--                    d8:88:2b:c2:ed
-+            RSA Public Key: (1024 bit)
-+                Modulus (1024 bit):
-+                    00:e3:7d:4f:c2:23:77:a9:3a:2c:d2:69:59:a0:2f:
-+                    4e:d1:51:4c:ae:8d:f5:17:cc:ce:58:9c:83:4f:0b:
-+                    a3:bb:29:a2:b8:1d:3e:1b:04:f9:a9:3e:e2:61:d0:
-+                    e6:7b:b9:7c:12:d8:1f:86:c9:53:b5:04:dd:df:26:
-+                    e9:c0:2b:de:4a:96:2e:f3:23:6f:79:6d:a9:d2:4e:
-+                    17:af:2f:de:8b:68:44:ae:de:a3:e2:c4:37:1c:04:
-+                    ad:73:4b:85:f9:83:ac:fe:b7:c1:54:47:2e:96:d4:
-+                    31:96:85:94:69:d6:5a:63:24:04:99:89:19:1d:56:
-+                    8a:d1:77:aa:87:fb:38:cd:b7
-                 Exponent: 65537 (0x10001)
--    Signature Algorithm: md5WithRSAEncryption
--        73:ce:9c:6e:39:46:b4:14:be:da:3f:f3:1b:ba:90:bc:23:43:
--        d7:82:2a:70:4e:a6:d9:5a:65:5c:b7:df:71:df:75:77:c5:80:
--        a4:af:fa:d2:59:e2:fd:c9:9c:f0:98:95:8e:69:a9:8c:7c:d8:
--        6f:48:d2:e3:36:e0:cd:ff:3f:d1:a5:e6:ab:75:09:c4:50:10:
--        c4:96:dd:bf:3b:de:32:46:da:ca:4a:f1:d6:52:8a:33:2f:ab:
--        f5:2e:70:3f:d4:9c:be:00:c8:03:f9:39:8a:df:5b:70:3c:40:
--        ef:03:be:7c:3d:1d:32:32:f3:51:81:e2:83:30:6e:3d:38:9b:
--        fb:3c
-+        X509v3 extensions:
-+            X509v3 Basic Constraints: 
-+                CA:FALSE
-+            X509v3 Subject Key Identifier: 
-+                CC:8C:71:40:D0:0F:BF:D1:99:79:3F:1B:E9:10:76:19:67:36:0F:A3
-+            X509v3 Authority Key Identifier: 
-+                keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0
-+                DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
-+                serial:BE:58:AD:4C:1F:3D:25:95
-+
-+    Signature Algorithm: sha1WithRSAEncryption
-+        6f:ad:5e:59:fa:84:3a:be:e2:72:b1:e8:66:2a:4e:f8:73:19:
-+        11:06:11:92:78:56:3e:d6:e8:68:29:90:8b:59:d2:fe:aa:ae:
-+        25:59:c7:e9:99:bb:4a:06:43:dd:40:bd:cb:f4:ae:79:95:7d:
-+        8e:90:ef:58:d2:a8:fc:bf:07:f3:37:b2:9b:bd:da:e6:8c:56:
-+        dd:5e:c6:4a:70:7c:3e:3d:a1:e8:35:06:b8:a7:7b:ac:26:85:
-+        54:5d:09:a2:7b:77:b4:17:7f:72:31:cb:ff:cc:67:6d:e6:3e:
-+        c6:dc:96:eb:4a:0a:ae:e9:48:ae:8a:e0:d6:73:57:6e:32:4c:
-+        00:dc:28:da:55:b3:9f:9f:d8:98:cc:d9:f1:b6:b3:14:67:2e:
-+        a1:47:1e:51:11:cf:70:9f:31:8f:ba:59:29:f2:d0:88:0b:e2:
-+        51:6b:f8:31:ed:6d:ac:00:5e:d3:78:4c:95:97:02:cc:74:2b:
-+        3b:c6:28:e6:2a:c3:30:99:35:b4:4d:31:46:d4:90:f2:47:ed:
-+        64:85:1a:75:2a:72:0a:2f:c6:3a:2f:d2:ac:6b:31:cc:e5:a8:
-+        07:c2:d6:22:f3:c6:0f:bf:67:d9:d6:b2:79:cd:48:b5:c3:e0:
-+        e3:18:7f:b5:74:c9:43:19:fb:c4:93:29:ca:cc:90:2b:1b:6f:
-+        45:f6:25:f9
- -----BEGIN CERTIFICATE-----
--MIIBtzCCASACAxAAAjANBgkqhkiG9w0BAQQFADBEMQswCQYDVQQGEwJTRTEQMA4G
--A1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwg
--QUIwHhcNMTAwMTI5MTE1NjQ5WhcNMTUwMTI4MTE1NjQ5WjBGMQswCQYDVQQGEwJT
--RTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxEjAQBgNVBAMT
--CWxvY2FsaG9zdDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDN5IdRnXIRoNH685KL
--Exzr9+KaL3Ko1mVI0WmvG8BME+VgYFFB6aumvBO7DF4yfNlsns0FJIR424CRLtiI
--K8LtAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAc86cbjlGtBS+2j/zG7qQvCND14Iq
--cE6m2VplXLffcd91d8WApK/60lni/cmc8JiVjmmpjHzYb0jS4zbgzf8/0aXmq3UJ
--xFAQxJbdvzveMkbaykrx1lKKMy+r9S5wP9ScvgDIA/k5it9bcDxA7wO+fD0dMjLz
--UYHigzBuPTib+zw=
-+MIIDJTCCAg2gAwIBAgIBBDANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ
-+MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
-+UUwgQUIwHhcNMTAwMjIwMDI1NTA2WhcNMzAwOTAzMDI1NTA2WjBGMQswCQYDVQQG
-+EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxEjAQBgNV
-+BAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA431PwiN3
-+qTos0mlZoC9O0VFMro31F8zOWJyDTwujuymiuB0+GwT5qT7iYdDme7l8EtgfhslT
-+tQTd3ybpwCveSpYu8yNveW2p0k4Xry/ei2hErt6j4sQ3HAStc0uF+YOs/rfBVEcu
-+ltQxloWUadZaYyQEmYkZHVaK0Xeqh/s4zbcCAwEAAaOBozCBoDAJBgNVHRMEAjAA
-+MB0GA1UdDgQWBBTMjHFA0A+/0Zl5PxvpEHYZZzYPozB0BgNVHSMEbTBrgBSx+353
-+tUCNaBF+2RHlw8baTaxRsKFIpEYwRDELMAkGA1UEBhMCU0UxEDAOBgNVBAgTB1Vw
-+cHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCggkAvlit
-+TB89JZUwDQYJKoZIhvcNAQEFBQADggEBAG+tXln6hDq+4nKx6GYqTvhzGREGEZJ4
-+Vj7W6GgpkItZ0v6qriVZx+mZu0oGQ91Avcv0rnmVfY6Q71jSqPy/B/M3spu92uaM
-+Vt1exkpwfD49oeg1Brine6wmhVRdCaJ7d7QXf3Ixy//MZ23mPsbclutKCq7pSK6K
-+4NZzV24yTADcKNpVs5+f2JjM2fG2sxRnLqFHHlERz3CfMY+6WSny0IgL4lFr+DHt
-+bawAXtN4TJWXAsx0KzvGKOYqwzCZNbRNMUbUkPJH7WSFGnUqcgovxjov0qxrMczl
-+qAfC1iLzxg+/Z9nWsnnNSLXD4OMYf7V0yUMZ+8STKcrMkCsbb0X2Jfk=
- -----END CERTIFICATE-----
-diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server-key.pem mysql-5.1.50/mysql-test/std_data/server-key.pem
---- mysql-5.1.50.orig/mysql-test/std_data/server-key.pem       2010-08-03 13:55:08.000000000 -0400
-+++ mysql-5.1.50/mysql-test/std_data/server-key.pem    2010-08-27 23:42:05.754428433 -0400
-@@ -1,9 +1,15 @@
- -----BEGIN RSA PRIVATE KEY-----
--MIIBOwIBAAJBAM3kh1GdchGg0frzkosTHOv34povcqjWZUjRaa8bwEwT5WBgUUHp
--q6a8E7sMXjJ82WyezQUkhHjbgJEu2Igrwu0CAwEAAQJBAJuwhFbF3NzRpBbEmnqJ
--4GPa1UJMQMLFJF+04tqj/HxJcAIVhOJhGmmtYNw1yjz/ZsPnfJCMz4eFOtdjvGtf
--peECIQDmFFg2WLvYo+2m9w9V7z4ZIkg7ixYkI/ObUUctfZkPOQIhAOUWnrvjFrAX
--bIvYT/YR50+3ZDLEc51XxNgJnWqWYl1VAiEAnTOFWgyivFC1DgF8PvDp8u5TgCt2
--A1d1GMgd490O+TECIC/WMl0/hTxOF9930vKqOGf//o9PUGkZq8QE9fcM4gtlAiAE
--iOcFpnLjtWj57jrhuw214ucnB5rklkQQe+AtcARNkg==
-+MIICXgIBAAKBgQDjfU/CI3epOizSaVmgL07RUUyujfUXzM5YnINPC6O7KaK4HT4b
-+BPmpPuJh0OZ7uXwS2B+GyVO1BN3fJunAK95Kli7zI295banSThevL96LaESu3qPi
-+xDccBK1zS4X5g6z+t8FURy6W1DGWhZRp1lpjJASZiRkdVorRd6qH+zjNtwIDAQAB
-+AoGAUb0o91y/FjMs/72S0pes/lDz+JRRSGfyjKxQEgrgndNsADOhqRu0iTdrKDJj
-+XnlbN3ooecnFJfnFrvTQcJhSmlS30j6VrBw6LXpCBK3dvjYgJ9LOne7WK+dF1+vS
-+FMQtsP04C56Sxy6HJDpMyWJ6oS3Bu169ygG2AxKo+Fk+E6ECQQD38w/MzmrARz2Z
-+AGeEPDUnVZPYgtmXkmks95S0/2jSoLhmgpvJimzxwpYwVG/BG8dSDVuTDu5kp05D
-+3bZIp3EzAkEA6uAwJsCZPtHXlWU3wYZJsA697rUNjPaCQOIaZ/lnh5RUHTmUiw1h
-+Oj/VORqKB0kXqcDfawwLjZEvh1Xli+H5bQJBANTmhw2TvEPnp/OFTl1UGUvyBmXl
-+TRMB639qAu07VfVtfYi/4ya1zn/0VmOfTOoigQ5qW9Q1AOu6YNCTQl62L9MCQQDc
-+YfEsW2kvNYxYJHoVfuBjbuGuOnn1e1Oqd70ZND59S6NFLMMBWlORaVWzWACNZ3rp
-+kAzSj6HDeqgjD2jsQONdAkEAt7S1YHUn8F760bRn4AnAto2TVOYdArtTP/wYjd4o
-+9rJREO/d8AYkYJ96APLvF0SZ4n3t1pLwQRsKKN8ZGTmzLA==
- -----END RSA PRIVATE KEY-----
-diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server8k-cert.pem mysql-5.1.50/mysql-test/std_data/server8k-cert.pem
---- mysql-5.1.50.orig/mysql-test/std_data/server8k-cert.pem    2010-08-03 13:55:08.000000000 -0400
-+++ mysql-5.1.50/mysql-test/std_data/server8k-cert.pem 2010-08-27 23:43:00.005366270 -0400
-@@ -1,51 +1,69 @@
-+Certificate:
-+    Data:
-+        Version: 3 (0x2)
-+        Serial Number: 5 (0x5)
-+        Signature Algorithm: sha1WithRSAEncryption
-+        Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
-+        Validity
-+            Not Before: Feb 20 03:00:54 2010 GMT
-+            Not After : Sep  3 03:00:54 2030 GMT
-+        Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=server
-+        Subject Public Key Info:
-+            Public Key Algorithm: rsaEncryption
-+            RSA Public Key: (1024 bit)
-+                Modulus (1024 bit):
-+                    00:c5:da:44:95:06:77:16:21:af:a0:c4:3c:e9:f8:
-+                    1d:2d:95:f9:63:90:8c:3f:86:ba:77:76:4a:52:4b:
-+                    6b:af:29:f5:1c:aa:d4:3f:3e:42:9f:6d:46:ba:86:
-+                    90:b1:2d:cc:db:c6:33:15:a3:f4:af:53:33:4f:a1:
-+                    56:d1:aa:3b:26:10:f7:64:b5:f9:bf:1b:b1:47:8e:
-+                    cc:a6:d6:0d:aa:4a:77:e3:a3:63:9d:2a:dc:65:f4:
-+                    7f:91:17:38:2d:d6:cd:4e:8d:53:52:97:6e:87:fc:
-+                    64:60:a6:a1:00:ac:96:6c:e4:42:94:75:17:46:6f:
-+                    91:b5:dd:06:47:ed:05:e3:db
-+                Exponent: 65537 (0x10001)
-+        X509v3 extensions:
-+            X509v3 Basic Constraints: 
-+                CA:FALSE
-+            X509v3 Subject Key Identifier: 
-+                6E:60:3F:29:13:60:99:ED:0C:F7:15:B5:DB:7B:1C:FB:6F:60:19:ED
-+            X509v3 Authority Key Identifier: 
-+                keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0
-+                DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
-+                serial:BE:58:AD:4C:1F:3D:25:95
-+
-+    Signature Algorithm: sha1WithRSAEncryption
-+        63:2e:0f:07:14:06:cf:74:90:3d:37:42:f2:48:70:60:21:bc:
-+        34:52:31:f1:87:70:d2:b2:fb:ff:13:38:dc:f0:5e:43:d7:ee:
-+        a7:c7:1f:ac:aa:d2:8c:4f:fa:3c:4c:73:f6:b6:c2:0c:a0:ea:
-+        a2:c9:e2:73:61:c3:2e:78:40:0f:2a:d3:63:50:9b:b8:f9:89:
-+        40:ed:98:08:97:c3:07:24:17:34:b5:78:89:0a:bb:83:4c:e2:
-+        5c:2e:13:d6:21:30:ad:30:48:b5:70:12:ff:4a:6f:42:f0:f8:
-+        9f:b1:4b:bd:89:2b:f0:9d:e2:49:2b:35:69:18:1f:76:40:b4:
-+        76:bd:cb:dd:27:2f:c0:c1:e2:33:3e:6e:df:68:54:19:92:8a:
-+        bb:13:9c:cf:d6:17:56:da:bf:0d:64:70:3a:45:b7:aa:5f:e3:
-+        f5:96:ae:34:f2:17:37:27:d0:4b:e8:30:4a:c0:02:42:e2:d2:
-+        30:eb:eb:c7:d7:ec:d8:df:5c:43:58:e2:6f:b7:58:54:0d:c4:
-+        01:71:2d:59:8f:44:c7:a1:6c:0b:41:28:fa:b7:63:a7:68:d3:
-+        4f:c3:0f:17:9e:b2:32:50:e6:0b:87:3d:e2:39:47:c0:d8:0a:
-+        3b:f6:af:50:68:0f:9d:ef:6e:34:0d:3a:07:94:f8:a4:d7:24:
-+        86:32:d3:b4
- -----BEGIN CERTIFICATE-----
--MIIJFDCCBPwCAQEwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCU0UxEDAOBgNV
--BAgTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMQ0wCwYDVQQLEwRUZXN0MQsw
--CQYDVQQDEwJDQTAeFw0xMDA3MjgxNDA3MjhaFw0xODEwMTQxNDA3MjhaMFIxCzAJ
--BgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQjEN
--MAsGA1UECxMEVGVzdDEPMA0GA1UEAxMGc2VydmVyMIIEIjANBgkqhkiG9w0BAQEF
--AAOCBA8AMIIECgKCBAEA6h3v1OWb9I9U/Z8diBu/xYGS8NCTD3ZESboHxVI2qSEC
--PgxNNcG8Lh0ktQdgYcOe64MnDTZX0Bibm47hoDldrAlTSffFxQhylqBBoXxDF+Lr
--hXIqCz7K0PsK+bYusL9ezJ7PETDnCT7oy95q4GXbKsutbNsm9if4ZE41gs2KnoU2
--DA7kvMmkKojrMIL4+BqTXA20LLo0iSbgvUTvpSJw4u96BeyzMNnxK2wP5vvTtUo5
--hACbfU87YjaSKs+q2VXCzfyYGZk1L1xk5GUI0bP+jutf1dDzNttW2/q2Nf5rxx09
--Gh/GwmOnEk1O7cOZ8VQCsOHirIM39NuSARsY6Y3G5XM4k2W4nxyR/RtdG9bvs/33
--aGsZ5V5yp7WSs8s9HHwaCPSsUiLKckQ7uA0TTRgbeweMrrLKovG57jsbBBB8pQD4
--PRd31qgxCdstWXHiWwRyI8vOLWENPXPFqA/rJwwqNdWTogy38aqVXxGYR8PIwjA2
--OaIwFjwGZcsPNLqw6bgAN8O2UBqZHWiMF8mi7brvioDvAIufZuqa2SqT/At45H83
--psQ6R4FsxZt6SAK7EsdPo8OYTrY1i4iPZd/eKhnEu2srEZgsKRwY5H1mvDH5fWCc
--HSFu07sWmlmK6Or65Fsa0IaKLJiQDVVETd6xrI0wkM4AOcbKDrS7aywJ426dopbs
--+LFdt4N0cdII4gBgJAfLuuA2yrDXRq4P6cgpVMy0R+0dEYE8zzm8zf1a+Ud273LS
--9+LB+LJKwqbW8nOPBoiekimIKfJYoOA4+C/mAjsYl1sVjjEhXJAs9S9L2UvnUk1P
--sZi4UKHI6eAIEl7VM1sQ4GbdZ0px2dF2Ax7pGkhD+DLpYyYkCprharKZdmuUNLUd
--NhXxi/HSEiE+Uy+o8RIzmH7LuROl/ZgnfHjJEiBLt2qPvwrwYd4c3XuXWs4YsWfV
--JTt8Mx2ihgVcdGy9//shCSmgJwR1oWrhgC10AEL2fKeRnYUal1i+IxFPp7nb8uwx
--UADgR0cY4A3qR/JP489QFIcxBTVs65De+Bq3ecnujk6yeGpD9iptonq4Y8uNZMc1
--kOE7GiFGwR4EufT5SEMh+tUkjth2r+842vmZZuxrVQaohDiATmIJA07W51zKH+nQ
--uw4qVKnAhPaDLCLc7YMIH9JcmkeQX0nf8/S2O2WYDH8glVDi5hfW08tCmV647vRY
--nTIywUTO0lFpz7M+VyMNaJ6yXU6biBV5hLAI8C5ldr/SWI789W2+ebBaJ9gfK+PT
--trohFSK37GcoSH4V6qSLJHCBASEsiddqHIHMLJZRYD+B6J3tLhjVUM43u+MEGbFT
--d33ZDke/WzLTExWkaOv36e67gDBmgDuj9yroq3wGfwIDAQABMA0GCSqGSIb3DQEB
--BAUAA4IEAQCc9RBhRbuWlmRZPZkqIdi5/+enyjoMmOa6ryJPxFSP8D2jrlHgQsk1
--+GsJmPFT3rwWfoGAQu/aeSX4sp8OhKVJtqNA6MJrGYnZIMolgYa1wZPbkjJsdEfi
--UsZdIB0n2+KA0xwEdGPdkGCfNPBtOg557DkcyEvsIZ9ELp4Pp2XzWRhyFGasJZc4
--YwgD/3K2rpOPZoMkBKeKqV19j41OfLKGBVyuaqzitbu9+KT4RU1ibr2a+UuFCwdT
--oqyN7bfWXjcjXOMkxCsOmLfKmqQxs7TEOVrYPTdYjamDxLy/e5g5FgoCxGY8iil0
--+YFLZyH6eEx/Os9DlG/M3O1MeRD9U97CdsphbDVZIDyWw5xeX8qQHJe0KSprAgiG
--TLhTZHeyrKujQCQS1oFFmNy4gSqXt0j1/6/9T80j6HeyjiiYEaEQK9YLTAjRoA7W
--VN8wtHI5F3RlNOVQEJks/bjdlpLL3VhaWtfewGh/mXRGcow84cgcsejMexmhreHm
--JfTUl9+X1IFFxGq2/606A9ROQ7kN/s4rXu7/TiMODXI/kZijoWd2SCc7Z0YWoNo7
--IRKkmZtrsflJbObEuK2Jk59uqzSxyQOBId8qtbPo8qJJyHGV5GCp34g4x67BxJBo
--h1iyVMamBAS5Ip1ejghuROrB8Hit8NhAZApXju62btJeXLX+mQayXb/wC/IXNJJD
--83tXiLfZgs6GzLAq7+KW/64sZSvj87CPiNtxkvjchAvyr+fhbBXCrf4rlOjJE6SH
--Je2/Jon7uqijncARGLBeYUT0Aa6k1slpXuSKxDNt7EIkP21kDZ5/OJ0Y1u587KVB
--dEhuDgNf2/8ij7gAQBwBoZMe1DrwddrxgLLBlyHpAZetNYFZNT+Cs/OlpqI0Jm59
--kK9pX0BY4AGOd23XM3K/uLawdmf67kkftim7aVaqXFHPiWsJVtlzmidKvNSmbmZe
--dOmMXp6PBoqcdusFVUS7vjd3KAes5wUX/CaTyOOPRu0LMSnpwEnaL76IC9x4Jd6d
--7QqY/OFTjpPH8nP57LwouiT6MgSUCWGaOkPuBJ9w9sENSbbINpgJJ42iAe2kE+R7
--qEIvf/2ETCTseeQUqm2nWiSPLkNagEh6kojmEoKrGyrv3YjrSXSOY1a70tDVy43+
--ueQDQzNZm3Q7inpke2ZKvWyY0LQmLzP2te+tnNBcdLyKJx7emPRTuMUlEdK7cLbt
--V3Sy9IKtyAXqqd66fPFj4NhJygyncj8M6CSqhG5L0GhDbkA8UJ8yK/gfKm3h5xe2
--utULK5VMtAhQt6cVahO59A9t/OI17y45bmlIgdlEQISzVFe9ZbIUJW44zBfPx74k
--/w8pMRr8gEuRqpL2WdJiKGG6lhMHLVFo
-+MIIDIjCCAgqgAwIBAgIBBTANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ
-+MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
-+UUwgQUIwHhcNMTAwMjIwMDMwMDU0WhcNMzAwOTAzMDMwMDU0WjBDMQswCQYDVQQG
-+EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxDzANBgNV
-+BAMTBnNlcnZlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxdpElQZ3FiGv
-+oMQ86fgdLZX5Y5CMP4a6d3ZKUktrryn1HKrUPz5Cn21GuoaQsS3M28YzFaP0r1Mz
-+T6FW0ao7JhD3ZLX5vxuxR47MptYNqkp346NjnSrcZfR/kRc4LdbNTo1TUpduh/xk
-+YKahAKyWbORClHUXRm+Rtd0GR+0F49sCAwEAAaOBozCBoDAJBgNVHRMEAjAAMB0G
-+A1UdDgQWBBRuYD8pE2CZ7Qz3FbXbexz7b2AZ7TB0BgNVHSMEbTBrgBSx+353tUCN
-+aBF+2RHlw8baTaxRsKFIpEYwRDELMAkGA1UEBhMCU0UxEDAOBgNVBAgTB1VwcHNh
-+bGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCggkAvlitTB89
-+JZUwDQYJKoZIhvcNAQEFBQADggEBAGMuDwcUBs90kD03QvJIcGAhvDRSMfGHcNKy
-++/8TONzwXkPX7qfHH6yq0oxP+jxMc/a2wgyg6qLJ4nNhwy54QA8q02NQm7j5iUDt
-+mAiXwwckFzS1eIkKu4NM4lwuE9YhMK0wSLVwEv9Kb0Lw+J+xS72JK/Cd4kkrNWkY
-+H3ZAtHa9y90nL8DB4jM+bt9oVBmSirsTnM/WF1bavw1kcDpFt6pf4/WWrjTyFzcn
-+0EvoMErAAkLi0jDr68fX7NjfXENY4m+3WFQNxAFxLVmPRMehbAtBKPq3Y6do00/D
-+DxeesjJQ5guHPeI5R8DYCjv2r1BoD53vbjQNOgeU+KTXJIYy07Q=
- -----END CERTIFICATE-----
-diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server8k-key.pem mysql-5.1.50/mysql-test/std_data/server8k-key.pem
---- mysql-5.1.50.orig/mysql-test/std_data/server8k-key.pem     2010-08-03 13:55:08.000000000 -0400
-+++ mysql-5.1.50/mysql-test/std_data/server8k-key.pem  2010-08-27 23:43:10.165365998 -0400
-@@ -1,99 +1,15 @@
- -----BEGIN RSA PRIVATE KEY-----
--MIISKQIBAAKCBAEA6h3v1OWb9I9U/Z8diBu/xYGS8NCTD3ZESboHxVI2qSECPgxN
--NcG8Lh0ktQdgYcOe64MnDTZX0Bibm47hoDldrAlTSffFxQhylqBBoXxDF+LrhXIq
--Cz7K0PsK+bYusL9ezJ7PETDnCT7oy95q4GXbKsutbNsm9if4ZE41gs2KnoU2DA7k
--vMmkKojrMIL4+BqTXA20LLo0iSbgvUTvpSJw4u96BeyzMNnxK2wP5vvTtUo5hACb
--fU87YjaSKs+q2VXCzfyYGZk1L1xk5GUI0bP+jutf1dDzNttW2/q2Nf5rxx09Gh/G
--wmOnEk1O7cOZ8VQCsOHirIM39NuSARsY6Y3G5XM4k2W4nxyR/RtdG9bvs/33aGsZ
--5V5yp7WSs8s9HHwaCPSsUiLKckQ7uA0TTRgbeweMrrLKovG57jsbBBB8pQD4PRd3
--1qgxCdstWXHiWwRyI8vOLWENPXPFqA/rJwwqNdWTogy38aqVXxGYR8PIwjA2OaIw
--FjwGZcsPNLqw6bgAN8O2UBqZHWiMF8mi7brvioDvAIufZuqa2SqT/At45H83psQ6
--R4FsxZt6SAK7EsdPo8OYTrY1i4iPZd/eKhnEu2srEZgsKRwY5H1mvDH5fWCcHSFu
--07sWmlmK6Or65Fsa0IaKLJiQDVVETd6xrI0wkM4AOcbKDrS7aywJ426dopbs+LFd
--t4N0cdII4gBgJAfLuuA2yrDXRq4P6cgpVMy0R+0dEYE8zzm8zf1a+Ud273LS9+LB
--+LJKwqbW8nOPBoiekimIKfJYoOA4+C/mAjsYl1sVjjEhXJAs9S9L2UvnUk1PsZi4
--UKHI6eAIEl7VM1sQ4GbdZ0px2dF2Ax7pGkhD+DLpYyYkCprharKZdmuUNLUdNhXx
--i/HSEiE+Uy+o8RIzmH7LuROl/ZgnfHjJEiBLt2qPvwrwYd4c3XuXWs4YsWfVJTt8
--Mx2ihgVcdGy9//shCSmgJwR1oWrhgC10AEL2fKeRnYUal1i+IxFPp7nb8uwxUADg
--R0cY4A3qR/JP489QFIcxBTVs65De+Bq3ecnujk6yeGpD9iptonq4Y8uNZMc1kOE7
--GiFGwR4EufT5SEMh+tUkjth2r+842vmZZuxrVQaohDiATmIJA07W51zKH+nQuw4q
--VKnAhPaDLCLc7YMIH9JcmkeQX0nf8/S2O2WYDH8glVDi5hfW08tCmV647vRYnTIy
--wUTO0lFpz7M+VyMNaJ6yXU6biBV5hLAI8C5ldr/SWI789W2+ebBaJ9gfK+PTtroh
--FSK37GcoSH4V6qSLJHCBASEsiddqHIHMLJZRYD+B6J3tLhjVUM43u+MEGbFTd33Z
--Dke/WzLTExWkaOv36e67gDBmgDuj9yroq3wGfwIDAQABAoIEAQCSt6YoZqigz/50
--XvYT6Uf6T6S1lBDFXNmY1qOuDkLBJTWRiwYMDViQEaWCaZgGTKDYeT3M8uR/Phyu
--lRFi5vCEMufmcAeZ3hxptw7KU+R8ILJ207/zgit6YglTys9h5txTIack39+6FJmx
--wbZ64HpETJZnpMO6+fuZaMXyLjuT8mmXjvHcOgXOvjWeFkZOveDhjJkAesUXuqyX
--EI+ajoXuQiPXeKonkD2qd7NTjzfy4gw/ZF4NXs0ZVJeviqtIPo2xp33udOw2vRFh
--bMvlF4cNLAbIKYVyOG0ruOfd2I7Unsc/CvD1u5vlRVuUd8OO0JZLIZR7hlRX+A58
--8O1g2H/wJZAsF1BnLnFzDGYCX2WjCCK3Zn85FkKGRa0lTdYDduad/C/N3Y2/pHFE
--e7U/2D7IkEei59tD2HcsDBB3MJnckkn/hyiL9qWcxqWZ61vurE+XjU6tc6fnfhk9
--pJQ6yU3epPU7Vfsk0UGA7bbgKpsyzyH8Zl76YC2mN2ZVJjZekfhY+ibT9odEPdOl
--yLB5iXA6/WhKkDWaOqZGOH+7MblWgT9wHINlcn+nKzOr00JHl26ac6aMlXXi9vbe
--4jgJbFK1HYlFIndyX/BdqRTsFemDoDrVqrEYsaONoVYDd9c5qrqYOeh34DhOksQW
--hNwWBfmMlfzgOGtCYhMeK+AajqTtUbMYQA6qp47KJd/Oa5Dvi3ZCpvZh3Ll5iIau
--rqCtmojsWCqmpWSu7P+Wu4+O3XkUMPdQUuQ5rJFESEBB3yEJcxqk/RItTcKNElNC
--PASrPrMD9cli7S/pJ+frbhu1Gna1ArXzXQE9pMozPaBpjCig7+15R0lL3pmOKO6e
--WK3dgSwrnW6TQdLPlSD4lbRoiIdTHVBczztDeUqVvFiV3/cuaEi1nvaVdAYLqjuL
--ogK4HwE/FQ54S0ijAsP52n25usoH6OTU3bSd/7NTp0vZCy3yf10x7HUdsh2DvhRO
--3+TSK5t0yz0Nt7hNwcI6pLmWUIYcZgpFc/WsiiGscTfhy8rh3kRHI8ylGq53KNF+
--yCVmjqnBRWs91ArxmeF1ctX2t3w5p7gf65hJWqoX/2DiSi5FBsr6HLxa5sUi4wRZ
--136aCNt5Wu7w+AzPDbQW6qKUGSyfHJAw4JZasZcaZLise5IWb1ks0DtFbWWdT3ux
--8r2AM7IO1WopnekrYCnx/aBvBAv4NjWozVA517ztVttPERt3AGb4nm387nYt5R2U
--NO2GBWcDyT8JQLKmffE1AkWolCR1GsvcNLQfLCbnNppgsnsLE/viTG4mq1wjnd8O
--2Q8nH1SVTuyGFREMp/zsiAEaGfdd0hI2r1J7OdNPBBCtmhITsy9ZYHqm5vrGvy3s
--vi2GuB2RAoICAQD/oWUsg4eTJxHifTJLz/tVSTXnw7DhfbFVa1K1rUV63/MRQAFW
--pabN4T6Yfp3CpdRkljCA8KPJZj7euwhm4OEg1ulpOouA+cfWlE9RFE8wyOK5SYwM
--k+nk31P9MUC866pZg/ghzBGDub91OW1+ZGEtqnLI/n/LhiAIWt0hJvgZclTc1cAL
--xffHVlFwoSyNl/nc3ueZCC95nOLst2XcuxZLLbOFtZCmDYsp49q/Jn6EFjn4Ge2o
--qp38z6eZgDMP1F4lb9nDqXPHfUSt2jxKlmpfXS+IPKdba67+EjhbtmUYzaR4EoPI
--zh+o6SrVWT6Yve7KGiYv06fuRz1m/lLQO/Arbd9ntSjgn+ZEXGOkbhnHUX3DJ4ny
--/6XEGB9NLQjern4uNTn0AaV+uvhncapFMaIBnVfq0Cw8eog0136PBYRaVX7T44j5
--HwIyGXWtYGA/SzDEQoksD0Y/T61BEGnLZaKeavNd82WwFvcYHZtE0J4aQGjCEE7N
--+nijzCy+j5ETmme9KJvQHpEyXP3N4RBko1eWvyTwFZDdIXtoa6TTEI51lm+FXJ/b
--Y+BzMr6KRo29FB+7//1ptUoMvn5hzL0PwOv2ZSTQuoG5hLDEbxWXLNhd1VHcfznF
--3EZHwfD2F8aGQ3kz+fkMTNfK955KorDrmLgvmV9eZZ5yQxGZrs5H5YfKpwKCAgEA
--6nSUbzfSdVFUH89NM5FmEJgkD06vqCgHl2mpyF+VmDGcay4K06eA4QbRO5kns13+
--n6PcBl/YVW/rNE8iFi+WxfqUpAjdR1HlShvTuTRVqtFTfuN8XhbYU6VMjKyuE0kd
--LKe3KRdwubjVNhXRZLBknU+3Y/4hnIR7mcE3/M5Zv5hjb7XnwWg/SzxV9WojCKiu
--vQ7cXhH5/o7EuKcl1d6vueGhWsRylCG9RimwgViR2H7zD9kpkOc0nNym9cSpb0Gv
--Lui4cf/fVwIt2HfNEGBjbM/83e2MH6b8Xp1fFAy0aXCdRtOo4LVOzJVAxn5dERMX
--4JJ4d5cSFbssDN1bITOKzuytfBqRIQGNkOfizgQNWUiaFI0MhEN/icymjm1ybOIh
--Gc9tzqKI4wP2X9g+u3+Oof1QaBcZ4UbZEU9ITN87Pa6XVJmpNx7A81BafWoEPFeE
--ahoO4XDwlHZazDuSlOseEShxXcVwaIiqySy7OBEPBVuYdEd2Qw/z3JTx9Kw8MKnf
--hu+ar5tz5dPnJIsvLeYCcJDe/K6loiZuHTtPbWEy9p6It7qubQNPBvTSBN5eVDKc
--Q2bTQNCx8SAAA9C5gJiwWoQKsXJzbRFRY77P9JjuGpua3YJ2nYBHEJmF+fp1R33c
--uHIyMphPMkKC4GC3/43kkMr6tck8kZbXGSYsLsBr2GkCggIBAJvvrjILQianzKcm
--zAmnI6AQ+ssYesvyyrxaraeZvSqJdlLtgmOCxVANuQt5IW9djUSWwZvGL4Np1aw0
--15k6UNqhftzsE7FnrVneOsww4WXXBUcV8FKz4Bf3i9qFswILmGzmrfSf8YczRfGS
--SJKzVPxwX3jwlrBmbx/pnb7dcLbFIbNcyLvl1ZJJu4BDMVRmgssTRp/5eExtQZg4
--//A4SA8wH7TO3yAMXvn8vrGgH8kfbdlEp88d1SYk3g4rP/rGB3A63NIYikIEzmJn
--ICQ3wUfPJnGq3kRMWgEuyCZaCy2oNE3yrWVPJ8z3/2MJ/79ZDVNHxEeki2o1FuW+
--+nGAPq+fZIp03iy4HdVRro7dgugtc9QaSHJtNId8V4vSjviX5Oz3FxUb9AJst58S
--nVV8Q2FMxBa/SlzSOkhRtCg2q1gXkzhaMnIVUleRZFGQ2uWBToxKMjcoUifIyN1J
--z999bkfI4hBLq5pRSAXz+YVu5SMKa10GaawIwJLat+i+1zboF6QyI2o/Wz8nrsNq
--KX/ajFGu5C94WFgsVoWKNI90KBLe48Ssje9c68waBlV/WHMg1YLvU3yqVDOV+K5c
--IHB9tPMnG+AgBYZPxSzuvnLrrkj/GeKx0WI7TrvzOLRGKJo6irMEJ8IzFegASRUq
--TVZKYQDYRG7m+lKlSxU+pyMAh2c9AoICAE4kavCip1eIssQjYLTGSkFPo/0iGbOv
--G9CgXAE3snFWX67tWphupKrbjdMSWcQTmPD2OTg6q6zWL4twsIi6dcMooHAHsFC7
--//LyUV/SDJdxSyXohiQJ8zH1zwy35RDydnHSuF5OvLh53T44iWDI1dAEqLgAFI3J
--LjTxzEpLMGiGTuYFt+ejai0WQAQayvBw4ESM9m+4CB2K0hBFTXv5y5HlnNTW0uWC
--VUZUUMrbjUieDz8B/zOXi9aYSGFzmZFGUDAPSqJcSMEELemPDF7f8WNr8vi42tIV
--4tlaFD1nep4F9bWMiCXU6B2RxVQi+7vcJEIqL1KUnGd3ydfD00K+ng4Xnj7Vz/cz
--QE7CqrpFaXmPlCMzW6+dm51/AyhHXDLkL2od05hiXcNkJ7KMLWRqwExHVIxM3shR
--x7lYNl3ArUsCrNd6m4aOjnrKFk7kjeLavHxskPccoGKrC9o0JMfTkWLgmuBJFQ0S
--N/HzIbcvIFWF0Ms4ojb50yp6ziXhXfJOO/0KUQEki71XIhvw89mVZszDzD5lqzjf
--HCZMBU4MbmL6NdEevFIDH0zPPkx3HPNtJt3kIJbit9wI8VhUMe+ldGnGxpWb8tKw
--SfM3vrHkYr+lizk26XfXMFhdAuVtT7dzQKSNEyP/1a2Hs307Xzgiv8JulJ8QIkrX
--/nsYWPOAGLG5AoICABmdW9Ppkvuhb1AEcjTWb+XCyopoBc6vit/uQWD9uO+CeX7a
--cfzq+iH01CAjyVMc4E1JDc5Lpi106U+GRGcAAaPJB2Sp5NznoxaOVrb71blu4Q4x
--bNjtKM/P/DXpO+yJYoOPdKtaSDhtnfNDM7H/jztJ3XIrOltKA7CcRDohbBWIx8Q0
--0uEpvfFpZZBco3yVmjP0RLgIVYn/ZDj9wGhSvFWIJ5vv6GXmtDrcHGMLxcfv7t76
--UVcMW/Yy4mYJRCzGOrWagyVijJ6MTVNciqadWcH1KcbB3EGoMFYMn61or2qJABPM
--xz89IlhnROU1Re3X/QRx5t86cw6oa+FqrWMOhSs31I0dNWSuS/xDympG27YIYSDd
--mv5seT78GjFmMJC5pPOLoXsbTPB0HpsX2/UL/w/eRAfilTOef/Cf9VE5MP/C2YR7
--NBxUU7/+21D6WvdtBTcZbrXWGroAo8zPP+PwX0+c6WoAvqDJvCPndp8xZhSgEJN/
--0kScptezi8n3ZHI95EA9U5mAHxHz0IhDDVzWw/z1f1SBPxKVX3+By3zaa3lrD2ch
--cHq7nBkX72veEevnHUY8Z2rHE2G2jdmRfOtwm4sjL0VBV9fRRoxzJWRduKyeOtDL
--EhhBhUoTrT48UnfW9hxnbNLB9P/hh+UJu9HrS2uAwHoGE1+8gcyundupGDBn
-+MIICXgIBAAKBgQDF2kSVBncWIa+gxDzp+B0tlfljkIw/hrp3dkpSS2uvKfUcqtQ/
-+PkKfbUa6hpCxLczbxjMVo/SvUzNPoVbRqjsmEPdktfm/G7FHjsym1g2qSnfjo2Od
-+Ktxl9H+RFzgt1s1OjVNSl26H/GRgpqEArJZs5EKUdRdGb5G13QZH7QXj2wIDAQAB
-+AoGBAJLCjh7Q9eLnx+QDzH9s+Q/IcH4nSbERmh1lFEopAc6j29qQ6PGkmDy0DUPs
-+70VOCOh5A4mo3aZzm9sUfVb24/nRtmyTP/AtMuIVGCsUqzI28dJRGvRlY0aSQG/C
-+ILqMP69kiMNGBvuyEIiJhisOmMvDFEp7HrrXHJM9qcc217DpAkEA4nzJ9yyy2e4O
-+r6/D711hdfcU/F+ktXw+pL77kSSdTABUap92Uv2RL36UA4q5h8RNvq/GrzMNm6Ye
-+u2IMvBCiTQJBAN+iRbiMJCSitTg5YVMluVbT87co7jbTqk7LN1ujyIFEklm4xlHG
-+DLJNgEoDR7QJtAkL++FyogC4zsQsey5voscCQQCp54trTbDuI9QIoAaQrrDKWgz4
-+NpfNPeOQm2UFQT5vIWAyjGWrZGViB8bp0UvVOcJI5nxaOiZfOYOcdrWu75uRAkAn
-+67zMc9/j1lPJRJz2Dc7nDBD+ikTz7pcBV897AWLCiK4jbBOi91q+3YzgKXO8VNsZ
-+nlUJasA2psbqSBJ5OJ5zAkEA2UxoMju54hASjT54Z92IzraVw4Vo8CYwOcw5fr7z
-++m5xg1mmWdLBclmZ+WjARzDuTHIW6u/WCxNGg42AykWzfw==
- -----END RSA PRIVATE KEY-----
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql-install-test.patch b/mysql-wsrep-5.6/packaging/rpm-uln/mysql-install-test.patch
deleted file mode 100644 (file)
index 5980aea..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-Improve the documentation that will be installed in the mysql-test RPM.
-
-
-diff -Naur mysql-5.1.43.orig/mysql-test/README mysql-5.1.43/mysql-test/README
---- mysql-5.1.43.orig/mysql-test/README        2010-01-15 12:14:43.000000000 -0500
-+++ mysql-5.1.43/mysql-test/README     2010-02-13 21:18:06.000000000 -0500
-@@ -6,6 +6,16 @@
- actually have a co-existing MySQL installation. The tests will not
- conflict with it.
-+For use in Red Hat distributions, you should run the script as user mysql,
-+so the best bet is something like
-+      cd /usr/share/mysql-test
-+      sudo -u mysql ./mysql-test-run
-+This will use the installed mysql executables, but will run a private copy
-+of the server process (using data files within /usr/share/mysql-test),
-+so you need not start the mysqld service beforehand.
-+To clean up afterwards, remove the created "var" subdirectory, eg
-+      sudo -u mysql rm -rf /usr/share/mysql-test/var
-+
- All tests must pass. If one or more of them fail on your system, please
- read the following manual section for instructions on how to report the
- problem:
-@@ -25,7 +35,8 @@
- With no test cases named on the command line, mysql-test-run falls back
- to the normal "non-extern" behavior. The reason for this is that some
--tests cannot run with an external server.
-+tests cannot run with an external server (because they need to control the
-+options with which the server is started).
- You can create your own test cases. To create a test case, create a new
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql-strmov.patch b/mysql-wsrep-5.6/packaging/rpm-uln/mysql-strmov.patch
deleted file mode 100644 (file)
index a144d09..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-Remove overly optimistic definition of strmov() as stpcpy().
-
-mysql uses this macro with overlapping source and destination strings,
-which is verboten per spec, and fails on some Red Hat platforms.
-Deleting the definition is sufficient to make it fall back to a
-byte-at-a-time copy loop, which should consistently give the
-expected behavior.
-
-Note: the particular case that prompted this patch is reported and fixed
-at http://bugs.mysql.com/bug.php?id=48864.  However, my faith in upstream's
-ability to detect this type of error is low, and I also see little evidence
-of any real performance gain from optimizing these calls.  So I'm keeping
-this patch.
-
-
-diff -Naur mysql-5.1.37.orig/include/m_string.h mysql-5.1.37/include/m_string.h
---- mysql-5.1.37.orig/include/m_string.h       2009-07-13 19:08:50.000000000 -0400
-+++ mysql-5.1.37/include/m_string.h    2009-08-31 21:49:49.000000000 -0400
-@@ -81,13 +81,6 @@
- extern void *(*my_str_malloc)(size_t);
- extern void (*my_str_free)(void *);
--#if defined(HAVE_STPCPY)
--#define strmov(A,B) stpcpy((A),(B))
--#ifndef stpcpy
--extern char *stpcpy(char *, const char *);    /* For AIX with gcc 2.95.3 */
--#endif
--#endif
--
- /* Declared in int2str() */
- extern char NEAR _dig_vec_upper[];
- extern char NEAR _dig_vec_lower[];
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql.init b/mysql-wsrep-5.6/packaging/rpm-uln/mysql.init
deleted file mode 100644 (file)
index 310e8cf..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-#!/bin/sh
-#
-# mysqld       This shell script takes care of starting and stopping
-#              the MySQL subsystem (mysqld).
-#
-# chkconfig: - 64 36
-# description: MySQL database server.
-# processname: mysqld
-# config: /etc/my.cnf
-# pidfile: /var/run/mysqld/mysqld.pid
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-# Source networking configuration.
-. /etc/sysconfig/network
-
-
-exec="/usr/bin/mysqld_safe"
-prog="mysqld"
-
-# Set timeouts here so they can be overridden from /etc/sysconfig/mysqld
-STARTTIMEOUT=120
-STOPTIMEOUT=60
-
-[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
-lockfile=/var/lock/subsys/$prog
-
-
-# extract value of a MySQL option from config files
-# Usage: get_mysql_option SECTION VARNAME DEFAULT
-# result is returned in $result
-# We use my_print_defaults which prints all options from multiple files,
-# with the more specific ones later; hence take the last match.
-get_mysql_option(){
-       result=`/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1`
-       if [ -z "$result" ]; then
-           # not found, use default
-           result="$3"
-       fi
-}
-
-get_mysql_option mysqld datadir "/var/lib/mysql"
-datadir="$result"
-get_mysql_option mysqld socket "$datadir/mysql.sock"
-socketfile="$result"
-get_mysql_option mysqld_safe log-error "/var/log/mysqld.log"
-errlogfile="$result"
-get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"
-mypidfile="$result"
-
-
-start(){
-    [ -x $exec ] || exit 5
-    # check to see if it's already running
-    RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
-    if [ $? = 0 ]; then
-       # already running, do nothing
-       action $"Starting $prog: " /bin/true
-       ret=0
-    elif echo "$RESPONSE" | grep -q "Access denied for user"
-    then
-       # already running, do nothing
-       action $"Starting $prog: " /bin/true
-       ret=0
-    else
-       # prepare for start
-       touch "$errlogfile"
-       chown mysql:mysql "$errlogfile" 
-       chmod 0640 "$errlogfile"
-       [ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
-       if [ ! -d "$datadir/mysql" ] ; then
-           # First, make sure $datadir is there with correct permissions
-           if [ ! -e "$datadir" -a ! -h "$datadir" ]
-           then
-               mkdir -p "$datadir" || exit 1
-           fi
-           chown mysql:mysql "$datadir"
-           chmod 0755 "$datadir"
-           [ -x /sbin/restorecon ] && /sbin/restorecon "$datadir"
-           # Now create the database
-           action $"Initializing MySQL database: " /usr/bin/mysql_install_db --datadir="$datadir" --user=mysql
-           ret=$?
-           chown -R mysql:mysql "$datadir"
-           if [ $ret -ne 0 ] ; then
-               return $ret
-           fi
-       fi
-       chown mysql:mysql "$datadir"
-       chmod 0755 "$datadir"
-       # Pass all the options determined above, to ensure consistent behavior.
-       # In many cases mysqld_safe would arrive at the same conclusions anyway
-       # but we need to be sure.  (An exception is that we don't force the
-       # log-error setting, since this script doesn't really depend on that,
-       # and some users might prefer to configure logging to syslog.)
-       # Note: set --basedir to prevent probes that might trigger SELinux
-       # alarms, per bug #547485
-       $exec   --datadir="$datadir" --socket="$socketfile" \
-               --pid-file="$mypidfile" \
-               --basedir=/usr --user=mysql >/dev/null 2>&1 &
-       safe_pid=$!
-       # Spin for a maximum of N seconds waiting for the server to come up;
-       # exit the loop immediately if mysqld_safe process disappears.
-       # Rather than assuming we know a valid username, accept an "access
-       # denied" response as meaning the server is functioning.
-       ret=0
-       TIMEOUT="$STARTTIMEOUT"
-       while [ $TIMEOUT -gt 0 ]; do
-           RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` && break
-           echo "$RESPONSE" | grep -q "Access denied for user" && break
-           if ! /bin/kill -0 $safe_pid 2>/dev/null; then
-               echo "MySQL Daemon failed to start."
-               ret=1
-               break
-           fi
-           sleep 1
-           let TIMEOUT=${TIMEOUT}-1
-       done
-       if [ $TIMEOUT -eq 0 ]; then
-           echo "Timeout error occurred trying to start MySQL Daemon."
-           ret=1
-       fi
-       if [ $ret -eq 0 ]; then
-           action $"Starting $prog: " /bin/true
-           touch $lockfile
-       else
-           action $"Starting $prog: " /bin/false
-       fi
-    fi
-    return $ret
-}
-
-stop(){
-       if [ ! -f "$mypidfile" ]; then
-           # not running; per LSB standards this is "ok"
-           action $"Stopping $prog: " /bin/true
-           return 0
-       fi
-       MYSQLPID=`cat "$mypidfile"`
-       if [ -n "$MYSQLPID" ]; then
-           /bin/kill "$MYSQLPID" >/dev/null 2>&1
-           ret=$?
-           if [ $ret -eq 0 ]; then
-               TIMEOUT="$STOPTIMEOUT"
-               while [ $TIMEOUT -gt 0 ]; do
-                   /bin/kill -0 "$MYSQLPID" >/dev/null 2>&1 || break
-                   sleep 1
-                   let TIMEOUT=${TIMEOUT}-1
-               done
-               if [ $TIMEOUT -eq 0 ]; then
-                   echo "Timeout error occurred trying to stop MySQL Daemon."
-                   ret=1
-                   action $"Stopping $prog: " /bin/false
-               else
-                   rm -f $lockfile
-                   rm -f "$socketfile"
-                   action $"Stopping $prog: " /bin/true
-               fi
-           else
-               action $"Stopping $prog: " /bin/false
-           fi
-       else
-           # failed to read pidfile, probably insufficient permissions
-           action $"Stopping $prog: " /bin/false
-           ret=4
-       fi
-       return $ret
-}
-restart(){
-    stop
-    start
-}
-
-condrestart(){
-    [ -e $lockfile ] && restart || :
-}
-
-
-# See how we were called.
-case "$1" in
-  start)
-    start
-    ;;
-  stop)
-    stop
-    ;;
-  status)
-    status -p "$mypidfile" $prog
-    ;;
-  restart)
-    restart
-    ;;
-  condrestart|try-restart)
-    condrestart
-    ;;
-  reload)
-    exit 3
-    ;;
-  force-reload)
-    restart
-    ;;
-  *)
-    echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
-    exit 2
-esac
-
-exit $?
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/mysql.spec.sh b/mysql-wsrep-5.6/packaging/rpm-uln/mysql.spec.sh
deleted file mode 100644 (file)
index ce1d957..0000000
+++ /dev/null
@@ -1,2002 +0,0 @@
-#
-#   This file was modified by Oracle in 2011 and later.
-#   Details of the modifications are described in the "changelog" section.
-#
-#   Modifications copyright (c) 2011, 2012, 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; see the file COPYING. If not, write to the
-# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
-# MA  02110-1301  USA.
-
-##############################################################################
-# Some common macro definitions
-##############################################################################
-
-# NOTE: "vendor" is used in upgrade/downgrade check, so you can't
-# change these, has to be exactly as is.
-# %define mysql_old_vendor        MySQL AB               # Applies to traditional MySQL RPMs only.
-# %define mysql_vendor_2          Sun Microsystems, Inc.
-%define mysql_vendor            Oracle and/or its affiliates
-
-%define mysql_version   @VERSION@
-
-%define mysqldatadir    /var/lib/mysql
-
-%define release         1
-
-##############################################################################
-# Command line handling
-##############################################################################
-#
-# To set options:
-#
-#   $ rpmbuild --define="option <x>" ...
-#
-
-# ----------------------------------------------------------------------------
-# Commercial builds
-# ----------------------------------------------------------------------------
-%if %{undefined commercial}
-%define commercial 0
-%endif
-
-# ----------------------------------------------------------------------------
-# Source name
-# ----------------------------------------------------------------------------
-%if %{undefined src_base}
-%define src_base mysql
-%endif
-%define src_dir %{src_base}-%{mysql_version}
-
-# ----------------------------------------------------------------------------
-# Feature set (storage engines, options).  Default to community (everything)
-# ----------------------------------------------------------------------------
-%if %{undefined feature_set}
-%define feature_set community
-%endif
-
-# ----------------------------------------------------------------------------
-# Server comment strings
-# ----------------------------------------------------------------------------
-%if %{undefined compilation_comment_debug}
-%define compilation_comment_debug       MySQL Community Server - Debug (GPL)
-%endif
-%if %{undefined compilation_comment_release}
-%define compilation_comment_release     MySQL Community Server (GPL)
-%endif
-
-# ----------------------------------------------------------------------------
-# Product and server suffixes
-# ----------------------------------------------------------------------------
-%if %{undefined product_suffix}
-  %if %{defined short_product_tag}
-    %define product_suffix      -%{short_product_tag}
-  %else
-    %define product_suffix      %{nil}
-  %endif
-%endif
-
-%if %{undefined server_suffix}
-%define server_suffix   %{nil}
-%endif
-
-# ----------------------------------------------------------------------------
-# Distribution support
-# ----------------------------------------------------------------------------
-%if %{undefined distro_specific}
-%define distro_specific 0
-%endif
-%if %{distro_specific}
-    %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"
-        %define distro_description      Oracle Linux 6
-        %define distro_releasetag       el6
-        %define distro_buildreq         gcc-c++ ncurses-devel perl readline-devel time zlib-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" == "5"
-            %define distro_description    Red Hat Enterprise Linux 5
-            %define distro_releasetag     rhel5
-            %define distro_buildreq       gcc-c++ gperf ncurses-devel perl readline-devel time zlib-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 readline-devel time zlib-devel
-              %define distro_requires       chkconfig coreutils grep procps shadow-utils net-tools
-            %else
-              %{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
-            %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 readline-devel zlib-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 readline-devel zlib-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
-%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 readline-devel 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}
-
-# Hack to work around bug in RHEL5 __os_install_post macro, wrong inverted
-# test for __debug_package
-%define __strip         /bin/true
-
-# ----------------------------------------------------------------------------
-# Support optional "tcmalloc" library (experimental)
-# ----------------------------------------------------------------------------
-%if %{defined malloc_lib_target}
-%define WITH_TCMALLOC 1
-%else
-%define WITH_TCMALLOC 0
-%endif
-
-##############################################################################
-# Configuration based upon above user input, not to be set directly
-##############################################################################
-
-%if %{commercial}
-%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_type            GPL
-%endif
-
-##############################################################################
-# Main spec file section
-##############################################################################
-
-Name: mysql%{product_suffix}
-Summary: MySQL client programs and shared libraries
-Group: Applications/Databases
-Version: @MYSQL_RPM_VERSION@
-Release: %{release}%{?distro_releasetag:.%{distro_releasetag}}
-# exceptions allow client libraries to be linked with most open source SW,
-# not only GPL code.
-License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field.
-URL: http://www.mysql.com/
-Packager: MySQL Release Engineering <mysql-build@oss.oracle.com>
-Vendor:         %{mysql_vendor}
-
-# Regression tests may take a long time, override the default to skip them 
-%{!?runselftest:%global runselftest 1}
-
-# Upstream has a mirror redirector for downloads, so the URL is hard to
-# represent statically.  You can get the tarball by following a link from
-# http://dev.mysql.com/downloads/mysql/
-Source0: %{src_dir}.tar.gz
-# The upstream tarball includes non-free documentation that only the
-# copyright holder (MySQL -> Sun -> Oracle) may ship.
-# To remove the non-free documentation, run this script after downloading
-# the tarball into the current directory:
-# ./generate-tarball.sh $VERSION
-# Then, source name changes:
-#   Source0: mysql-%{version}-nodocs.tar.gz
-%if %{commercial}
-NoSource: 0
-%endif
-Source1: generate-tarball.sh
-Source2: mysql.init
-Source3: my.cnf
-Source4: scriptstub.c
-Source5: my_config.h
-# The below is only needed for packages built outside MySQL -> Sun -> Oracle:
-Source6: README.mysql-docs
-Source9: mysql-embedded-check.c
-# Working around perl dependency checking bug in rpm FTTB. Remove later.
-Source999: filter-requires-mysql.sh
-
-# Patch1: mysql-ssl-multilib.patch           Not needed by MySQL (yaSSL), will not work in 5.5 (cmake)
-# Patch2: mysql-5.5-errno.patch              Fixed in trunk
-Patch4: mysql-5.5-testing.patch
-Patch5: mysql-install-test.patch
-# Patch6: mysql-5.6-stack-guard.patch        Fixed in 5.6
-# Patch7: mysql-disable-test.patch           Already fixed in current 5.1
-# Patch8: mysql-setschedparam.patch          Will not work in 5.5 (cmake)
-# Patch9: mysql-no-docs.patch                Will not work in 5.5 (cmake)
-Patch10: mysql-strmov.patch
-       # Not used by MySQL
-# Patch12: mysql-cve-2008-7247.patch         Already fixed in 5.5
-Patch13: mysql-expired-certs.patch
-       # Will not be used by MySQL
-# Patch14: mysql-missing-string-code.patch   Undecided, will not work in 5.5 (cmake)
-# Patch15: mysql-lowercase-bug.patch         Fixed in MySQL 5.1.54 and 5.5.9
-Patch16: mysql-chain-certs.patch
-Patch17: mysql-5.5-libdir.patch
-Patch18: mysql-5.5-fix-tests.patch
-Patch19: mysql-5.5-mtr1.patch
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires:  %{distro_buildreq}
-BuildRequires: gawk
-# make test requires time and ps
-BuildRequires: procps
-# Socket and Time::HiRes are needed to run regression tests
-BuildRequires: perl(Socket), perl(Time::HiRes)
-
-Requires: %{distro_requires}
-Requires: fileutils
-Requires: mysql-libs%{product_suffix} = %{version}-%{release}
-Requires: bash
-
-# If %%{product_suffix} is non-empty, the auto-generated capability is insufficient:
-# We want all dependency handling to use the generic name only.
-# Similar in other sub-packages
-Provides: mysql
-
-# MySQL (with caps) is upstream's spelling of their own RPMs for mysql
-Obsoletes: MySQL
-# mysql-cluster used to be built from this SRPM, but no more
-Obsoletes: mysql-cluster < 5.1.44
-# We need cross-product "Obsoletes:" to allow cross-product upgrades:
-Obsoletes: mysql < %{version}-%{release} 
-Obsoletes: mysql-advanced < %{version}-%{release}
-
-# Working around perl dependency checking bug in rpm FTTB. Remove later.
-%global __perl_requires %{SOURCE999}
-
-%description -n mysql%{product_suffix}
-MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
-client/server implementation consisting of a server daemon (mysqld)
-and many different client programs and libraries. The base package
-contains the standard MySQL client programs and generic MySQL files.
-
-The MySQL software has Dual Licensing, which means you can use the MySQL
-software free of charge under the GNU General Public License
-(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
-licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
-the GPL. See the chapter "Licensing and Support" in the manual for
-further info.
-
-%package -n mysql-libs%{product_suffix}
-
-Summary: The shared libraries required for MySQL clients
-Group: Applications/Databases
-Requires: /sbin/ldconfig
-Obsoletes: mysql-libs < %{version}-%{release}  
-Obsoletes: mysql-libs-advanced < %{version}-%{release}
-Provides: mysql-libs
-
-%description -n mysql-libs%{product_suffix}
-The mysql-libs package provides the essential shared libraries for any 
-MySQL client program or interface. You will need to install this package
-to use any other MySQL package or any clients that need to connect to a
-MySQL server.
-
-%package -n mysql-server%{product_suffix}
-
-Summary: The MySQL server and related files
-Group: Applications/Databases
-Requires: mysql%{product_suffix} = %{version}-%{release}
-Requires: sh-utils
-Requires(pre): /usr/sbin/useradd
-Requires(post): chkconfig
-Requires(preun): chkconfig
-# This is for /sbin/service
-Requires(preun): initscripts
-Requires(postun): initscripts
-# mysqlhotcopy needs DBI/DBD support
-Requires: perl-DBI, perl-DBD-MySQL
-Obsoletes: MySQL-server
-Obsoletes: mysql-server < %{version}-%{release}
-Obsoletes: mysql-server-advanced < %{version}-%{release}
-Provides: mysql-server
-
-%description -n mysql-server%{product_suffix}
-MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
-client/server implementation consisting of a server daemon (mysqld)
-and many different client programs and libraries. This package contains
-the MySQL server and some accompanying files and directories.
-
-%package -n mysql-devel%{product_suffix}
-
-Summary: Files for development of MySQL applications
-Group: Applications/Databases
-Requires: mysql%{product_suffix} = %{version}-%{release}
-Requires: openssl-devel
-Obsoletes: MySQL-devel
-Obsoletes: mysql-devel < %{version}-%{release}
-Obsoletes: mysql-devel-advanced < %{version}-%{release}
-Provides: mysql-devel
-
-%description -n mysql-devel%{product_suffix}
-MySQL is a multi-user, multi-threaded SQL database server. This
-package contains the libraries and header files that are needed for
-developing MySQL client applications.
-
-%package -n mysql-embedded%{product_suffix}
-
-Summary: MySQL as an embeddable library
-Group: Applications/Databases
-Obsoletes: mysql-embedded < %{version}-%{release}
-Obsoletes: mysql-embedded-advanced < %{version}-%{release}
-Provides: mysql-embedded
-
-%description -n mysql-embedded%{product_suffix}
-MySQL is a multi-user, multi-threaded SQL database server. This
-package contains a version of the MySQL server that can be embedded
-into a client application instead of running as a separate process,
-as well as a command line client with such an embedded server.
-
-%package -n mysql-embedded-devel%{product_suffix}
-
-Summary: Development files for MySQL as an embeddable library
-Group: Applications/Databases
-Requires: mysql-embedded%{product_suffix} = %{version}-%{release}
-Requires: mysql-devel%{product_suffix} = %{version}-%{release}
-Obsoletes: mysql-embedded-devel < %{version}-%{release}
-Obsoletes: mysql-embedded-devel-advanced < %{version}-%{release}
-Provides: mysql-embedded-devel
-
-%description -n mysql-embedded-devel%{product_suffix}
-MySQL is a multi-user, multi-threaded SQL database server. This
-package contains files needed for developing and testing with
-the embedded version of the MySQL server.
-
-%package -n mysql-test%{product_suffix}
-
-Summary: The test suite distributed with MySQL
-Group: Applications/Databases
-Requires: mysql%{product_suffix} = %{version}-%{release}
-Requires: mysql-server%{product_suffix} = %{version}-%{release}
-Obsoletes: MySQL-test
-Obsoletes: mysql-test < %{version}-%{release}
-Obsoletes: mysql-test-advanced < %{version}-%{release}
-Provides: mysql-test
-
-%description -n mysql-test%{product_suffix}
-MySQL is a multi-user, multi-threaded SQL database server. This
-package contains the regression test suite distributed with
-the MySQL sources.
-
-%prep
-%setup -T -a 0 -c -n %{src_dir}
-
-cd %{src_dir} # read about "%setup -n"
-# %patch1 -p1
-# %patch2 -p1
-# %patch4 -p1  TODO / FIXME: if wanted, needs to be adapted to new mysql-test-run setup
-%patch5 -p1
-# %patch6 -p1
-# %patch8 -p1
-# %patch9 -p1
-# %patch10 -p1
-# %patch13 -p1
-# %patch14 -p1
-%patch16 -p1
-%patch17 -p1
-%patch18 -p1
-%patch19 -p1
-
-# workaround for upstream bug #56342
-rm -f mysql-test/t/ssl_8k_key-master.opt
-
-%build
-
-# Fail quickly and obviously if user tries to build as root
-%if %runselftest
-       if [ x"`id -u`" = x0 ]; then
-               echo "The MySQL regression tests may fail if run as root."
-               echo "If you really need to build the RPM as root, use"
-               echo "--define='runselftest 0' to skip the regression tests."
-               exit 1
-       fi
-%endif
-
-# Be strict about variables, bail at earliest opportunity, etc.
-set -eu
-
-# Optional package files
-touch optional-files-devel
-
-#
-# Set environment in order of preference, MYSQL_BUILD_* first, then variable
-# name, finally a default.  RPM_OPT_FLAGS is assumed to be a part of the
-# default RPM build environment.
-#
-# We set CXX=gcc by default to support so-called 'generic' binaries, where we
-# do not have a dependancy on libgcc/libstdc++.  This only works while we do
-# not require C++ features such as exceptions, and may need to be removed at
-# a later date.
-#
-
-# This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break
-# the compile in cmd-line-utils/readline - needs investigation, but for now
-# we simply unset it and use those specified directly in cmake.
-%if "%{_arch}" == "ia64"
-RPM_OPT_FLAGS=
-%endif
-
-# This goes in sync with Patch19. "rm" is faster than "patch" for this.
-rm -rf %{src_dir}/mysql-test/lib/v1
-
-export PATH=${MYSQL_BUILD_PATH:-$PATH}
-export CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
-export CXX=${MYSQL_BUILD_CXX:-${CXX:-g++}}
-export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
-# Following "%ifarch" developed by RedHat, MySQL/Oracle does not support/maintain Linux/Sparc:
-# gcc seems to have some bugs on sparc as of 4.4.1, back off optimization
-# submitted as bz #529298
-%ifarch sparc sparcv9 sparc64
-CFLAGS=`echo $CFLAGS| sed -e "s|-O2|-O1|g" `
-%endif
-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:-%{?_smp_mflags}}
-
-# Build debug mysqld and libmysqld.a
-mkdir debug
-(
-  cd debug
-  # Attempt to remove any optimisation flags from the debug build
-  CFLAGS=`echo " ${CFLAGS} " | \
-            sed -e 's/ -O[0-9]* / /' \
-                -e 's/ -unroll2 / /' \
-                -e 's/ -ip / /' \
-                -e 's/^ //' \
-                -e 's/ $//'`
-  CXXFLAGS=`echo " ${CXXFLAGS} " | \
-              sed -e 's/ -O[0-9]* / /' \
-                  -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 \
-           -DCMAKE_BUILD_TYPE=Debug \
-           -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-           -DFEATURE_SET="%{feature_set}" \
-           -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
-           -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
-  echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG
-  make ${MAKE_JFLAG} VERBOSE=1
-)
-# Build full release
-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 \
-           -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-           -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-           -DFEATURE_SET="%{feature_set}" \
-           -DCOMPILATION_COMMENT="%{compilation_comment_release}" \
-           -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
-  echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
-  make ${MAKE_JFLAG} VERBOSE=1
-)
-
-# TODO / FIXME: Do we need "scriptstub"?
-gcc $CFLAGS $LDFLAGS -o scriptstub "-DLIBDIR=\"%{_libdir}/mysql\"" %{SOURCE4}
-
-# TODO / FIXME: "libmysqld.so" should have been produced above
-# regular build will make libmysqld.a but not libmysqld.so :-(
-cd release
-mkdir libmysqld/work
-cd libmysqld/work
-# "libmysqld" provides the same ABI as "libmysqlclient", but it implements the server:
-# The shared object is identified by the full version,
-# for linkage selection the first two levels are sufficient so that upgrades are possible
-# (see "man ld", option "-soname").
-SO_FULL='%{mysql_version}'
-SO_USE=`echo $SO_FULL | sed -e 's/\([0-9]\.[0-9]\)\.[0-9]*/\1/'`
-# These two modules should pull everything else which is needed:
-ar -x ../libmysqld.a client.c.o signal_handler.cc.o
-gcc $CFLAGS $LDFLAGS -shared -Wl,-soname,libmysqld.so.$SO_USE -o libmysqld.so.$SO_FULL \
-       *.o ../libmysqld.a \
-       -lpthread -lcrypt -laio -lnsl -lssl -lcrypto -lz -lrt -lstdc++ -lm -lc
-# this is to check that we built a complete library
-cp %{SOURCE9} .
-PROGNAME=`basename %{SOURCE9} .c`
-ln -s libmysqld.so.$SO_FULL libmysqld.so.$SO_USE
-gcc -I../../include -I../../../%{src_dir}/include $CFLAGS -o $PROGNAME %{SOURCE9} libmysqld.so.$SO_USE
-LD_LIBRARY_PATH=. ldd $PROGNAME
-cd ../..
-cd ..
-
-# TODO / FIXME: autotools only?
-# make check
-
-# TODO / FIXME: Test suite is run elsewhere in release builds -
-#               do we need this for users who want to build from source?
-# Also, check whether MTR_BUILD_THREAD=auto would solve all issues
-%if %runselftest
-  # hack to let 32- and 64-bit tests run concurrently on same build machine
-  case `uname -m` in
-    ppc64 | s390x | x86_64 | sparc64 )
-      MTR_BUILD_THREAD=7
-      ;;
-    *)
-      MTR_BUILD_THREAD=11
-      ;;
-  esac
-  export MTR_BUILD_THREAD
-
-  # if you want to change which tests are run, look at mysql-5.5-testing.patch too.
-  (cd release && make test-bt-fast )
-%endif
-
-%install
-RBR=$RPM_BUILD_ROOT
-MBD=$RPM_BUILD_DIR/%{src_dir}
-[ -n "$RPM_BUILD_ROOT" -a  "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-
-# Ensure that needed directories exists
-# TODO / FIXME: needed ?  install -d $RBR%{mysqldatadir}/mysql
-# TODO / FIXME: needed ?  install -d $RBR%{_datadir}/mysql-test
-# TODO / FIXME: needed ?  install -d $RBR%{_datadir}/mysql/SELinux/RHEL4
-# TODO / FIXME: needed ?  install -d $RBR%{_includedir}
-# TODO / FIXME: needed ?  install -d $RBR%{_libdir}
-# TODO / FIXME: needed ?  install -d $RBR%{_mandir}
-# TODO / FIXME: needed ?  install -d $RBR%{_sbindir}
-
-# Install all binaries
-(
-  cd $MBD/release
-  make DESTDIR=$RBR install
-)
-
-# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921).  Do
-# this in a sub-shell to ensure we don't pollute the install environment
-# with compiler bits.
-(
-  PATH=${MYSQL_BUILD_PATH:-$PATH}
-  CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
-  CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
-  if "${CC}" -v 2>&1 | grep '^gcc.version' >/dev/null 2>&1; then
-    libgcc=`${CC} ${CFLAGS} --print-libgcc-file`
-    if [ -f ${libgcc} ]; then
-      mkdir -p $RBR%{_libdir}/mysql
-      install -m 644 ${libgcc} $RBR%{_libdir}/mysql/libmygcc.a
-      echo "%{_libdir}/mysql/libmygcc.a" >>optional-files-devel
-    fi
-  fi
-)
-
-# multilib header hacks
-# we only apply this to known Red Hat multilib arches, per bug #181335
-case `uname -i` in
-  i386 | x86_64 | ppc | ppc64 | s390 | s390x | sparc | sparc64 )
-    mv $RPM_BUILD_ROOT/usr/include/mysql/my_config.h $RPM_BUILD_ROOT/usr/include/mysql/my_config_`uname -i`.h
-    install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/include/mysql/
-    ;;
-  *)
-    ;;
-esac
-
-mkdir -p $RPM_BUILD_ROOT/var/log
-touch $RPM_BUILD_ROOT/var/log/mysqld.log
-
-# List the installed tree for RPM package maintenance purposes.
-find $RPM_BUILD_ROOT -print | sed "s|^$RPM_BUILD_ROOT||" | sort > ROOTFILES
-
-mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
-mkdir -p $RPM_BUILD_ROOT/var/run/mysqld
-install -m 0755 -d $RPM_BUILD_ROOT/var/lib/mysql
-install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysqld
-install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/etc/my.cnf
-# obsolete: mv $RPM_BUILD_ROOT/usr/sql-bench $RPM_BUILD_ROOT%{_datadir}/sql-bench   # 'sql-bench' is dropped
-# obsolete: mv $RPM_BUILD_ROOT/usr/mysql-test $RPM_BUILD_ROOT%{_datadir}/mysql-test  # 'mysql-test' is there already
-# 5.1.32 forgets to install the mysql-test README file
-# obsolete: install -m 0644 mysql-test/README $RPM_BUILD_ROOT%{_datadir}/mysql-test/README  # 'README' is there already
-
-mv ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug ${RPM_BUILD_ROOT}%{_libdir}/mysql/mysqlbug
-install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug
-mv ${RPM_BUILD_ROOT}%{_bindir}/mysql_config ${RPM_BUILD_ROOT}%{_libdir}/mysql/mysql_config
-install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysql_config
-
-rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.a
-SO_FULL='%{mysql_version}'
-SO_USE=`echo $SO_FULL | sed -e 's/\([0-9]\.[0-9]\)\.[0-9]*/\1/'`
-install -m 0755 release/libmysqld/work/libmysqld.so.$SO_FULL ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.$SO_FULL
-ln -s libmysqld.so.$SO_FULL ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.$SO_USE
-ln -s libmysqld.so.$SO_USE  ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so
-
-rm -f ${RPM_BUILD_ROOT}%{_bindir}/comp_err
-rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/comp_err.1*
-rm -f ${RPM_BUILD_ROOT}%{_bindir}/make_win_binary_distribution
-rm -f ${RPM_BUILD_ROOT}%{_bindir}/make_win_src_distribution
-rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/make_win_bin_dist.1*
-rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/make_win_src_distribution.1*
-rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqlclient*.la
-rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/*.a
-rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/plugin/*.la
-rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/plugin/*.a
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/binary-configure
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/make_binary_distribution
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/make_sharedlib_distribution
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mi_test_all*
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/ndb-config-2-node.ini
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysql.server
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysqld_multi.server
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/MySQL-shared-compat.spec
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/*.plist
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/preinstall
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/postinstall
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysql-*.spec
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysql-log-rotate
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/ChangeLog
-rm -fr ${RPM_BUILD_ROOT}%{_datadir}/mysql/solaris/
-rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-stress-test.pl.1*
-rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-test-run.pl.1*
-
-mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
-echo "%{_libdir}/mysql" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
-
-# The below *only* applies to builds not done by MySQL / Sun / Oracle:
-# copy additional docs into build tree so %%doc will find them
-# cp %{SOURCE6} README.mysql-docs
-
-%clean
-[ -n "$RPM_BUILD_ROOT" -a  "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-
-%pre -n mysql-server%{product_suffix}
-
-# Check if we can safely upgrade.  An upgrade is only safe if it's from one
-# of our RPMs in the same version family.
-
-# Handle both ways of spelling the capability.
-installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
-if [ $? -ne 0 -o -z "$installed" ]; then
-  installed=`rpm -q --whatprovides MySQL-server 2> /dev/null`
-fi
-if [ $? -eq 0 -a -n "$installed" ]; then
-  installed=`echo $installed | sed 's/\([^ ]*\) .*/\1/'` # Tests have shown duplicated package names
-  vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
-  version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
-  myvendor='%{mysql_vendor}'
-  myversion='%{mysql_version}'
-
-  old_family=`echo $version \
-    | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
-  new_family=`echo $myversion \
-    | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
-
-  [ -z "$vendor" ] && vendor='<unknown>'
-  [ -z "$old_family" ] && old_family="<unrecognized version $version>"
-  [ -z "$new_family" ] && new_family="<bad package specification: version $myversion>"
-
-  error_text=
-  if [ "$vendor" != "$myvendor" ]; then
-    error_text="$error_text
-The current MySQL server package is provided by a different
-vendor ($vendor) than $myvendor.
-Some files may be installed to different locations, including log
-files and the service startup script in %{_sysconfdir}/init.d/.
-"
-  fi
-
-  if [ "$old_family" != "$new_family" ]; then
-    error_text="$error_text
-Upgrading directly from MySQL $old_family to MySQL $new_family may not
-be safe in all cases.  A manual dump and restore using mysqldump is
-recommended.  It is important to review the MySQL manual's Upgrading
-section for version-specific incompatibilities.
-"
-  fi
-
-  if [ -n "$error_text" ]; then
-    cat <<HERE >&2
-
-******************************************************************
-A MySQL server package ($installed) is installed.
-$error_text
-A manual upgrade is required.
-
-- Ensure that you have a complete, working backup of your data and my.cnf
-  files
-- Shut down the MySQL server cleanly
-- Remove the existing MySQL packages.  Usually this command will
-  list the packages you should remove:
-  rpm -qa | grep -i '^mysql-'
-
-  You may choose to use 'rpm --nodeps -ev <package-name>' to remove
-  the package which contains the mysqlclient shared library.  The
-  library will be reinstalled by the MySQL-shared-compat package.
-- Install the new MySQL packages supplied by $myvendor
-- Ensure that the MySQL server is started
-- Run the 'mysql_upgrade' program
-
-This is a brief description of the upgrade process.  Important details
-can be found in the MySQL manual, in the Upgrading section.
-******************************************************************
-HERE
-    exit 1
-  fi
-fi
-
-/usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || :
-/usr/sbin/useradd -M -N -g mysql -o -r -d /var/lib/mysql -s /bin/bash \
-       -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
-
-%post -n mysql-libs%{product_suffix}
-/sbin/ldconfig
-
-%post -n mysql-server%{product_suffix}
-if [ $1 = 1 ]; then
-    /sbin/chkconfig --add mysqld
-fi
-/bin/chmod 0755 /var/lib/mysql
-/bin/touch /var/log/mysqld.log
-
-%preun -n mysql-server%{product_suffix}
-if [ $1 = 0 ]; then
-    /sbin/service mysqld stop >/dev/null 2>&1
-    /sbin/chkconfig --del mysqld
-fi
-
-%postun -n mysql-libs%{product_suffix}
-if [ $1 = 0 ] ; then
-    /sbin/ldconfig
-fi
-
-%postun -n mysql-server%{product_suffix}
-if [ $1 -ge 1 ]; then
-    /sbin/service mysqld condrestart >/dev/null 2>&1 || :
-fi
-
-
-%files -n mysql%{product_suffix}
-%defattr(-,root,root)
-%doc %{license_files_server}
-
-# The below file *only* applies to builds not done by MySQL / Sun / Oracle:
-# %doc README.mysql-docs
-
-%{_bindir}/msql2mysql
-%{_bindir}/mysql
-%{_bindir}/mysql_config
-%{_bindir}/mysql_find_rows
-%{_bindir}/mysql_waitpid
-%{_bindir}/mysqlaccess
-%{_bindir}/mysqlaccess.conf
-%{_bindir}/mysqladmin
-%{_bindir}/mysqlbinlog
-%{_bindir}/mysqlcheck
-%{_bindir}/mysqldump
-%{_bindir}/mysqlimport
-%{_bindir}/mysqlshow
-%{_bindir}/mysqlslap
-%{_bindir}/my_print_defaults
-%{_bindir}/mysql_config_editor
-
-%{_mandir}/man1/mysql.1*
-%{_mandir}/man1/mysql_config.1*
-%{_mandir}/man1/mysql_find_rows.1*
-%{_mandir}/man1/mysql_waitpid.1*
-%{_mandir}/man1/mysqlaccess.1*
-%{_mandir}/man1/mysqladmin.1*
-%{_mandir}/man1/mysqldump.1*
-%{_mandir}/man1/mysqlshow.1*
-%{_mandir}/man1/mysqlslap.1*
-%{_mandir}/man1/my_print_defaults.1*
-%{_mandir}/man1/mysql_config_editor.1*
-
-%{_libdir}/mysql/mysqlbug
-%{_libdir}/mysql/mysql_config
-
-%files -n mysql-libs%{product_suffix}
-%defattr(-,root,root)
-%doc %{license_files_server}
-# although the default my.cnf contains only server settings, we put it in the
-# libs package because it can be used for client settings too.
-%config(noreplace) /etc/my.cnf
-%dir %{_libdir}/mysql
-%{_libdir}/mysql/libmysqlclient*.so.*
-/etc/ld.so.conf.d/*
-
-%dir %{_datadir}/mysql
-%{_datadir}/mysql/english
-%lang(bg) %{_datadir}/mysql/bulgarian
-%lang(cs) %{_datadir}/mysql/czech
-%lang(da) %{_datadir}/mysql/danish
-%lang(nl) %{_datadir}/mysql/dutch
-%lang(et) %{_datadir}/mysql/estonian
-%lang(fr) %{_datadir}/mysql/french
-%lang(de) %{_datadir}/mysql/german
-%lang(el) %{_datadir}/mysql/greek
-%lang(hu) %{_datadir}/mysql/hungarian
-%lang(it) %{_datadir}/mysql/italian
-%lang(ja) %{_datadir}/mysql/japanese
-%lang(ko) %{_datadir}/mysql/korean
-%lang(no) %{_datadir}/mysql/norwegian
-%lang(no) %{_datadir}/mysql/norwegian-ny
-%lang(pl) %{_datadir}/mysql/polish
-%lang(pt) %{_datadir}/mysql/portuguese
-%lang(ro) %{_datadir}/mysql/romanian
-%lang(ru) %{_datadir}/mysql/russian
-%lang(sr) %{_datadir}/mysql/serbian
-%lang(sk) %{_datadir}/mysql/slovak
-%lang(es) %{_datadir}/mysql/spanish
-%lang(sv) %{_datadir}/mysql/swedish
-%lang(uk) %{_datadir}/mysql/ukrainian
-%{_datadir}/mysql/charsets
-
-%files -n mysql-server%{product_suffix} -f release/support-files/plugins.files
-%defattr(-,root,root)
-%doc release/support-files/*.cnf
-%doc %{_datadir}/info/mysql.info*
-%doc %{src_dir}/Docs/ChangeLog
-%doc %{src_dir}/Docs/INFO_SRC*
-%doc release/Docs/INFO_BIN*
-
-%{_bindir}/myisamchk
-%{_bindir}/myisam_ftdump
-%{_bindir}/myisamlog
-%{_bindir}/myisampack
-%{_bindir}/mysql_convert_table_format
-%{_bindir}/mysql_fix_extensions
-%{_bindir}/mysql_install_db
-%{_bindir}/mysql_plugin
-%{_bindir}/mysql_secure_installation
-%if %{commercial}
-%else
-%{_bindir}/mysql_setpermission
-%endif
-%{_bindir}/mysql_tzinfo_to_sql
-%{_bindir}/mysql_upgrade
-%{_bindir}/mysql_zap
-%{_bindir}/mysqlbug
-%{_bindir}/mysqldumpslow
-%{_bindir}/mysqld_multi
-%{_bindir}/mysqld_safe
-%{_bindir}/mysqlhotcopy
-%{_bindir}/mysqltest
-%{_bindir}/innochecksum
-%{_bindir}/perror
-%{_bindir}/replace
-%{_bindir}/resolve_stack_dump
-%{_bindir}/resolveip
-
-/usr/libexec/mysqld
-/usr/libexec/mysqld-debug
-%{_libdir}/mysql/plugin/daemon_example.ini
-
-%if %{WITH_TCMALLOC}
-%{_libdir}/mysql/%{malloc_lib_target}
-%endif
-
-# obsolete by "-f release/support-files/plugins.files" above
-# %{_libdir}/mysql/plugin
-
-%{_mandir}/man1/msql2mysql.1*
-%{_mandir}/man1/myisamchk.1*
-%{_mandir}/man1/myisamlog.1*
-%{_mandir}/man1/myisampack.1*
-%{_mandir}/man1/mysql_convert_table_format.1*
-%{_mandir}/man1/myisam_ftdump.1*
-%{_mandir}/man1/mysql.server.1*
-%{_mandir}/man1/mysql_fix_extensions.1*
-%{_mandir}/man1/mysql_install_db.1*
-%{_mandir}/man1/mysql_plugin.1*
-%{_mandir}/man1/mysql_secure_installation.1*
-%{_mandir}/man1/mysql_upgrade.1*
-%{_mandir}/man1/mysql_zap.1*
-%{_mandir}/man1/mysqlbug.1*
-%{_mandir}/man1/mysqldumpslow.1*
-%{_mandir}/man1/mysqlbinlog.1*
-%{_mandir}/man1/mysqlcheck.1*
-%{_mandir}/man1/mysqld_multi.1*
-%{_mandir}/man1/mysqld_safe.1*
-%{_mandir}/man1/mysqlhotcopy.1*
-%{_mandir}/man1/mysqlimport.1*
-%{_mandir}/man1/mysqlman.1*
-%if %{commercial}
-%else
-%{_mandir}/man1/mysql_setpermission.1*
-%endif
-%{_mandir}/man1/mysqltest.1*
-%{_mandir}/man1/innochecksum.1*
-%{_mandir}/man1/perror.1*
-%{_mandir}/man1/replace.1*
-%{_mandir}/man1/resolve_stack_dump.1*
-%{_mandir}/man1/resolveip.1*
-%{_mandir}/man1/mysql_tzinfo_to_sql.1*
-%{_mandir}/man8/mysqld.8*
-
-%{_datadir}/mysql/dictionary.txt
-%{_datadir}/mysql/errmsg-utf8.txt
-%{_datadir}/mysql/fill_help_tables.sql
-%{_datadir}/mysql/innodb_memcached_config.sql
-%{_datadir}/mysql/magic
-%{_datadir}/mysql/mysql_security_commands.sql
-%{_datadir}/mysql/mysql_system_tables.sql
-%{_datadir}/mysql/mysql_system_tables_data.sql
-%{_datadir}/mysql/mysql_test_data_timezone.sql
-%{_datadir}/mysql/my-default.cnf
-
-/etc/rc.d/init.d/mysqld
-%attr(0755,mysql,mysql) %dir /var/run/mysqld
-%attr(0755,mysql,mysql) %dir /var/lib/mysql
-%attr(0640,mysql,mysql) %config(noreplace) %verify(not md5 size mtime) /var/log/mysqld.log
-
-# TODO / FIXME: Do we need "libmygcc.a"? If yes, append "-f optional-files-devel"
-#               and fix the "rm -f" list in the "install" section.
-%files -n mysql-devel%{product_suffix}
-%defattr(-,root,root)
-/usr/include/mysql
-/usr/share/aclocal/mysql.m4
-%{_libdir}/mysql/libmysqlclient*.so
-
-%files -n mysql-embedded%{product_suffix}
-%defattr(-,root,root)
-%doc %{license_files_server}
-%{_libdir}/mysql/libmysqld.so.*
-%{_bindir}/mysql_embedded
-
-%files -n mysql-embedded-devel%{product_suffix}
-%defattr(-,root,root)
-%{_libdir}/mysql/libmysqld.so
-%{_bindir}/mysql_client_test_embedded
-%{_bindir}/mysqltest_embedded
-%{_mandir}/man1/mysql_client_test_embedded.1*
-%{_mandir}/man1/mysqltest_embedded.1*
-
-%files -n mysql-test%{product_suffix}
-%defattr(-,root,root)
-%{_bindir}/mysql_client_test
-%attr(-,mysql,mysql) %{_datadir}/mysql-test
-
-%{_mandir}/man1/mysql_client_test.1*
-
-%changelog
-* Mon Jul  8 2013 Tor Didriksen <tor.didriksen@oracle.com>
-- Fix Bug#35019 Use pthread_attr_getguardsize for better robustness
-  of stack thread sizes
-- Remove Patch6: mysql-5.6-stack-guard.patch
-
-* Mon Dec 10 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-- Replace old my-*.cnf config file examples with template my-default.cnf
-- Handle several files for packaging which are new in 5.6 (compared to 5.5).
-
-* Thu Dec  7 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-- Change the way in which "libmysqld.so" is created: Using all object modules
-  was wrong, gcc / ld can resolve the dependencies from "libmysqld.a".
-  Also, identify the ".so" version from the MySQL version, "0.0.1" was wrong.
-  Bug#15972480
-
-* Fri Nov  9 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-- The "stack-guard.patch" needs to be adapted for MySQL 5.6,
-  reflect that in a name change "5.5" -> "5.6".
-- Set CXX=g++ by default to add a dependency on libgcc/libstdc++.
-  Also, remove the use of the -fno-exceptions and -fno-rtti flags.
-
-* Tue Sep 18 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-- Restrict the vendor check to Oracle: There is no history here
-  which we have to allow for.
-
-* Thu Jul 26 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-- Add the vendor and release series checks from the traditional MySQL RPM
-  spec file, to protect against errors happening during upgrades.
-- Do some code alignment with the traditional MySQL RPM spec file,
-  to make synchronous maintenance (and possibly even integration?) easier.
-
-* Mon Feb 13 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-- Add "Provides:" lines for the generic names of the subpackages,
-  independent of "product_suffix".
-
-* Tue Feb  7 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-- Make "mysql_setpermission" and its man page appear in GPL builds only.
-
-* Thu Nov 24 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-- Add two patches (#18 + #19) regarding the test suite;
-  version 1 of "mysql-test-run.pl" had to go because the auto-detection
-  of Perl dependencies does not handle differences between run directory
-  and delivery location.
-
-* Thu Nov  3 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-- Adapt from MySQL 5.1 to 5.5, tested using 5.5.17:
-  - Done by the MySQL Build Team at Oracle:
-    set as packager, set copyright owner and related info;
-  - handle command line options, allowing different configurations, platforms, ...
-    - configurations will show up in the file name as "product_suffix",
-    - use "-n" for all subpackage specifications,
-    - license may be GPL or commercial, mention that in the description,
-      the license output and the included license files will vary,
-    - commercial is "nosource",
-    - improve "requires" listings for different platforms,
-    - explicitly use "product_suffix" in the "requires" entries;
-  - adapt to 5.5 changes in features and function:
-    - remove "mysql-bench" package (files are outdated, not maintained),
-    - no InnoDB plugin,
-    - the set of plugins will vary by configuration, to control the "server"
-      package contents use "-f release/support-files/plugins.files" in the
-      "files" section,
-    - remove "mysqlmanager", "mysql_fix_privilege_tables",
-    - add "mysql_embedded", "mysql-plugin", "mysqlaccess.conf", "magic",
-    - "errmsg.txt" is now in UTF8: "errmsg-utf8.txt",
-    - adapt patches to changed code where needed, rename these to include "5.5",
-    - stop using patches which are not applicable to 5.5;
-  - 5.5 uses a different way of building:
-    - autotools are replaced by cmake,
-    - both a "release" and a "debug" server are built in separate subtrees
-      ("out of source"!), this also affects path names in further handling,
-    - the debug server is added to the "server" subpackage,
-    - add "mysql-5.5-libdir.patch" to handle file placement at user site.
-
-* Mon Dec 20 2010 Tom Lane <tgl@redhat.com> 5.1.52-1.1
-- Update to MySQL 5.1.52, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-52.html
-  including numerous small security issues
-Resolves: #652553
-- Sync with current Fedora package; this includes:
-- Duplicate COPYING and EXCEPTIONS-CLIENT in -libs and -embedded subpackages,
-  to ensure they are available when any subset of mysql RPMs are installed,
-  per revised packaging guidelines
-- Allow init script's STARTTIMEOUT/STOPTIMEOUT to be overridden from sysconfig
-
-* Thu Jul 15 2010 Tom Lane <tgl@redhat.com> 5.1.47-4
-- Add backported patch for CVE-2010-2008 (upstream bug 53804)
-Resolves: #614215
-- Add BuildRequires perl(Time::HiRes) ... seems to no longer be installed
-  by just pulling in perl.
-
-* Mon Jun 28 2010 Tom Lane <tgl@redhat.com> 5.1.47-3
-- Add -p "$mypidfile" to initscript's status call to improve corner cases.
-  (Note: can't be fixed in Fedora until 595597 is fixed there.)
-Resolves: #596008
-
-* Mon Jun  7 2010 Tom Lane <tgl@redhat.com> 5.1.47-2
-- Add back "partition" storage engine
-Resolves: #598585
-- Fix broken "federated" storage engine plugin
-Resolves: #587170
-- Read all certificates in SSL certificate files, to support chained certs
-Resolves: #598656
-
-* Mon May 24 2010 Tom Lane <tgl@redhat.com> 5.1.47-1
-- Update to MySQL 5.1.47, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-47.html
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-46.html
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-45.html
-  including fixes for CVE-2010-1621, CVE-2010-1626,
-  CVE-2010-1848, CVE-2010-1849, CVE-2010-1850
-Resolves: #590598
-- Create mysql group explicitly in pre-server script, to ensure correct GID
-
-* Mon Mar  8 2010 Tom Lane <tgl@redhat.com> 5.1.44-2
-- Update to MySQL 5.1.44, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-44.html
-Resolves: #565554
-- Remove mysql.info, which is not freely redistributable
-Related: #560181
-- Revert broken upstream fix for their bug 45058
-Related: #566547
-- Bring init script into some modicum of compliance with Fedora/LSB standards
-Resolves: #557711
-Resolves: #562749
-
-* Mon Feb 15 2010 Tom Lane <tgl@redhat.com> 5.1.43-2
-- Update to MySQL 5.1.43, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-43.html
-Resolves: #565554
-- Remove mysql-cluster, which is no longer supported by upstream in this
-  source distribution.  If we want it we'll need a separate SRPM for it.
-Resolves: #565210
-
-* Fri Jan 29 2010 Tom Lane <tgl@redhat.com> 5.1.42-7
-- Add backported patch for CVE-2008-7247 (upstream bug 39277)
-Resolves: #549329
-- Use non-expired certificates for SSL testing (upstream bug 50702)
-
-* Tue Jan 26 2010 Tom Lane <tgl@redhat.com> 5.1.42-6
-- Emit explicit error message if user tries to build RPM as root
-Resolves: #558915
-
-* Wed Jan 20 2010 Tom Lane <tgl@redhat.com> 5.1.42-5
-- Correct Source0: tag and comment to reflect how to get the tarball
-
-* Fri Jan  8 2010 Tom Lane <tgl@redhat.com> 5.1.42-4
-- Sync with current Fedora build, including:
-- Update to MySQL 5.1.42, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-42.html
-- Disable symbolic links by default in /etc/my.cnf
-Resolves: #553653
-- Remove static libraries (.a files) from package, per packaging guidelines
-- Change %%define to %%global, per packaging guidelines
-- Disable building the innodb plugin; it tickles assorted gcc bugs and
-  doesn't seem entirely ready for prime time anyway.
-Resolves: #553632
-- Start mysqld_safe with --basedir=/usr, to avoid unwanted SELinux messages
-  (see 547485)
-- Stop waiting during "service mysqld start" if mysqld_safe exits
-Resolves: #544095
-
-* Mon Nov 23 2009 Tom Lane <tgl@redhat.com> 5.1.41-1
-- Update to MySQL 5.1.41, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-41.html
-  including fixes for CVE-2009-4019
-Resolves: #549327
-- Don't set old_passwords=1; we aren't being bug-compatible with 3.23 anymore
-Resolves: #540735
-
-* Tue Nov 10 2009 Tom Lane <tgl@redhat.com> 5.1.40-1
-- Update to MySQL 5.1.40, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-40.html
-- Do not force the --log-error setting in mysqld init script
-Resolves: #533736
-
-* Sat Oct 17 2009 Tom Lane <tgl@redhat.com> 5.1.39-4
-- Replace kluge fix for ndbd sparc crash with a real fix (mysql bug 48132)
-
-* Thu Oct 15 2009 Tom Lane <tgl@redhat.com> 5.1.39-3
-- Work around two different compiler bugs on sparc, one by backing off
-  optimization from -O2 to -O1, and the other with a klugy patch
-Related: #529298, #529299
-- Clean up bogosity in multilib stub header support: ia64 should not be
-  listed (it's not multilib), sparc and sparc64 should be
-
-* Wed Sep 23 2009 Tom Lane <tgl@redhat.com> 5.1.39-2
-- Work around upstream bug 46895 by disabling outfile_loaddata test
-
-* Tue Sep 22 2009 Tom Lane <tgl@redhat.com> 5.1.39-1
-- Update to MySQL 5.1.39, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-39.html
-
-* Mon Aug 31 2009 Tom Lane <tgl@redhat.com> 5.1.37-5
-- Work around unportable assumptions about stpcpy(); re-enable main.mysql test
-- Clean up some obsolete parameters to the configure script
-
-* Sat Aug 29 2009 Tom Lane <tgl@redhat.com> 5.1.37-4
-- Remove one misguided patch; turns out I was chasing a glibc bug
-- Temporarily disable "main.mysql" test; there's something broken there too,
-  but we need to get mysql built in rawhide for dependency reasons
-
-* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 5.1.37-3
-- rebuilt with new openssl
-
-* Fri Aug 14 2009 Tom Lane <tgl@redhat.com> 5.1.37-2
-- Add a couple of patches to improve the probability of the regression tests
-  completing in koji builds
-
-* Sun Aug  2 2009 Tom Lane <tgl@redhat.com> 5.1.37-1
-- Update to MySQL 5.1.37, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-37.html
-
-* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.36-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
-
-* Fri Jul 10 2009 Tom Lane <tgl@redhat.com> 5.1.36-1
-- Update to MySQL 5.1.36, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-36.html
-
-* Sat Jun  6 2009 Tom Lane <tgl@redhat.com> 5.1.35-1
-- Update to MySQL 5.1.35, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-35.html
-- Ensure that /var/lib/mysql is created with the right SELinux context
-Resolves: #502966
-
-* Fri May 15 2009 Tom Lane <tgl@redhat.com> 5.1.34-1
-- Update to MySQL 5.1.34, for various fixes described at
-  http://dev.mysql.com/doc/refman/5.1/en/news-5-1-34.html
-- Increase startup timeout per bug #472222
-
-* Wed Apr 15 2009 Tom Lane <tgl@redhat.com> 5.1.33-2
-- Increase stack size of ndbd threads for safety's sake.
-Related: #494631
-
-* Tue Apr  7 2009 Tom Lane <tgl@redhat.com> 5.1.33-1
-- Update to MySQL 5.1.33.
-- Disable use of pthread_setschedparam; doesn't work the way code expects.
-Related: #477624
-
-* Wed Mar  4 2009 Tom Lane <tgl@redhat.com> 5.1.32-1
-- Update to MySQL 5.1.32.
-
-* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.31-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
-
-* Fri Feb 13 2009 Tom Lane <tgl@redhat.com> 5.1.31-1
-- Update to MySQL 5.1.31.
-
-* Thu Jan 22 2009 Tom Lane <tgl@redhat.com> 5.1.30-2
-- hm, apparently --with-innodb and --with-ndbcluster are still needed
-  even though no longer documented ...
-
-* Thu Jan 22 2009 Tom Lane <tgl@redhat.com> 5.1.30-1
-- Update to MySQL 5.1.30.  Note that this includes an ABI break for
-  libmysqlclient (it's now got .so major version 16).
-- This also updates mysql for new openssl build
-
-* Wed Oct  1 2008 Tom Lane <tgl@redhat.com> 5.0.67-2
-- Build the "embedded server" library, and package it in a new sub-RPM
-  mysql-embedded, along with mysql-embedded-devel for devel support files.
-Resolves: #149829
-
-* Sat Aug 23 2008 Tom Lane <tgl@redhat.com> 5.0.67-1
-- Update to mysql version 5.0.67
-- Move mysql_config's man page to base package, again (apparently I synced
-  that change the wrong way while importing specfile changes for ndbcluster)
-
-* Sun Jul 27 2008 Tom Lane <tgl@redhat.com> 5.0.51a-2
-- Enable ndbcluster support
-Resolves: #163758
-- Suppress odd crash messages during package build, caused by trying to
-  build dbug manual (which we don't install anyway) with dbug disabled
-Resolves: #437053
-- Improve mysql.init to pass configured datadir to mysql_install_db,
-  and to force user=mysql for both mysql_install_db and mysqld_safe.
-Related: #450178
-
-* Mon Mar  3 2008 Tom Lane <tgl@redhat.com> 5.0.51a-1
-- Update to mysql version 5.0.51a
-
-* Mon Mar  3 2008 Tom Lane <tgl@redhat.com> 5.0.45-11
-- Fix mysql-stack-guard patch to work correctly on IA64
-- Fix mysql.init to wait correctly when socket is not in default place
-Related: #435494
-
-* Mon Mar 03 2008 Dennis Gilmore <dennis@ausil.us> 5.0.45-10
-- add sparc64 to 64 bit arches for test suite checking
-- add sparc, sparcv9 and sparc64 to multilib handling
-
-* Thu Feb 28 2008 Tom Lane <tgl@redhat.com> 5.0.45-9
-- Fix the stack overflow problem encountered in January.  It seems the real
-issue is that the buildfarm machines were moved to RHEL5, which uses 64K not
-4K pages on PPC, and because RHEL5 takes the guard area out of the requested
-thread stack size we no longer had enough headroom.
-Related: #435337
-
-* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 5.0.45-8
-- Autorebuild for GCC 4.3
-
-* Tue Jan  8 2008 Tom Lane <tgl@redhat.com> 5.0.45-7
-- Unbelievable ... upstream still thinks that it's a good idea to have a
-  regression test that is guaranteed to begin failing come January 1.
-- ... and it seems we need to raise STACK_MIN_SIZE again too.
-
-* Thu Dec 13 2007 Tom Lane <tgl@redhat.com> 5.0.45-6
-- Back-port upstream fixes for CVE-2007-5925, CVE-2007-5969, CVE-2007-6303.
-Related: #422211
-
-* Wed Dec  5 2007 Tom Lane <tgl@redhat.com> 5.0.45-5
-- Rebuild for new openssl
-
-* Sat Aug 25 2007 Tom Lane <tgl@redhat.com> 5.0.45-4
-- Seems we need explicit BuildRequires on gawk and procps now
-- Rebuild to fix Fedora toolchain issues
-
-* Sun Aug 12 2007 Tom Lane <tgl@redhat.com> 5.0.45-3
-- Recent perl changes in rawhide mean we need a more specific BuildRequires
-
-* Thu Aug  2 2007 Tom Lane <tgl@redhat.com> 5.0.45-2
-- Update License tag to match code.
-- Work around recent Fedora change that makes "open" a macro name.
-
-* Sun Jul 22 2007 Tom Lane <tgl@redhat.com> 5.0.45-1
-- Update to MySQL 5.0.45
-Resolves: #246535
-- Move mysql_config's man page to base package
-Resolves: #245770
-- move my_print_defaults to base RPM, for consistency with Stacks packaging
-- mysql user is no longer deleted at RPM uninstall
-Resolves: #241912
-
-* Thu Mar 29 2007 Tom Lane <tgl@redhat.com> 5.0.37-2
-- Use a less hacky method of getting default values in initscript
-Related: #233771, #194596
-- Improve packaging of mysql-libs per suggestions from Remi Collet
-Resolves: #233731
-- Update default /etc/my.cnf ([mysql.server] has been bogus for a long time)
-
-* Mon Mar 12 2007 Tom Lane <tgl@redhat.com> 5.0.37-1
-- Update to MySQL 5.0.37
-Resolves: #231838
-- Put client library into a separate mysql-libs RPM to reduce dependencies
-Resolves: #205630
-
-* Fri Feb  9 2007 Tom Lane <tgl@redhat.com> 5.0.33-1
-- Update to MySQL 5.0.33
-- Install band-aid fix for "view" regression test designed to fail after 2006
-- Don't chmod -R the entire database directory tree on every startup
-Related: #221085
-- Fix unsafe use of install-info
-Resolves: #223713
-- Cope with new automake in F7
-Resolves: #224171
-
-* Thu Nov  9 2006 Tom Lane <tgl@redhat.com> 5.0.27-1
-- Update to MySQL 5.0.27 (see CVE-2006-4031, CVE-2006-4226, CVE-2006-4227)
-Resolves: #202247, #202675, #203427, #203428, #203432, #203434, #208641
-- Fix init script to return status 1 on server start timeout
-Resolves: #203910
-- Move mysqldumpslow from base package to mysql-server
-Resolves: #193559
-- Adjust link options for BDB module
-Resolves: #199368
-
-* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 5.0.22-2.1
-- rebuild
-
-* Sat Jun 10 2006 Tom Lane <tgl@redhat.com> 5.0.22-2
-- Work around brew's tendency not to clean up failed builds completely,
-  by adding code in mysql-testing.patch to kill leftover mysql daemons.
-
-* Thu Jun  8 2006 Tom Lane <tgl@redhat.com> 5.0.22-1
-- Update to MySQL 5.0.22 (fixes CVE-2006-2753)
-- Install temporary workaround for gcc bug on s390x (bz #193912)
-
-* Tue May  2 2006 Tom Lane <tgl@redhat.com> 5.0.21-2
-- Fix bogus perl Requires for mysql-test
-
-* Mon May  1 2006 Tom Lane <tgl@redhat.com> 5.0.21-1
-- Update to MySQL 5.0.21
-
-* Mon Mar 27 2006 Tom Lane <tgl@redhat.com> 5.0.18-4
-- Modify multilib header hack to not break non-RH arches, per bug #181335
-- Remove logrotate script, per bug #180639.
-- Add a new mysql-test RPM to carry the regression test files;
-  hack up test scripts as needed to make them run in /usr/share/mysql-test.
-
-* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 5.0.18-2.1
-- bump again for double-long bug on ppc(64)
-
-* Thu Feb  9 2006 Tom Lane <tgl@redhat.com> 5.0.18-2
-- err-log option has been renamed to log-error, fix my.cnf and initscript
-
-* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 5.0.18-1.1
-- rebuilt for new gcc4.1 snapshot and glibc changes
-
-* Thu Jan  5 2006 Tom Lane <tgl@redhat.com> 5.0.18-1
-- Update to MySQL 5.0.18
-
-* Thu Dec 15 2005 Tom Lane <tgl@redhat.com> 5.0.16-4
-- fix my_config.h for ppc platforms
-
-* Thu Dec 15 2005 Tom Lane <tgl@redhat.com> 5.0.16-3
-- my_config.h needs to guard against 64-bit platforms that also define the
-  32-bit symbol
-
-* Wed Dec 14 2005 Tom Lane <tgl@redhat.com> 5.0.16-2
-- oops, looks like we want uname -i not uname -m
-
-* Mon Dec 12 2005 Tom Lane <tgl@redhat.com> 5.0.16-1
-- Update to MySQL 5.0.16
-- Add EXCEPTIONS-CLIENT license info to the shipped documentation
-- Make my_config.h architecture-independent for multilib installs;
-  put the original my_config.h into my_config_$ARCH.h
-- Add -fwrapv to CFLAGS so that gcc 4.1 doesn't break it
-
-* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
-- rebuilt
-
-* Mon Nov 14 2005 Tom Lane <tgl@redhat.com> 5.0.15-3
-- Make stop script wait for daemon process to disappear (bz#172426)
-
-* Wed Nov  9 2005 Tom Lane <tgl@redhat.com> 5.0.15-2
-- Rebuild due to openssl library update.
-
-* Thu Nov  3 2005 Tom Lane <tgl@redhat.com> 5.0.15-1
-- Update to MySQL 5.0.15 (scratch build for now)
-
-* Wed Oct  5 2005 Tom Lane <tgl@redhat.com> 4.1.14-1
-- Update to MySQL 4.1.14
-
-* Tue Aug 23 2005 Tom Lane <tgl@redhat.com> 4.1.12-3
-- Use politically correct patch name.
-
-* Tue Jul 12 2005 Tom Lane <tgl@redhat.com> 4.1.12-2
-- Fix buffer overflow newly exposed in isam code; it's the same issue
-  previously found in myisam, and not very exciting, but I'm tired of
-  seeing build warnings.
-
-* Mon Jul 11 2005 Tom Lane <tgl@redhat.com> 4.1.12-1
-- Update to MySQL 4.1.12 (includes a fix for bz#158688, bz#158689)
-- Extend mysql-test-ssl.patch to solve rpl_openssl test failure (bz#155850)
-- Update mysql-lock-ssl.patch to match the upstream committed version
-- Add --with-isam to re-enable the old ISAM table type, per bz#159262
-- Add dependency on openssl-devel per bz#159569
-- Remove manual.txt, as upstream decided not to ship it anymore;
-  it was redundant with the mysql.info file anyway.
-
-* Mon May  9 2005 Tom Lane <tgl@redhat.com> 4.1.11-4
-- Include proper locking for OpenSSL in the server, per bz#155850
-
-* Mon Apr 25 2005 Tom Lane <tgl@redhat.com> 4.1.11-3
-- Enable openssl tests during build, per bz#155850
-- Might as well turn on --disable-dependency-tracking
-
-* Fri Apr  8 2005 Tom Lane <tgl@redhat.com> 4.1.11-2
-- Avoid dependency on <asm/atomic.h>, cause it won't build anymore on ia64.
-  This is probably a cleaner solution for bz#143537, too.
-
-* Thu Apr  7 2005 Tom Lane <tgl@redhat.com> 4.1.11-1
-- Update to MySQL 4.1.11 to fix bz#152911 as well as other issues
-- Move perl-DBI, perl-DBD-MySQL dependencies to server package (bz#154123)
-- Override configure thread library test to suppress HAVE_LINUXTHREADS check
-- Fix BDB failure on s390x (bz#143537)
-- At last we can enable "make test" on all arches
-
-* Fri Mar 11 2005 Tom Lane <tgl@redhat.com> 4.1.10a-1
-- Update to MySQL 4.1.10a to fix security vulnerabilities (bz#150868,
-  for CAN-2005-0711, and bz#150871 for CAN-2005-0709, CAN-2005-0710).
-
-* Sun Mar  6 2005 Tom Lane <tgl@redhat.com> 4.1.10-3
-- Fix package Requires: interdependencies.
-
-* Sat Mar  5 2005 Tom Lane <tgl@redhat.com> 4.1.10-2
-- Need -fno-strict-aliasing in at least one place, probably more.
-- Work around some C spec violations in mysql.
-
-* Fri Feb 18 2005 Tom Lane <tgl@redhat.com> 4.1.10-1
-- Update to MySQL 4.1.10.
-
-* Sat Jan 15 2005 Tom Lane <tgl@redhat.com> 4.1.9-1
-- Update to MySQL 4.1.9.
-
-* Wed Jan 12 2005 Tom Lane <tgl@redhat.com> 4.1.7-10
-- Don't assume /etc/my.cnf will specify pid-file (bz#143724)
-
-* Wed Jan 12 2005 Tim Waugh <twaugh@redhat.com> 4.1.7-9
-- Rebuilt for new readline.
-
-* Tue Dec 21 2004 Tom Lane <tgl@redhat.com> 4.1.7-8
-- Run make test on all archs except s390x (which seems to have a bdb issue)
-
-* Mon Dec 13 2004 Tom Lane <tgl@redhat.com> 4.1.7-7
-- Suppress someone's silly idea that libtool overhead can be skipped
-
-* Sun Dec 12 2004 Tom Lane <tgl@redhat.com> 4.1.7-6
-- Fix init script to not need a valid username for startup check (bz#142328)
-- Fix init script to honor settings appearing in /etc/my.cnf (bz#76051)
-- Enable SSL (bz#142032)
-
-* Thu Dec  2 2004 Tom Lane <tgl@redhat.com> 4.1.7-5
-- Add a restorecon to keep the mysql.log file in the right context (bz#143887)
-
-* Tue Nov 23 2004 Tom Lane <tgl@redhat.com> 4.1.7-4
-- Turn off old_passwords in default /etc/my.cnf file, for better compatibility
-  with mysql 3.x clients (per suggestion from Joe Orton).
-
-* Fri Oct 29 2004 Tom Lane <tgl@redhat.com> 4.1.7-3
-- Handle ldconfig more cleanly (put a file in /etc/ld.so.conf.d/).
-
-* Thu Oct 28 2004 Tom Lane <tgl@redhat.com> 4.1.7-2
-- rebuild in devel branch
-
-* Wed Oct 27 2004 Tom Lane <tgl@redhat.com> 4.1.7-1
-- Update to MySQL 4.1.x.
-
-* Tue Oct 12 2004 Tom Lane <tgl@redhat.com> 3.23.58-13
-- fix security issues CAN-2004-0835, CAN-2004-0836, CAN-2004-0837
-  (bugs #135372, 135375, 135387)
-- fix privilege escalation on GRANT ALL ON `Foo\_Bar` (CAN-2004-0957)
-
-* Wed Oct 06 2004 Tom Lane <tgl@redhat.com> 3.23.58-12
-- fix multilib problem with mysqlbug and mysql_config
-- adjust chkconfig priority per bug #128852
-- remove bogus quoting per bug #129409 (MySQL 4.0 has done likewise)
-- add sleep to mysql.init restart(); may or may not fix bug #133993
-
-* Tue Oct 05 2004 Tom Lane <tgl@redhat.com> 3.23.58-11
-- fix low-priority security issues CAN-2004-0388, CAN-2004-0381, CAN-2004-0457
-  (bugs #119442, 125991, 130347, 130348)
-- fix bug with dropping databases under recent kernels (bug #124352)
-
-* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com> 3.23.58-10
-- rebuilt
-
-* Sat Apr 17 2004 Warren Togami <wtogami@redhat.com> 3.23.58-9
-- remove redundant INSTALL-SOURCE, manual.*
-- compress manual.txt.bz2
-- BR time
-
-* Tue Mar 16 2004 Tom Lane <tgl@redhat.com> 3.23.58-8
-- repair logfile attributes in %%files, per bug #102190
-- repair quoting problem in mysqlhotcopy, per bug #112693
-- repair missing flush in mysql_setpermission, per bug #113960
-- repair broken error message printf, per bug #115165
-- delete mysql user during uninstall, per bug #117017
-- rebuilt
-
-* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
-- rebuilt
-
-* Tue Feb 24 2004 Tom Lane <tgl@redhat.com>
-- fix chown syntax in mysql.init
-- rebuild
-
-* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
-- rebuilt
-
-* Tue Nov 18 2003 Kim Ho <kho@redhat.com> 3.23.58-5
-- update mysql.init to use anonymous user (UNKNOWN_MYSQL_USER) for
-  pinging mysql server (#108779)
-
-* Mon Oct 27 2003 Kim Ho <kho@redhat.com> 3.23.58-4
-- update mysql.init to wait (max 10 seconds) for mysql server to 
-  start (#58732)
-
-* Mon Oct 27 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.58-3
-- re-enable Berkeley DB support (#106832)
-- re-enable ia64 testing
-
-* Fri Sep 19 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.58-2
-- rebuilt
-
-* Mon Sep 15 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.58-1
-- upgrade to 3.23.58 for security fix
-
-* Tue Aug 26 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.57-2
-- rebuilt
-
-* Wed Jul 02 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.57-1
-- revert to prior version of MySQL due to license incompatibilities 
-  with packages that link against the client.  The MySQL folks are
-  looking into the issue.
-
-* Wed Jun 18 2003 Patrick Macdonald <patrickm@redhat.com> 4.0.13-4
-- restrict test on ia64 (temporary)
-
-* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> 4.0.13-3
-- rebuilt
-
-* Thu May 29 2003 Patrick Macdonald <patrickm@redhat.com> 4.0.13-2
-- fix filter-requires-mysql.sh with less restrictive for mysql-bench 
-
-* Wed May 28 2003 Patrick Macdonald <patrickm@redhat.com> 4.0.13-1
-- update for MySQL 4.0
-- back-level shared libraries available in mysqlclient10 package
-
-* Fri May 09 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.56-2
-- add sql-bench package (#90110) 
-
-* Wed Mar 19 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.56-1
-- upgrade to 3.23.56 for security fixes
-- remove patch for double-free (included in 3.23.56) 
-
-* Tue Feb 18 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.54a-11
-- enable thread safe client
-- add patch for double free fix
-
-* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
-- rebuilt
-
-* Mon Jan 13 2003 Karsten Hopp <karsten@redhat.de> 3.23.54a-9
-- disable checks on s390x
-
-* Sat Jan  4 2003 Jeff Johnson <jbj@redhat.com> 3.23.54a-8
-- use internal dep generator.
-
-* Wed Jan  1 2003 Bill Nottingham <notting@redhat.com> 3.23.54a-7
-- fix mysql_config on hammer
-
-* Sun Dec 22 2002 Tim Powers <timp@redhat.com> 3.23.54a-6
-- don't use rpms internal dep generator
-
-* Tue Dec 17 2002 Elliot Lee <sopwith@redhat.com> 3.23.54a-5
-- Push it into the build system
-
-* Mon Dec 16 2002 Joe Orton <jorton@redhat.com> 3.23.54a-4
-- upgrade to 3.23.54a for safe_mysqld fix
-
-* Thu Dec 12 2002 Joe Orton <jorton@redhat.com> 3.23.54-3
-- upgrade to 3.23.54 for latest security fixes
-
-* Tue Nov 19 2002 Jakub Jelinek <jakub@redhat.com> 3.23.52-5
-- Always include <errno.h> for errno
-- Remove unpackaged files
-
-* Tue Nov 12 2002 Florian La Roche <Florian.LaRoche@redhat.de>
-- do not prereq userdel, not used at all
-
-* Mon Sep  9 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.52-4
-- Use %%{_libdir}
-- Add patch for x86-64
-
-* Wed Sep  4 2002 Jakub Jelinek <jakub@redhat.com> 3.23.52-3
-- rebuilt with gcc-3.2-7
-
-* Thu Aug 29 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.52-2
-- Add --enable-local-infile to configure - a new option
-  which doesn't default to the old behaviour (#72885)
-
-* Fri Aug 23 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.52-1
-- 3.23.52. Fixes a minor security problem, various bugfixes.
-
-* Sat Aug 10 2002 Elliot Lee <sopwith@redhat.com> 3.23.51-5
-- rebuilt with gcc-3.2 (we hope)
-
-* Mon Jul 22 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.51-4
-- rebuild
-
-* Thu Jul 18 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.51-3
-- Fix #63543 and #63542 
-
-* Thu Jul 11 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.51-2
-- Turn off bdb on PPC(#68591)
-- Turn off the assembly optimizations, for safety. 
-
-* Wed Jun 26 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.51-1
-- Work around annoying auto* thinking this is a crosscompile
-- 3.23.51
-
-* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
-- automated rebuild
-
-* Mon Jun 10 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.50-2
-- Add dependency on perl-DBI and perl-DBD-MySQL (#66349)
-
-* Thu May 30 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.50-1
-- 3.23.50
-
-* Thu May 23 2002 Tim Powers <timp@redhat.com>
-- automated rebuild
-
-* Mon May 13 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.49-4
-- Rebuild
-- Don't set CXX to gcc, it doesn't work anymore
-- Exclude Alpha
-
-* Mon Apr  8 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.49-3
-- Add the various .cnf examples as doc files to mysql-server (#60349)
-- Don't include manual.ps, it's just 200 bytes with a URL inside (#60349)
-- Don't include random files in /usr/share/mysql (#60349)
-- langify (#60349)
-
-* Thu Feb 21 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.49-2
-- Rebuild
-
-* Sun Feb 17 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.49-1
-- 3.23.49
-
-* Thu Feb 14 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.48-2
-- work around perl dependency bug.
-
-* Mon Feb 11 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.48-1
-- 3.23.48
-
-* Thu Jan 17 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.47-4
-- Use kill, not mysqladmin, to flush logs and shut down. Thus, 
-  an admin password can be set with no problems.
-- Remove reload from init script
-
-* Wed Jan 16 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.47-3
-- remove db3-devel from buildrequires, 
-  MySQL has had its own bundled copy since the mid thirties
-
-* Sun Jan  6 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.47-1
-- 3.23.47
-- Don't build for alpha, toolchain immature.
-
-* Mon Dec  3 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.46-1
-- 3.23.46
-- use -fno-rtti and -fno-exceptions, and set CXX to increase stability. 
-  Recommended by mysql developers.
-
-* Sun Nov 25 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.45-1
-- 3.23.45
-
-* Wed Nov 14 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.44-2
-- centralize definition of datadir in the initscript (#55873)
-
-* Fri Nov  2 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.44-1
-- 3.23.44
-
-* Thu Oct  4 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.43-1
-- 3.23.43
-
-* Mon Sep 10 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.42-1
-- 3.23.42
-- reenable innodb
-
-* Tue Aug 14 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.41-1
-- 3.23.41 bugfix release
-- disable innodb, to avoid the broken updates
-- Use "mysqladmin flush_logs" instead of kill -HUP in logrotate 
-  script (#51711)
-
-* Sat Jul 21 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.40, bugfix release
-- Add zlib-devel to buildrequires:
-
-* Fri Jul 20 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- BuildRequires-tweaking
-
-* Thu Jun 28 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- Reenable test, but don't run them for s390, s390x or ia64
-- Make /etc/my.cnf config(noplace). Same for /etc/logrotate.d/mysqld
-
-* Thu Jun 14 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.29
-- enable innodb
-- enable assembly again
-- disable tests for now...
-
-* Tue May 15 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.38
-- Don't use BDB on Alpha - no fast mutexes
-
-* Tue Apr 24 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.37
-- Add _GNU_SOURCE to the compile flags
-
-* Wed Mar 28 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- Make it obsolete our 6.2 PowerTools packages
-- 3.23.36 bugfix release - fixes some security issues
-  which didn't apply to our standard configuration
-- Make "make test" part of the build process, except on IA64
-  (it fails there)
-
-* Tue Mar 20 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.35 bugfix release
-- Don't delete the mysql user on uninstall
-
-* Tue Mar 13 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.34a bugfix release
-
-* Wed Feb  7 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- added readline-devel to BuildRequires:
-
-* Tue Feb  6 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- small i18n-fixes to initscript (action needs $)
-
-* Tue Jan 30 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- make it shut down and rotate logs without using mysqladmin 
-  (from #24909)
-
-* Mon Jan 29 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- conflict with "MySQL"
-
-* Tue Jan 23 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- improve gettextizing
-
-* Mon Jan 22 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.32
-- fix logrotate script (#24589)
-
-* Wed Jan 17 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- gettextize
-- move the items in Requires(post): to Requires: in preparation
-  for an errata for 7.0 when 3.23.31 is released
-- 3.23.31
-
-* Tue Jan 16 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- add the log file to the rpm database, and make it 0640
-  (#24116)
-- as above in logrotate script
-- changes to the init sequence - put most of the data
-  in /etc/my.cnf instead of hardcoding in the init script
-- use /var/run/mysqld/mysqld.pid instead of 
-  /var/run/mysqld/pid
-- use standard safe_mysqld
-- shut down cleaner
-
-* Mon Jan 08 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.30
-- do an explicit chmod on /var/lib/mysql in post, to avoid 
-  any problems with broken permissons. There is a report
-  of rm not changing this on its own (#22989)
-
-* Mon Jan 01 2001 Trond Eivind Glomsrd <teg@redhat.com>
-- bzipped source
-- changed from 85 to 78 in startup, so it starts before
-  apache (which can use modules requiring mysql)
-
-* Wed Dec 27 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.29a
-
-* Tue Dec 19 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- add requirement for new libstdc++, build for errata
-
-* Mon Dec 18 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.29
-
-* Mon Nov 27 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.28 (gamma)
-- remove old patches, as they are now upstreamed
-
-* Thu Nov 14 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- Add a requirement for a new glibc (#20735)
-- build on IA64
-
-* Wed Nov  1 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- disable more assembly
-
-* Wed Nov  1 2000 Jakub Jelinek <jakub@redhat.com>
-- fix mysql on SPARC (#20124)
-
-* Tue Oct 31 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.27
-
-* Wed Oct 25 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- add patch for fixing bogus aliasing in mysql from Jakub,
-  which should fix #18905 and #18620
-
-* Mon Oct 23 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- check for negative niceness values, and negate it
-  if present (#17899)
-- redefine optflags on IA32 FTTB
-
-* Wed Oct 18 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.26, which among other fixes now uses mkstemp()
-  instead of tempnam().
-- revert changes made yesterday, the problem is now
-  isolated
-* Tue Oct 17 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- use the compat C++ compiler FTTB. Argh.
-- add requirement of ncurses4 (see above)
-
-* Sun Oct 01 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.25
-- fix shutdown problem (#17956)
-
-* Tue Sep 26 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- Don't try to include no-longer-existing PUBLIC file
-  as doc (#17532)
-
-* Thu Sep 12 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- rename config file to /etc/my.cnf, which is what
-  mysqld wants... doh. (#17432)
-- include a changed safe_mysqld, so the pid file option
-  works. 
-- make mysql dir world readable to they can access the 
-  mysql socket. (#17432)
-- 3.23.24
-
-* Wed Sep 06 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.23
-
-* Sun Aug 27 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- Add "|| :" to condrestart to avoid non-zero exit code
-
-* Thu Aug 24 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- it's mysql.com, not mysql.org and use correct path to 
-  source (#16830)
-
-* Wed Aug 16 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- source file from /etc/rc.d, not /etc/rd.d. Doh.
-
-* Sun Aug 13 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- don't run ldconfig -n, it doesn't update ld.so.cache
-  (#16034)
-- include some missing binaries
-- use safe_mysqld to start the server (request from
-  mysql developers)
-
-* Sat Aug 05 2000 Bill Nottingham <notting@redhat.com>
-- condrestart fixes
-
-* Mon Aug 01 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.22. Disable the old patches, they're now in.
-
-* Thu Jul 27 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- bugfixes in the initscript
-- move the .so link to the devel package
-
-* Wed Jul 19 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- rebuild due to glibc changes
-
-* Tue Jul 18 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- disable compiler patch
-- don't include info directory file
-
-* Mon Jul 17 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- move back to /etc/rc.d/init.d
-
-* Fri Jul 14 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- more cleanups in initscript
-
-* Thu Jul 13 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- add a patch to work around compiler bug 
-  (from monty@mysql.com) 
-
-* Wed Jul 12 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- don't build the SQL daemon statically (glibc problems)
-- fix the logrotate script - only flush log if mysql
-  is running
-- change the reloading procedure 
-- remove icon - glint is obsolete a long time ago
-
-* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
-- automatic rebuild
-
-* Mon Jul 10 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- try the new compiler again
-- build the SQL daemon statically
-- add compile time support for complex charsets
-- enable assembler
-- more cleanups in initscript
-
-* Sun Jul 09 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- use old C++ compiler
-- Exclusivearch x86
-
-* Sat Jul 08 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- move .so files to devel package
-- more cleanups
-- exclude sparc for now
-
-* Wed Jul 05 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- 3.23.21
-- remove file from /etc/sysconfig
-- Fix initscript a bit - initialization of databases doesn't
-  work yet
-- specify the correct licenses
-- include a /etc/my.conf (empty, FTTB)
-- add conditional restart to spec file
-
-* Tue Jul  2 2000 Jakub Jelinek <jakub@redhat.com>
-- Rebuild with new C++
-
-* Fri Jun 30 2000 Trond Eivind Glomsrd <teg@redhat.com>
-- update to 3.23.20
-- use %%configure, %%makeinstall, %%{_tmppath}, %%{_mandir},
-  %%{_infodir}, /etc/init.d
-- remove the bench package
-- change some of the descriptions a little bit
-- fix the init script
-- some compile fixes
-- specify mysql user
-- use mysql uid 27 (postgresql is 26)
-- don't build on ia64
-
-* Sat Feb 26 2000 Jos Vos <jos@xos.nl>
-- Version 3.22.32 release XOS.1 for LinuX/OS 1.8.0
-- Upgrade from version 3.22.27 to 3.22.32.
-- Do "make install" instead of "make install-strip", because "install -s"
-  now appears to fail on various scripts.  Afterwards, strip manually.
-- Reorganize subpackages, according to common Red Hat packages: the client
-  program and shared library become the base package and the server and
-  some accompanying files are now in a separate server package.  The
-  server package implicitly requires the base package (shared library),
-  but we have added a manual require tag anyway (because of the shared
-  config file, and more).
-- Rename the mysql-benchmark subpackage to mysql-bench.
-
-* Mon Jan 31 2000 Jos Vos <jos@xos.nl>
-- Version 3.22.27 release XOS.2 for LinuX/OS 1.7.1
-- Add post(un)install scripts for updating ld.so.conf (client subpackage).
-
-* Sun Nov 21 1999 Jos Vos <jos@xos.nl>
-- Version 3.22.27 release XOS.1 for LinuX/OS 1.7.0
-- Initial version.
-- Some ideas borrowed from Red Hat Powertools 6.1, although this spec
-  file is a full rewrite from scratch.
diff --git a/mysql-wsrep-5.6/packaging/rpm-uln/scriptstub.c b/mysql-wsrep-5.6/packaging/rpm-uln/scriptstub.c
deleted file mode 100644 (file)
index de942c1..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-/* Translate call of myself into call of same-named script in LIBDIR */
-/* The macro LIBDIR must be defined as a double-quoted string */
-
-int main (int argc, char **argv)
-{
-  char *basename;
-  char *fullname;
-  char **newargs;
-  int i;
-
-  basename = strrchr(argv[0], '/');
-  if (basename)
-    basename++;
-  else
-    basename = argv[0];
-  fullname = malloc(strlen(LIBDIR) + strlen(basename) + 2);
-  sprintf(fullname, "%s/%s", LIBDIR, basename);
-  newargs = malloc((argc+1) * sizeof(char *));
-  newargs[0] = fullname;
-  for (i = 1; i < argc; i++)
-    newargs[i] = argv[i];
-  newargs[argc] = NULL;
-
-  execvp(fullname, newargs);
-
-  return 1;
-}
index 1648d4e747adcca2d50b977ebf6754e783081d39..7f2b09df0338ed0f28cde2cdc0c332c002dba5b2 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 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
@@ -27,6 +27,9 @@ MYSQL_ADD_PLUGIN(qa_auth_server qa_auth_server.c
 
 MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c 
   MODULE_ONLY)
+  
+MYSQL_ADD_PLUGIN(mysql_no_login mysql_no_login.c 
+  MODULE_ONLY)
 
 CHECK_CXX_SOURCE_COMPILES(
 "#ifndef _GNU_SOURCE
diff --git a/mysql-wsrep-5.6/plugin/auth/mysql_no_login.c b/mysql-wsrep-5.6/plugin/auth/mysql_no_login.c
new file mode 100644 (file)
index 0000000..c7a5520
--- /dev/null
@@ -0,0 +1,64 @@
+/*  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 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 */
+
+/**
+  @file
+
+  mysql_no_login authentication plugin.
+
+  This plugin exists to support system user accounts, which
+  cannot be accessed externally.  This is useful for privileged
+  stored programs, views and events.  Such objects can be created
+  with DEFINER = [sys account] SQL SECURITY DEFINER.
+*/
+
+#include <my_global.h>
+#include <mysql/plugin_auth.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static int mysql_no_login(
+    MYSQL_PLUGIN_VIO *vio __attribute__((unused)),
+    MYSQL_SERVER_AUTH_INFO *info __attribute__((unused)))
+{
+  return CR_ERROR;
+}
+
+static struct st_mysql_auth mysql_no_login_handler=
+{
+  MYSQL_AUTHENTICATION_INTERFACE_VERSION,
+  0,
+  mysql_no_login
+};
+
+mysql_declare_plugin(mysql_no_login)
+{
+  MYSQL_AUTHENTICATION_PLUGIN,                  /* type constant    */
+  &mysql_no_login_handler,                      /* type descriptor  */
+  "mysql_no_login",                             /* Name             */
+  "Todd Farmer",                                /* Author           */
+  "No login authentication plugin",             /* Description      */
+  PLUGIN_LICENSE_GPL,                           /* License          */
+  NULL,                                         /* Init function    */
+  NULL,                                         /* Deinit function  */
+  0x0100,                                       /* Version (1.0)    */
+  NULL,                                         /* status variables */
+  NULL,                                         /* system variables */
+  NULL,                                         /* config options   */
+  0,                                            /* flags            */
+}
+mysql_declare_plugin_end;
diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/.gitignore b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/.gitignore
deleted file mode 100644 (file)
index 685f686..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-# Keep the entries sorted to reduce the risk for a merge conflict
-*.[ao]
-*.exe
-*.gcda
-*.gcno
-*.gcov
-*.l[ao]
-*.tcov
-*.pyc
-*~
-.deps
-/.libs/
-/INSTALL
-/aclocal.m4
-/autom4te.cache
-/breakdancer_testsuite.c
-/config.h
-/config.h.in
-/config.log
-/config.status
-/config/Doxyfile
-/config/Doxyfile-api
-/config/compile
-/config/config.guess
-/config/config.sub
-/config/depcomp
-/config/install-sh
-/config/ltmain.sh
-/config/missing
-/configure
-/doc/doxy
-/doc/doxy-api
-/doc/engine-interface.txt
-/doc/protocol-binary-range.txt
-/doc/protocol-binary.txt
-/engine_testapp
-/libtool
-/m4/version.m4
-/mcstat
-/memcached
-/memcached-*.tar.gz
-/memcached-debug
-/memcached-debug.profile
-/memcached.spec
-/memcached_dtrace.h
-/mkinstalldirs
-/sizes
-/stamp-h1
-/t/binary-sasl.t
-/testapp
-/timedrun
-/version.num
-Makefile
-Makefile.in
-TAGS
-cscope.out
-tags
index 11a1276b955ca84f412c03447d1327b759235883..e53980bba0a92c9ee19bd656e89058d7651efa8d 100644 (file)
@@ -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/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/config.h b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/config.h
new file mode 100644 (file)
index 0000000..a04bac4
--- /dev/null
@@ -0,0 +1,192 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Set to nonzero if you want to include DTRACE */
+/* #undef ENABLE_DTRACE */
+
+/* Set to nonzero if you want to include ISASL */
+/* #undef ENABLE_ISASL */
+
+/* Set to nonzero if you want to include SASL */
+/* #undef ENABLE_SASL */
+
+/* Set to nonzero if you want to enable a SASL pwdb */
+/* #undef ENABLE_SASL_PWDB */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define this if you have an implementation of drop_privileges() */
+/* #undef HAVE_DROP_PRIVILEGES */
+
+/* Define to 1 if you have the `getpagesizes' function. */
+/* #undef HAVE_GETPAGESIZES */
+
+/* Have ntohll */
+/* #undef HAVE_HTONLL */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <link.h> header file. */
+#define HAVE_LINK_H 1
+
+/* Define to 1 if you have the `memcntl' function. */
+/* #undef HAVE_MEMCNTL */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mlockall' function. */
+#define HAVE_MLOCKALL 1
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#define HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#define HAVE_NETINET_TCP_H 1
+
+/* Define to 1 if you have the <priv.h> header file. */
+/* #undef HAVE_PRIV_H */
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#define HAVE_PWD_H 1
+
+/* Set to nonzero if your SASL implementation supports SASL_CB_GETCONF */
+/* #undef HAVE_SASL_CB_GETCONF */
+
+/* Define to 1 if you have the <sasl/sasl.h> header file. */
+/* #undef HAVE_SASL_SASL_H */
+
+/* Define to 1 if you have the `setppriv' function. */
+/* #undef HAVE_SETPPRIV */
+
+/* Define to 1 if you have the `sigignore' function. */
+#define HAVE_SIGIGNORE 1
+
+/* Define to 1 if stdbool.h conforms to C99. */
+/* #undef HAVE_STDBOOL_H */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sysexits.h> header file. */
+#define HAVE_SYSEXITS_H 1
+
+/* Define to 1 if you have the <syslog.h> header file. */
+#define HAVE_SYSLOG_H 1
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#define HAVE_SYS_UN_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define this if you have umem.h */
+/* #undef HAVE_UMEM_H */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* Define to 1 if the system has the type `_Bool'. */
+#define HAVE__BOOL 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Machine need alignment */
+#define NEED_ALIGN 1
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "memcached"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "memcached@googlegroups.com"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "memcached"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "memcached 1.6.0_beta1"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "memcached"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.6.0_beta1"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "1.6.0_beta1"
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* #  undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* find sigignore on Linux */
+#define _GNU_SOURCE 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* define to int if socklen_t not available */
+/* #undef socklen_t */
+
+#include "config_static.h"
+#endif
index 6c740f23871dc6641fe8c625abdb8be4bac39bcf..4d2cf3833f237322eb0a5263b3588b99d9b26e33 100644 (file)
@@ -3,8 +3,11 @@
  *  memcached - memory caching daemon
  *
  *       http://www.danga.com/memcached/
- *
+ *  Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
  *  Copyright 2003 Danga Interactive, Inc.  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.
  *
  *  Use and distribution licensed under the BSD license.  See
  *  the LICENSE file for full text.
@@ -4247,6 +4250,13 @@ static void process_update_command(conn *c, token_t *tokens, const size_t ntoken
         return;
     }
 
+    /* Negative expire values not allowed */
+
+    if (exptime_int < 0) {
+        out_string(c, "CLIENT_ERROR Invalid expire time");
+        return;
+    }
+
     /* Ubuntu 8.04 breaks when I pass exptime to safe_strtol */
     exptime = exptime_int;
 
@@ -6423,6 +6433,15 @@ static void *new_independent_stats(void) {
     int ii;
     int nrecords = num_independent_stats();
     struct independent_stats *independent_stats = calloc(sizeof(independent_stats) + sizeof(struct thread_stats) * nrecords, 1);
+
+#ifdef INNODB_MEMCACHED
+    if (independent_stats == NULL) {
+       fprintf(stderr, "Unable to allocate memory for"
+                      "independent_stats...\n");
+       return (NULL);
+    }
+#endif
+
     if (settings.topkeys > 0)
         independent_stats->topkeys = topkeys_init(settings.topkeys);
     for (ii = 0; ii < nrecords; ii++)
@@ -7851,6 +7870,12 @@ int main (int argc, char **argv) {
 
     default_independent_stats = new_independent_stats();
 
+#ifdef INNODB_MEMCACHED
+    if (!default_independent_stats) {
+       exit(EXIT_FAILURE);
+    }
+#endif
+
 #ifndef __WIN32__
     /*
      * ignore SIGPIPE signals; we can use errno == EPIPE if we
index 82980d640a97318332b2ee671e6c62144167e833..d2f6e094aea90a5e7f736178cb15c7f9145dcfc6 100644 (file)
@@ -1,3 +1,5 @@
+/* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. */
+
 #ifndef UTIL_H
 #define UTIL_H
 /*
 #include <memcached/visibility.h>
 #include <memcached/types.h>
 
+/* Changed for INNODB_MEMCACHED */
+#if defined(htonll)
+#define HAVE_HTONLL 1
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/t/binary-sasl.t b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/t/binary-sasl.t
new file mode 100644 (file)
index 0000000..fa81328
--- /dev/null
@@ -0,0 +1,638 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Cwd;
+use FindBin qw($Bin);
+use lib "$Bin/lib";
+use MemcachedTest;
+
+my $supports_sasl = supports_sasl();
+my $saslpasswd2 = '';
+my $sasldb;
+my $expected_mechs = 'PLAIN';
+
+# If sasl, then use saslpasswd
+unless ($saslpasswd2 eq "isasl") {
+    $sasldb = '/tmp/test-memcached.sasldb';
+    $expected_mechs = "CRAM-MD5 $expected_mechs";
+}
+# if isasl, use plain text file
+else {
+    $sasldb = '/tmp/isasl.txt';
+    $ENV{'ISASL_PWFILE'} = $sasldb;
+}
+
+use Test::More;
+
+if (supports_sasl()) {
+    if ($saslpasswd2 eq '') {
+         plan skip_all => "The binary 'saslpasswd' is missing from your system";
+    }
+    else {
+       plan tests => 25;
+    }
+} else {
+    plan tests => 1;
+    eval {
+        my $server = new_memcached("-S");
+    };
+    ok($@, "Died with illegal -S args when SASL is not supported.");
+    exit 0;
+}
+
+eval {
+    my $server = new_memcached("-S -B auto");
+};
+ok($@, "SASL shouldn't be used with protocol auto negotiate");
+
+eval {
+    my $server = new_memcached("-S -B ascii");
+};
+ok($@, "SASL isn't implemented in the ascii protocol");
+
+eval {
+    my $server = new_memcached("-S -B binary -B ascii");
+};
+ok($@, "SASL isn't implemented in the ascii protocol");
+
+# Based almost 100% off testClient.py which is:
+# Copyright (c) 2007  Dustin Sallings <dustin@spy.net>
+
+# Command constants
+use constant CMD_GET        => 0x00;
+use constant CMD_SET        => 0x01;
+use constant CMD_ADD        => 0x02;
+use constant CMD_REPLACE    => 0x03;
+use constant CMD_DELETE     => 0x04;
+use constant CMD_INCR       => 0x05;
+use constant CMD_DECR       => 0x06;
+use constant CMD_QUIT       => 0x07;
+use constant CMD_FLUSH      => 0x08;
+use constant CMD_GETQ       => 0x09;
+use constant CMD_NOOP       => 0x0A;
+use constant CMD_VERSION    => 0x0B;
+use constant CMD_GETK       => 0x0C;
+use constant CMD_GETKQ      => 0x0D;
+use constant CMD_APPEND     => 0x0E;
+use constant CMD_PREPEND    => 0x0F;
+use constant CMD_STAT       => 0x10;
+use constant CMD_SETQ       => 0x11;
+use constant CMD_ADDQ       => 0x12;
+use constant CMD_REPLACEQ   => 0x13;
+use constant CMD_DELETEQ    => 0x14;
+use constant CMD_INCREMENTQ => 0x15;
+use constant CMD_DECREMENTQ => 0x16;
+use constant CMD_QUITQ      => 0x17;
+use constant CMD_FLUSHQ     => 0x18;
+use constant CMD_APPENDQ    => 0x19;
+use constant CMD_PREPENDQ   => 0x1A;
+
+use constant CMD_SASL_LIST_MECHS    => 0x20;
+use constant CMD_SASL_AUTH          => 0x21;
+use constant CMD_SASL_STEP          => 0x22;
+use constant ERR_AUTH_ERROR   => 0x20;
+
+
+# REQ and RES formats are divided even though they currently share
+# the same format, since they _could_ differ in the future.
+use constant REQ_PKT_FMT      => "CCnCCnNNNN";
+use constant RES_PKT_FMT      => "CCnCCnNNNN";
+use constant INCRDECR_PKT_FMT => "NNNNN";
+use constant MIN_RECV_BYTES   => length(pack(RES_PKT_FMT));
+use constant REQ_MAGIC        => 0x80;
+use constant RES_MAGIC        => 0x81;
+
+my $pwd=getcwd;
+$ENV{'SASL_CONF_PATH'} = "$pwd/t/sasl";
+
+my $server = new_memcached('-B binary -S ');
+
+my $mc = MC::Client->new;
+
+my $check = sub {
+    my ($key, $orig_val) = @_;
+    my ($status, $val, $cas) = $mc->get($key);
+
+    if ($val =~ /^\d+$/) {
+        cmp_ok($val,'==', $orig_val, "$val = $orig_val");
+    }
+    else {
+        cmp_ok($val, 'eq', $orig_val, "$val = $orig_val");
+    }
+};
+
+my $set = sub {
+    my ($key, $orig_value, $exp) = @_;
+    $exp = defined $exp ? $exp : 0;
+    my ($status, $rv)= $mc->set($key, $orig_value, $exp);
+    $check->($key, $orig_value);
+};
+
+my $empty = sub {
+    my $key = shift;
+    my ($status,$rv) =()= eval { $mc->get($key) };
+    #if ($status == ERR_AUTH_ERROR) {
+    #    ok($@->auth_error, "Not authorized to connect");
+    #}
+    #else {
+    #    ok($@->not_found, "We got a not found error when we expected one");
+    #}
+    if ($status) {
+        ok($@->not_found, "We got a not found error when we expected one");
+    }
+};
+
+my $delete = sub {
+    my ($key, $when) = @_;
+    $mc->delete($key, $when);
+    $empty->($key);
+};
+
+# BEGIN THE TEST
+ok($server, "started the server");
+
+my $v = $mc->version;
+ok(defined $v && length($v), "Proper version: $v");
+
+# list mechs
+my $mechs= $mc->list_mechs();
+Test::More::cmp_ok($mechs, 'eq', $expected_mechs, "list_mechs $mechs");
+
+# this should fail, not authenticated
+{
+    my ($status, $val)= $mc->set('x', "somevalue");
+    ok($status, "this fails to authenticate");
+    cmp_ok($status,'==',ERR_AUTH_ERROR, "error code matches");
+}
+$empty->('x');
+{
+    my $mc = MC::Client->new;
+    my ($status, $val) = $mc->delete('x');
+    ok($status, "this fails to authenticate");
+    cmp_ok($status,'==',ERR_AUTH_ERROR, "error code matches");
+}
+$empty->('x');
+{
+    my $mc = MC::Client->new;
+    my ($status, $val)= $mc->set('x', "somevalue");
+    ok($status, "this fails to authenticate");
+    cmp_ok($status,'==',ERR_AUTH_ERROR, "error code matches");
+}
+$empty->('x');
+{
+    my $mc = MC::Client->new;
+    my ($status, $val)=  $mc->flush('x');
+    ok($status, "this fails to authenticate");
+    cmp_ok($status,'==',ERR_AUTH_ERROR, "error code matches");
+}
+$empty->('x');
+
+unlink $sasldb;
+my ($testuser, $testpass) = ('testuser', 'testpass');
+unless ($saslpasswd2 eq "isasl") {
+    system("echo $testpass | $saslpasswd2 -a memcached -f $sasldb -c -p $testuser");
+}
+else {
+    my $isasl_fh;
+    open($isasl_fh, ">$sasldb") or die "unable to open $sasldb\n";
+    print $isasl_fh "$testuser $testpass";
+    close($isasl_fh);
+}
+
+$mc = MC::Client->new;
+
+# Attempt a bad auth mech.
+is ($mc->authenticate('testuser', 'testpass', "X" x 40), 0x4, "bad mech");
+
+# Attempt bad authentication.
+is ($mc->authenticate('testuser', 'wrongpassword'), 0x20, "bad auth");
+
+# Now try good authentication and make the tests work.
+is ($mc->authenticate('testuser', 'testpass'), 0, "authenticated");
+# these should work
+{
+    my ($status, $val)= $mc->set('x', "somevalue");
+    ok(! $status);
+}
+$check->('x','somevalue');
+
+{
+    my ($status, $val)= $mc->delete('x');
+    ok(! $status);
+}
+$empty->('x');
+
+{
+    my ($status, $val)= $mc->set('x', "somevalue");
+    ok(! $status);
+}
+$check->('x','somevalue');
+
+{
+    my ($status, $val)=  $mc->flush('x');
+    ok(! $status);
+}
+$empty->('x');
+
+# check the SASL stats, make sure they track things correctly
+# note: the enabled or not is presence checked in stats.t
+
+# while authenticated, get current counter
+#
+# My initial approach was going to be to get current counts, reauthenticate
+# and fail, followed by a reauth successfully so I'd know what happened.
+# Reauthentication is currently unsupported, so it doesn't work that way at the
+# moment.  Adding tests may break this.
+
+{
+    my %stats = $mc->stats('');
+    is ($stats{'auth_cmds'}, 2, "auth commands counted");
+    is ($stats{'auth_errors'}, 1, "auth errors correct");
+}
+
+
+# Along with the assertion added to the code to verify we're staying
+# within bounds when we do a stats detail dump (detail turned on at
+# the top).
+# my %stats = $mc->stats('detail dump');
+
+# ######################################################################
+# Test ends around here.
+# ######################################################################
+
+package MC::Client;
+
+use strict;
+use warnings;
+use fields qw(socket);
+use IO::Socket::INET;
+
+use constant ERR_AUTH_ERROR   => 0x20;
+
+sub new {
+    my $self = shift;
+    my ($s) = @_;
+    $s = $server unless defined $s;
+    my $sock = $s->sock;
+    $self = fields::new($self);
+    $self->{socket} = $sock;
+    return $self;
+}
+
+sub authenticate {
+    my ($self, $user, $pass, $mech)= @_;
+    $mech ||= 'PLAIN';
+    my $buf = sprintf("%c%s%c%s", 0, $user, 0, $pass);
+    my ($status, $rv, undef) = $self->_do_command(::CMD_SASL_AUTH, $mech, $buf, '');
+    return $status;
+}
+sub list_mechs {
+    my ($self)= @_;
+    my ($status, $rv, undef) = $self->_do_command(::CMD_SASL_LIST_MECHS, '', '', '');
+    return join(" ", sort(split(/\s+/, $rv)));
+}
+
+sub build_command {
+    my $self = shift;
+    die "Not enough args to send_command" unless @_ >= 4;
+    my ($cmd, $key, $val, $opaque, $extra_header, $cas) = @_;
+
+    $extra_header = '' unless defined $extra_header;
+    my $keylen    = length($key);
+    my $vallen    = length($val);
+    my $extralen  = length($extra_header);
+    my $datatype  = 0;  # field for future use
+    my $reserved  = 0;  # field for future use
+    my $totallen  = $keylen + $vallen + $extralen;
+    my $ident_hi  = 0;
+    my $ident_lo  = 0;
+
+    if ($cas) {
+        $ident_hi = int($cas / 2 ** 32);
+        $ident_lo = int($cas % 2 ** 32);
+    }
+
+    my $msg = pack(::REQ_PKT_FMT, ::REQ_MAGIC, $cmd, $keylen, $extralen,
+                   $datatype, $reserved, $totallen, $opaque, $ident_hi,
+                   $ident_lo);
+    my $full_msg = $msg . $extra_header . $key . $val;
+    return $full_msg;
+}
+
+sub send_command {
+    my $self = shift;
+    die "Not enough args to send_command" unless @_ >= 4;
+    my ($cmd, $key, $val, $opaque, $extra_header, $cas) = @_;
+
+    my $full_msg = $self->build_command($cmd, $key, $val, $opaque, $extra_header, $cas);
+
+    my $sent = $self->{socket}->send($full_msg);
+    die("Send failed:  $!") unless $sent;
+    if($sent != length($full_msg)) {
+        die("only sent $sent of " . length($full_msg) . " bytes");
+    }
+}
+
+sub flush_socket {
+    my $self = shift;
+    $self->{socket}->flush;
+}
+
+# Send a silent command and ensure it doesn't respond.
+sub send_silent {
+    my $self = shift;
+    die "Not enough args to send_silent" unless @_ >= 4;
+    my ($cmd, $key, $val, $opaque, $extra_header, $cas) = @_;
+
+    $self->send_command($cmd, $key, $val, $opaque, $extra_header, $cas);
+    $self->send_command(::CMD_NOOP, '', '', $opaque + 1);
+
+    my ($ropaque, $status, $data) = $self->_handle_single_response;
+    Test::More::is($ropaque, $opaque + 1);
+}
+
+sub silent_mutation {
+    my $self = shift;
+    my ($cmd, $key, $value) = @_;
+
+    $empty->($key);
+    my $extra = pack "NN", 82, 0;
+    $mc->send_silent($cmd, $key, $value, 7278552, $extra, 0);
+    $check->($key, $value);
+}
+
+sub _handle_single_response {
+    my $self = shift;
+    my $myopaque = shift;
+
+    $self->{socket}->recv(my $response, ::MIN_RECV_BYTES);
+
+    my ($magic, $cmd, $keylen, $extralen, $datatype, $status, $remaining,
+        $opaque, $ident_hi, $ident_lo) = unpack(::RES_PKT_FMT, $response);
+
+    return ($opaque, '', '', '', 0) if not defined $remaining;
+    return ($opaque, '', '', '', 0) if ($remaining == 0);
+
+    # fetch the value
+    my $rv="";
+    while($remaining - length($rv) > 0) {
+        $self->{socket}->recv(my $buf, $remaining - length($rv));
+        $rv .= $buf;
+    }
+    if(length($rv) != $remaining) {
+        my $found = length($rv);
+        die("Expected $remaining bytes, got $found");
+    }
+
+    my $cas = ($ident_hi * 2 ** 32) + $ident_lo;
+
+    #if ($status) {
+        #die MC::Error->new($status, $rv);
+    #}
+
+    return ($opaque, $status, $rv, $cas, $keylen);
+}
+
+sub _do_command {
+    my $self = shift;
+    die unless @_ >= 3;
+    my ($cmd, $key, $val, $extra_header, $cas) = @_;
+
+    $extra_header = '' unless defined $extra_header;
+    my $opaque = int(rand(2**32));
+    $self->send_command($cmd, $key, $val, $opaque, $extra_header, $cas);
+    my (undef, $status, $rv, $rcas) = $self->_handle_single_response($opaque);
+    return ($status, $rv, $rcas);
+}
+
+sub _incrdecr_header {
+    my $self = shift;
+    my ($amt, $init, $exp) = @_;
+
+    my $amt_hi = int($amt / 2 ** 32);
+    my $amt_lo = int($amt % 2 ** 32);
+
+    my $init_hi = int($init / 2 ** 32);
+    my $init_lo = int($init % 2 ** 32);
+
+    my $extra_header = pack(::INCRDECR_PKT_FMT, $amt_hi, $amt_lo, $init_hi,
+                            $init_lo, $exp);
+
+    return $extra_header;
+}
+
+sub _incrdecr {
+    my $self = shift;
+    my ($cmd, $key, $amt, $init, $exp) = @_;
+
+    my ($status, $data, undef) = $self->_do_command($cmd, $key, '',
+                                           $self->_incrdecr_header($amt, $init, $exp));
+
+    my $header = substr $data, 0, 8, '';
+    my ($resp_hi, $resp_lo) = unpack "NN", $header;
+    my $resp = ($resp_hi * 2 ** 32) + $resp_lo;
+
+    return $resp;
+}
+
+sub silent_incrdecr {
+    my $self = shift;
+    my ($cmd, $key, $amt, $init, $exp) = @_;
+    my $opaque = 8275753;
+
+    $mc->send_silent($cmd, $key, '', $opaque,
+                     $mc->_incrdecr_header($amt, $init, $exp));
+}
+
+sub stats {
+    my $self = shift;
+    my $key  = shift;
+    my $cas = 0;
+    my $opaque = int(rand(2**32));
+    $self->send_command(::CMD_STAT, $key, '', $opaque, '', $cas);
+
+    my %rv = ();
+    my $found_key = '';
+    my $found_val = '';
+    my $status= 0;
+    do {
+        my ($op, $status, $data, $cas, $keylen) = $self->_handle_single_response($opaque);
+        if ($keylen > 0) {
+            $found_key = substr($data, 0, $keylen);
+            $found_val = substr($data, $keylen);
+            $rv{$found_key} = $found_val;
+        } else {
+            $found_key = '';
+        }
+    } while($found_key ne '');
+    return %rv;
+}
+
+sub get {
+    my $self = shift;
+    my $key  = shift;
+    my ($status, $rv, $cas) = $self->_do_command(::CMD_GET, $key, '', '');
+
+    my $header = substr $rv, 0, 4, '';
+    my $flags  = unpack("N", $header);
+
+    return ($status, $rv);
+}
+
+sub get_multi {
+    my $self = shift;
+    my @keys = @_;
+
+    for (my $i = 0; $i < @keys; $i++) {
+        $self->send_command(::CMD_GETQ, $keys[$i], '', $i, '', 0);
+    }
+
+    my $terminal = @keys + 10;
+    $self->send_command(::CMD_NOOP, '', '', $terminal);
+
+    my %return;
+    my $status = 0;
+    while (1) {
+        my ($opaque, $status, $data) = $self->_handle_single_response;
+        last if $opaque == $terminal;
+
+        my $header = substr $data, 0, 4, '';
+        my $flags  = unpack("N", $header);
+
+        $return{$keys[$opaque]} = [$flags, $data];
+    }
+
+    return %return if wantarray;
+    return \%return;
+}
+
+sub version {
+    my $self = shift;
+    return $self->_do_command(::CMD_VERSION, '', '');
+}
+
+sub flush {
+    my $self = shift;
+    return $self->_do_command(::CMD_FLUSH, '', '');
+}
+
+sub add {
+    my $self = shift;
+    my ($key, $val, $flags, $expire) = @_;
+    my $extra_header = pack "NN", $flags, $expire;
+    my $cas = 0;
+    return $self->_do_command(::CMD_ADD, $key, $val, $extra_header, $cas);
+}
+
+sub set {
+    my $self = shift;
+    my $flags = 0;
+    my $cas = 0;
+    my ($key, $val, $expire) = @_;
+    $expire = defined $expire ? $expire : 0;
+    my $extra_header = pack "NN", $flags, $expire;
+    return $self->_do_command(::CMD_SET, $key, $val, $extra_header, $cas);
+}
+
+sub _append_prepend {
+    my $self = shift;
+    my ($cmd, $key, $val, $cas) = @_;
+    return $self->_do_command($cmd, $key, $val, '', $cas);
+}
+
+sub replace {
+    my $self = shift;
+    my ($key, $val, $flags, $expire) = @_;
+    my $extra_header = pack "NN", $flags, $expire;
+    my $cas = 0;
+    return $self->_do_command(::CMD_REPLACE, $key, $val, $extra_header, $cas);
+}
+
+sub delete {
+    my $self = shift;
+    my ($key) = @_;
+    return $self->_do_command(::CMD_DELETE, $key, '');
+}
+
+sub incr {
+    my $self = shift;
+    my ($key, $amt, $init, $exp) = @_;
+    $amt = 1 unless defined $amt;
+    $init = 0 unless defined $init;
+    $exp = 0 unless defined $exp;
+
+    return $self->_incrdecr(::CMD_INCR, $key, $amt, $init, $exp);
+}
+
+sub decr {
+    my $self = shift;
+    my ($key, $amt, $init, $exp) = @_;
+    $amt = 1 unless defined $amt;
+    $init = 0 unless defined $init;
+    $exp = 0 unless defined $exp;
+
+    return $self->_incrdecr(::CMD_DECR, $key, $amt, $init, $exp);
+}
+
+sub noop {
+    my $self = shift;
+    return $self->_do_command(::CMD_NOOP, '', '');
+}
+
+package MC::Error;
+
+use strict;
+use warnings;
+
+use constant ERR_UNKNOWN_CMD  => 0x81;
+use constant ERR_NOT_FOUND    => 0x1;
+use constant ERR_EXISTS       => 0x2;
+use constant ERR_TOO_BIG      => 0x3;
+use constant ERR_EINVAL       => 0x4;
+use constant ERR_NOT_STORED   => 0x5;
+use constant ERR_DELTA_BADVAL => 0x6;
+use constant ERR_AUTH_ERROR   => 0x20;
+
+use overload '""' => sub {
+    my $self = shift;
+    return "Memcache Error ($self->[0]): $self->[1]";
+};
+
+sub new {
+    my $class = shift;
+    my $error = [@_];
+    my $self = bless $error, (ref $class || $class);
+
+    return $self;
+}
+
+sub not_found {
+    my $self = shift;
+    return $self->[0] == ERR_NOT_FOUND;
+}
+
+sub exists {
+    my $self = shift;
+    return $self->[0] == ERR_EXISTS;
+}
+
+sub too_big {
+    my $self = shift;
+    return $self->[0] == ERR_TOO_BIG;
+}
+
+sub delta_badval {
+    my $self = shift;
+    return $self->[0] == ERR_DELTA_BADVAL;
+}
+
+sub auth_error {
+    my $self = shift;
+    return $self->[0] == ERR_AUTH_ERROR;
+}
+
+unlink $sasldb;
+
+# vim: filetype=perl
+
index f5bf4e23e80a71344b8b2ea855de48fe260f2877..d8232a0aaf61dd62f41640f1a055ab2c65ff20f7 100644 (file)
@@ -1,3 +1,5 @@
+/*  Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */
+
 #include "config.h"
 #include <stdio.h>
 #include <assert.h>
@@ -9,6 +11,8 @@
 
 #include "memcached/util.h"
 
+
+#define INT_MAX32 0x7fffffff
 /* Avoid warnings on solaris, where isspace() is an index into an array, and gcc uses signed chars */
 #define xisspace(c) isspace((unsigned char)c)
 
@@ -79,6 +83,7 @@ bool safe_strtoul(const char *str, uint32_t *out) {
     return false;
 }
 
+/*Function converts string into int */
 bool safe_strtol(const char *str, int32_t *out) {
     assert(out != NULL);
     errno = 0;
@@ -87,6 +92,10 @@ bool safe_strtol(const char *str, int32_t *out) {
     long l = strtol(str, &endptr, 10);
     if (errno == ERANGE)
         return false;
+
+    if (l > INT_MAX32)
+        return false;
+
     if (xisspace(*endptr) || (*endptr == '\0' && endptr != str)) {
         *out = l;
         return true;
diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/.gitignore b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/.gitignore
deleted file mode 100644 (file)
index 12dc37f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-*.build
-xcode/ndbmemcache.xcodeproj/jdd.perspectivev3
-xcode/ndbmemcache.xcodeproj/jdd.mode1v3
-xcode/ndbmemcache.xcodeproj/*.mode1v3
-xcode/ndbmemcache.xcodeproj/*.pbxuser
-.DS_Store
-Makefile.in
-junkbin
-aclocal.m4
-compile
-configure
-depcomp
-install-sh
-ltmain.sh
-missing
-autom4te.cache/
-config.guess
-config.h.in
-config.sub
-Makefile
-config.h
-config.log
-config.status
-libtool
-src/.deps/
-src/Makefile
-stamp-h1
-unit/.deps/
-unit/test_workqueue
-unit/Makefile
-unit/casbits_test
-unit/ndbapi_interp_test
-unit/test_interp
-.libs
-.deps
-*.la
-*.lo
-
index d9986c135db317927881e0e509d84aff7f843c40..4ce0a057031930a4d627466fc8ca58a4dc194cad 100644 (file)
@@ -1,3 +1,8 @@
+/*****************************************************************************
+This file was modified by Oracle on 2015/02/05
+Modifications copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+*****************************************************************************/
+
 #include "config.h"
 
 #include <stdlib.h>
@@ -270,7 +275,8 @@ static ENGINE_ERROR_CODE default_item_allocate(ENGINE_HANDLE* handle,
    }
 
    hash_item *it;
-   it = item_alloc(engine, key, nkey, flags, exptime, nbytes, cookie);
+   it = item_alloc(engine, key, nkey, flags, engine->server.core->realtime(exptime),
+                   nbytes, cookie);
 
    if (it != NULL) {
       *item = it;
diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/config.h b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/config.h
new file mode 100644 (file)
index 0000000..e2cbff5
--- /dev/null
@@ -0,0 +1,222 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Enable debug log */
+/* #undef DEBUG_OUTPUT */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Darwin libkern OSAtomic functions. */
+/* #undef HAVE_DARWIN_ATOMICS */
+
+/* Define to 1 if you have the <dispatch/dispatch.h> header file. */
+/* #undef HAVE_DISPATCH_DISPATCH_H */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* GCC atomic builtins. */
+#define HAVE_GCC_ATOMIC_BUILTINS 1
+
+/* Define to 1 if you have the `gethrtime' function. */
+/* #undef HAVE_GETHRTIME */
+
+/* Define to 1 if you have the `gethrvtime' function. */
+/* #undef HAVE_GETHRVTIME */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `dispatch' library (-ldispatch). */
+/* #undef HAVE_LIBDISPATCH */
+
+/* Define to 1 if you have the <mach/mach_time.h> header file. */
+/* #undef HAVE_MACH_MACH_TIME_H */
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+   to 0 otherwise. */
+#define HAVE_MALLOC 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+   and to 0 otherwise. */
+#define HAVE_REALLOC 1
+
+/* Solaris Atomic functions. */
+/* #undef HAVE_SOLARIS_ATOMICS */
+
+/* Define to 1 if you have the `srandomdev' function. */
+/* #undef HAVE_SRANDOMDEV */
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if the system has the type `_Bool'. */
+#define HAVE__BOOL 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Machine need alignment */
+#define NEED_ALIGN 1
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "innodbmemcache"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "innodbmemcache"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "innodbmemcache proto4"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "innodbmemcache"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "proto4"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "proto4"
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* #  undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* find sigignore on Linux */
+#define _GNU_SOURCE 1
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT64_T */
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT8_T */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int32_t */
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int64_t */
+
+/* Define to rpl_malloc if the replacement function should be used. */
+/* #undef malloc */
+
+/* Define to rpl_realloc if the replacement function should be used. */
+/* #undef realloc */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint16_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint64_t */
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint8_t */
+
+#if HAVE_STDBOOL_H
+#include <stdbool.h>
+#else
+#define bool char
+#define false 0
+#define true 1
+#endif 
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
index 5f0fba8bb976a30cac3c680cd4759cba2af4ffb9..22e5a57068919d210ec0b7b168c5ece7253a7e86 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-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 the Free Software
@@ -32,6 +32,7 @@ Created 3/14/2011 Jimmy Yang
 /** Defines for handler_unlock_table()'s mode field */
 #define HDL_READ       0x1
 #define HDL_WRITE      0x2
+#define HDL_FLUSH      0x3
 
 /** Defines for handler_binlog_row()'s mode field */
 typedef enum hdl_op_type {
@@ -136,6 +137,14 @@ handler_rec_setup_uint64(
        bool            unsigned_flag,  /*!< in: whether it is unsigned */
        bool            is_null);       /*!< in: whether it is null value */
 
+
+
+/**********************************************************************//**
+Check if global read lock is active */
+bool
+handler_check_global_read_lock_active();
+/*====================================*/
+
 /**********************************************************************//**
 Unlock a table and commit the transaction
 return 0 if fail to commit the transaction */
index 05f7b37c446d833c75d32a76658996d6db7e064e..534e33e946158c195c4f3484adf3157c218432ff 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
 
-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 the
@@ -48,6 +48,9 @@ connection specific operations */
                pthread_mutex_lock(&(conn)->curr_conn_mutex);   \
        }
 
+#define LOCK_CURRENT_CONN_TRYLOCK(conn)                                \
+               pthread_mutex_trylock(&(conn)->curr_conn_mutex); \
+
 #define UNLOCK_CURRENT_CONN_IF_NOT_LOCKED(has_lock, conn)      \
        if (!(has_lock)) {                                      \
                pthread_mutex_unlock(&(conn)->curr_conn_mutex); \
index 159795ae332cd54c2ff49edda0bcd90b8a925472..330d9577bc08613fb8b19ff2ffe5cd1b1b6fc99c 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
 
-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 the
@@ -463,6 +463,13 @@ ib_err_t
 /*====================*/
        ib_crsr_t       ib_crsr);
 
+typedef
+ib_u32_t
+(*cb_trx_read_only_t)(
+/*==================*/
+       ib_trx_t        ib_trx);
+
+
 cb_open_table_t                        ib_cb_open_table;
 cb_read_row_t                  ib_cb_read_row;
 cb_insert_row_t                        ib_cb_insert_row;
@@ -524,5 +531,6 @@ cb_cursor_clear_trx_t               ib_cb_cursor_clear_trx;
 cb_trx_get_start_time          ib_cb_trx_get_start_time;
 cb_bk_commit_interval          ib_cb_cfg_bk_commit_interval;
 cb_cursor_stmt_begin           ib_cb_cursor_stmt_begin;
+cb_trx_read_only_t             ib_cb_trx_read_only;
 
 #endif /* innodb_cb_api_h */
index b6a54c09604e1efd810ac13d2eaefc9a2f8fe526..13e5d81eee14a65819ccb90304bcbeb2d69fb1b2 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
 
-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 the
@@ -74,6 +74,10 @@ struct innodb_conn_data_struct {
                                        is processing a request */
        bool            is_stale;       /*!< connection closed, this is
                                        stale */
+       bool            is_flushing;    /*!< if flush is running. */
+       bool            is_waiting_for_mdl;
+                                       /*!< Used to detrmine if the connection is
+                                       locked and waiting on MDL */
        void*           conn_cookie;    /*!< connection cookie */
        uint64_t        n_total_reads;  /*!< number of reads */
        uint64_t        n_reads_since_commit;
@@ -147,6 +151,8 @@ typedef struct innodb_engine {
                                                connection specific data */
        pthread_mutex_t         cas_mutex;      /*!< mutex synchronizes
                                                CAS */
+       pthread_mutex_t         flush_mutex;    /*!< mutex synchronizes
+                                               flush and DMLs. */
        pthread_t               bk_thd_for_commit;/*!< background thread for
                                                committing long running
                                                transactions */
index 3846ddcd017c71fecefaff7a9c03ae1ade01e6f7..8ca3cf92221a58a94e5e5826985c4a37a1bbcb06 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-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 the Free Software
@@ -151,6 +151,17 @@ handler_open_table(
                                ? MDL_SHARED_WRITE
                                : MDL_SHARED_READ, MDL_TRANSACTION);
 
+       /* For flush, we need to request exclusive mdl lock. */
+       if (lock_type == HDL_FLUSH) {
+               tables.mdl_request.init(MDL_key::TABLE, db_name, table_name,
+                                       MDL_EXCLUSIVE, MDL_TRANSACTION);
+       } else {
+               tables.mdl_request.init(MDL_key::TABLE, db_name, table_name,
+                                       (lock_mode > TL_READ)
+                                       ? MDL_SHARED_WRITE
+                                       : MDL_SHARED_READ, MDL_TRANSACTION);
+       }
+
        if (!open_table(thd, &tables, &table_ctx)) {
                TABLE*  table = tables.table;
                table->use_all_columns();
@@ -373,6 +384,15 @@ handler_close_thd(
        my_pthread_setspecific_ptr(THR_THD,  0);
 }
 
+/**********************************************************************//**
+Check if global read lock is active */
+
+bool
+handler_check_global_read_lock_active()
+{
+        return Global_read_lock::global_read_lock_active();
+}
+
 /**********************************************************************//**
 Unlock a table and commit the transaction
 return 0 if failed to commit the transaction */
index 14e2fa771cf9f3ec162f48c255c0199a04641cc4..7066e61fbc0df238bde5c3375304008c12e5da03 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
 
-Copyright (c) 2011, 2014, 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 the
@@ -37,6 +37,8 @@ Created 04/12/2011 Jimmy Yang
 /** Whether to update all columns' value or a specific column value */
 #define UPDATE_ALL_VAL_COL     -1
 
+extern bool    release_mdl_lock;
+
 extern option_t config_option_names[];
 
 /** InnoDB API callback functions */
@@ -101,7 +103,8 @@ static ib_cb_t* innodb_memcached_api[] = {
        (ib_cb_t*) &ib_cb_get_idx_field_name,
        (ib_cb_t*) &ib_cb_trx_get_start_time,
        (ib_cb_t*) &ib_cb_cfg_bk_commit_interval,
-       (ib_cb_t*) &ib_cb_cursor_stmt_begin
+       (ib_cb_t*) &ib_cb_cursor_stmt_begin,
+       (ib_cb_t*) &ib_cb_trx_read_only
 };
 
 /** Set expiration time. If the exp sent by client is larger than
@@ -170,6 +173,46 @@ innodb_api_begin(
                        return(err);
                }
 
+               /* If MDL is enabled, we need to create mysql handler. */
+               if (engine) {
+
+                       if (lock_mode == IB_LOCK_NONE) {
+
+                               /* Skip MDL locking for enabling reads */
+                       } else if (conn_data && (engine->enable_binlog
+                                                || engine->enable_mdl
+                                                || lock_mode == IB_LOCK_TABLE_X)) {
+
+                               /* Create a "Fake" THD if binlog is enabled */
+                               /* For flush_all which request IB_LOCK_TABLE_X
+                               lock, we need to add MDL lock. It's because we need
+                               to block DMLs from sql layer. */
+
+                               if (!conn_data->thd) {
+                                       conn_data->thd = handler_create_thd(
+                                               engine->enable_binlog);
+
+                                       if (!conn_data->thd) {
+                                               innodb_cb_cursor_close(*crsr);
+                                               *crsr = NULL;
+                                               return(DB_ERROR);
+                                       }
+                               }
+
+                               if (!conn_data->mysql_tbl) {
+                                       int lock_type =
+                                               (lock_mode == IB_LOCK_TABLE_X?
+                                                       HDL_FLUSH : HDL_WRITE);
+                                       conn_data->mysql_tbl =
+                                               handler_open_table(
+                                                       conn_data->thd,
+                                                       dbname,
+                                                       name,
+                                                       lock_type);
+                               }
+                       }
+               }
+
                err = innodb_cb_cursor_lock(engine, *crsr, lock_mode);
 
                if (err != DB_SUCCESS) {
@@ -208,30 +251,8 @@ innodb_api_begin(
                                err = innodb_cb_cursor_lock(engine, *idx_crsr,
                                                      lock_mode);
                        }
-
-                       /* Create a "Fake" THD if binlog is enabled */
-                       if (conn_data && (engine->enable_binlog
-                                         || engine->enable_mdl)) {
-                               if (!conn_data->thd) {
-                                       conn_data->thd = handler_create_thd(
-                                               engine->enable_binlog);
-
-                                       if (!conn_data->thd) {
-                                               innodb_cb_cursor_close(*crsr);
-                                               *crsr = NULL;
-                                               return(DB_ERROR);
-                                       }
-                               }
-
-                               if (!conn_data->mysql_tbl) {
-                                       conn_data->mysql_tbl =
-                                               handler_open_table(
-                                                       conn_data->thd,
-                                                       dbname,
-                                                       name, HDL_WRITE);
-                               }
-                       }
                }
+
        } else {
                ib_cb_cursor_new_trx(*crsr, ib_trx);
 
@@ -274,7 +295,7 @@ innodb_api_read_uint64(
        uint64_t        value64;
 
        assert (m_col->type == IB_INT && m_col->type_len == sizeof(uint64_t)
-               && m_col->attr == IB_COL_UNSIGNED);
+               && m_col->attr & IB_COL_UNSIGNED);
 
        ib_cb_tuple_read_u64(read_tpl, i, &value64);
 
@@ -301,7 +322,7 @@ innodb_api_read_int(
                || m_col->type_len == sizeof(uint16_t)
                || m_col->type_len == sizeof(uint8_t));
 
-       if (m_col->attr == IB_COL_UNSIGNED) {
+       if (m_col->attr & IB_COL_UNSIGNED) {
                if (m_col->type_len == sizeof(uint64_t)) {
                        /* We handle uint64 in innodb_api_read_uint64 */
                        assert(0);
@@ -369,7 +390,7 @@ innodb_api_write_int(
        assert(m_col->type_len == 8 || m_col->type_len == 4
               || m_col->type_len == 2 || m_col->type_len == 1);
 
-       if (m_col->attr == IB_COL_UNSIGNED) {
+       if (m_col->attr & IB_COL_UNSIGNED) {
                if (m_col->type_len == 8) {
                        src = &value;
 
@@ -465,7 +486,7 @@ innodb_api_write_uint64(
        ib_cb_col_get_meta(tpl, field, m_col);
 
        assert(m_col->type == IB_INT && m_col->type_len == 8
-              && m_col->attr == IB_COL_UNSIGNED);
+              && m_col->attr & IB_COL_UNSIGNED);
 
        src = &value;
 
@@ -515,7 +536,8 @@ innodb_api_setup_field_value(
                memcpy(val_buf, value, val_len);
                val_buf[val_len] = 0;
 
-               if (col_info->col_meta.attr == IB_COL_UNSIGNED) {
+               if (col_info->col_meta.attr & IB_COL_UNSIGNED
+                   && col_info->col_meta.type_len == 8) {
                        uint64_t int_value = 0;
 
                        int_value = strtoull(val_buf, &end_ptr, 10);
@@ -583,7 +605,7 @@ innodb_api_fill_mci(
                mci_item->is_str = true;
        } else {
                if (col_meta.type == IB_INT) {
-                       if (col_meta.attr == IB_COL_UNSIGNED
+                       if (col_meta.attr & IB_COL_UNSIGNED
                            && data_len == 8) {
                                mci_item->value_int =
                                        innodb_api_read_uint64(&col_meta,
@@ -599,7 +621,7 @@ innodb_api_fill_mci(
                        mci_item->value_str = NULL;
                        mci_item->value_len = sizeof(mci_item->value_int);
                        mci_item->is_str = false;
-                       mci_item->is_unsigned = (col_meta.attr == IB_COL_UNSIGNED);
+                       mci_item->is_unsigned = (col_meta.attr & IB_COL_UNSIGNED);
                } else {
 
                        mci_item->value_str = (char*)ib_cb_col_get_value(
@@ -641,7 +663,7 @@ innodb_api_copy_mci(
                        mci_item->value_str = malloc(50);
                        memset(mci_item->value_str, 0, 50);
 
-                       if (col_meta.attr == IB_COL_UNSIGNED) {
+                       if (col_meta.attr & IB_COL_UNSIGNED) {
                                uint64_t int_val = 0;
 
                                int_val = innodb_api_read_uint64(&col_meta,
@@ -666,7 +688,6 @@ innodb_api_copy_mci(
 
                } else {
                        mci_item->value_str = malloc(data_len);
-
                        if (!mci_item->value_str) {
                                return(false);
                        }
@@ -709,6 +730,11 @@ innodb_api_fill_value(
                if (col_id == col_info[CONTAINER_VALUE].field_id) {
 
                        if (alloc_mem) {
+
+                               /* when using innodb memcache the
+                               code  will never come here becasue
+                               we do not allocate memory for column
+                               objects */
                                innodb_api_copy_mci(
                                        read_tpl, col_id,
                                        &item->col_value[MCI_COL_VALUE]);
@@ -906,7 +932,7 @@ innodb_api_search(
                                if (data_len == IB_SQL_NULL) {
                                        col_value->is_null = true;
                                } else {
-                                       if (col_meta->attr == IB_COL_UNSIGNED
+                                       if (col_meta->attr & IB_COL_UNSIGNED
                                            && data_len == 8) {
                                                col_value->value_int =
                                                        innodb_api_read_uint64(col_meta,
@@ -932,7 +958,7 @@ innodb_api_search(
                                if (data_len == IB_SQL_NULL) {
                                        col_value->is_null = true;
                                } else {
-                                       if (col_meta->attr == IB_COL_UNSIGNED
+                                       if (col_meta->attr & IB_COL_UNSIGNED
                                           && data_len == 8) {
                                                col_value->value_int =
                                                        innodb_api_read_uint64(col_meta,
@@ -961,7 +987,7 @@ innodb_api_search(
                                if (data_len == IB_SQL_NULL) {
                                        col_value->is_null = true;
                                } else {
-                                       if (col_meta->attr == IB_COL_UNSIGNED
+                                       if (col_meta->attr & IB_COL_UNSIGNED
                                            && data_len == 8) {
                                                col_value->value_int =
                                                        innodb_api_read_uint64(col_meta,
@@ -1488,9 +1514,19 @@ innodb_api_link(
                        column_used = 0;
                }
 
+               /* For int column, we don't support append command. */
+               if (append && !result->extra_col_value[column_used].is_str) {
+                       return DB_UNSUPPORTED;
+               }
+
                before_len = result->extra_col_value[column_used].value_len;
                before_val = result->extra_col_value[column_used].value_str;
        } else {
+               /* For int column, we don't support append command. */
+               if (append && !result->col_value[MCI_COL_VALUE].is_str) {
+                       return DB_UNSUPPORTED;
+               }
+
                before_len = result->col_value[MCI_COL_VALUE].value_len;
                before_val = result->col_value[MCI_COL_VALUE].value_str;
                column_used = UPDATE_ALL_VAL_COL;
@@ -1610,7 +1646,7 @@ innodb_api_arithmetic(
                } else {
                        /* cursor_data->mysql_tbl can't be created.
                        So safe to return here */
-                       return(DB_RECORD_NOT_FOUND);
+                       return(ENGINE_KEY_ENOENT);
                }
        }
 
@@ -2015,7 +2051,8 @@ innodb_api_cursor_reset(
                break;
        }
 
-       if (conn_data->n_reads_since_commit >= engine->read_batch_size
+       if (release_mdl_lock
+           || conn_data->n_reads_since_commit >= engine->read_batch_size
            || conn_data->n_writes_since_commit >= engine->write_batch_size
            || (op_type == CONN_OP_FLUSH) || !commit) {
                commit_trx = innodb_reset_conn(
index 949dbd4d6ca44b6a5bd2a53ef4ea0b1ecb68ddd2..d7c6ee52f91804425006d948d4a8c6d7e05d7364 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
 
-Copyright (c) 2011, 2014, 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 the
@@ -62,6 +62,9 @@ static bool   memcached_shutdown      = false;
 /** Tells whether the background thread is exited */
 static bool    bk_thd_exited           = true;
 
+/** Tells whether all connections need to release MDL locks */
+bool   release_mdl_lock        = false;
+
 /** InnoDB Memcached engine configuration info */
 typedef struct eng_config_info {
        char*           option_string;          /*!< memcached config option
@@ -76,6 +79,11 @@ typedef struct eng_config_info {
 
 extern option_t config_option_names[];
 
+/** Check if global read lock is active  */
+extern
+bool
+handler_check_global_read_lock_active();
+
 /** Check the input key name implies a table mapping switch. The name
 would start with "@@", and in the format of "@@new_table_mapping.key"
 or simply "@@new_table_mapping" */
@@ -161,12 +169,12 @@ create_instance(
        }
 
        innodb_eng = malloc(sizeof(struct innodb_engine));
-       memset(innodb_eng, 0, sizeof(*innodb_eng));
 
        if (innodb_eng == NULL) {
                return(ENGINE_ENOMEM);
        }
 
+       memset(innodb_eng, 0, sizeof(*innodb_eng));
        innodb_eng->engine.interface.interface = 1;
        innodb_eng->engine.get_info = innodb_get_info;
        innodb_eng->engine.initialize = innodb_initialize;
@@ -250,6 +258,12 @@ innodb_bk_thread(
                uint64_t                trx_start = 0;
                uint64_t                processed_count = 0;
 
+               if (handler_check_global_read_lock_active()) {
+                       release_mdl_lock = true;
+               } else {
+                       release_mdl_lock = false;
+               }
+
                /* Do the cleanup every innodb_eng->bk_commit_interval
                seconds. We also check if the plugin is being shutdown
                every second */
@@ -268,11 +282,6 @@ innodb_bk_thread(
                        continue;
                }
 
-               /* Set the clean_stale_conn to prevent force clean in
-               innodb_conn_clean. */
-               LOCK_CONN_IF_NOT_LOCKED(false, innodb_eng);
-               innodb_eng->clean_stale_conn = true;
-               UNLOCK_CONN_IF_NOT_LOCKED(false, innodb_eng);
 
                if (!conn_data) {
                        conn_data = UT_LIST_GET_FIRST(innodb_eng->conn_data);
@@ -284,8 +293,28 @@ innodb_bk_thread(
                        next_conn_data = NULL;
                }
 
+               /* Set the clean_stale_conn to prevent force clean in
+               innodb_conn_clean. */
+               LOCK_CONN_IF_NOT_LOCKED(false, innodb_eng);
+               innodb_eng->clean_stale_conn = true;
+               UNLOCK_CONN_IF_NOT_LOCKED(false, innodb_eng);
+
                while (conn_data) {
-                       LOCK_CURRENT_CONN_IF_NOT_LOCKED(false, conn_data);
+                       if (release_mdl_lock && !conn_data->is_stale) {
+                               int err;
+
+                               if(conn_data->is_waiting_for_mdl) {
+                                       goto next_item;
+                               }
+
+                               err = LOCK_CURRENT_CONN_TRYLOCK(conn_data);
+                               if (err != 0) {
+                                       goto next_item;
+                               }
+                               /* We have got the lock here */
+                       } else {
+                               LOCK_CURRENT_CONN_IF_NOT_LOCKED(false, conn_data);
+                       }
 
                        if (conn_data->is_stale) {
                                UNLOCK_CURRENT_CONN_IF_NOT_LOCKED(
@@ -298,6 +327,39 @@ innodb_bk_thread(
                                goto next_item;
                        }
 
+                       if (release_mdl_lock) {
+                               if (conn_data->thd) {
+                                       handler_thd_attach(conn_data->thd, NULL);
+                               }
+
+                               if (conn_data->in_use) {
+                                       UNLOCK_CURRENT_CONN_IF_NOT_LOCKED(false, conn_data);
+                                       goto next_item;
+                               }
+
+                               innodb_reset_conn(conn_data, true, true,
+                                       innodb_eng->enable_binlog);
+                               if(conn_data->mysql_tbl) {
+                                       handler_unlock_table(conn_data->thd,
+                                                            conn_data->mysql_tbl,
+                                                            HDL_READ);
+                                       conn_data->mysql_tbl = NULL;
+                               }
+
+                               /*Close the data cursor */
+                               if (conn_data->crsr) {
+                                       innodb_cb_cursor_close(conn_data->crsr);
+                                       conn_data->crsr = NULL;
+                               }
+                               if(conn_data->crsr_trx != NULL) {
+                                       ib_cb_trx_release(conn_data->crsr_trx);
+                                       conn_data->crsr_trx = NULL;
+                               }
+
+                               UNLOCK_CURRENT_CONN_IF_NOT_LOCKED(false, conn_data);
+                               goto next_item;
+                       }
+
                        if (conn_data->crsr_trx) {
                                trx_start = ib_cb_trx_get_start_time(
                                                conn_data->crsr_trx);
@@ -329,7 +391,8 @@ next_item:
                        conn_data = next_conn_data;
 
                        /* Process BK_MAX_PROCESS_COMMIT (5) trx at a time */
-                       if (processed_count > BK_MAX_PROCESS_COMMIT) {
+                       if (!release_mdl_lock &&
+                           processed_count > BK_MAX_PROCESS_COMMIT) {
                                break;
                        }
 
@@ -338,6 +401,7 @@ next_item:
                                        conn_list, conn_data);
                        }
                }
+
                /* Set the clean_stale_conn back. */
                LOCK_CONN_IF_NOT_LOCKED(false, innodb_eng);
                innodb_eng->clean_stale_conn = false;
@@ -424,6 +488,7 @@ innodb_initialize(
        UT_LIST_INIT(innodb_eng->conn_data);
        pthread_mutex_init(&innodb_eng->conn_mutex, NULL);
        pthread_mutex_init(&innodb_eng->cas_mutex, NULL);
+       pthread_mutex_init(&innodb_eng->flush_mutex, NULL);
 
        /* Fetch InnoDB specific settings */
        innodb_eng->meta_info = innodb_config(
@@ -450,6 +515,29 @@ innodb_initialize(
 
 extern void handler_close_thd(void*);
 
+/*******************************************************************//**
+Close table using handler functions.
+@param conn_data       cursor information of connection */
+void
+innodb_close_mysql_table(
+/*=====================*/
+       innodb_conn_data_t*     conn_data)      /*!< in: connection
+                                                        cursor*/
+{
+       if (conn_data->mysql_tbl) {
+               assert(conn_data->thd);
+               handler_unlock_table(conn_data->thd,
+                                    conn_data->mysql_tbl,
+                                    HDL_READ);
+                conn_data->mysql_tbl = NULL;
+       }
+
+       if (conn_data->thd) {
+               handler_close_thd(conn_data->thd);
+               conn_data->thd = NULL;
+       }
+}
+
 /*******************************************************************//**
 Cleanup idle connections if "clear_all" is false, and clean up all
 connections if "clear_all" is true.
@@ -496,18 +584,7 @@ innodb_conn_clean_data(
                conn_data->crsr_trx = NULL;
        }
 
-       if (conn_data->mysql_tbl) {
-               assert(conn_data->thd);
-               handler_unlock_table(conn_data->thd,
-                                    conn_data->mysql_tbl,
-                                    HDL_READ);
-               conn_data->mysql_tbl = NULL;
-       }
-
-       if (conn_data->thd) {
-               handler_close_thd(conn_data->thd);
-               conn_data->thd = NULL;
-       }
+       innodb_close_mysql_table(conn_data);
 
        if (conn_data->tpl) {
                ib_cb_tuple_delete(conn_data->tpl);
@@ -684,6 +761,7 @@ innodb_destroy(
 
        pthread_mutex_destroy(&innodb_eng->conn_mutex);
        pthread_mutex_destroy(&innodb_eng->cas_mutex);
+       pthread_mutex_destroy(&innodb_eng->flush_mutex);
 
        if (innodb_eng->default_engine) {
                def_eng->engine.destroy(innodb_eng->default_engine, force);
@@ -701,6 +779,57 @@ enum conn_mode {
        CONN_MODE_NONE
 };
 
+
+/*******************************************************************//**
+Opens mysql table if enable_binlog or enable_mdl is set
+@param conn_data       connection cursor data
+@param conn_optioin    read or write operation
+@param engine          Innodb memcached engine
+@returns DB_SUCCESS on success and DB_ERROR on failure */
+ib_err_t
+innodb_open_mysql_table(
+/*====================*/
+       innodb_conn_data_t*     conn_data,      /*!< in/out:Connection cursor data */
+       int                     conn_option,    /*!< in: Read or write operation */
+       innodb_engine_t*        engine)         /*!< in: InnoDB memcached engine */
+{
+       meta_cfg_info_t*        meta_info;
+       meta_info = conn_data->conn_meta;
+       conn_data->is_waiting_for_mdl = true;
+
+       /* Close the table before opening it again */
+       innodb_close_mysql_table(conn_data);
+
+       if (conn_option == CONN_MODE_READ) {
+               conn_data->is_waiting_for_mdl = false;
+               return (DB_SUCCESS);
+       }
+
+       if (!conn_data->thd) {
+               conn_data->thd = handler_create_thd(engine->enable_binlog);
+               if (!conn_data->thd) {
+                       return(DB_ERROR);
+               }
+       }
+
+       if (!conn_data->mysql_tbl) {
+               conn_data->mysql_tbl =
+                       handler_open_table(
+                               conn_data->thd,
+                               meta_info->col_info[CONTAINER_DB].col_name,
+                               meta_info->col_info[CONTAINER_TABLE].col_name,
+                               HDL_WRITE);
+       }
+       conn_data->is_waiting_for_mdl = false;
+
+       if(!conn_data->mysql_tbl) {
+               return(DB_LOCK_WAIT);
+       }
+
+       return (DB_SUCCESS);
+}
+
+
 /*******************************************************************//**
 Cleanup connections
 @return number of connection cleaned */
@@ -758,19 +887,45 @@ innodb_conn_init(
 
                memset(conn_data, 0, sizeof(*conn_data));
                conn_data->result = malloc(sizeof(mci_item_t));
-               conn_data->conn_cookie = (void*) cookie;
-               UT_LIST_ADD_LAST(conn_list, engine->conn_data, conn_data);
-               engine->server.cookie->store_engine_specific(
-                       cookie, conn_data);
+                if (!conn_data->result) {
+                       UNLOCK_CONN_IF_NOT_LOCKED(has_lock, engine);
+                       free(conn_data);
+                       conn_data = NULL;
+                       return(NULL);
+               }
                conn_data->conn_meta = new_meta_info
                                         ? new_meta_info
                                         : engine->meta_info;
                conn_data->row_buf = malloc(1024);
+                if (!conn_data->row_buf) {
+                       UNLOCK_CONN_IF_NOT_LOCKED(has_lock, engine);
+                       free(conn_data->result);
+                       free(conn_data);
+                       conn_data = NULL;
+                       return(NULL);
+               }
                conn_data->row_buf_len = 1024;
 
                conn_data->cmd_buf = malloc(1024);
+                if (!conn_data->cmd_buf) {
+                       UNLOCK_CONN_IF_NOT_LOCKED(has_lock, engine);
+                       free(conn_data->row_buf);
+                       free(conn_data->result);
+                       free(conn_data);
+                       conn_data = NULL;
+                       return(NULL);
+               }
                conn_data->cmd_buf_len = 1024;
 
+               conn_data->is_flushing = false;
+
+               conn_data->conn_cookie = (void*) cookie;
+
+               /* Add connection to the list after all memory allocations */
+               UT_LIST_ADD_LAST(conn_list, engine->conn_data, conn_data);
+               engine->server.cookie->store_engine_specific(
+                       cookie, conn_data);
+
                pthread_mutex_init(&conn_data->curr_conn_mutex, NULL);
                UNLOCK_CONN_IF_NOT_LOCKED(has_lock, engine);
        }
@@ -785,6 +940,30 @@ have_conn:
        }
 
        LOCK_CURRENT_CONN_IF_NOT_LOCKED(has_lock, conn_data);
+
+       /* If flush is running, then wait for it complete. */
+       if (conn_data->is_flushing) {
+               /* Request flush_mutex for waiting for flush
+               completed. */
+               pthread_mutex_lock(&engine->flush_mutex);
+               pthread_mutex_unlock(&engine->flush_mutex);
+       }
+
+       /* This special case added to facilitate unlocking
+          of MDL lock during FLUSH TABLE WITH READ LOCK */
+       if (engine &&
+           release_mdl_lock &&
+           (engine->enable_binlog || engine->enable_mdl)) {
+               if ( DB_SUCCESS !=
+                       innodb_open_mysql_table(conn_data,
+                                               conn_option,
+                                               engine)){
+                       UNLOCK_CURRENT_CONN_IF_NOT_LOCKED(
+                               has_lock, conn_data);
+                       return NULL;
+               }
+       }
+
        conn_data->in_use = true;
 
        crsr = conn_data->crsr;
@@ -797,9 +976,16 @@ have_conn:
                } else {
                        /* Write cursor transaction exists.
                           Reuse this transaction.*/
-                       assert(ib_cb_trx_start(conn_data->crsr_trx,
-                                              engine->trx_level,
-                                              true, false, NULL));
+                       if (ib_cb_trx_read_only(conn_data->crsr_trx)) {
+                               innodb_cb_trx_commit(
+                                       conn_data->crsr_trx);
+                       }
+
+                       err = ib_cb_trx_start(conn_data->crsr_trx,
+                                             engine->trx_level,
+                                             true, false, NULL);
+                       assert(err == DB_SUCCESS);
+
                }
 
                err = innodb_api_begin(
@@ -837,6 +1023,11 @@ have_conn:
                                        engine->trx_level, true, false);
                                trx_updated = true;
                        } else {
+                               if (ib_cb_trx_read_only(conn_data->crsr_trx)) {
+                                       innodb_cb_trx_commit(
+                                               conn_data->crsr_trx);
+                               }
+
                                ib_cb_trx_start(conn_data->crsr_trx,
                                                engine->trx_level,
                                                true, false, NULL);
@@ -902,6 +1093,12 @@ have_conn:
                                        engine, idx_crsr, lock_mode);
                        }
                } else {
+
+                       if (ib_cb_trx_read_only(conn_data->crsr_trx)) {
+                               innodb_cb_trx_commit(
+                                       conn_data->crsr_trx);
+                       }
+
                        ib_cb_trx_start(conn_data->crsr_trx,
                                        engine->trx_level,
                                        true, false, NULL);
@@ -1499,6 +1696,31 @@ convert_to_char(
        return(strlen(buf));
 }
 
+
+/*******************************************************************//**
+Free value assocaited with key */
+static
+void
+innodb_free_item(
+/*=====================*/
+       void* item)     /*!< in: Item to be freed */
+{
+
+       mci_item_t*     result = (mci_item_t*) item;
+       if (result->extra_col_value) {
+               for (int i = 0; i < result->n_extra_col; i++) {
+                       if(result->extra_col_value[i].allocated)
+                               free(result->extra_col_value[i].value_str);
+                       }
+                       free(result->extra_col_value);
+                       result->extra_col_value=NULL;
+               }
+       if (result->col_value[MCI_COL_VALUE].allocated) {
+               free(result->col_value[MCI_COL_VALUE].value_str);
+               result->col_value[MCI_COL_VALUE].allocated =
+                       false;
+       }
+}
 /*******************************************************************//**
 Support memcached "GET" command, fetch the value according to key
 @return ENGINE_SUCCESS if successfully, otherwise error code */
@@ -1631,31 +1853,17 @@ search_done:
        we will check whether the item is expired */
        if (result->col_value[MCI_COL_EXP].is_valid
            && result->col_value[MCI_COL_EXP].value_int) {
-               uint64_t                time;
+               uint64_t time;
                time = mci_get_time();
-
                if (time > result->col_value[MCI_COL_EXP].value_int) {
-                       /* Free allocated memory. */
-                       if (result->extra_col_value) {
-                               for (int i = 0; i < result->n_extra_col; i++) {
-                                       free(result->extra_col_value[i].value_str);
-                               }
-
-                               free(result->extra_col_value);
-                       }
-                       if (result->col_value[MCI_COL_VALUE].allocated) {
-                               free(result->col_value[MCI_COL_VALUE].value_str);
-                               result->col_value[MCI_COL_VALUE].allocated =
-                                       false;
-                       }
-
+                       innodb_free_item(result);
                        err_ret = ENGINE_KEY_ENOENT;
                        goto func_exit;
                }
        }
 
        if (result->extra_col_value) {
-               int             i;
+               int             i;
                char*           c_value;
                char*           value_end;
                unsigned int    total_len = 0;
@@ -1974,28 +2182,44 @@ connections if "clear_all" is true.
 @return number of connection cleaned */
 static
 bool
-innodb_flush_clean_conn(
-/*====================*/
+innodb_flush_sync_conn(
+/*===================*/
        innodb_engine_t*        engine,         /*!< in/out: InnoDB memcached
                                                engine */
-       const void*             cookie)         /*!< in: connection cookie */
+       const void*             cookie,         /*!< in: connection cookie */
+       bool                    flush_flag)     /*!< in: flush is running or not */
 {
        innodb_conn_data_t*     conn_data = NULL;
        innodb_conn_data_t*     curr_conn_data;
+       bool                    ret = true;
 
        curr_conn_data = engine->server.cookie->get_engine_specific(cookie);
        assert(curr_conn_data);
-       assert(!engine->enable_binlog || curr_conn_data->thd);
 
        conn_data = UT_LIST_GET_FIRST(engine->conn_data);
 
        while (conn_data) {
                if (conn_data != curr_conn_data && (!conn_data->is_stale)) {
-                       if (curr_conn_data->thd) {
+                       if (conn_data->thd) {
                                handler_thd_attach(conn_data->thd, NULL);
                        }
-                       innodb_reset_conn(conn_data, false, true,
-                                         engine->enable_binlog);
+                       LOCK_CURRENT_CONN_IF_NOT_LOCKED(false, conn_data);
+                       if (flush_flag == false) {
+                               conn_data->is_flushing = flush_flag;
+                               UNLOCK_CURRENT_CONN_IF_NOT_LOCKED(false, conn_data);
+                               conn_data = UT_LIST_GET_NEXT(conn_list, conn_data);
+                               continue;
+                       }
+                       if (!conn_data->in_use) {
+                               /* Set flushing flag to conn_data for preventing
+                               it is get by other request.  */
+                               conn_data->is_flushing = flush_flag;
+                               UNLOCK_CURRENT_CONN_IF_NOT_LOCKED(false, conn_data);
+                       } else {
+                               ret = false;
+                               UNLOCK_CURRENT_CONN_IF_NOT_LOCKED(false, conn_data);
+                               break;
+                       }
                }
                conn_data = UT_LIST_GET_NEXT(conn_list, conn_data);
        }
@@ -2003,7 +2227,8 @@ innodb_flush_clean_conn(
        if (curr_conn_data->thd) {
                handler_thd_attach(curr_conn_data->thd, NULL);
        }
-       return(true);
+
+       return(ret);
 }
 
 /*******************************************************************//**
@@ -2044,6 +2269,9 @@ innodb_flush(
        new opeartion */
         pthread_mutex_lock(&innodb_eng->conn_mutex);
 
+       /* Lock the flush_mutex for blocking other DMLs. */
+       pthread_mutex_lock(&innodb_eng->flush_mutex);
+
        conn_data = innodb_eng->server.cookie->get_engine_specific(cookie);
 
        if (conn_data) {
@@ -2056,21 +2284,34 @@ innodb_flush(
                                     IB_LOCK_TABLE_X, true, NULL);
 
        if (!conn_data) {
+               pthread_mutex_unlock(&innodb_eng->flush_mutex);
                pthread_mutex_unlock(&innodb_eng->conn_mutex);
                return(ENGINE_SUCCESS);
        }
 
-       innodb_flush_clean_conn(innodb_eng, cookie);
-
+       /* Commit any previous work on this connection */
        innodb_api_cursor_reset(innodb_eng, conn_data, CONN_OP_FLUSH, true);
-       meta_info = conn_data->conn_meta;
+
+       if (!innodb_flush_sync_conn(innodb_eng, cookie, true)) {
+               pthread_mutex_unlock(&innodb_eng->flush_mutex);
+               pthread_mutex_unlock(&innodb_eng->conn_mutex);
+               innodb_flush_sync_conn(innodb_eng, cookie, false);
+               return(ENGINE_TMPFAIL);
+       }
 
        ib_err = innodb_api_flush(innodb_eng, conn_data,
                                  meta_info->col_info[CONTAINER_DB].col_name,
                                  meta_info->col_info[CONTAINER_TABLE].col_name);
 
+       /* Commit work and release the MDL table. */
+       innodb_api_cursor_reset(innodb_eng, conn_data, CONN_OP_FLUSH, true);
+       innodb_conn_clean_data(conn_data, false, false);
+
+        pthread_mutex_unlock(&innodb_eng->flush_mutex);
         pthread_mutex_unlock(&innodb_eng->conn_mutex);
 
+       innodb_flush_sync_conn(innodb_eng, cookie, false);
+
        return((ib_err == DB_SUCCESS) ? ENGINE_SUCCESS : ENGINE_TMPFAIL);
 }
 
index 92de768e3bc74ac22d00a07c461ef2ac196547fa..2d53379c235b037730e89d187703985827bb8511 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
 
-Copyright (c) 2011, 2012, 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 the
@@ -127,6 +127,13 @@ innodb_clean_engine(
        const void*     cookie,         /*!< in: connection cookie */
        void*           conn);          /*!< in: item to free */
 /*******************************************************************//**
+Free value assocaited with key */
+static
+void
+innodb_free_item(
+/*=====================*/
+        void* item);     /*!< in: Item to be freed */
+/*******************************************************************//**
 Support memcached "GET" command, fetch the value according to key
 @return ENGINE_SUCCESS if successfully, otherwise error code */
 static
index f889b3b17330377cf7a6faafdd859c921e33267b..9bee07c03216a87e167a02bf1b50a2e639f320e6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2013, 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
 #include <string>
 #include <mysql/plugin_validate_password.h>
 #include <set>
+#include <ios>       // std::streamoff
 #include <iostream>
 #include <fstream>
+#include <algorithm> // std::swap
 
 
 /*  
 #define MIN_DICTIONARY_WORD_LENGTH    4
 #define MAX_PASSWORD_LENGTH           100
 
+/* Read-write lock for dictionary_words cache */
+mysql_rwlock_t LOCK_dict_file;
+
+#ifdef HAVE_PSI_INTERFACE
+PSI_rwlock_key key_validate_password_LOCK_dict_file;
+
+static PSI_rwlock_info all_validate_password_rwlocks[]=
+{
+  { &key_validate_password_LOCK_dict_file, "LOCK_dict_file", 0}
+};
+
+void init_validate_password_psi_keys()
+{
+  const char* category= "validate";
+  int count;
+
+  count= array_elements(all_validate_password_rwlocks);
+  mysql_rwlock_register(category, all_validate_password_rwlocks, count);
+}
+#endif /* HAVE_PSI_INTERFACE */
+
+
 /*
   Handle assigned when loading the plugin.
   Used with the error reporting functions.
@@ -70,50 +94,113 @@ static int validate_password_mixed_case_count;
 static int validate_password_special_char_count;
 static ulong validate_password_policy;
 static char *validate_password_dictionary_file;
+static char *validate_password_dictionary_file_last_parsed= NULL;
+static long long validate_password_dictionary_file_words_count= 0;
+
+/**
+  Activate the new dictionary
+
+  Assigns a local list to the global variable,
+  taking the correct locks in the process.
+  Also updates the status variables.
+  @param dict_words new dictionary words set
+
+*/
+static void dictionary_activate(set_type *dict_words)
+{
+  time_t start_time;
+  struct tm tm;
+  char timebuf[20]; /* "YYYY-MM-DD HH:MM:SS" */
+  char *new_ts;
+
+  /* fetch the start time */
+  start_time= my_time(MYF(0));
+  localtime_r(&start_time, &tm);
+  my_snprintf(timebuf, sizeof(timebuf), "%04d-%02d-%02d %02d:%02d:%02d",
+              tm.tm_year + 1900,
+              tm.tm_mon + 1,
+              tm.tm_mday,
+              tm.tm_hour,
+              tm.tm_min,
+              tm.tm_sec);
+  new_ts= my_strdup(timebuf, MYF(0));
+
+  mysql_rwlock_wrlock(&LOCK_dict_file);
+  std::swap(dictionary_words, *dict_words);
+  validate_password_dictionary_file_words_count= dictionary_words.size();
+  std::swap(new_ts, validate_password_dictionary_file_last_parsed);
+  mysql_rwlock_unlock(&LOCK_dict_file);
+
+  /* frees up the data just replaced */
+  if (!dict_words->empty())
+    dict_words->clear();
+  if (new_ts)
+    my_free(new_ts);
+}
+
 
 /* To read dictionary file into std::set */
 static void read_dictionary_file()
 {
   string_type words;
-  long file_length;
+  set_type dict_words;
+  std::streamoff file_length;
 
   if (validate_password_dictionary_file == NULL)
   {
-    my_plugin_log_message(&plugin_info_ptr, MY_WARNING_LEVEL,
-                          "Dictionary file not specified");
-    return;
-  }
-  std::ifstream dictionary_stream(validate_password_dictionary_file);
-  if (!dictionary_stream)
-  {
-    my_plugin_log_message(&plugin_info_ptr, MY_WARNING_LEVEL,
-                          "Dictionary file not loaded");
+    if (validate_password_policy == PASSWORD_POLICY_STRONG)
+      my_plugin_log_message(&plugin_info_ptr, MY_WARNING_LEVEL,
+                            "Dictionary file not specified");
+    /* NULL is a valid value, despite the warning */
+    dictionary_activate(&dict_words);
     return;
   }
-  dictionary_stream.seekg(0, std::ios::end);
-  file_length= dictionary_stream.tellg();
-  dictionary_stream.seekg(0, std::ios::beg);
-  if (file_length > MAX_DICTIONARY_FILE_LENGTH)
+  try
   {
+    std::ifstream dictionary_stream(validate_password_dictionary_file);
+    if (!dictionary_stream || !dictionary_stream.is_open())
+    {
+      my_plugin_log_message(&plugin_info_ptr, MY_WARNING_LEVEL,
+                            "Dictionary file not loaded");
+      return;
+    }
+    dictionary_stream.seekg(0, std::ios::end);
+    file_length= dictionary_stream.tellg();
+    dictionary_stream.seekg(0, std::ios::beg);
+    if (file_length > MAX_DICTIONARY_FILE_LENGTH)
+    {
+      dictionary_stream.close();
+      my_plugin_log_message(&plugin_info_ptr, MY_WARNING_LEVEL,
+                            "Dictionary file size exceeded",
+                            "MAX_DICTIONARY_FILE_LENGTH, not loaded");
+      return;
+    }
+    for (std::getline(dictionary_stream, words); dictionary_stream.good();
+         std::getline(dictionary_stream, words))
+         dict_words.insert(words);
     dictionary_stream.close();
-    my_plugin_log_message(&plugin_info_ptr, MY_WARNING_LEVEL,
-                          "Dictionary file size exceed",
-                          "MAX_DICTIONARY_FILE_LENGTH, not loaded");
-    return;
+    dictionary_activate(&dict_words);
   }
-  while (dictionary_stream.good())
+  catch (...) // no exceptions !
   {
-    std::getline(dictionary_stream, words);
-    dictionary_words.insert(words);
+    my_plugin_log_message(&plugin_info_ptr, MY_WARNING_LEVEL,
+                          "Exception while reading the dictionary file");
   }
-  dictionary_stream.close();
 }
 
+
 /* Clear words from std::set */
 static void free_dictionary_file()
 {
+  mysql_rwlock_wrlock(&LOCK_dict_file);
   if (!dictionary_words.empty())
     dictionary_words.clear();
+  if (validate_password_dictionary_file_last_parsed)
+  {
+    my_free(validate_password_dictionary_file_last_parsed);
+    validate_password_dictionary_file_last_parsed= NULL;
+  }
+  mysql_rwlock_unlock(&LOCK_dict_file);
 }
 
 /*
@@ -141,13 +228,14 @@ static int validate_dictionary_check(mysql_string_handle password)
   mysql_string_free(lower_string_handle);
   int substr_pos= 0;
   int substr_length= length;
-  string_type password_str= (const char *)buffer;
+  string_type password_str= string_type((const char *)buffer, length);
   string_type password_substr;
   set_type::iterator itr;
   /*  
     std::set as container stores the dictionary words,
     binary comparison between dictionary words and password
   */
+  mysql_rwlock_rdlock(&LOCK_dict_file);
   while (substr_length >= MIN_DICTIONARY_WORD_LENGTH)
   {
     substr_pos= 0;
@@ -157,6 +245,7 @@ static int validate_dictionary_check(mysql_string_handle password)
       itr= dictionary_words.find(password_substr);
       if (itr != dictionary_words.end())
       {
+        mysql_rwlock_unlock(&LOCK_dict_file);
         free(buffer);
         return (0);
       }
@@ -164,6 +253,7 @@ static int validate_dictionary_check(mysql_string_handle password)
     }
     substr_length--;
   }
+  mysql_rwlock_unlock(&LOCK_dict_file);
   free(buffer);
   return (1);
 }
@@ -264,6 +354,10 @@ static struct st_mysql_validate_password validate_password_descriptor=
 static int validate_password_init(MYSQL_PLUGIN plugin_info)
 {
   plugin_info_ptr= plugin_info;
+#ifdef HAVE_PSI_INTERFACE
+  init_validate_password_psi_keys();
+#endif
+  mysql_rwlock_init(key_validate_password_LOCK_dict_file, &LOCK_dict_file);
   read_dictionary_file();
   return (0);
 }
@@ -276,9 +370,23 @@ static int validate_password_init(MYSQL_PLUGIN plugin_info)
 static int validate_password_deinit(void *arg __attribute__((unused)))
 {
   free_dictionary_file();
+  mysql_rwlock_destroy(&LOCK_dict_file);
   return (0);
 }
 
+/*
+  Update function for validate_password_dictionary_file.
+  If dictionary file is changed, this function will flush
+  the cache and re-load the new dictionary file.
+*/
+static void
+dictionary_update(MYSQL_THD thd __attribute__((unused)),
+                  struct st_mysql_sys_var *var __attribute__((unused)),
+                  void *var_ptr, const void *save)
+{
+  *(const char**)var_ptr= *(const char**)save;
+  read_dictionary_file();
+}
 
 /*
   update function for:
@@ -367,9 +475,9 @@ static MYSQL_SYSVAR_ENUM(policy, validate_password_policy,
   NULL, NULL, PASSWORD_POLICY_MEDIUM, &password_policy_typelib_t);
 
 static MYSQL_SYSVAR_STR(dictionary_file, validate_password_dictionary_file,
-  PLUGIN_VAR_READONLY,
+  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
   "password_validate_dictionary file to be loaded and check for password",
-  NULL, NULL, NULL);
+  NULL, dictionary_update, NULL);
 
 static struct st_mysql_sys_var* validate_password_system_variables[]= {
   MYSQL_SYSVAR(length),
@@ -381,6 +489,12 @@ static struct st_mysql_sys_var* validate_password_system_variables[]= {
   NULL
 };
 
+static struct st_mysql_show_var validate_password_status_variables[]= {
+    { "validate_password_dictionary_file_last_parsed", (char *) &validate_password_dictionary_file_last_parsed, SHOW_CHAR_PTR },
+    { "validate_password_dictionary_file_words_count", (char *) &validate_password_dictionary_file_words_count, SHOW_LONGLONG },
+    { NullS, NullS, SHOW_LONG }
+};
+
 mysql_declare_plugin(validate_password)
 {
   MYSQL_VALIDATE_PASSWORD_PLUGIN,     /*   type                            */
@@ -391,8 +505,8 @@ mysql_declare_plugin(validate_password)
   PLUGIN_LICENSE_GPL,
   validate_password_init,             /*   init function (when loaded)     */
   validate_password_deinit,           /*   deinit function (when unloaded) */
-  0x0100,                             /*   version                         */
-  NULL,
+  0x0101,                             /*   version                         */
+  validate_password_status_variables, /*   status variables                */
   validate_password_system_variables, /*   system variables                */
   NULL,
   0,
index d84c5580dfafddf291e32b1502d71de47d6f9eaa..af459cc7d2200a50cc8b968ae9f0e46a66c455d8 100644 (file)
@@ -1,6 +1,5 @@
 /* Copyright (C) 2007 Google Inc.
-   Copyright (c) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
-   Use is subject to license terms.
+   Copyright (c) 2008, 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
@@ -52,7 +51,7 @@ static int getWaitTime(const struct timespec& start_ts);
 
 static unsigned long long timespec_to_usec(const struct timespec *ts)
 {
-#ifndef __WIN__
+#ifdef HAVE_STRUCT_TIMESPEC
   return (unsigned long long) ts->tv_sec * TIME_MILLION + ts->tv_nsec / TIME_THOUSAND;
 #else
   return ts->tv.i64 / 10;
@@ -224,6 +223,54 @@ bool ActiveTranx::is_tranx_end_pos(const char *log_file_name,
   return (entry != NULL);
 }
 
+int ActiveTranx::signal_waiting_sessions_all()
+{
+  const char *kWho = "ActiveTranx::signal_waiting_sessions_all";
+  function_enter(kWho);
+  for (TranxNode* entry= trx_front_; entry; entry=entry->next_)
+    mysql_cond_broadcast(&entry->cond);
+
+  return function_exit(kWho, 0);
+}
+
+int ActiveTranx::signal_waiting_sessions_up_to(const char *log_file_name,
+                                               my_off_t log_file_pos)
+{
+  const char *kWho = "ActiveTranx::signal_waiting_sessions_up_to";
+  function_enter(kWho);
+
+  TranxNode* entry= trx_front_;
+  int cmp= ActiveTranx::compare(entry->log_name_, entry->log_pos_, log_file_name, log_file_pos) ;
+  while (entry && cmp <= 0)
+  {
+    mysql_cond_broadcast(&entry->cond);
+    entry= entry->next_;
+    if (entry)
+      cmp= ActiveTranx::compare(entry->log_name_, entry->log_pos_, log_file_name, log_file_pos) ;
+  }
+
+  return function_exit(kWho, (entry != NULL));
+}
+
+TranxNode * ActiveTranx::find_active_tranx_node(const char *log_file_name,
+                                                my_off_t log_file_pos)
+{
+  const char *kWho = "ActiveTranx::find_active_tranx_node";
+  function_enter(kWho);
+
+  TranxNode* entry= trx_front_;
+
+  while (entry)
+  {
+    if (ActiveTranx::compare(log_file_name, log_file_pos, entry->log_name_,
+                             entry->log_pos_) <= 0)
+      break;
+    entry= entry->next_;
+  }
+  function_exit(kWho, 0);
+  return entry;
+}
+
 int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name,
                                          my_off_t log_file_pos)
 {
@@ -238,7 +285,8 @@ int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name,
 
     while (new_front)
     {
-      if (compare(new_front, log_file_name, log_file_pos) > 0)
+      if (compare(new_front, log_file_name, log_file_pos) > 0 ||
+          new_front->n_waiters > 0)
         break;
       new_front = new_front->next_;
     }
@@ -365,8 +413,6 @@ int ReplSemiSyncMaster::initObject()
   /* Mutex initialization can only be done after MY_INIT(). */
   mysql_mutex_init(key_ss_mutex_LOCK_binlog_,
                    &LOCK_binlog_, MY_MUTEX_INIT_FAST);
-  mysql_cond_init(key_ss_cond_COND_binlog_send_,
-                  &COND_binlog_send_, NULL);
 
   if (rpl_semi_sync_master_enabled)
     result = enableMaster();
@@ -385,7 +431,9 @@ int ReplSemiSyncMaster::enableMaster()
 
   if (!getMasterEnabled())
   {
-    active_tranxs_ = new ActiveTranx(&LOCK_binlog_, trace_level_);
+    if (active_tranxs_ == NULL)
+      active_tranxs_ = new ActiveTranx(&LOCK_binlog_, trace_level_);
+
     if (active_tranxs_ != NULL)
     {
       commit_file_name_inited_ = false;
@@ -420,9 +468,11 @@ int ReplSemiSyncMaster::disableMaster()
      */
     switch_off();
 
-    assert(active_tranxs_ != NULL);
-    delete active_tranxs_;
-    active_tranxs_ = NULL;
+    if ( active_tranxs_ && active_tranxs_->is_empty())
+    {
+      delete active_tranxs_;
+      active_tranxs_ = NULL;
+    }
 
     reply_file_name_inited_ = false;
     wait_file_name_inited_  = false;
@@ -442,7 +492,6 @@ ReplSemiSyncMaster::~ReplSemiSyncMaster()
   if (init_done_)
   {
     mysql_mutex_destroy(&LOCK_binlog_);
-    mysql_cond_destroy(&COND_binlog_send_);
   }
 
   delete active_tranxs_;
@@ -458,22 +507,6 @@ void ReplSemiSyncMaster::unlock()
   mysql_mutex_unlock(&LOCK_binlog_);
 }
 
-void ReplSemiSyncMaster::cond_broadcast()
-{
-  mysql_cond_broadcast(&COND_binlog_send_);
-}
-
-int ReplSemiSyncMaster::cond_timewait(struct timespec *wait_time)
-{
-  const char *kWho = "ReplSemiSyncMaster::cond_timewait()";
-  int wait_res;
-
-  function_enter(kWho);
-  wait_res= mysql_cond_timedwait(&COND_binlog_send_,
-                                 &LOCK_binlog_, wait_time);
-  return function_exit(kWho, wait_res);
-}
-
 void ReplSemiSyncMaster::add_slave()
 {
   lock();
@@ -579,10 +612,6 @@ int ReplSemiSyncMaster::reportReplyBinlog(uint32 server_id,
     reply_file_pos_ = log_file_pos;
     reply_file_name_inited_ = true;
 
-    /* Remove all active transaction nodes before this point. */
-    assert(active_tranxs_ != NULL);
-    active_tranxs_->clear_active_tranx_nodes(log_file_name, log_file_pos);
-
     if (trace_level_ & kTraceDetail)
     {
       if(!skipped_event)
@@ -612,16 +641,14 @@ int ReplSemiSyncMaster::reportReplyBinlog(uint32 server_id,
   }
 
  l_end:
-  unlock();
 
   if (can_release_threads)
   {
     if (trace_level_ & kTraceDetail)
       sql_print_information("%s: signal all waiting threads.", kWho);
-
-    cond_broadcast();
+    active_tranxs_->signal_waiting_sessions_up_to(reply_file_name_, reply_file_pos_);
   }
-
+  unlock();
   return function_exit(kWho, 0);
 }
 
@@ -631,28 +658,38 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
   const char *kWho = "ReplSemiSyncMaster::commitTrx";
 
   function_enter(kWho);
+  PSI_stage_info old_stage;
+
+#if defined(ENABLED_DEBUG_SYNC)
+  /* debug sync may not be initialized for a master */
+  if (current_thd->debug_sync_control)
+    DEBUG_SYNC(current_thd, "rpl_semisync_master_commit_trx_before_lock");
+#endif
+  /* Acquire the mutex. */
+  lock();
+
+  TranxNode* entry= NULL;
+  mysql_cond_t* thd_cond= NULL;
+  if (active_tranxs_ != NULL && trx_wait_binlog_name)
+  {
+    entry=
+      active_tranxs_->find_active_tranx_node(trx_wait_binlog_name,
+                                             trx_wait_binlog_pos);
+    if (entry)
+      thd_cond= &entry->cond;
+  }
+  /* This must be called after acquired the lock */
+  THD_ENTER_COND(NULL, thd_cond, &LOCK_binlog_,
+                 & stage_waiting_for_semi_sync_ack_from_slave,
+                 & old_stage);
 
   if (getMasterEnabled() && trx_wait_binlog_name)
   {
     struct timespec start_ts;
     struct timespec abstime;
     int wait_result;
-    PSI_stage_info old_stage;
 
     set_timespec(start_ts, 0);
-#if defined(ENABLED_DEBUG_SYNC)
-    /* debug sync may not be initialized for a master */
-    if (current_thd->debug_sync_control)
-      DEBUG_SYNC(current_thd, "rpl_semisync_master_commit_trx_before_lock");
-#endif
-    /* Acquire the mutex. */
-    lock();
-
-    /* This must be called after acquired the lock */
-    THD_ENTER_COND(NULL, &COND_binlog_send_, &LOCK_binlog_,
-                   & stage_waiting_for_semi_sync_ack_from_slave,
-                   & old_stage);
-
     /* This is the real check inside the mutex. */
     if (!getMasterEnabled() || !is_on())
       goto l_end;
@@ -665,7 +702,7 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
     }
 
     /* Calcuate the waiting period. */
-#ifdef __WIN__
+#ifndef HAVE_STRUCT_TIMESPEC
       abstime.tv.i64 = start_ts.tv.i64 + (__int64)wait_timeout_ * TIME_THOUSAND * 10;
       abstime.max_timeout_msec= (long)wait_timeout_;
 #else
@@ -751,7 +788,11 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
                               kWho, wait_timeout_,
                               wait_file_name_, (unsigned long)wait_file_pos_);
       
-      wait_result = cond_timewait(&abstime);
+      /* wait for the position to be ACK'ed back */
+      assert(entry);
+      entry->n_waiters++;
+      wait_result= mysql_cond_timedwait(&entry->cond, &LOCK_binlog_, &abstime);
+      entry->n_waiters--;
       rpl_semi_sync_master_wait_sessions--;
       
       if (wait_result != 0)
@@ -790,25 +831,24 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
       }
     }
 
-    /*
-      At this point, the binlog file and position of this transaction
-      must have been removed from ActiveTranx.
-    */
-    assert(!getMasterEnabled() ||
-           !active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name,
-                                             trx_wait_binlog_pos));
-  l_end:
+l_end:
     /* Update the status counter. */
     if (is_on())
       rpl_semi_sync_master_yes_transactions++;
     else
       rpl_semi_sync_master_no_transactions++;
 
-    /* The lock held will be released by thd_exit_cond, so no need to
-       call unlock() here */
-    THD_EXIT_COND(NULL, & old_stage);
   }
 
+  /* Last waiter removes the TranxNode */
+  if (trx_wait_binlog_name && active_tranxs_
+      && entry && entry->n_waiters == 0)
+    active_tranxs_->clear_active_tranx_nodes(trx_wait_binlog_name,
+                                             trx_wait_binlog_pos);
+
+  /* The lock held will be released by thd_exit_cond, so no need to
+    call unlock() here */
+  THD_EXIT_COND(NULL, & old_stage);
   return function_exit(kWho, 0);
 }
 
@@ -825,30 +865,27 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
  *
  * If semi-sync is disabled, all transactions still update the wait
  * position with the last position in binlog.  But no transactions will
- * wait for confirmations and the active transaction list would not be
- * maintained.  In binlog dump thread, updateSyncHeader() checks whether
- * the current sending event catches up with last wait position.  If it
- * does match, semi-sync will be switched on again.
+ * wait for confirmations maintained.  In binlog dump thread,
+ * updateSyncHeader() checks whether the current sending event catches
+ * up with last wait position.  If it does match, semi-sync will be
+ * switched on again.
  */
 int ReplSemiSyncMaster::switch_off()
 {
   const char *kWho = "ReplSemiSyncMaster::switch_off";
-  int result;
 
   function_enter(kWho);
   state_ = false;
 
-  /* Clear the active transaction list. */
-  assert(active_tranxs_ != NULL);
-  result = active_tranxs_->clear_active_tranx_nodes(NULL, 0);
-
   rpl_semi_sync_master_off_times++;
   wait_file_name_inited_   = false;
   reply_file_name_inited_  = false;
   sql_print_information("Semi-sync replication switched OFF.");
-  cond_broadcast();                            /* wake up all waiting threads */
 
-  return function_exit(kWho, result);
+  /* signal waiting sessions */
+  active_tranxs_->signal_waiting_sessions_all();
+
+  return function_exit(kWho, 0);
 }
 
 int ReplSemiSyncMaster::try_switch_on(int server_id,
index 6f7cd45e0aab9426d0e84a1fc33c62ff02701caa..ab446d2315bea4211de45a3f8d0eaebc753d164e 100644 (file)
@@ -1,6 +1,5 @@
 /* Copyright (C) 2007 Google Inc.
-   Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
-   Use is subject to license terms.
+   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
@@ -30,7 +29,9 @@ extern PSI_stage_info stage_waiting_for_semi_sync_ack_from_slave;
 
 struct TranxNode {
   char             log_name_[FN_REFLEN];
-  my_off_t          log_pos_;
+  my_off_t         log_pos_;
+  mysql_cond_t     cond;
+  int              n_waiters;
   struct TranxNode *next_;            /* the next node in the sorted list */
   struct TranxNode *hash_next_;    /* the next node during hash collision */
 };
@@ -128,6 +129,7 @@ public:
     trx_node->log_pos_= 0;
     trx_node->next_= 0;
     trx_node->hash_next_= 0;
+    trx_node->n_waiters= 0;
     return trx_node;
   }
 
@@ -246,6 +248,12 @@ private:
       /* New Block is always the current_block */
       current_block= block;
       ++block_num;
+
+      for (int i=0; i< BLOCK_TRANX_NODES; i++)
+        mysql_cond_init(key_ss_cond_COND_binlog_send_,
+                        &current_block->nodes[i].cond,
+                        NULL);
+
       return 0;
     }
     return 1;
@@ -257,6 +265,8 @@ private:
    */
   void free_block(Block *block)
   {
+    for (int i=0; i< BLOCK_TRANX_NODES; i++)
+      mysql_cond_destroy(&block->nodes[i].cond);
     my_free(block);
     --block_num;
   }
@@ -330,6 +340,11 @@ private:
   }
 
 public:
+  int signal_waiting_sessions_all();
+  int signal_waiting_sessions_up_to(const char *log_file_name,
+                                    my_off_t log_file_pos);
+  TranxNode* find_active_tranx_node(const char *log_file_name,
+                                    my_off_t log_file_pos);
   ActiveTranx(mysql_mutex_t *lock, unsigned long trace_level);
   ~ActiveTranx();
 
@@ -362,6 +377,17 @@ public:
   static int compare(const char *log_file_name1, my_off_t log_file_pos1,
                      const char *log_file_name2, my_off_t log_file_pos2);
 
+  /* Find out if active tranx node list is empty or not
+   *
+   * Return:
+   *   True :  If there are no nodes
+   *   False:  othewise
+  */
+  bool is_empty()
+  {
+    return (trx_front_ == NULL);
+  }
+
 };
 
 /**
@@ -376,11 +402,6 @@ class ReplSemiSyncMaster
   /* True when initObject has been called */
   bool init_done_;
 
-  /* This cond variable is signaled when enough binlog has been sent to slave,
-   * so that a waiting trx can return the 'ok' to the client for a commit.
-   */
-  mysql_cond_t  COND_binlog_send_;
-
   /* Mutex that protects the following state variables and the active
    * transaction list.
    * Under no cirumstances we can acquire mysql_bin_log.LOCK_log if we are
@@ -434,8 +455,6 @@ class ReplSemiSyncMaster
 
   void lock();
   void unlock();
-  void cond_broadcast();
-  int  cond_timewait(struct timespec *wait_time);
 
   /* Is semi-sync replication on? */
   bool is_on() {
index ea4450fc06c060afb1e679b90d066519396e47ff..8eb11fbeccc74f18121f3fc2fcb33cbcd95cf2f6 100644 (file)
@@ -498,7 +498,8 @@ char *should;
                                (sub.rm_so != -1 && sub.rm_eo == -1) ||
                                (sub.rm_so != -1 && sub.rm_so < 0) ||
                                (sub.rm_eo != -1 && sub.rm_eo < 0) ) {
-               sprintf(grump, "start %ld end %ld", (long)sub.rm_so,
+               snprintf(grump, sizeof(grump),
+                        "start %ld end %ld", (long)sub.rm_so,
                                                        (long)sub.rm_eo);
                return(grump);
        }
@@ -511,7 +512,8 @@ char *should;
 
        /* check for in range */
        if ((int) sub.rm_eo > (int) strlen(str)) {
-               sprintf(grump, "start %ld end %ld, past end of string",
+               snprintf(grump, sizeof(grump),
+                        "start %ld end %ld, past end of string",
                                        (long)sub.rm_so, (long)sub.rm_eo);
                return(grump);
        }
@@ -522,13 +524,15 @@ char *should;
 
        /* check for not supposed to match */
        if (should == NULL) {
-               sprintf(grump, "matched `%.*s'", len, p);
+               snprintf(grump, sizeof(grump),
+                        "matched `%.*s'", len, p);
                return(grump);
        }
 
        /* check for wrong match */
        if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) {
-               sprintf(grump, "matched `%.*s' instead", len, p);
+               snprintf(grump, sizeof(grump),
+                        "matched `%.*s' instead", len, p);
                return(grump);
        }
        if (shlen > 0)
@@ -541,7 +545,8 @@ char *should;
        if (shlen == 0)
                shlen = 1;      /* force check for end-of-string */
        if (strncmp(p, at, shlen) != 0) {
-               sprintf(grump, "matched null at `%.20s'", p);
+               snprintf(grump, sizeof(grump),
+                        "matched null at `%.20s'", p);
                return(grump);
        }
        return(NULL);
@@ -574,7 +579,7 @@ char *name;
        static char efbuf[100];
        my_regex_t re;
 
-       sprintf(efbuf, "MY_REG_%s", name);
+       snprintf(efbuf, sizeof(efbuf), "MY_REG_%s", name);
        assert(strlen(efbuf) < sizeof(efbuf));
        re.re_endp = efbuf;
        (void) my_regerror(MY_REG_ATOI, &re, efbuf, sizeof(efbuf));
index 6fdaf4507ab507dfad3eda285358f8878866fa53..727082871aba2d3dfddd1abfaceeef2d2d54090d 100644 (file)
@@ -1,3 +1,11 @@
+/* Copyright 1992, 1993, 1994 Henry Spencer.  All rights reserved.
+   See file COPYRIGHT for details.
+
+   This file was modified by Oracle on 2015-05-18 for 32-bit compatibility.
+
+   Modifications copyright (c) 2015, Oracle and/or its affiliates. All rights
+   reserved. */
+
 #include <my_global.h>
 #include <m_string.h>
 #include <m_ctype.h>
@@ -133,12 +141,26 @@ const CHARSET_INFO *charset;
        } else
                len = strlen((char *)pattern);
 
+       /*
+        Find the maximum len we can safely process
+        without a rollover and a mis-malloc.
+        p->ssize is a sopno is a long (32+ bit signed);
+        size_t is 16+ bit unsigned.
+       */
+       {
+         size_t new_ssize = len / (size_t)2 * (size_t)3 + (size_t)1; /* ugh */
+         if ((new_ssize < len) ||      /* size_t rolled over */
+             ((SIZE_T_MAX / sizeof(sop)) < new_ssize) ||       /* malloc arg */
+             (new_ssize > LONG_MAX))   /* won't fit in ssize */
+               return(MY_REG_ESPACE);  /* MY_REG_ESPACE or MY_REG_INVARG */
+         p->ssize = new_ssize;
+       }
+
        /* do the mallocs early so failure handling is easy */
        g = (struct re_guts *)malloc(sizeof(struct re_guts) +
                                                        (NC-1)*sizeof(cat_t));
        if (g == NULL)
                return(MY_REG_ESPACE);
-       p->ssize = (long) (len/(size_t)2*(size_t)3 + (size_t)1); /* ugh */
        p->strip = (sop *)malloc(p->ssize * sizeof(sop));
        p->slen = 0;
        if (p->strip == NULL) {
index c043f078bb23a4645532f28d65532964676b5b96..265f81f2755aca7d4dd1ce00f818a2ca136d7a70 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2014, 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
@@ -105,6 +105,25 @@ ELSE()
     "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
 ENDIF()
 
+STRING(REGEX REPLACE "--param=[-=a-z0-9]*"           "" CFLAGS "${CFLAGS}")
+STRING(REGEX REPLACE "-specs=[-A-Za-z0-9/]*"         "" CFLAGS "${CFLAGS}")
+STRING(REGEX REPLACE "-DMY_PTHREAD_FASTMUTEX[=0-9]*" "" CFLAGS "${CFLAGS}")
+STRING(REGEX REPLACE "-Werror=[-A-Za-z]*"            "" CFLAGS "${CFLAGS}")
+STRING(REGEX REPLACE "-Wp,[-=_A-Za-z0-9]*"           "" CFLAGS "${CFLAGS}")
+STRING(REPLACE       "-fstack-protector-strong"      "" CFLAGS "${CFLAGS}")
+STRING(REPLACE       "-grecord-gcc-switches"         "" CFLAGS "${CFLAGS}")
+STRING(REPLACE       "-pipe"                         "" CFLAGS "${CFLAGS}")
+STRING(REPLACE       "-fexceptions"                  "" CFLAGS "${CFLAGS}")
+
+STRING(REGEX REPLACE "--param=[-=a-z0-9]*"           "" CXXFLAGS "${CXXFLAGS}")
+STRING(REGEX REPLACE "-specs=[-A-Za-z0-9/]*"         "" CXXFLAGS "${CXXFLAGS}")
+STRING(REGEX REPLACE "-DMY_PTHREAD_FASTMUTEX[=0-9]*" "" CXXFLAGS "${CXXFLAGS}")
+STRING(REGEX REPLACE "-Werror=[-A-Za-z]*"            "" CXXFLAGS "${CXXFLAGS}")
+STRING(REGEX REPLACE "-Wp,[-=_A-Za-z0-9]*"           "" CXXFLAGS "${CXXFLAGS}")
+STRING(REPLACE       "-fstack-protector-strong"      "" CXXFLAGS "${CXXFLAGS}")
+STRING(REPLACE       "-grecord-gcc-switches"         "" CXXFLAGS "${CXXFLAGS}")
+STRING(REPLACE       "-pipe"                         "" CXXFLAGS "${CXXFLAGS}")
+
 IF(UNIX)
   # FIND_PROC and CHECK_PID are used by mysqld_safe
 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
@@ -320,6 +339,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 +367,7 @@ ELSE()
     mysqldumpslow
     mysqld_multi
     mysqld_safe
+    ${WSREP_BINARIES}
   )
   FOREACH(file ${BIN_SCRIPTS})
     IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh)
index fda0b9c41c8ead9611f0d443a439701f44434372..4ff8c9e4670ff026a20352ea03a209fc74c7792a 100644 (file)
--- Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
---
+-- Copyright (C) 2005 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.
-
--- DO NOT EDIT THIS FILE. It is generated automatically by the MySQL docs
--- team. If you require changes to the format of this file, contact the
--- docs team.
-
--- File generation date: 2015-01-16
--- MySQL series: 5.6
--- Document repository revision: 41302
-
--- To use this file, load its contents into the mysql database. For example,
--- with the mysql client program, process the file like this, where
--- file_name is the name of this file:
-
---     mysql -u root -p mysql < file_name
-
-SET NAMES 'utf8';
-
-TRUNCATE TABLE help_topic;
-TRUNCATE TABLE help_category;
-TRUNCATE TABLE help_keyword;
-TRUNCATE TABLE help_relation;
-
-START TRANSACTION;
-
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (1,'Geographic',0,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (2,'Polygon properties',35,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (3,'Numeric Functions',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (4,'WKT',35,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (5,'Plugins',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (6,'Control flow functions',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (7,'MBR',35,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (8,'Transactions',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (9,'Help Metadata',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (10,'Account Management',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (11,'Point properties',35,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (12,'Encryption Functions',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (13,'LineString properties',35,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (14,'Miscellaneous Functions',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (15,'Logical operators',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (16,'Functions and Modifiers for Use with GROUP BY',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (17,'Information Functions',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (18,'Storage Engines',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (19,'Bit Functions',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (20,'Comparison operators',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (21,'Table Maintenance',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (22,'User-Defined Functions',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (23,'Data Types',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (24,'Compound Statements',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (25,'Geometry constructors',35,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (26,'GeometryCollection properties',1,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (27,'Administration',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (28,'Data Manipulation',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (29,'Utility',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (30,'Language Structure',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (31,'Geometry relations',35,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (32,'Date and Time Functions',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (33,'WKB',35,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (34,'Procedures',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (35,'Geographic Features',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (36,'Contents',0,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (37,'Geometry properties',35,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (38,'String Functions',39,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (39,'Functions',36,'');
-INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (40,'Data Definition',36,'');
-
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (0,28,'JOIN','MySQL supports the following JOIN syntaxes for the table_references\npart of SELECT statements and multiple-table DELETE and UPDATE\nstatements:\n\ntable_references:\n    escaped_table_reference [, escaped_table_reference] ...\n\nescaped_table_reference:\n    table_reference\n  | { OJ table_reference }\n\ntable_reference:\n    table_factor\n  | join_table\n\ntable_factor:\n    tbl_name [PARTITION (partition_names)] \n        [[AS] alias] [index_hint_list]\n  | table_subquery [AS] alias\n  | ( table_references )\n\njoin_table:\n    table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n  | table_reference STRAIGHT_JOIN table_factor\n  | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n  | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n  | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n    ON conditional_expr\n  | USING (column_list)\n\nindex_hint_list:\n    index_hint [, index_hint] ...\n\nindex_hint:\n    USE {INDEX|KEY}\n      [FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n  | IGNORE {INDEX|KEY}\n      [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n  | FORCE {INDEX|KEY}\n      [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n    index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nIn MySQL 5.6.2 and later, a table reference (when it refers to a\npartitioned table) may contain a PARTITION option, including a\ncomma-separated list of partitions, subpartitions, or both. This option\nfollows the name of the table and precedes any alias declaration. The\neffect of this option is that rows are selected only from the listed\npartitions or subpartitions---in other words, any partitions or\nsubpartitions not named in the list are ignored For more information,\nsee http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html.\n\nThe syntax of table_factor is extended in comparison with the SQL\nStandard. The latter accepts only table_reference, not a list of them\ninside a pair of parentheses.\n\nThis is a conservative extension if we consider each comma in a list of\ntable_reference items as equivalent to an inner join. For example:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n                 ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n                 ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nIn MySQL, JOIN, CROSS JOIN, and INNER JOIN are syntactic equivalents\n(they can replace each other). In standard SQL, they are not\nequivalent. INNER JOIN is used with an ON clause, CROSS JOIN is used\notherwise.\n\nIn general, parentheses can be ignored in join expressions containing\nonly inner join operations. MySQL also supports nested joins (see\nhttp://dev.mysql.com/doc/refman/5.6/en/nested-join-optimization.html).\n\nIndex hints can be specified to affect how the MySQL optimizer makes\nuse of indexes. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/index-hints.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/join.html\n\n','SELECT left_tbl.*\n  FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n  WHERE right_tbl.id IS NULL;\n','http://dev.mysql.com/doc/refman/5.6/en/join.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (1,38,'HEX','Syntax:\nHEX(str), HEX(N)\n\nFor a string argument str, HEX() returns a hexadecimal string\nrepresentation of str where each byte of each character in str is\nconverted to two hexadecimal digits. (Multibyte characters therefore\nbecome more than two digits.) The inverse of this operation is\nperformed by the UNHEX() function.\n\nFor a numeric argument N, HEX() returns a hexadecimal string\nrepresentation of the value of N treated as a longlong (BIGINT) number.\nThis is equivalent to CONV(N,10,16). The inverse of this operation is\nperformed by CONV(HEX(N),16,10).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT 0x616263, HEX(\'abc\'), UNHEX(HEX(\'abc\'));\n        -> \'abc\', 616263, \'abc\'\nmysql> SELECT HEX(255), CONV(HEX(255),16,10);\n        -> \'FF\', 255\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (2,31,'CONTAINS','Contains(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2. This\ntests the opposite relationship as Within().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (3,37,'SRID','SRID(g)\n\nReturns an integer indicating the Spatial Reference System ID for the\ngeometry value g.\n\nIn MySQL, the SRID value is just an integer associated with the\ngeometry value. All calculations are done assuming Euclidean (planar)\ngeometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','mysql> SELECT SRID(GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------+\n| SRID(GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------+\n|                                           101 |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (4,27,'SHOW CONTRIBUTORS','Syntax:\nSHOW CONTRIBUTORS\n\nThe SHOW CONTRIBUTORS statement displays information about the people\nwho contribute to MySQL source or to causes that we support. For each\ncontributor, it displays Name, Location, and Comment values.\n\nThis statement is removed as of MySQL 5.6.8.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-contributors.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-contributors.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (5,16,'VARIANCE','Syntax:\nVARIANCE(expr)\n\nReturns the population standard variance of expr. This is an extension\nto standard SQL. The standard SQL function VAR_POP() can be used\ninstead.\n\nVARIANCE() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (6,40,'DROP SERVER','Syntax:\nDROP SERVER [ IF EXISTS ] server_name\n\nDrops the server definition for the server named server_name. The\ncorresponding row in the mysql.servers table is deleted. This statement\nrequires the SUPER privilege.\n\nDropping a server for a table does not affect any FEDERATED tables that\nused this connection information when they were created. See [HELP\nCREATE SERVER].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-server.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-server.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (7,27,'SHOW AUTHORS','Syntax:\nSHOW AUTHORS\n\nThe SHOW AUTHORS statement displays information about the people who\nwork on MySQL. For each author, it displays Name, Location, and Comment\nvalues.\n\nThis statement is removed as of MySQL 5.6.8.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-authors.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-authors.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (8,38,'CONCAT','Syntax:\nCONCAT(str1,str2,...)\n\nReturns the string that results from concatenating the arguments. May\nhave one or more arguments. If all arguments are nonbinary strings, the\nresult is a nonbinary string. If the arguments include any binary\nstrings, the result is a binary string. A numeric argument is converted\nto its equivalent nonbinary string form.\n\nCONCAT() returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT CONCAT(\'My\', \'S\', \'QL\');\n        -> \'MySQL\'\nmysql> SELECT CONCAT(\'My\', NULL, \'QL\');\n        -> NULL\nmysql> SELECT CONCAT(14.3);\n        -> \'14.3\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (9,35,'GEOMETRY HIERARCHY','Geometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and\ntwo-dimensional geometric objects that exist in two-dimensional\ncoordinate space. All instantiable geometry classes are defined so that\nvalid instances of a geometry class are topologically closed (that is,\nall defined geometries include their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\no Point represents zero-dimensional objects.\n\no Curve represents one-dimensional objects, and has subclass\n  LineString, with sub-subclasses Line and LinearRing.\n\no Surface is designed for two-dimensional objects and has subclass\n  Polygon.\n\no GeometryCollection has specialized zero-, one-, and two-dimensional\n  collection classes named MultiPoint, MultiLineString, and\n  MultiPolygon for modeling geometries corresponding to collections of\n  Points, LineStrings, and Polygons, respectively. MultiCurve and\n  MultiSurface are introduced as abstract superclasses that generalize\n  the collection interfaces to handle Curves and Surfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnoninstantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint,\nMultiLineString, and MultiPolygon are instantiable classes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-geometry-class-hierarchy.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-geometry-class-hierarchy.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (10,38,'CHAR FUNCTION','Syntax:\nCHAR(N,... [USING charset_name])\n\nCHAR() interprets each argument N as an integer and returns a string\nconsisting of the characters given by the code values of those\nintegers. NULL values are skipped.\nBy default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nmysql> SELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));\n+---------------------+--------------------------------+\n| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |\n+---------------------+--------------------------------+\n| binary              | utf8                           |\n+---------------------+--------------------------------+\n\nIf USING is given and the result string is illegal for the given\ncharacter set, a warning is issued. Also, if strict SQL mode is\nenabled, the result from CHAR() becomes NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT CHAR(77,121,83,81,\'76\');\n        -> \'MySQL\'\nmysql> SELECT CHAR(77,77.3,\'77.3\');\n        -> \'MMM\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (11,7,'ASYMMETRIC_DECRYPT','Syntax:\nASYMMETRIC_DECRYPT(algorithm, crypt_str, key_str)\n\nDecrypts an encrypted string using the given algorithm and key string,\nand returns the resulting plaintext as a binary string. If decryption\nfails, the result is NULL.\n\nkey_str must be a valid key string in PEM format. For successful\ndecryption, it must be the public or private key string corresponding\nto the private or public key string used with ASYMMETRIC_ENCRYPT() to\nproduce the encrypted string. algorithm indicates the encryption\nalgorithm used to create the key.\n\nSupported algorithm values: \'RSA\'\n\nFor a usage example, see the description of ASYMMETRIC_ENCRYPT().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (12,27,'SHOW CREATE TRIGGER','Syntax:\nSHOW CREATE TRIGGER trigger_name\n\nThis statement shows the CREATE TRIGGER statement that creates the\nnamed trigger.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-create-trigger.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (13,27,'SHOW CREATE PROCEDURE','Syntax:\nSHOW CREATE PROCEDURE proc_name\n\nThis statement is a MySQL extension. It returns the exact string that\ncan be used to re-create the named stored procedure. A similar\nstatement, SHOW CREATE FUNCTION, displays information about stored\nfunctions (see [HELP SHOW CREATE FUNCTION]).\n\nTo use either statement, you must be the user named in the routine\nDEFINER clause or have SELECT access to the mysql.proc table. If you do\nnot have privileges for the routine itself, the value displayed for the\nCreate Procedure or Create Function field will be NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-procedure.html\n\n','mysql> SHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row ***************************\n           Procedure: simpleproc\n            sql_mode:\n    Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n                      BEGIN\n                      SELECT COUNT(*) INTO param1 FROM t;\n                      END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n\nmysql> SHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n            Function: hello\n            sql_mode:\n     Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n                      RETURNS CHAR(50)\n                      RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-procedure.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (14,24,'OPEN','Syntax:\nOPEN cursor_name\n\nThis statement opens a previously declared cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/open.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/open.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (15,31,'ST_INTERSECTS','ST_Intersects(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially intersects g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (16,38,'LOWER','Syntax:\nLOWER(str)\n\nReturns the string str with all characters changed to lowercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT LOWER(\'QUADRATICALLY\');\n        -> \'quadratically\'\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings\n(BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert\nthe string to a nonbinary string:\n\nmysql> SET @str = BINARY \'New York\';\nmysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+-------------+-----------------------------------+\n| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |\n+-------------+-----------------------------------+\n| New York    | new york                          |\n+-------------+-----------------------------------+\n\nFor Unicode character sets, LOWER() and UPPER() work accounting to\nUnicode Collation Algorithm (UCA) 5.2.0 for xxx_unicode_520_ci\ncollations and for language-specific collations that are derived from\nthem. For other Unicode collations, LOWER() and UPPER() work accounting\nto Unicode Collation Algorithm (UCA) 4.0.0. See\nhttp://dev.mysql.com/doc/refman/5.6/en/charset-unicode-sets.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (17,40,'CREATE TRIGGER','Syntax:\nCREATE\n    [DEFINER = { user | CURRENT_USER }]\n    TRIGGER trigger_name\n    trigger_time trigger_event\n    ON tbl_name FOR EACH ROW\n    trigger_body\n\ntrigger_time: { BEFORE | AFTER }\n\ntrigger_event: { INSERT | UPDATE | DELETE }\n\nThis statement creates a new trigger. A trigger is a named database\nobject that is associated with a table, and that activates when a\nparticular event occurs for the table. The trigger becomes associated\nwith the table named tbl_name, which must refer to a permanent table.\nYou cannot associate a trigger with a TEMPORARY table or a view.\n\nTrigger names exist in the schema namespace, meaning that all triggers\nmust have unique names within a schema. Triggers in different schemas\ncan have the same name.\n\nThis section describes CREATE TRIGGER syntax. For additional\ndiscussion, see\nhttp://dev.mysql.com/doc/refman/5.6/en/trigger-syntax.html.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated\nwith the trigger. The statement might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section. If\nbinary logging is enabled, CREATE TRIGGER might require the SUPER\nprivilege, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-logging.html.\n\nThe DEFINER clause determines the security context to be used when\nchecking access privileges at trigger activation time, as described\nlater in this section.\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to\nindicate that the trigger activates before or after each row to be\nmodified.\n\ntrigger_event indicates the kind of operation that activates the\ntrigger. These trigger_event values are permitted:\n\no INSERT: The trigger activates whenever a new row is inserted into the\n  table; for example, through INSERT, LOAD DATA, and REPLACE\n  statements.\n\no UPDATE: The trigger activates whenever a row is modified; for\n  example, through UPDATE statements.\n\no DELETE: The trigger activates whenever a row is deleted from the\n  table; for example, through DELETE and REPLACE statements. DROP TABLE\n  and TRUNCATE TABLE statements on the table do not activate this\n  trigger, because they do not use DELETE. Dropping a partition does\n  not activate DELETE triggers, either.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-trigger.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (18,32,'MONTH','Syntax:\nMONTH(date)\n\nReturns the month for date, in the range 1 to 12 for January to\nDecember, or 0 for dates such as \'0000-00-00\' or \'2008-00-00\' that have\na zero month part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MONTH(\'2008-02-03\');\n        -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (19,7,'ASYMMETRIC_ENCRYPT','Syntax:\nASYMMETRIC_ENCRYPT(algorithm, str, key_str)\n\nEncrypts a string using the given algorithm and key string, and returns\nthe resulting ciphertext as a binary string. If encryption fails, the\nresult is NULL.\n\nThe str length cannot be greater than the key_str length - 11, in bytes\n\nkey_str must be a valid key string in PEM format. algorithm indicates\nthe encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\'\n\nTo encrypt a string, pass a private or public key string to\nASYMMETRIC_ENCRYPT(). To recover the original unencrypted string, pass\nthe encrypted string to ASYMMETRIC_DECRYPT(), along with the public or\nprivate key string correponding to the private or public key string\nused for encryption.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','-- Generate private/public key pair\nSET @priv = CREATE_ASYMMETRIC_PRIV_KEY(\'RSA\', 1024);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(\'RSA\', @priv);\n\n-- Encrypt using private key, decrypt using public key\nSET @ciphertext = ASYMMETRIC_ENCRYPT(\'RSA\', \'The quick brown fox\', @priv);\nSET @plaintext = ASYMMETRIC_DECRYPT(\'RSA\', @ciphertext, @pub);\n\n-- Encrypt using public key, decrypt using private key\nSET @ciphertext = ASYMMETRIC_ENCRYPT(\'RSA\', \'The quick brown fox\', @pub);\nSET @plaintext = ASYMMETRIC_DECRYPT(\'RSA\', @ciphertext, @priv);\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (20,27,'SHOW TRIGGERS','Syntax:\nSHOW TRIGGERS [{FROM | IN} db_name]\n    [LIKE \'pattern\' | WHERE expr]\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a\ndatabase (the default database unless a FROM clause is given). This\nstatement returns results only for databases and tables for which you\nhave the TRIGGER privilege. The LIKE clause, if present, indicates\nwhich table names to match (not trigger names) and causes the statement\nto display triggers for those tables. The WHERE clause can be given to\nselect rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nFor the trigger ins_sum as defined in\nhttp://dev.mysql.com/doc/refman/5.6/en/triggers.html, the output of\nthis statement is as shown here:\n\nmysql> SHOW TRIGGERS LIKE \'acc%\'\\G\n*************************** 1. row ***************************\n             Trigger: ins_sum\n               Event: INSERT\n               Table: account\n           Statement: SET @sum = @sum + NEW.amount\n              Timing: BEFORE\n             Created: NULL\n            sql_mode: NO_ENGINE_SUBSTITUTION\n             Definer: me@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n  Database Collation: latin1_swedish_ci\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-triggers.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-triggers.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (21,13,'ISCLOSED','IsClosed(ls)\n\nReturns 1 if the LineString value ls is closed (that is, its\nStartPoint() and EndPoint() values are the same) and is simple (does\nnot pass through the same point more than once). Returns 0 if ls is not\nclosed, and -1 if it is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls1 = \'LineString(1 1,2 2,3 3,2 2)\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SET @ls2 = \'LineString(1 1,2 2,3 3,1 1)\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT IsClosed(GeomFromText(@ls1));\n+------------------------------+\n| IsClosed(GeomFromText(@ls1)) |\n+------------------------------+\n|                            0 |\n+------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT IsClosed(GeomFromText(@ls2));\n+------------------------------+\n| IsClosed(GeomFromText(@ls2)) |\n+------------------------------+\n|                            1 |\n+------------------------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (22,38,'REGEXP','Syntax:\nexpr REGEXP pat, expr RLIKE pat\n\nPerforms a pattern match of a string expression expr against a pattern\npat. The pattern can be an extended regular expression, the syntax for\nwhich is discussed later in this section. Returns 1 if expr matches\npat; otherwise it returns 0. If either expr or pat is NULL, the result\nis NULL. RLIKE is a synonym for REGEXP, provided for mSQL\ncompatibility.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\n*Note*: Because MySQL uses the C escape syntax in strings (for example,\n"\\n" to represent the newline character), you must double any "\\" that\nyou use in your REGEXP strings.\n\nREGEXP is not case sensitive, except when used with binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/regexp.html\n\n','mysql> SELECT \'Monty!\' REGEXP \'.*\';\n        -> 1\nmysql> SELECT \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\';\n        -> 1\nmysql> SELECT \'a\' REGEXP \'A\', \'a\' REGEXP BINARY \'A\';\n        -> 1  0\nmysql> SELECT \'a\' REGEXP \'^[a-d]\';\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/regexp.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (23,24,'IF STATEMENT','Syntax:\nIF search_condition THEN statement_list\n    [ELSEIF search_condition THEN statement_list] ...\n    [ELSE statement_list]\nEND IF\n\nThe IF statement for stored programs implements a basic conditional\nconstruct.\n\n*Note*: There is also an IF() function, which differs from the IF\nstatement described here. See\nhttp://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html. The\nIF statement can have THEN, ELSE, and ELSEIF clauses, and it is\nterminated with END IF.\n\nIf the search_condition evaluates to true, the corresponding THEN or\nELSEIF clause statement_list executes. If no search_condition matches,\nthe ELSE clause statement_list executes.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/if.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/if.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (24,12,'VALIDATE_PASSWORD_STRENGTH','Syntax:\nVALIDATE_PASSWORD_STRENGTH(str)\n\nGiven an argument representing a cleartext password, this function\nreturns an integer to indicate how strong the password is. The return\nvalue ranges from 0 (weak) to 100 (strong).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (25,31,'WITHIN','Within(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This\ntests the opposite relationship as Contains().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (26,27,'SHOW PLUGINS','Syntax:\nSHOW PLUGINS\n\nSHOW PLUGINS displays information about server plugins. Plugin\ninformation is also available in the INFORMATION_SCHEMA.PLUGINS table.\nSee http://dev.mysql.com/doc/refman/5.6/en/plugins-table.html.\n\nExample of SHOW PLUGINS output:\n\nmysql> SHOW PLUGINS\\G\n*************************** 1. row ***************************\n   Name: binlog\n Status: ACTIVE\n   Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 2. row ***************************\n   Name: CSV\n Status: ACTIVE\n   Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 3. row ***************************\n   Name: MEMORY\n Status: ACTIVE\n   Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 4. row ***************************\n   Name: MyISAM\n Status: ACTIVE\n   Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n...\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-plugins.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-plugins.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (27,8,'PREPARE','Syntax:\nPREPARE stmt_name FROM preparable_stmt\n\nThe PREPARE statement prepares a SQL statement and assigns it a name,\nstmt_name, by which to refer to the statement later. The prepared\nstatement is executed with EXECUTE and released with DEALLOCATE\nPREPARE. For examples, see\nhttp://dev.mysql.com/doc/refman/5.6/en/sql-syntax-prepared-statements.h\ntml.\n\nStatement names are not case sensitive. preparable_stmt is either a\nstring literal or a user variable that contains the text of the SQL\nstatement. The text must represent a single statement, not multiple\nstatements. Within the statement, ? characters can be used as parameter\nmarkers to indicate where data values are to be bound to the query\nlater when you execute it. The ? characters should not be enclosed\nwithin quotation marks, even if you intend to bind them to string\nvalues. Parameter markers can be used only where data values should\nappear, not for SQL keywords, identifiers, and so forth.\n\nIf a prepared statement with the given name already exists, it is\ndeallocated implicitly before the new statement is prepared. This means\nthat if the new statement contains an error and cannot be prepared, an\nerror is returned and no statement with the given name exists.\n\nThe scope of a prepared statement is the session within which it is\ncreated, which as several implications:\n\no A prepared statement created in one session is not available to other\n  sessions.\n\no When a session ends, whether normally or abnormally, its prepared\n  statements no longer exist. If auto-reconnect is enabled, the client\n  is not notified that the connection was lost. For this reason,\n  clients may wish to disable auto-reconnect. See\n  http://dev.mysql.com/doc/refman/5.6/en/auto-reconnect.html.\n\no A prepared statement created within a stored program continues to\n  exist after the program finishes executing and can be executed\n  outside the program later.\n\no A statement prepared in stored program context cannot refer to stored\n  procedure or function parameters or local variables because they go\n  out of scope when the program ends and would be unavailable were the\n  statement to be executed later outside the program. As a workaround,\n  refer instead to user-defined variables, which also have session\n  scope; see\n  http://dev.mysql.com/doc/refman/5.6/en/user-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/prepare.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (28,8,'LOCK','Syntax:\nLOCK TABLES\n    tbl_name [[AS] alias] lock_type\n    [, tbl_name [[AS] alias] lock_type] ...\n\nlock_type:\n    READ [LOCAL]\n  | [LOW_PRIORITY] WRITE\n\nUNLOCK TABLES\n\nMySQL enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to\nprevent other sessions from modifying tables during periods when a\nsession requires exclusive access to them. A session can acquire or\nrelease locks only for itself. One session cannot acquire locks for\nanother session or release locks held by another session.\n\nLocks may be used to emulate transactions or to get more speed when\nupdating tables. This is explained in more detail later in this\nsection.\n\nLOCK TABLES explicitly acquires table locks for the current client\nsession. Table locks can be acquired for base tables or views. You must\nhave the LOCK TABLES privilege, and the SELECT privilege for each\nobject to be locked.\n\nFor view locking, LOCK TABLES adds all base tables used in the view to\nthe set of tables to be locked and locks them automatically. If you\nlock a table explicitly with LOCK TABLES, any tables used in triggers\nare also locked implicitly, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/lock-tables-and-triggers.html.\n\nUNLOCK TABLES explicitly releases any table locks held by the current\nsession. LOCK TABLES implicitly releases any table locks held by the\ncurrent session before acquiring new locks.\n\nAnother use for UNLOCK TABLES is to release the global read lock\nacquired with the FLUSH TABLES WITH READ LOCK statement, which enables\nyou to lock all tables in all databases. See [HELP FLUSH]. (This is a\nvery convenient way to get backups if you have a file system such as\nVeritas that can take snapshots in time.)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/lock-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/lock-tables.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (29,27,'SHOW BINARY LOGS','Syntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [HELP PURGE BINARY LOGS], that shows\nhow to determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name      | File_size |\n+---------------+-----------+\n| binlog.000015 |    724935 |\n| binlog.000016 |    733481 |\n+---------------+-----------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-binary-logs.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-binary-logs.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (30,25,'POLYGON','Polygon(ls1,ls2,...)\n\nConstructs a Polygon value from a number of LineString or WKB\nLineString arguments. If any argument does not represent a LinearRing\n(that is, not a closed and simple LineString), the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (31,32,'MINUTE','Syntax:\nMINUTE(time)\n\nReturns the minute for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MINUTE(\'2008-02-03 10:05:03\');\n        -> 5\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (32,38,'MID','Syntax:\nMID(str,pos,len)\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (33,17,'CONNECTION_ID','Syntax:\nCONNECTION_ID()\n\nReturns the connection ID (thread ID) for the connection. Every\nconnection has an ID that is unique among the set of currently\nconnected clients.\n\nThe value returned by CONNECTION_ID() is the same type of value as\ndisplayed in the ID column of the INFORMATION_SCHEMA.PROCESSLIST table,\nthe Id column of SHOW PROCESSLIST output, and the PROCESSLIST_ID column\nof the Performance Schema threads table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT CONNECTION_ID();\n        -> 23786\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (34,38,'FROM_BASE64()','Syntax:\nFROM_BASE64(str)\n\nTakes a string encoded with the base-64 encoded rules used by\nTO_BASE64() and returns the decoded result as a binary string. The\nresult is NULL if the argument is NULL or not a valid base-64 string.\nSee the description of TO_BASE64() for details about the encoding and\ndecoding rules.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n        -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (35,28,'DELETE','Syntax:\nDELETE is a DML statement that removes rows from a table.\n\nSingle-Table Syntax\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name\n    [PARTITION (partition_name,...)]\n    [WHERE where_condition]\n    [ORDER BY ...]\n    [LIMIT row_count]\n\nThe DELETE statement deletes rows from tbl_name and returns the number\nof deleted rows. To check the number of deleted rows, call the\nROW_COUNT() function described in\nhttp://dev.mysql.com/doc/refman/5.6/en/information-functions.html.\n\nMain Clauses\n\nThe conditions in the optional WHERE clause identify which rows to\ndelete. With no WHERE clause, all rows are deleted.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe deleted. It is specified as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nIf the ORDER BY clause is specified, the rows are deleted in the order\nthat is specified. The LIMIT clause places a limit on the number of\nrows that can be deleted. These clauses apply to single-table deletes,\nbut not multi-table deletes.\n\nMultiple-Table Syntax\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n    tbl_name[.*] [, tbl_name[.*]] ...\n    FROM table_references\n    [WHERE where_condition]\n\nOr:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n    FROM tbl_name[.*] [, tbl_name[.*]] ...\n    USING table_references\n    [WHERE where_condition]\n\nPrivileges\n\nYou need the DELETE privilege on a table to delete rows from it. You\nneed only the SELECT privilege for any columns that are only read, such\nas those named in the WHERE clause.\n\nPerformance\n\nWhen you do not need to know the number of deleted rows, the TRUNCATE\nTABLE statement is a faster way to empty a table than a DELETE\nstatement with no WHERE clause. Unlike DELETE, TRUNCATE TABLE cannot be\nused within a transaction or if you have a lock on the table. See [HELP\nTRUNCATE TABLE] and [HELP LOCK].\n\nThe speed of delete operations may also be affected by factors\ndiscussed in http://dev.mysql.com/doc/refman/5.6/en/delete-speed.html.\n\nTo ensure that a given DELETE statement does not take too much time,\nthe MySQL-specific LIMIT row_count clause for DELETE specifies the\nmaximum number of rows to be deleted. If the number of rows to delete\nis larger than the limit, repeat the DELETE statement until the number\nof affected rows is less than the LIMIT value.\n\nSubqueries\n\nCurrently, you cannot delete from a table and select from the same\ntable in a subquery.\n\nPartitioned Tables\n\nBeginning with MySQL 5.6.2, DELETE supports explicit partition\nselection using the PARTITION option, which takes a comma-separated\nlist of the names of one or more partitions or subpartitions (or both)\nfrom which to select rows to be dropped. Partitions not included in the\nlist are ignored. Given a partitioned table t with a partition named\np0, executing the statement DELETE FROM t PARTITION (p0) has the same\neffect on the table as executing ALTER TABLE t TRUNCATE PARTITION (p0);\nin both cases, all rows in partition p0 are dropped.\n\nPARTITION can be used along with a WHERE condition, in which case the\ncondition is tested only on rows in the listed partitions. For example,\nDELETE FROM t PARTITION (p0) WHERE c < 5 deletes rows only from\npartition p0 for which the condition c < 5 is true; rows in any other\npartitions are not checked and thus not affected by the DELETE.\n\nThe PARTITION option can also be used in multiple-table DELETE\nstatements. You can use up to one such option per table named in the\nFROM option.\n\nSee http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html,\nfor more information and examples.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/delete.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/delete.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (36,24,'CLOSE','Syntax:\nCLOSE cursor_name\n\nThis statement closes a previously opened cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nAn error occurs if the cursor is not open.\n\nIf not closed explicitly, a cursor is closed at the end of the BEGIN\n... END block in which it was declared.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/close.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/close.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (37,38,'REPLACE FUNCTION','Syntax:\nREPLACE(str,from_str,to_str)\n\nReturns the string str with all occurrences of the string from_str\nreplaced by the string to_str. REPLACE() performs a case-sensitive\nmatch when searching for from_str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT REPLACE(\'www.mysql.com\', \'w\', \'Ww\');\n        -> \'WwWwWw.mysql.com\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (38,29,'USE','Syntax:\nUSE db_name\n\nThe USE db_name statement tells MySQL to use the db_name database as\nthe default (current) database for subsequent statements. The database\nremains the default until the end of the session or another USE\nstatement is issued:\n\nUSE db1;\nSELECT COUNT(*) FROM mytable;   # selects from db1.mytable\nUSE db2;\nSELECT COUNT(*) FROM mytable;   # selects from db2.mytable\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/use.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/use.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (39,6,'CASE OPERATOR','Syntax:\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nThe first version returns the result where value=compare_value. The\nsecond version returns the result for the first condition that is true.\nIf there was no matching result value, the result after ELSE is\nreturned, or NULL if there is no ELSE part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT CASE 1 WHEN 1 THEN \'one\'\n    ->     WHEN 2 THEN \'two\' ELSE \'more\' END;\n        -> \'one\'\nmysql> SELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n        -> \'true\'\nmysql> SELECT CASE BINARY \'B\'\n    ->     WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (40,27,'SHOW MASTER STATUS','Syntax:\nSHOW MASTER STATUS\n\nThis statement provides status information about the binary log files\nof the master. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nExample:\n\nmysql> SHOW MASTER STATUS\\G\n*************************** 1. row ***************************\n             File: master-bin.000002\n         Position: 1307\n     Binlog_Do_DB: test\n Binlog_Ignore_DB: manual, mysql\nExecuted_Gtid_Set: 3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\n1 row in set (0.00 sec)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-master-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-master-status.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (41,32,'TO_SECONDS','Syntax:\nTO_SECONDS(expr)\n\nGiven a date or datetime expr, returns a the number of seconds since\nthe year 0. If expr is not a valid date or datetime value, returns\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TO_SECONDS(950501);\n        -> 62966505600\nmysql> SELECT TO_SECONDS(\'2009-11-29\');\n        -> 63426672000\nmysql> SELECT TO_SECONDS(\'2009-11-29 13:43:32\');\n        -> 63426721412\nmysql> SELECT TO_SECONDS( NOW() );\n        -> 63426721458\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (42,32,'TIMESTAMPDIFF','Syntax:\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nReturns datetime_expr2 - datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be\na date and the other a datetime; a date value is treated as a datetime\nhaving the time part \'00:00:00\' where necessary. The unit for the\nresult (an integer) is given by the unit argument. The legal values for\nunit are the same as those listed in the description of the\nTIMESTAMPADD() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n        -> 3\nmysql> SELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n        -> -1\nmysql> SELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n        -> 128885\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (43,35,'SPATIAL','For MyISAM tables, MySQL can create spatial indexes using syntax\nsimilar to that for creating regular indexes, but using the SPATIAL\nkeyword. Columns in spatial indexes must be declared NOT NULL. The\nfollowing examples demonstrate how to create spatial indexes:\n\no With CREATE TABLE:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g)) ENGINE=MyISAM;\n\no With ALTER TABLE:\n\nALTER TABLE geom ADD SPATIAL INDEX(g);\n\no With CREATE INDEX:\n\nCREATE SPATIAL INDEX sp_index ON geom (g);\n\nSPATIAL INDEX creates an R-tree index. For storage engines that support\nnonspatial indexing of spatial columns, the engine creates a B-tree\nindex. A B-tree index on spatial values is useful for exact-value\nlookups, but not for range scans.\n\nFor more information on indexing spatial columns, see [HELP CREATE\nINDEX].\n\nTo drop spatial indexes, use ALTER TABLE or DROP INDEX:\n\no With ALTER TABLE:\n\nALTER TABLE geom DROP INDEX g;\n\no With DROP INDEX:\n\nDROP INDEX sp_index ON geom;\n\nExample: Suppose that a table geom contains more than 32,000\ngeometries, which are stored in the column g of type GEOMETRY. The\ntable also has an AUTO_INCREMENT column fid for storing object ID\nvalues.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-indexes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-indexes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (44,38,'REVERSE','Syntax:\nREVERSE(str)\n\nReturns the string str with the order of the characters reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT REVERSE(\'abc\');\n        -> \'cba\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (45,20,'ISNULL','Syntax:\nISNULL(expr)\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT ISNULL(1+1);\n        -> 0\nmysql> SELECT ISNULL(1/0);\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (46,23,'BINARY','BINARY(M)\n\nThe BINARY type is similar to the CHAR type, but stores binary byte\nstrings rather than nonbinary character strings. M represents the\ncolumn length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (47,23,'BLOB DATA TYPE','A BLOB is a binary large object that can hold a variable amount of\ndata. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.\nThese differ only in the maximum length of the values they can hold.\nThe four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These\ncorrespond to the four BLOB types and have the same maximum lengths and\nstorage requirements. See\nhttp://dev.mysql.com/doc/refman/5.6/en/storage-requirements.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/blob.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/blob.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (48,17,'CURRENT_USER','Syntax:\nCURRENT_USER, CURRENT_USER()\n\nReturns the user name and host name combination for the MySQL account\nthat the server used to authenticate the current client. This account\ndetermines your access privileges. The return value is a string in the\nutf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT USER();\n        -> \'davida@localhost\'\nmysql> SELECT * FROM mysql.user;\nERROR 1044: Access denied for user \'\'@\'localhost\' to\ndatabase \'mysql\'\nmysql> SELECT CURRENT_USER();\n        -> \'@localhost\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (49,20,'<=','Syntax:\n<=\n\nLess than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 0.1 <= 2;\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (50,27,'SHOW PROFILES','Syntax:\nSHOW PROFILES\n\nThe SHOW PROFILES statement, together with SHOW PROFILE, displays\nprofiling information that indicates resource usage for statements\nexecuted during the course of the current session. For more\ninformation, see [HELP SHOW PROFILE].\n\n*Note*: These statements are deprecated as of MySQL 5.6.7 and will be\nremoved in a future MySQL release. Use the Performance Schema instead;\nsee http://dev.mysql.com/doc/refman/5.6/en/performance-schema.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-profiles.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-profiles.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (51,28,'UPDATE','Syntax:\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference\n    SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n    [WHERE where_condition]\n    [ORDER BY ...]\n    [LIMIT row_count]\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n    SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n    [WHERE where_condition]\n\nFor the single-table syntax, the UPDATE statement updates columns of\nexisting rows in the named table with new values. The SET clause\nindicates which columns to modify and the values they should be given.\nEach value can be given as an expression, or the keyword DEFAULT to set\na column explicitly to its default value. The WHERE clause, if given,\nspecifies the conditions that identify which rows to update. With no\nWHERE clause, all rows are updated. If the ORDER BY clause is\nspecified, the rows are updated in the order that is specified. The\nLIMIT clause places a limit on the number of rows that can be updated.\n\nFor the multiple-table syntax, UPDATE updates rows in each table named\nin table_references that satisfy the conditions. Each matching row is\nupdated once, even if it matches the conditions multiple times. For\nmultiple-table syntax, ORDER BY and LIMIT cannot be used.\n\nFor partitioned tables, both the single-single and multiple-table forms\nof this statement support the use of a PARTITION option as part of a\ntable reference. This option takes a list of one or more partitions or\nsubpartitions (or both). Only the partitions (or subpartitions) listed\nare checked for matches, and a row that is not in any of these\npartitions or subpartitions is not updated, whether it satisfies the\nwhere_condition or not.\n\n*Note*: Unlike the case when using PARTITION with an INSERT or REPLACE\nstatement, an otherwise valid UPDATE ... PARTITION statement is\nconsidered successful even if no rows in the listed partitions (or\nsubpartitions) match the where_condition.\n\nSee http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html,\nfor more information and examples.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe updated. For expression syntax, see\nhttp://dev.mysql.com/doc/refman/5.6/en/expressions.html.\n\ntable_references and where_condition are specified as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE\nthat are actually updated. You need only the SELECT privilege for any\ncolumns that are read but not modified.\n\nThe UPDATE statement supports the following modifiers:\n\no With the LOW_PRIORITY keyword, execution of the UPDATE is delayed\n  until no other clients are reading from the table. This affects only\n  storage engines that use only table-level locking (such as MyISAM,\n  MEMORY, and MERGE).\n\no With the IGNORE keyword, the update statement does not abort even if\n  errors occur during the update. Rows for which duplicate-key\n  conflicts occur on a unique key value are not updated. Rows updated\n  to values that would cause data conversion errors are updated to the\n  closest valid values instead.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/update.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/update.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (52,24,'CASE STATEMENT','Syntax:\nCASE case_value\n    WHEN when_value THEN statement_list\n    [WHEN when_value THEN statement_list] ...\n    [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n    WHEN search_condition THEN statement_list\n    [WHEN search_condition THEN statement_list] ...\n    [ELSE statement_list]\nEND CASE\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct.\n\n*Note*: There is also a CASE expression, which differs from the CASE\nstatement described here. See\nhttp://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated\nwith END CASE instead of END.\n\nFor the first syntax, case_value is an expression. This value is\ncompared to the when_value expression in each WHEN clause until one of\nthem is equal. When an equal when_value is found, the corresponding\nTHEN clause statement_list executes. If no when_value is equal, the\nELSE clause statement_list executes, if there is one.\n\nThis syntax cannot be used to test for equality with NULL because NULL\n= NULL is false. See\nhttp://dev.mysql.com/doc/refman/5.6/en/working-with-null.html.\n\nFor the second syntax, each WHEN clause search_condition expression is\nevaluated until one is true, at which point its corresponding THEN\nclause statement_list executes. If no search_condition is equal, the\nELSE clause statement_list executes, if there is one.\n\nIf no when_value or search_condition matches the value tested and the\nCASE statement contains no ELSE clause, a Case not found for CASE\nstatement error results.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nTo handle situations where no value is matched by any WHEN clause, use\nan ELSE containing an empty BEGIN ... END block, as shown in this\nexample. (The indentation used here in the ELSE clause is for purposes\nof clarity only, and is not otherwise significant.)\n\nDELIMITER |\n\nCREATE PROCEDURE p()\n  BEGIN\n    DECLARE v INT DEFAULT 1;\n\n    CASE v\n      WHEN 2 THEN SELECT v;\n      WHEN 3 THEN SELECT 0;\n      ELSE\n        BEGIN\n        END;\n    END CASE;\n  END;\n  |\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/case.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/case.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (53,8,'EXECUTE STATEMENT','Syntax:\nEXECUTE stmt_name\n    [USING @var_name [, @var_name] ...]\n\nAfter preparing a statement with PREPARE, you execute it with an\nEXECUTE statement that refers to the prepared statement name. If the\nprepared statement contains any parameter markers, you must supply a\nUSING clause that lists user variables containing the values to be\nbound to the parameters. Parameter values can be supplied only by user\nvariables, and the USING clause must name exactly as many variables as\nthe number of parameter markers in the statement.\n\nYou can execute a given prepared statement multiple times, passing\ndifferent variables to it or setting the variables to different values\nbefore each execution.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/execute.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/execute.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (54,40,'DROP INDEX','Syntax:\nDROP INDEX [ONLINE|OFFLINE] index_name ON tbl_name\n    [algorithm_option | lock_option] ...\n\nalgorithm_option:\n    ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n\nlock_option:\n    LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nDROP INDEX drops the index named index_name from the table tbl_name.\nThis statement is mapped to an ALTER TABLE statement to drop the index.\nSee [HELP ALTER TABLE].\n\nTo drop a primary key, the index name is always PRIMARY, which must be\nspecified as a quoted identifier because PRIMARY is a reserved word:\n\nDROP INDEX `PRIMARY` ON t;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-index.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (55,3,'ABS','Syntax:\nABS(X)\n\nReturns the absolute value of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ABS(2);\n        -> 2\nmysql> SELECT ABS(-32);\n        -> 32\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (56,14,'IS_IPV4','Syntax:\nIS_IPV4(expr)\n\nReturns 1 if the argument is a valid IPv4 address specified as a\nstring, 0 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4(\'10.0.5.9\'), IS_IPV4(\'10.0.5.256\');\n        -> 1, 0\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (57,33,'POLYFROMWKB','PolyFromWKB(wkb[,srid]), PolygonFromWKB(wkb[,srid])\n\nConstructs a Polygon value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (58,38,'NOT LIKE','Syntax:\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (59,38,'SPACE','Syntax:\nSPACE(N)\n\nReturns a string consisting of N space characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SPACE(6);\n        -> \'      \'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (60,16,'MAX','Syntax:\nMAX([DISTINCT] expr)\n\nReturns the maximum value of expr. MAX() may take a string argument; in\nsuch cases, it returns the maximum string value. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nMAX() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n    ->        FROM student\n    ->        GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (61,22,'CREATE FUNCTION UDF','Syntax:\nCREATE [AGGREGATE] FUNCTION function_name RETURNS {STRING|INTEGER|REAL|DECIMAL}\n    SONAME shared_library_name\n\nA user-defined function (UDF) is a way to extend MySQL with a new\nfunction that works like a native (built-in) MySQL function such as\nABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to\ninvoke the function. The RETURNS clause indicates the type of the\nfunction\'s return value. DECIMAL is a legal value after RETURNS, but\ncurrently DECIMAL functions return string values and should be written\nlike STRING functions.\n\nshared_library_name is the basename of the shared object file that\ncontains the code that implements the function. The file must be\nlocated in the plugin directory. This directory is given by the value\nof the plugin_dir system variable. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/udf-compiling.html.\n\nTo create a function, you must have the INSERT privilege for the mysql\ndatabase. This is necessary because CREATE FUNCTION adds a row to the\nmysql.func system table that records the function\'s name, type, and\nshared library name. If you do not have this table, you should run the\nmysql_upgrade command to create it. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-upgrade.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-function-udf.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (62,23,'TIMESTAMP','TIMESTAMP[(fsp)]\n\nA timestamp. The range is \'1970-01-01 00:00:01.000000\' UTC to\n\'2038-01-19 03:14:07.999999\' UTC. TIMESTAMP values are stored as the\nnumber of seconds since the epoch (\'1970-01-01 00:00:00\' UTC). A\nTIMESTAMP cannot represent the value \'1970-01-01 00:00:00\' because that\nis equivalent to 0 seconds from the epoch and the value 0 is reserved\nfor representing \'0000-00-00 00:00:00\', the "zero" TIMESTAMP value.\n\nAs of MySQL 5.6.4, an optional fsp value in the range from 0 to 6 may\nbe given to specify fractional seconds precision. A value of 0\nsignifies that there is no fractional part. If omitted, the default\nprecision is 0.\n\nThe way the server handles TIMESTAMP definitions depends on the value\nof the explicit_defaults_for_timestamp system variable (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html).\nBy default, explicit_defaults_for_timestamp is disabled and the server\nhandles TIMESTAMP as follows:\n\nUnless specified otherwise, the first TIMESTAMP column in a table is\ndefined to be automatically set to the date and time of the most recent\nmodification if not explicitly assigned a value. This makes TIMESTAMP\nuseful for recording the timestamp of an INSERT or UPDATE operation.\nYou can also set any TIMESTAMP column to the current date and time by\nassigning it a NULL value, unless it has been defined with the NULL\nattribute to permit NULL values.\n\nAutomatic initialization and updating to the current date and time can\nbe specified using DEFAULT CURRENT_TIMESTAMP and ON UPDATE\nCURRENT_TIMESTAMP column definition clauses. By default, the first\nTIMESTAMP column has these properties, as previously noted. As of MySQL\n5.6.5, any TIMESTAMP column in a table can be defined to have these\nproperties. Before 5.6.5, at most one TIMESTAMP column per table can\nhave them, but it is possible to suppress them for the first column and\ninstead assign them to a different TIMESTAMP column. See\nhttp://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html.\n\nIf explicit_defaults_for_timestamp is enabled, there is no automatic\nassignment of the DEFAULT CURRENT_TIMESTAMP or ON UPDATE\nCURRENT_TIMESTAMP attributes to any TIMESTAMP column. They must be\nincluded explicitly in the column definition. Also, any TIMESTAMP not\nexplicitly declared as NOT NULL permits NULL values.\n\nexplicit_defaults_for_timestamp is available as of MySQL 5.6.6. Before\n5.6.6, the server handles TIMESTAMP as discussed for\nexplicit_defaults_for_timestamp disabled. Those behaviors, while they\nremain the default, are nonstandard and are deprecated as of 5.6.6. For\ndiscussion regarding upgrading to an installation with\nexplicit_defaults_for_timestamp enabled, see\nhttp://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.h\ntml.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (63,7,'CREATE_ASYMMETRIC_PUB_KEY','Syntax:\nCREATE_ASYMMETRIC_PUB_KEY(algorithm, priv_key_str)\n\nDerives a public key from the given private key using the given\nalgorithm, and returns the key as a binary string in PEM format. If key\nderivation fails, the result is NULL.\n\npriv_key_str must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\', \'DH\'\n\nFor a usage example, see the description of\nCREATE_ASYMMETRIC_PRIV_KEY().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (64,27,'CACHE INDEX','Syntax:\nCACHE INDEX\n  tbl_index_list [, tbl_index_list] ...\n  [PARTITION (partition_list | ALL)]\n  IN key_cache_name\n\ntbl_index_list:\n  tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\npartition_list:\n  partition_name[, partition_name][, ...]\n\nThe CACHE INDEX statement assigns table indexes to a specific key\ncache. It is used only for MyISAM tables. After the indexes have been\nassigned, they can be preloaded into the cache if desired with LOAD\nINDEX INTO CACHE.\n\nThe following statement assigns indexes from the tables t1, t2, and t3\nto the key cache named hot_cache:\n\nmysql> CACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table   | Op                 | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status   | OK       |\n| test.t2 | assign_to_keycache | status   | OK       |\n| test.t3 | assign_to_keycache | status   | OK       |\n+---------+--------------------+----------+----------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cache-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/cache-index.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (65,12,'COMPRESS','Syntax:\nCOMPRESS(string_to_compress)\n\nCompresses a string and returns the result as a binary string. This\nfunction requires MySQL to have been compiled with a compression\nlibrary such as zlib. Otherwise, the return value is always NULL. The\ncompressed string can be uncompressed with UNCOMPRESS().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n        -> 21\nmysql> SELECT LENGTH(COMPRESS(\'\'));\n        -> 0\nmysql> SELECT LENGTH(COMPRESS(\'a\'));\n        -> 13\nmysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n        -> 15\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (66,28,'HANDLER','Syntax:\nHANDLER tbl_name OPEN [ [AS] alias]\n\nHANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)\n    [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n    [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n    [ WHERE where_condition ] [LIMIT ... ]\n\nHANDLER tbl_name CLOSE\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces. It is available for InnoDB and MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/handler.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/handler.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (67,9,'HELP_DATE','This help information was generated from the MySQL 5.6 Reference Manual\non: 2015-01-16\n','','');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (68,40,'RENAME TABLE','Syntax:\nRENAME TABLE tbl_name TO new_tbl_name\n    [, tbl_name2 TO new_tbl_name2] ...\n\nThis statement renames one or more tables.\n\nThe rename operation is done atomically, which means that no other\nsession can access any of the tables while the rename is running. For\nexample, if you have an existing table old_table, you can create\nanother table new_table that has the same structure but is empty, and\nthen replace the existing table with the empty one as follows (assuming\nthat backup_table does not already exist):\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/rename-table.html\n\n','CREATE TABLE new_table (...);\nRENAME TABLE old_table TO backup_table, new_table TO old_table;\n','http://dev.mysql.com/doc/refman/5.6/en/rename-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (69,23,'BOOLEAN','BOOL, BOOLEAN\n\nThese types are synonyms for TINYINT(1). A value of zero is considered\nfalse. Nonzero values are considered true:\n\nmysql> SELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false                  |\n+------------------------+\n\nmysql> SELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true                   |\n+------------------------+\n\nmysql> SELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true                   |\n+------------------------+\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0,\nrespectively, as shown here:\n\nmysql> SELECT IF(0 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true                           |\n+--------------------------------+\n\nmysql> SELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true                          |\n+-------------------------------+\n\nmysql> SELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false                         |\n+-------------------------------+\n\nmysql> SELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false                          |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (70,3,'MOD','Syntax:\nMOD(N,M), N % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT MOD(234, 10);\n        -> 4\nmysql> SELECT 253 % 7;\n        -> 1\nmysql> SELECT MOD(29,9);\n        -> 2\nmysql> SELECT 29 MOD 9;\n        -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (71,29,'HELP STATEMENT','Syntax:\nHELP \'search_string\'\n\nThe HELP statement returns online information from the MySQL Reference\nmanual. Its proper operation requires that the help tables in the mysql\ndatabase be initialized with help topic information (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-side-help-support.html).\n\nThe HELP statement searches the help tables for the given search string\nand displays the result of the search. The search string is not case\nsensitive.\n\nThe search string can contain the wildcard characters "%" and "_".\nThese have the same meaning as for pattern-matching operations\nperformed with the LIKE operator. For example, HELP \'rep%\' returns a\nlist of topics that begin with rep.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/help.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/help.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (72,38,'UCASE','Syntax:\nUCASE(str)\n\nUCASE() is a synonym for UPPER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (73,27,'SHOW BINLOG EVENTS','Syntax:\nSHOW BINLOG EVENTS\n   [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nShows the events in the binary log. If you do not specify \'log_name\',\nthe first binary log is displayed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-binlog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-binlog-events.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (74,33,'MPOLYFROMWKB','MPolyFromWKB(wkb[,srid]), MultiPolygonFromWKB(wkb[,srid])\n\nConstructs a MultiPolygon value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (75,24,'ITERATE','Syntax:\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements.\nITERATE means "start the loop again."\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/iterate.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/iterate.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (76,28,'DO','Syntax:\nDO expr [, expr] ...\n\nDO executes the expressions but does not return any results. In most\nrespects, DO is shorthand for SELECT expr, ..., but has the advantage\nthat it is slightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\nExample: This SELECT statement pauses, but also produces a result set:\n\nmysql> SELECT SLEEP(5);\n+----------+\n| SLEEP(5) |\n+----------+\n|        0 |\n+----------+\n1 row in set (5.02 sec)\n\nDO, on the other hand, pauses without producing a result set.:\n\nmysql> DO SLEEP(5);\nQuery OK, 0 rows affected (4.99 sec)\n\nThis could be useful, for example in a stored function or trigger,\nwhich prohibit statements that produce result sets.\n\nDO only executes expressions. It cannot be used in all cases where\nSELECT can be used. For example, DO id FROM t1 is invalid because it\nreferences a table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/do.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/do.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (77,38,'CHAR_LENGTH','Syntax:\nCHAR_LENGTH(str)\n\nReturns the length of the string str, measured in characters. A\nmultibyte character counts as a single character. This means that for a\nstring containing five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (78,23,'DATE','DATE\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MySQL\ndisplays DATE values in \'YYYY-MM-DD\' format, but permits assignment of\nvalues to DATE columns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (79,38,'EXTRACTVALUE','Syntax:\nExtractValue(xml_frag, xpath_expr)\n\nExtractValue() takes two string arguments, a fragment of XML markup\nxml_frag and an XPath expression xpath_expr (also known as a locator);\nit returns the text (CDATA) of the first text node which is a child of\nthe elements or elements matched by the XPath expression. In MySQL\n5.6.6 and earlier, the XPath expression could contain at most 127\ncharacters. This limitation was lifted in MySQL 5.6.7. (Bug #13007062,\nBug#62429)\n\nUsing this function is the equivalent of performing a match using the\nxpath_expr after appending /text(). In other words,\nExtractValue(\'<a><b>Sakila</b></a>\', \'/a/b\') and\nExtractValue(\'<a><b>Sakila</b></a>\', \'/a/b/text()\') produce the same\nresult.\n\nIf multiple matches are found, the content of the first child text node\nof each matching element is returned (in the order matched) as a\nsingle, space-delimited string.\n\nIf no matching text node is found for the expression (including the\nimplicit /text())---for whatever reason, as long as xpath_expr is\nvalid, and xml_frag consists of elements which are properly nested and\nclosed---an empty string is returned. No distinction is made between a\nmatch on an empty element and no match at all. This is by design.\n\nIf you need to determine whether no matching element was found in\nxml_frag or such an element was found but contained no child text\nnodes, you should test the result of an expression that uses the XPath\ncount() function. For example, both of these statements return an empty\nstring, as shown here:\n\nmysql> SELECT ExtractValue(\'<a><b/></a>\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'<a><b/></a>\', \'/a/b\') |\n+-------------------------------------+\n|                                     |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'<a><c/></a>\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'<a><c/></a>\', \'/a/b\') |\n+-------------------------------------+\n|                                     |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nHowever, you can determine whether there was actually a matching\nelement using the following:\n\nmysql> SELECT ExtractValue(\'<a><b/></a>\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'<a><b/></a>\', \'count(/a/b)\') |\n+-------------------------------------+\n| 1                                   |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'<a><c/></a>\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'<a><c/></a>\', \'count(/a/b)\') |\n+-------------------------------------+\n| 0                                   |\n+-------------------------------------+\n1 row in set (0.01 sec)\n\n*Important*: ExtractValue() returns only CDATA, and does not return any\ntags that might be contained within a matching tag, nor any of their\ncontent (see the result returned as val1 in the following example).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html\n\n','mysql> SELECT\n    ->   ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a\') AS val1,\n    ->   ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a/b\') AS val2,\n    ->   ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'//b\') AS val3,\n    ->   ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/b\') AS val4,\n    ->   ExtractValue(\'<a>ccc<b>ddd</b><b>eee</b></a>\', \'//b\') AS val5;\n\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5    |\n+------+------+------+------+---------+\n| ccc  | ddd  | ddd  |      | ddd eee |\n+------+------+------+------+---------+\n','http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (80,12,'OLD_PASSWORD','Syntax:\nOLD_PASSWORD(str)\n\nOLD_PASSWORD() was added when the implementation of PASSWORD() was\nchanged in MySQL 4.1 to improve security. OLD_PASSWORD() returns the\nvalue of the pre-4.1 implementation of PASSWORD() as a string, and is\nintended to permit you to reset passwords for any pre-4.1 clients that\nneed to connect to your version 5.6 MySQL server without locking them\nout. See http://dev.mysql.com/doc/refman/5.6/en/password-hashing.html.\n\nThe return value is a nonbinary string in the connection character set.\n\n*Note*: Passwords that use the pre-4.1 hashing method are less secure\nthan passwords that use the native password hashing method and should\nbe avoided. Pre-4.1 passwords are deprecated and support for them will\nbe removed in a future MySQL release. Consequently, OLD_PASSWORD() is\nalso deprecated.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (81,38,'FORMAT','Syntax:\nFORMAT(X,D[,locale])\n\nFormats the number X to a format like \'#,###,###.##\', rounded to D\ndecimal places, and returns the result as a string. If D is 0, the\nresult has no decimal point or fractional part.\n\nThe optional third parameter enables a locale to be specified to be\nused for the result number\'s decimal point, thousands separator, and\ngrouping between separators. Permissible locale values are the same as\nthe legal values for the lc_time_names system variable (see\nhttp://dev.mysql.com/doc/refman/5.6/en/locale-support.html). If no\nlocale is specified, the default is \'en_US\'.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FORMAT(12332.123456, 4);\n        -> \'12,332.1235\'\nmysql> SELECT FORMAT(12332.1,4);\n        -> \'12,332.1000\'\nmysql> SELECT FORMAT(12332.2,0);\n        -> \'12,332\'\nmysql> SELECT FORMAT(12332.2,2,\'de_DE\');\n        -> \'12.332,20\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (82,15,'||','Syntax:\nOR, ||\n\nLogical OR. When both operands are non-NULL, the result is 1 if any\noperand is nonzero, and 0 otherwise. With a NULL operand, the result is\n1 if the other operand is nonzero, and NULL otherwise. If both operands\nare NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT 1 || 1;\n        -> 1\nmysql> SELECT 1 || 0;\n        -> 1\nmysql> SELECT 0 || 0;\n        -> 0\nmysql> SELECT 0 || NULL;\n        -> NULL\nmysql> SELECT 1 || NULL;\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (83,38,'BIT_LENGTH','Syntax:\nBIT_LENGTH(str)\n\nReturns the length of the string str in bits.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT BIT_LENGTH(\'text\');\n        -> 32\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (84,2,'EXTERIORRING','ExteriorRing(poly)\n\nReturns the exterior ring of the Polygon value poly as a LineString.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n    -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT AsText(ExteriorRing(GeomFromText(@poly)));\n+-------------------------------------------+\n| AsText(ExteriorRing(GeomFromText(@poly))) |\n+-------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0)           |\n+-------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (85,33,'GEOMFROMWKB','GeomFromWKB(wkb[,srid]), GeometryFromWKB(wkb[,srid])\n\nConstructs a geometry value of any type using its WKB representation\nand SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (86,20,'BETWEEN AND','Syntax:\nexpr BETWEEN min AND max\n\nIf expr is greater than or equal to min and expr is less than or equal\nto max, BETWEEN returns 1, otherwise it returns 0. This is equivalent\nto the expression (min <= expr AND expr <= max) if all the arguments\nare of the same type. Otherwise type conversion takes place according\nto the rules described in\nhttp://dev.mysql.com/doc/refman/5.6/en/type-conversion.html, but\napplied to all the three arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 BETWEEN 1 AND 3, 2 BETWEEN 3 and 1;\n        -> 1, 0\nmysql> SELECT 1 BETWEEN 2 AND 3;\n        -> 0\nmysql> SELECT \'b\' BETWEEN \'a\' AND \'c\';\n        -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'3\';\n        -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'x-3\';\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (87,25,'MULTIPOLYGON','MultiPolygon(poly1,poly2,...)\n\nConstructs a MultiPolygon value from a set of Polygon or WKB Polygon\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (88,38,'LEFT','Syntax:\nLEFT(str,len)\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LEFT(\'foobarbar\', 5);\n        -> \'fooba\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (89,27,'FLUSH QUERY CACHE','You can defragment the query cache to better utilize its memory with\nthe FLUSH QUERY CACHE statement. The statement does not remove any\nqueries from the cache.\n\nThe RESET QUERY CACHE statement removes all query results from the\nquery cache. The FLUSH TABLES statement also does this.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/query-cache-status-and-maintenance.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/query-cache-status-and-maintenance.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (90,23,'SET DATA TYPE','SET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA set. A string object that can have zero or more values, each of which\nmust be chosen from the list of values \'value1\', \'value2\', ... SET\nvalues are represented internally as integers.\n\nA SET column can have a maximum of 64 distinct members. A table can\nhave no more than 255 unique element list definitions among its ENUM\nand SET columns considered as a group. For more information on this\nlimit, see http://dev.mysql.com/doc/refman/5.6/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (91,3,'RAND','Syntax:\nRAND(), RAND(N)\n\nReturns a random floating-point value v in the range 0 <= v < 1.0. If a\nconstant integer argument N is specified, it is used as the seed value,\nwhich produces a repeatable sequence of column values. In the following\nexample, the sequences of values produced by RAND(3) are the same in\nboth places where they occur.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> CREATE TABLE t (i INT);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3  Duplicates: 0  Warnings: 0\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i    | RAND()           |\n+------+------------------+\n|    1 | 0.61914388706828 |\n|    2 | 0.93845168309142 |\n|    3 | 0.83482678498591 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i    | RAND(3)          |\n+------+------------------+\n|    1 | 0.90576975597606 |\n|    2 | 0.37307905813035 |\n|    3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i    | RAND()           |\n+------+------------------+\n|    1 | 0.35877890638893 |\n|    2 | 0.28941420772058 |\n|    3 | 0.37073435016976 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i    | RAND(3)          |\n+------+------------------+\n|    1 | 0.90576975597606 |\n|    2 | 0.37307905813035 |\n|    3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (92,38,'RPAD','Syntax:\nRPAD(str,len,padstr)\n\nReturns the string str, right-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RPAD(\'hi\',5,\'?\');\n        -> \'hi???\'\nmysql> SELECT RPAD(\'hi\',1,\'?\');\n        -> \'h\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (93,23,'DEC','DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED]\n[ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nThese types are synonyms for DECIMAL. The FIXED synonym is available\nfor compatibility with other database systems.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (94,38,'ELT','Syntax:\nELT(N,str1,str2,str3,...)\n\nELT() returns the Nth element of the list of strings: str1 if N = 1,\nstr2 if N = 2, and so on. Returns NULL if N is less than 1 or greater\nthan the number of arguments. ELT() is the complement of FIELD().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n        -> \'ej\'\nmysql> SELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n        -> \'foo\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (95,40,'ALTER VIEW','Syntax:\nALTER\n    [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n    [DEFINER = { user | CURRENT_USER }]\n    [SQL SECURITY { DEFINER | INVOKER }]\n    VIEW view_name [(column_list)]\n    AS select_statement\n    [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThis statement changes the definition of a view, which must exist. The\nsyntax is similar to that for CREATE VIEW and the effect is the same as\nfor CREATE OR REPLACE VIEW. See [HELP CREATE VIEW]. This statement\nrequires the CREATE VIEW and DROP privileges for the view, and some\nprivilege for each column referred to in the SELECT statement. ALTER\nVIEW is permitted only to the definer or users with the SUPER\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-view.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (96,27,'SHOW DATABASES','Syntax:\nSHOW {DATABASES | SCHEMAS}\n    [LIKE \'pattern\' | WHERE expr]\n\nSHOW DATABASES lists the databases on the MySQL server host. SHOW\nSCHEMAS is a synonym for SHOW DATABASES. The LIKE clause, if present,\nindicates which database names to match. The WHERE clause can be given\nto select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nYou see only those databases for which you have some kind of privilege,\nunless you have the global SHOW DATABASES privilege. You can also get\nthis list using the mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you\ncannot use this statement at all unless you have the SHOW DATABASES\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-databases.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-databases.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (97,32,'SEC_TO_TIME','Syntax:\nSEC_TO_TIME(seconds)\n\nReturns the seconds argument, converted to hours, minutes, and seconds,\nas a TIME value. The range of the result is constrained to that of the\nTIME data type. A warning occurs if the argument corresponds to a value\noutside that range.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SEC_TO_TIME(2378);\n        -> \'00:39:38\'\nmysql> SELECT SEC_TO_TIME(2378) + 0;\n        -> 3938\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (98,38,'LOCATE','Syntax:\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nThe first syntax returns the position of the first occurrence of\nsubstring substr in string str. The second syntax returns the position\nof the first occurrence of substring substr in string str, starting at\nposition pos. Returns 0 if substr is not in str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LOCATE(\'bar\', \'foobarbar\');\n        -> 4\nmysql> SELECT LOCATE(\'xbar\', \'foobar\');\n        -> 0\nmysql> SELECT LOCATE(\'bar\', \'foobarbar\', 5);\n        -> 7\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (99,27,'SHOW EVENTS','Syntax:\nSHOW EVENTS [{FROM | IN} schema_name]\n    [LIKE \'pattern\' | WHERE expr]\n\nThis statement displays information about Event Manager events. It\nrequires the EVENT privilege for the database from which the events are\nto be shown.\n\nIn its simplest form, SHOW EVENTS lists all of the events in the\ncurrent schema:\n\nmysql> SELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora    | myschema |\n+----------------+----------+\n1 row in set (0.00 sec)\n\nmysql> SHOW EVENTS\\G\n*************************** 1. row ***************************\n                  Db: myschema\n                Name: e_daily\n             Definer: jon@ghidora\n           Time zone: SYSTEM\n                Type: RECURRING\n          Execute at: NULL\n      Interval value: 10\n      Interval field: SECOND\n              Starts: 2006-02-09 10:41:23\n                Ends: NULL\n              Status: ENABLED\n          Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n\nTo see events for a specific schema, use the FROM clause. For example,\nto see events for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-events.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-events.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (100,23,'LONGTEXT','LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\ncharacters. The effective maximum length is less if the value contains\nmultibyte characters. The effective maximum length of LONGTEXT columns\nalso depends on the configured maximum packet size in the client/server\nprotocol and available memory. Each LONGTEXT value is stored using a\n4-byte length prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (101,27,'KILL','Syntax:\nKILL [CONNECTION | QUERY] processlist_id\n\nEach connection to mysqld runs in a separate thread. You can kill a\nthread with the KILL processlist_id statement.\n\nThread processlist identifiers can be determined from the ID column of\nthe INFORMATION_SCHEMA.PROCESSLIST table, the Id column of SHOW\nPROCESSLIST output, and the PROCESSLIST_ID column of the Performance\nSchema threads table. The value for the current thread is returned by\nthe CONNECTION_ID() function.\n\nKILL permits an optional CONNECTION or QUERY modifier:\n\no KILL CONNECTION is the same as KILL with no modifier: It terminates\n  the connection associated with the given processlist_id.\n\no KILL QUERY terminates the statement that the connection is currently\n  executing, but leaves the connection itself intact.\n\nIf you have the PROCESS privilege, you can see all threads. If you have\nthe SUPER privilege, you can kill all threads and statements.\nOtherwise, you can see and kill only your own threads and statements.\n\nYou can also use the mysqladmin processlist and mysqladmin kill\ncommands to examine and kill threads.\n\n*Note*: You cannot use KILL with the Embedded MySQL Server library\nbecause the embedded server merely runs inside the threads of the host\napplication. It does not create any connection threads of its own.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/kill.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/kill.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (102,31,'DISJOINT','Disjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does\nnot intersect) g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (103,38,'LPAD','Syntax:\nLPAD(str,len,padstr)\n\nReturns the string str, left-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LPAD(\'hi\',4,\'??\');\n        -> \'??hi\'\nmysql> SELECT LPAD(\'hi\',1,\'??\');\n        -> \'h\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (104,31,'OVERLAPS','Overlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (105,8,'SET GLOBAL SQL_SLAVE_SKIP_COUNTER','Syntax:\nSET GLOBAL sql_slave_skip_counter = N\n\nThis statement skips the next N events from the master. This is useful\nfor recovering from replication stops caused by a statement.\n\nThis statement is valid only when the slave threads are not running.\nOtherwise, it produces an error.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-global-sql-slave-skip-counter.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-global-sql-slave-skip-counter.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (106,7,'MBREQUAL','MBREqual(g1,g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (107,34,'PROCEDURE ANALYSE','Syntax:\nANALYSE([max_elements[,max_memory]])\n\nANALYSE() examines the result from a query and returns an analysis of\nthe results that suggests optimal data types for each column that may\nhelp reduce table sizes. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query,\nand propose an optimal data type for the columns. This can be helpful\nfor checking your existing tables, or after importing new data. You may\nneed to try different settings for the arguments so that PROCEDURE\nANALYSE() does not suggest the ENUM data type when it is not\nappropriate.\n\nThe arguments are optional and are used as follows:\n\no max_elements (default 256) is the maximum number of distinct values\n  that ANALYSE() notices per column. This is used by ANALYSE() to check\n  whether the optimal data type should be of type ENUM; if there are\n  more than max_elements distinct values, then ENUM is not a suggested\n  type.\n\no max_memory (default 8192) is the maximum amount of memory that\n  ANALYSE() should allocate per column while trying to find all\n  distinct values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/procedure-analyse.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/procedure-analyse.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (108,9,'HELP_VERSION','This help information was generated from the MySQL 5.6 Reference Manual\non: 2015-01-16 (revision: 41302)\n\nThis information applies to MySQL 5.6 through 5.6.23.\n','','');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (109,38,'CHARACTER_LENGTH','Syntax:\nCHARACTER_LENGTH(str)\n\nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (110,27,'SHOW PRIVILEGES','Syntax:\nSHOW PRIVILEGES\n\nSHOW PRIVILEGES shows the list of system privileges that the MySQL\nserver supports. The exact list of privileges depends on the version of\nyour server.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-privileges.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-privileges.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (111,40,'CREATE TABLESPACE','Syntax:\nCREATE TABLESPACE tablespace_name\n    ADD DATAFILE \'file_name\'\n    USE LOGFILE GROUP logfile_group\n    [EXTENT_SIZE [=] extent_size]\n    [INITIAL_SIZE [=] initial_size]\n    [AUTOEXTEND_SIZE [=] autoextend_size]\n    [MAX_SIZE [=] max_size]\n    [NODEGROUP [=] nodegroup_id]\n    [WAIT]\n    [COMMENT [=] comment_text]\n    ENGINE [=] engine_name\n\nThis statement is used to create a tablespace, which can contain one or\nmore data files, providing storage space for tables. One data file is\ncreated and added to the tablespace using this statement. Additional\ndata files may be added to the tablespace by using the ALTER TABLESPACE\nstatement (see [HELP ALTER TABLESPACE]). For rules covering the naming\nof tablespaces, see\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and a log file group with the same name, or a\ntablespace and a data file with the same name.\n\nA log file group of one or more UNDO log files must be assigned to the\ntablespace to be created with the USE LOGFILE GROUP clause.\nlogfile_group must be an existing log file group created with CREATE\nLOGFILE GROUP (see [HELP CREATE LOGFILE GROUP]). Multiple tablespaces\nmay use the same log file group for UNDO logging.\n\nThe EXTENT_SIZE sets the size, in bytes, of the extents used by any\nfiles belonging to the tablespace. The default value is 1M. The minimum\nsize is 32K, and theoretical maximum is 2G, although the practical\nmaximum size depends on a number of factors. In most cases, changing\nthe extent size does not have any measurable effect on performance, and\nthe default value is recommended for all but the most unusual\nsituations.\n\nAn extent is a unit of disk space allocation. One extent is filled with\nas much data as that extent can contain before another extent is used.\nIn theory, up to 65,535 (64K) extents may used per data file; however,\nthe recommended maximum is 32,768 (32K). The recommended maximum size\nfor a single data file is 32G---that is, 32K extents x 1 MB per extent.\nIn addition, once an extent is allocated to a given partition, it\ncannot be used to store data from a different partition; an extent\ncannot store data from more than one partition. This means, for example\nthat a tablespace having a single datafile whose INITIAL_SIZE is 256 MB\nand whose EXTENT_SIZE is 128M has just two extents, and so can be used\nto store data from at most two different disk data table partitions.\n\nYou can see how many extents remain free in a given data file by\nquerying the INFORMATION_SCHEMA.FILES table, and so derive an estimate\nfor how much space remains free in the file. For further discussion and\nexamples, see http://dev.mysql.com/doc/refman/5.6/en/files-table.html.\n\nThe INITIAL_SIZE parameter sets the data file\'s total size in bytes.\nOnce the file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using ALTER TABLESPACE\n... ADD DATAFILE. See [HELP ALTER TABLESPACE].\n\nINITIAL_SIZE is optional; its default value is 134217728 (128 MB).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nWhen setting EXTENT_SIZE, you may optionally follow the number with a\none-letter abbreviation for an order of magnitude, similar to those\nused in my.cnf. Generally, this is one of the letters M (for megabytes)\nor G (for gigabytes). In MySQL Cluster NDB 7.3.2 and later, these\nabbreviations are also supported when specifying INITIAL_SIZE as well.\n(Bug #13116514, Bug #16104705, Bug #62858)\n\nINITIAL_SIZE, EXTENT_SIZE, and UNDO_BUFFER_SIZE are subject to rounding\nas follows:\n\no EXTENT_SIZE and UNDO_BUFFER_SIZE are each rounded up to the nearest\n  whole multiple of 32K.\n\no INITIAL_SIZE is rounded down to the nearest whole multiple of 32K.\n\n  For data files, INITIAL_SIZE is subject to further rounding; the\n  result just obtained is rounded up to the nearest whole multiple of\n  EXTENT_SIZE (after any rounding).\n\nThe rounding just described is done explicitly, and a warning is issued\nby the MySQL Server when any such rounding is performed. The rounded\nvalues are also used by the NDB kernel for calculating\nINFORMATION_SCHEMA.FILES column values and other purposes. However, to\navoid an unexpected result, we suggest that you always use whole\nmultiples of 32K in specifying these options.\n\nAUTOEXTEND_SIZE, MAX_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but\nignored, and so currently have no effect. These options are intended\nfor future expansion.\n\nThe ENGINE parameter determines the storage engine which uses this\ntablespace, with engine_name being the name of the storage engine.\nCurrently, engine_name must be one of the values NDB or NDBCLUSTER.\n\nWhen CREATE TABLESPACE is used with ENGINE = NDB, a tablespace and\nassociated data file are created on each Cluster data node. You can\nverify that the data files were created and obtain information about\nthem by querying the INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n    -> FROM INFORMATION_SCHEMA.FILES\n    -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+-------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME   | EXTRA          |\n+--------------------+-------------+----------------+\n| lg_3               | newdata.dat | CLUSTER_NODE=3 |\n| lg_3               | newdata.dat | CLUSTER_NODE=4 |\n+--------------------+-------------+----------------+\n2 rows in set (0.01 sec)\n\n(See http://dev.mysql.com/doc/refman/5.6/en/files-table.html.)\n\nCREATE TABLESPACE is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-tablespace.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (112,38,'INSERT FUNCTION','Syntax:\nINSERT(str,pos,len,newstr)\n\nReturns the string str, with the substring beginning at position pos\nand len characters long replaced by the string newstr. Returns the\noriginal string if pos is not within the length of the string. Replaces\nthe rest of the string from position pos if len is not within the\nlength of the rest of the string. Returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n        -> \'QuWhattic\'\nmysql> SELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n        -> \'Quadratic\'\nmysql> SELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n        -> \'QuWhat\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (113,15,'XOR','Syntax:\nXOR\n\nLogical XOR. Returns NULL if either operand is NULL. For non-NULL\noperands, evaluates to 1 if an odd number of operands is nonzero,\notherwise 0 is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT 1 XOR 1;\n        -> 0\nmysql> SELECT 1 XOR 0;\n        -> 1\nmysql> SELECT 1 XOR NULL;\n        -> NULL\nmysql> SELECT 1 XOR 1 XOR 1;\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (114,10,'GRANT','Syntax:\nGRANT\n    priv_type [(column_list)]\n      [, priv_type [(column_list)]] ...\n    ON [object_type] priv_level\n    TO user_specification [, user_specification] ...\n    [REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]\n    [WITH with_option ...]\n\nGRANT PROXY ON user_specification\n    TO user_specification [, user_specification] ...\n    [WITH GRANT OPTION]\n\nobject_type:\n    TABLE\n  | FUNCTION\n  | PROCEDURE\n\npriv_level:\n    *\n  | *.*\n  | db_name.*\n  | db_name.tbl_name\n  | tbl_name\n  | db_name.routine_name\n\nuser_specification:\n    user\n    [\n      | IDENTIFIED WITH auth_plugin [AS \'auth_string\']\n        IDENTIFIED BY [PASSWORD] \'password\'\n    ]\n\nssl_option:\n    SSL\n  | X509\n  | CIPHER \'cipher\'\n  | ISSUER \'issuer\'\n  | SUBJECT \'subject\'\n\nwith_option:\n    GRANT OPTION\n  | MAX_QUERIES_PER_HOUR count\n  | MAX_UPDATES_PER_HOUR count\n  | MAX_CONNECTIONS_PER_HOUR count\n  | MAX_USER_CONNECTIONS count\n\nThe GRANT statement grants privileges to MySQL user accounts. GRANT\nalso serves to specify other account characteristics such as use of\nsecure connections and limits on access to server resources. To use\nGRANT, you must have the GRANT OPTION privilege, and you must have the\nprivileges that you are granting.\n\nNormally, a database administrator first uses CREATE USER to create an\naccount, then GRANT to define its privileges and characteristics. For\nexample:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\nGRANT ALL ON db1.* TO \'jeffrey\'@\'localhost\';\nGRANT SELECT ON db2.invoice TO \'jeffrey\'@\'localhost\';\nGRANT USAGE ON *.* TO \'jeffrey\'@\'localhost\' WITH MAX_QUERIES_PER_HOUR 90;\n\nHowever, if an account named in a GRANT statement does not already\nexist, GRANT may create it under the conditions described later in the\ndiscussion of the NO_AUTO_CREATE_USER SQL mode.\n\nThe REVOKE statement is related to GRANT and enables administrators to\nremove account privileges. See [HELP REVOKE].\n\nWhen successfully executed from the mysql program, GRANT responds with\nQuery OK, 0 rows affected. To determine what privileges result from the\noperation, use SHOW GRANTS. See [HELP SHOW GRANTS].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/grant.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/grant.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (115,7,'MBRINTERSECTS','MBRIntersects(g1,g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 intersect.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (116,20,'IS NOT','Syntax:\nIS NOT boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n        -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (117,3,'SQRT','Syntax:\nSQRT(X)\n\nReturns the square root of a nonnegative number X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT SQRT(4);\n        -> 2\nmysql> SELECT SQRT(20);\n        -> 4.4721359549996\nmysql> SELECT SQRT(-16);\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (118,40,'CREATE INDEX','Syntax:\nCREATE [ONLINE|OFFLINE] [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name\n    [index_type]\n    ON tbl_name (index_col_name,...)\n    [index_option]\n    [algorithm_option | lock_option] ...\n\nindex_col_name:\n    col_name [(length)] [ASC | DESC]\n\nindex_type:\n    USING {BTREE | HASH}\n\nindex_option:\n    KEY_BLOCK_SIZE [=] value\n  | index_type\n  | WITH PARSER parser_name\n  | COMMENT \'string\'\n\nalgorithm_option:\n    ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n\nlock_option:\n    LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nCREATE INDEX is mapped to an ALTER TABLE statement to create indexes.\nSee [HELP ALTER TABLE]. CREATE INDEX cannot be used to create a PRIMARY\nKEY; use ALTER TABLE instead. For more information about indexes, see\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-index.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (119,40,'ALTER DATABASE','Syntax:\nALTER {DATABASE | SCHEMA} [db_name]\n    alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n    UPGRADE DATA DIRECTORY NAME\n\nalter_specification:\n    [DEFAULT] CHARACTER SET [=] charset_name\n  | [DEFAULT] COLLATE [=] collation_name\n\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the\ndatabase directory. To use ALTER DATABASE, you need the ALTER privilege\non the database. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe database name can be omitted from the first syntax, in which case\nthe statement applies to the default database.\n\nNational Language Characteristics\n\nThe CHARACTER SET clause changes the default database character set.\nThe COLLATE clause changes the default database collation.\nhttp://dev.mysql.com/doc/refman/5.6/en/charset.html, discusses\ncharacter set and collation names.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements. See\n[HELP SHOW CHARACTER SET], and [HELP SHOW COLLATION], for more\ninformation.\n\nIf you change the default character set or collation for a database,\nstored routines that use the database defaults must be dropped and\nrecreated so that they use the new defaults. (In a stored routine,\nvariables with character data types use the database defaults if the\ncharacter set or collation are not specified explicitly. See [HELP\nCREATE PROCEDURE].)\n\nUpgrading from Versions Older than MySQL 5.1\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause updates\nthe name of the directory associated with the database to use the\nencoding implemented in MySQL 5.1 for mapping database names to\ndatabase directory names (see\nhttp://dev.mysql.com/doc/refman/5.6/en/identifier-mapping.html). This\nclause is for use under these conditions:\n\no It is intended when upgrading MySQL to 5.1 or later from older\n  versions.\n\no It is intended to update a database directory name to the current\n  encoding format if the name contains special characters that need\n  encoding.\n\no The statement is used by mysqlcheck (as invoked by mysql_upgrade).\n\nFor example, if a database in MySQL 5.0 has the name a-b-c, the name\ncontains instances of the - (dash) character. In MySQL 5.0, the\ndatabase directory is also named a-b-c, which is not necessarily safe\nfor all file systems. In MySQL 5.1 and later, the same database name is\nencoded as a@002db@002dc to produce a file system-neutral directory\nname.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an\nolder version,the server displays a name such as a-b-c (which is in the\nold format) as #mysql50#a-b-c, and you must refer to the name using the\n#mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME in this case to\nexplicitly tell the server to re-encode the database directory name to\nthe current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c\nwithout the special #mysql50# prefix.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-database.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-database.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (120,26,'GEOMETRYN','GeometryN(gc,N)\n\nReturns the N-th geometry in the GeometryCollection value gc.\nGeometries are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT AsText(GeometryN(GeomFromText(@gc),1));\n+----------------------------------------+\n| AsText(GeometryN(GeomFromText(@gc),1)) |\n+----------------------------------------+\n| POINT(1 1)                             |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (121,19,'<<','Syntax:\n<<\n\nShifts a longlong (BIGINT) number to the left.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 1 << 2;\n        -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (122,27,'SHOW TABLE STATUS','Syntax:\nSHOW TABLE STATUS [{FROM | IN} db_name]\n    [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLE STATUS works likes SHOW TABLES, but provides a lot of\ninformation about each non-TEMPORARY table. You can also get this list\nusing the mysqlshow --status db_name command. The LIKE clause, if\npresent, indicates which table names to match. The WHERE clause can be\ngiven to select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-table-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-table-status.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (123,38,'ASCII','Syntax:\nASCII(str)\n\nReturns the numeric value of the leftmost character of the string str.\nReturns 0 if str is the empty string. Returns NULL if str is NULL.\nASCII() works for 8-bit characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ASCII(\'2\');\n        -> 50\nmysql> SELECT ASCII(2);\n        -> 50\nmysql> SELECT ASCII(\'dx\');\n        -> 100\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (124,3,'DIV','Syntax:\nDIV\n\nInteger division. Similar to FLOOR(), but is safe with BIGINT values.\n\nIn MySQL 5.6, if either operand has a noninteger type, the operands are\nconverted to DECIMAL and divided using DECIMAL arithmetic before\nconverting the result to BIGINT. If the result exceeds BIGINT range, an\nerror occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 5 DIV 2;\n        -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (125,27,'SHOW SLAVE STATUS','Syntax:\nSHOW SLAVE STATUS\n\nThis statement provides status information on essential parameters of\nthe slave threads. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nIf you issue this statement using the mysql client, you can use a \\G\nstatement terminator rather than a semicolon to obtain a more readable\nvertical layout:\n\nmysql> SHOW SLAVE STATUS\\G\n*************************** 1. row ***************************\n               Slave_IO_State: Waiting for master to send event\n                  Master_Host: localhost\n                  Master_User: root\n                  Master_Port: 13000\n                Connect_Retry: 60\n              Master_Log_File: master-bin.000002\n          Read_Master_Log_Pos: 1307\n               Relay_Log_File: slave-relay-bin.000003\n                Relay_Log_Pos: 1508\n        Relay_Master_Log_File: master-bin.000002\n             Slave_IO_Running: Yes\n            Slave_SQL_Running: Yes\n              Replicate_Do_DB:\n          Replicate_Ignore_DB:\n           Replicate_Do_Table:\n       Replicate_Ignore_Table:\n      Replicate_Wild_Do_Table:\n  Replicate_Wild_Ignore_Table:\n                   Last_Errno: 0\n                   Last_Error:\n                 Skip_Counter: 0\n          Exec_Master_Log_Pos: 1307\n              Relay_Log_Space: 1858\n              Until_Condition: None\n               Until_Log_File:\n                Until_Log_Pos: 0\n           Master_SSL_Allowed: No\n           Master_SSL_CA_File:\n           Master_SSL_CA_Path:\n              Master_SSL_Cert:\n            Master_SSL_Cipher:\n               Master_SSL_Key:\n        Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n                Last_IO_Errno: 0\n                Last_IO_Error:\n               Last_SQL_Errno: 0\n               Last_SQL_Error:\n  Replicate_Ignore_Server_Ids:\n             Master_Server_Id: 1\n                  Master_UUID: 3e11fa47-71ca-11e1-9e33-c80aa9429562\n             Master_Info_File: /var/mysqld.2/data/master.info\n                    SQL_Delay: 0\n          SQL_Remaining_Delay: NULL\n      Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it\n           Master_Retry_Count: 10\n                  Master_Bind:\n      Last_IO_Error_Timestamp:\n     Last_SQL_Error_Timestamp:\n               Master_SSL_Crl:\n           Master_SSL_Crlpath:\n           Retrieved_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n            Executed_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n                Auto_Position: 1\n1 row in set (0.00 sec)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-slave-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-slave-status.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (126,35,'GEOMETRY','MySQL provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Spatial columns\nare supported for MyISAM, InnoDB, NDB, and ARCHIVE tables. See also the\nnotes about spatial indexes under [HELP SPATIAL].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-columns.html\n\n','CREATE TABLE geom (g GEOMETRY);\n','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-columns.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (127,19,'&','Syntax:\n&\n\nBitwise AND:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 29 & 15;\n        -> 13\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (128,15,'ASSIGN-EQUAL','Syntax:\n=\n\nThis operator is used to perform value assignments in two cases,\ndescribed in the next two paragraphs.\n\nWithin a SET statement, = is treated as an assignment operator that\ncauses the user variable on the left hand side of the operator to take\non the value to its right. (In other words, when used in a SET\nstatement, = is treated identically to :=.) The value on the right hand\nside may be a literal value, another variable storing a value, or any\nlegal expression that yields a scalar value, including the result of a\nquery (provided that this value is a scalar value). You can perform\nmultiple assignments in the same SET statement.\n\nIn the SET clause of an UPDATE statement, = also acts as an assignment\noperator; in this case, however, it causes the column named on the left\nhand side of the operator to assume the value given to the right,\nprovided any WHERE conditions that are part of the UPDATE are met. You\ncan make multiple assignments in the same SET clause of an UPDATE\nstatement.\n\nIn any other context, = is treated as a comparison operator.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n        -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n        -> 1, NULL\nmysql> SELECT @var1, @var2;\n        -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n        -> 1, 1\nmysql> SELECT @var1, @var2;\n        -> 1, 1\n','http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (129,38,'CONVERT','Syntax:\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nThe CONVERT() and CAST() functions take an expression of any type and\nproduce a result value of a specified type.\n\nThe type for the result can be one of the following values:\n\no BINARY[(N)]\n\no CHAR[(N)]\n\no DATE\n\no DATETIME\n\no DECIMAL[(M[,D])]\n\no SIGNED [INTEGER]\n\no TIME\n\no UNSIGNED [INTEGER]\n\nBINARY produces a string with the BINARY data type. See\nhttp://dev.mysql.com/doc/refman/5.6/en/binary-varbinary.html for a\ndescription of how this affects comparisons. If the optional length N\nis given, BINARY(N) causes the cast to use no more than N bytes of the\nargument. Values shorter than N bytes are padded with 0x00 bytes to a\nlength of N.\n\nCHAR(N) causes the cast to use no more than N characters of the\nargument.\n\nCAST() and CONVERT(... USING ...) are standard SQL syntax. The\nnon-USING form of CONVERT() is ODBC syntax.\n\nCONVERT() with USING is used to convert data between different\ncharacter sets. In MySQL, transcoding names are the same as the\ncorresponding character set names. For example, this statement converts\nthe string \'abc\' in the default character set to the corresponding\nstring in the utf8 character set:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html\n\n','SELECT enum_col FROM tbl_name ORDER BY CAST(enum_col AS CHAR);\n','http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (130,24,'REPEAT LOOP','Syntax:\n[begin_label:] REPEAT\n    statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition expression is true. Thus, a REPEAT always enters the\nloop at least once. statement_list consists of one or more statements,\neach terminated by a semicolon (;) statement delimiter.\n\nA REPEAT statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/repeat.html\n\n','mysql> delimiter //\n\nmysql> CREATE PROCEDURE dorepeat(p1 INT)\n    -> BEGIN\n    ->   SET @x = 0;\n    ->   REPEAT\n    ->     SET @x = @x + 1;\n    ->   UNTIL @x > p1 END REPEAT;\n    -> END\n    -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL dorepeat(1000)//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n+------+\n| @x   |\n+------+\n| 1001 |\n+------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/repeat.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (131,23,'SMALLINT','SMALLINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA small integer. The signed range is -32768 to 32767. The unsigned\nrange is 0 to 65535.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (132,23,'DOUBLE PRECISION','DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL], REAL[(M,D)] [UNSIGNED]\n[ZEROFILL]\n\nThese types are synonyms for DOUBLE. Exception: If the REAL_AS_FLOAT\nSQL mode is enabled, REAL is a synonym for FLOAT rather than DOUBLE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (133,38,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multibyte character,\nreturns the code for that character, calculated from the numeric values\nof its constituent bytes using this formula:\n\n  (1st byte code)\n+ (2nd byte code * 256)\n+ (3rd byte code * 2562) ...\n\nIf the leftmost character is not a multibyte character, ORD() returns\nthe same value as the ASCII() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ORD(\'2\');\n        -> 50\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (134,37,'ENVELOPE','Envelope(g)\n\nST_Envelope() and Envelope() are synonyms. For more information, see\nthe description of ST_Envelope().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (135,14,'INET_ATON','Syntax:\nINET_ATON(expr)\n\nGiven the dotted-quad representation of an IPv4 network address as a\nstring, returns an integer that represents the numeric value of the\naddress in network byte order (big endian). INET_ATON() returns NULL if\nit does not understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_ATON(\'10.0.5.9\');\n        -> 167773449\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (136,37,'ISSIMPLE','IsSimple(g)\n\nReturns 1 if the geometry value g has no anomalous geometric points,\nsuch as self-intersection or self-tangency. IsSimple() returns 0 if the\nargument is not simple, and NULL if it is NULL.\n\nThe description of each instantiable geometric class given earlier in\nthe chapter includes the specific conditions that cause an instance of\nthat class to be classified as not simple. (See [HELP Geometry\nhierarchy].)\n\nPrior to MySQL 5.6.1, this function always returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (137,3,'- BINARY','Syntax:\n-\n\nSubtraction:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3-5;\n        -> -2\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (138,32,'CURRENT_TIME','Syntax:\nCURRENT_TIME, CURRENT_TIME([fsp])\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (139,4,'WKT DEFINITION','The Well-Known Text (WKT) representation of geometry values is designed\nfor exchanging geometry data in ASCII form. The OpenGIS specification\nprovides a Backus-Naur grammar that specifies the formal production\nrules for writing WKT values (see\nhttp://dev.mysql.com/doc/refman/5.6/en/spatial-extensions.html).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-data-formats.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-data-formats.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (140,10,'REVOKE','Syntax:\nREVOKE\n    priv_type [(column_list)]\n      [, priv_type [(column_list)]] ...\n    ON [object_type] priv_level\n    FROM user [, user] ...\n\nREVOKE ALL PRIVILEGES, GRANT OPTION\n    FROM user [, user] ...\n\nREVOKE PROXY ON user\n    FROM user [, user] ...\n\nThe REVOKE statement enables system administrators to revoke privileges\nfrom MySQL accounts. Each account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nREVOKE INSERT ON *.* FROM \'jeffrey\'@\'localhost\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nFor details on the levels at which privileges exist, the permissible\npriv_type and priv_level values, and the syntax for specifying users\nand passwords, see [HELP GRANT]\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all\nglobal, database, table, column, and routine privileges for the named\nuser or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER\nprivilege or the UPDATE privilege for the mysql database.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/revoke.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/revoke.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (141,32,'LAST_DAY','Syntax:\nLAST_DAY(date)\n\nTakes a date or datetime value and returns the corresponding value for\nthe last day of the month. Returns NULL if the argument is invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT LAST_DAY(\'2003-02-05\');\n        -> \'2003-02-28\'\nmysql> SELECT LAST_DAY(\'2004-02-05\');\n        -> \'2004-02-29\'\nmysql> SELECT LAST_DAY(\'2004-01-01 01:01:01\');\n        -> \'2004-01-31\'\nmysql> SELECT LAST_DAY(\'2003-03-32\');\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (142,23,'MEDIUMINT','MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The\nunsigned range is 0 to 16777215.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (143,12,'RANDOM_BYTES','Syntax:\nRANDOM_BYTES(len)\n\nThis function returns a binary string of len random bytes generated\nusing the random number generator of the SSL library (OpenSSL or\nyaSSL). Permitted values of len range from 1 to 1024. For values\noutside that range, RANDOM_BYTES() generates a warning and returns\nNULL.\n\nRANDOM_BYTES() can be used to provide the initialization vector for the\nAES_DECRYPT() and AES_ENCRYPT() functions. For use in that context, len\nmust be at least 16. Larger values are permitted, but bytes in excess\nof 16 are ignored.\n\nRANDOM_BYTES() generates a random value, which makes its result\nnondeterministic. Consequently, statements that use this function are\nunsafe for statement-based replication and cannot be stored in the\nquery cache.\n\nThis function is available as of MySQL 5.6.17.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (144,38,'RTRIM','Syntax:\nRTRIM(str)\n\nReturns the string str with trailing space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RTRIM(\'barbar   \');\n        -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (145,29,'EXPLAIN','Syntax:\n{EXPLAIN | DESCRIBE | DESC}\n    tbl_name [col_name | wild]\n\n{EXPLAIN | DESCRIBE | DESC}\n    [explain_type]\n    explainable_stmt\n\nexplain_type: {\n    EXTENDED\n  | PARTITIONS\n  | FORMAT = format_name\n}\n\nformat_name: {\n    TRADITIONAL\n  | JSON\n}\n\nexplainable_stmt: {\n    SELECT statement\n  | DELETE statement\n  | INSERT statement\n  | REPLACE statement\n  | UPDATE statement\n}\n\nThe DESCRIBE and EXPLAIN statements are synonyms. In practice, the\nDESCRIBE keyword is more often used to obtain information about table\nstructure, whereas EXPLAIN is used to obtain a query execution plan\n(that is, an explanation of how MySQL would execute a query). The\nfollowing discussion uses the DESCRIBE and EXPLAIN keywords in\naccordance with those uses, but the MySQL parser treats them as\ncompletely synonymous.\n\nObtaining Table Structure Information\n\nDESCRIBE provides information about the columns in a table:\n\nmysql> DESCRIBE City;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | NO   |     |         |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | NO   |     | 0       |                |\n+------------+----------+------+-----+---------+----------------+\n\nDESCRIBE is a shortcut for SHOW COLUMNS. These statements also display\ninformation for views. The description for SHOW COLUMNS provides more\ninformation about the output columns. See [HELP SHOW COLUMNS].\n\nBy default, DESCRIBE displays information about all columns in the\ntable. col_name, if given, is the name of a column in the table. In\nthis case, the statement displays information only for the named\ncolumn. wild, if given, is a pattern string. It can contain the SQL "%"\nand "_" wildcard characters. In this case, the statement displays\noutput only for the columns with names matching the string. There is no\nneed to enclose the string within quotation marks unless it contains\nspaces or other special characters.\n\nThe DESCRIBE statement is provided for compatibility with Oracle.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nObtaining Execution Plan Information\n\nThe EXPLAIN statement provides information about how MySQL executes\nstatements:\n\no As of MySQL 5.6.3, permitted explainable statements for EXPLAIN are\n  SELECT, DELETE, INSERT, REPLACE, and UPDATE. Before MySQL 5.6.3,\n  SELECT is the only explainable statement.\n\no When EXPLAIN is used with an explainable statement, MySQL displays\n  information from the optimizer about the statement execution plan.\n  That is, MySQL explains how it would process the statement, including\n  information about how tables are joined and in which order. For\n  information about using EXPLAIN to obtain execution plan information,\n  see http://dev.mysql.com/doc/refman/5.6/en/explain-output.html.\n\no EXPLAIN EXTENDED can be used to obtain additional execution plan\n  information. See\n  http://dev.mysql.com/doc/refman/5.6/en/explain-extended.html.\n\no EXPLAIN PARTITIONS is useful for examining queries involving\n  partitioned tables. See\n  http://dev.mysql.com/doc/refman/5.6/en/partitioning-info.html.\n\no As of MySQL 5.6.5, the FORMAT option can be used to select the output\n  format. TRADITIONAL presents the output in tabular format. This is\n  the default if no FORMAT option is present. JSON format displays the\n  information in JSON format. With FORMAT = JSON, the output includes\n  extended and partition information.\n\nWith the help of EXPLAIN, you can see where you should add indexes to\ntables so that the statement executes faster by using indexes to find\nrows. You can also use EXPLAIN to check whether the optimizer joins the\ntables in an optimal order. To give a hint to the optimizer to use a\njoin order corresponding to the order in which the tables are named in\na SELECT statement, begin the statement with SELECT STRAIGHT_JOIN\nrather than just SELECT. (See\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.)\n\nIf you have a problem with indexes not being used when you believe that\nthey should be, run ANALYZE TABLE to update table statistics, such as\ncardinality of keys, that can affect the choices the optimizer makes.\nSee [HELP ANALYZE TABLE].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/explain.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/explain.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (146,3,'DEGREES','Syntax:\nDEGREES(X)\n\nReturns the argument X, converted from radians to degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT DEGREES(PI());\n        -> 180\nmysql> SELECT DEGREES(PI() / 2);\n        -> 90\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (147,3,'- UNARY','Syntax:\n-\n\nUnary minus. This operator changes the sign of the operand.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT - 2;\n        -> -2\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (148,23,'VARCHAR','[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,535. The effective maximum length\nof a VARCHAR is subject to the maximum row size (65,535 bytes, which is\nshared among all columns) and the character set used. For example, utf8\ncharacters can require up to three bytes per character, so a VARCHAR\ncolumn that uses the utf8 character set can be declared to be a maximum\nof 21,844 characters. See\nhttp://dev.mysql.com/doc/refman/5.6/en/column-count-limit.html.\n\nMySQL stores VARCHAR values as a 1-byte or 2-byte length prefix plus\ndata. The length prefix indicates the number of bytes in the value. A\nVARCHAR column uses one length byte if values require no more than 255\nbytes, two length bytes if values may require more than 255 bytes.\n\n*Note*: MySQL 5.6 follows the standard SQL specification, and does not\nremove trailing spaces from VARCHAR values.\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the\nstandard SQL way to define that a VARCHAR column should use some\npredefined character set. MySQL 4.1 and up uses utf8 as this predefined\ncharacter set.\nhttp://dev.mysql.com/doc/refman/5.6/en/charset-national.html. NVARCHAR\nis shorthand for NATIONAL VARCHAR.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (149,38,'UNHEX','Syntax:\n\nUNHEX(str)\n\nFor a string argument str, UNHEX(str) interprets each pair of\ncharacters in the argument as a hexadecimal number and converts it to\nthe byte represented by the number. The return value is a binary\nstring.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT UNHEX(\'4D7953514C\');\n        -> \'MySQL\'\nmysql> SELECT 0x4D7953514C;\n        -> \'MySQL\'\nmysql> SELECT UNHEX(HEX(\'string\'));\n        -> \'string\'\nmysql> SELECT HEX(UNHEX(\'1267\'));\n        -> \'1267\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (150,40,'DROP TRIGGER','Syntax:\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nThis statement drops a trigger. The schema (database) name is optional.\nIf the schema is omitted, the trigger is dropped from the default\nschema. DROP TRIGGER requires the TRIGGER privilege for the table\nassociated with the trigger.\n\nUse IF EXISTS to prevent an error from occurring for a trigger that\ndoes not exist. A NOTE is generated for a nonexistent trigger when\nusing IF EXISTS. See [HELP SHOW WARNINGS].\n\nTriggers for a table are also dropped if you drop the table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-trigger.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (151,8,'RESET MASTER','Syntax:\nRESET MASTER\n\nDeletes all binary log files listed in the index file, resets the\nbinary log index file to be empty, and creates a new binary log file.\n\nIn MySQL 5.6.5 and later, RESET MASTER also clears the values of the\ngtid_purged system variable (known as gtid_lost in MySQL 5.6.8 and\nearlier) as well as the global value of the gtid_executed (gtid_done,\nprior to MySQL 5.6.9) system variable (but not its session value); that\nis, executing this statement sets each of these values to an empty\nstring (\'\').\n\nThis statement is intended to be used only when the master is started\nfor the first time.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/reset-master.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/reset-master.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (152,3,'PI','Syntax:\nPI()\n\nReturns the value of π (pi). The default number of decimal places\ndisplayed is seven, but MySQL uses the full double-precision value\ninternally.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT PI();\n        -> 3.141593\nmysql> SELECT PI()+0.000000000000000000;\n        -> 3.141592653589793116\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (153,3,'/','Syntax:\n/\n\nDivision:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3/5;\n        -> 0.60\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (154,8,'PURGE BINARY LOGS','Syntax:\nPURGE { BINARY | MASTER } LOGS\n    { TO \'log_name\' | BEFORE datetime_expr }\n\nThe binary log is a set of files that contain information about data\nmodifications made by the MySQL server. The log consists of a set of\nbinary log files, plus an index file (see\nhttp://dev.mysql.com/doc/refman/5.6/en/binary-log.html).\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed\nin the log index file prior to the specified log file name or date.\nBINARY and MASTER are synonyms. Deleted log files also are removed from\nthe list recorded in the index file, so that the given log file becomes\nthe first in the list.\n\nThis statement has no effect if the server was not started with the\n--log-bin option to enable binary logging.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/purge-binary-logs.html\n\n','PURGE BINARY LOGS TO \'mysql-bin.010\';\nPURGE BINARY LOGS BEFORE \'2008-04-02 22:46:26\';\n','http://dev.mysql.com/doc/refman/5.6/en/purge-binary-logs.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (155,16,'STDDEV_SAMP','Syntax:\nSTDDEV_SAMP(expr)\n\nReturns the sample standard deviation of expr (the square root of\nVAR_SAMP().\n\nSTDDEV_SAMP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (156,31,'ST_TOUCHES','ST_Touches(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two\ngeometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either\nthe boundary or the interior of the other.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (157,17,'SCHEMA','Syntax:\nSCHEMA()\n\nThis function is a synonym for DATABASE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (158,33,'MLINEFROMWKB','MLineFromWKB(wkb[,srid]), MultiLineStringFromWKB(wkb[,srid])\n\nConstructs a MultiLineString value using its WKB representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (159,27,'SHOW CREATE TABLE','Syntax:\nSHOW CREATE TABLE tbl_name\n\nShows the CREATE TABLE statement that creates the named table. To use\nthis statement, you must have some privilege for the table. This\nstatement also works with views.\nSHOW CREATE TABLE quotes table and column names according to the value\nof the sql_quote_show_create option. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-table.html\n\n','mysql> SHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n       Table: t\nCreate Table: CREATE TABLE t (\n  id INT(11) default NULL auto_increment,\n  s char(60) default NULL,\n  PRIMARY KEY (id)\n) ENGINE=MyISAM\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (160,28,'DUAL','You are permitted to specify DUAL as a dummy table name in situations\nwhere no tables are referenced:\n\nmysql> SELECT 1 + 1 FROM DUAL;\n        -> 2\n\nDUAL is purely for the convenience of people who require that all\nSELECT statements should have FROM and possibly other clauses. MySQL\nmay ignore the clauses. MySQL does not require FROM DUAL if no tables\nare referenced.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/select.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (161,38,'INSTR','Syntax:\nINSTR(str,substr)\n\nReturns the position of the first occurrence of substring substr in\nstring str. This is the same as the two-argument form of LOCATE(),\nexcept that the order of the arguments is reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT INSTR(\'foobarbar\', \'bar\');\n        -> 4\nmysql> SELECT INSTR(\'xbar\', \'foobar\');\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (162,20,'>=','Syntax:\n>=\n\nGreater than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 >= 2;\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (163,3,'EXP','Syntax:\nEXP(X)\n\nReturns the value of e (the base of natural logarithms) raised to the\npower of X. The inverse of this function is LOG() (using a single\nargument only) or LN().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT EXP(2);\n        -> 7.3890560989307\nmysql> SELECT EXP(-2);\n        -> 0.13533528323661\nmysql> SELECT EXP(0);\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (164,13,'POINTN','PointN(ls,N)\n\nReturns the N-th Point in the Linestring value ls. Points are numbered\nbeginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(PointN(GeomFromText(@ls),2));\n+-------------------------------------+\n| AsText(PointN(GeomFromText(@ls),2)) |\n+-------------------------------------+\n| POINT(2 2)                          |\n+-------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (165,38,'OCT','Syntax:\nOCT(N)\n\nReturns a string representation of the octal value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,8). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT OCT(12);\n        -> \'14\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (166,32,'SYSDATE','Syntax:\nSYSDATE([fsp])\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the\ntime at which the statement began to execute. (Within a stored function\nor trigger, NOW() returns the time at which the function or triggering\nstatement began to execute.)\n\nmysql> SELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW()               | SLEEP(2) | NOW()               |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:36 |        0 | 2006-04-12 13:47:36 |\n+---------------------+----------+---------------------+\n\nmysql> SELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE()           | SLEEP(2) | SYSDATE()           |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:44 |        0 | 2006-04-12 13:47:46 |\n+---------------------+----------+---------------------+\n\nIn addition, the SET TIMESTAMP statement affects the value returned by\nNOW() but not by SYSDATE(). This means that timestamp settings in the\nbinary log have no effect on invocations of SYSDATE().\n\nBecause SYSDATE() can return different values even within the same\nstatement, and is not affected by SET TIMESTAMP, it is nondeterministic\nand therefore unsafe for replication if statement-based binary logging\nis used. If that is a problem, you can use row-based logging.\n\nAlternatively, you can use the --sysdate-is-now option to cause\nSYSDATE() to be an alias for NOW(). This works if the option is used on\nboth the master and the slave.\n\nThe nondeterministic nature of SYSDATE() also means that indexes cannot\nbe used for evaluating expressions that refer to it.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (167,5,'UNINSTALL PLUGIN','Syntax:\nUNINSTALL PLUGIN plugin_name\n\nThis statement removes an installed server plugin. It requires the\nDELETE privilege for the mysql.plugin table.\n\nplugin_name must be the name of some plugin that is listed in the\nmysql.plugin table. The server executes the plugin\'s deinitialization\nfunction and removes the row for the plugin from the mysql.plugin\ntable, so that subsequent server restarts will not load and initialize\nthe plugin. UNINSTALL PLUGIN does not remove the plugin\'s shared\nlibrary file.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/uninstall-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/uninstall-plugin.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (168,33,'ASBINARY','AsBinary(g), AsWKB(g)\n\nConverts a value in internal geometry format to its WKB representation\nand returns the binary result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html\n\n','SELECT AsBinary(g) FROM geom;\n','http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (169,27,'SHOW TABLES','Syntax:\nSHOW [FULL] TABLES [{FROM | IN} db_name]\n    [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLES lists the non-TEMPORARY tables in a given database. You can\nalso get this list using the mysqlshow db_name command. The LIKE\nclause, if present, indicates which table names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nMatching performed by the LIKE clause is dependent on the setting of\nthe lower_case_table_names system variable.\n\nThis statement also lists any views in the database. The FULL modifier\nis supported such that SHOW FULL TABLES displays a second output\ncolumn. Values for the second column are BASE TABLE for a table and\nVIEW for a view.\n\nIf you have no privileges for a base table or view, it does not show up\nin the output from SHOW TABLES or mysqlshow db_name.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-tables.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (170,32,'MAKEDATE','Syntax:\nMAKEDATE(year,dayofyear)\n\nReturns a date, given year and day-of-year values. dayofyear must be\ngreater than 0 or the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n        -> \'2011-01-31\', \'2011-02-01\'\nmysql> SELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n        -> \'2011-12-31\', \'2014-12-31\'\nmysql> SELECT MAKEDATE(2011,0);\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (171,38,'BINARY OPERATOR','Syntax:\nBINARY\n\nThe BINARY operator casts the string following it to a binary string.\nThis is an easy way to force a column comparison to be done byte by\nbyte rather than character by character. This causes the comparison to\nbe case sensitive even if the column is not defined as BINARY or BLOB.\nBINARY also causes trailing spaces to be significant.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html\n\n','mysql> SELECT \'a\' = \'A\';\n        -> 1\nmysql> SELECT BINARY \'a\' = \'A\';\n        -> 0\nmysql> SELECT \'a\' = \'a \';\n        -> 1\nmysql> SELECT BINARY \'a\' = \'a \';\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (172,7,'MBROVERLAPS','MBROverlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 overlap. The term spatially overlaps is\nused if two geometries intersect and their intersection results in a\ngeometry of the same dimension but not equal to either of the given\ngeometries.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (173,7,'ASYMMETRIC_DERIVE','Syntax:\nASYMMETRIC_DERIVE(pub_key_str, priv_key_str)\n\nDerives a symmetric key using the private key of one party and the\npublic key of another, and returns the resulting key as a binary\nstring. If key derivation fails, the result is NULL.\n\npub_key_str and priv_key_str must be valid key strings in PEM format.\nThey must be created using the DH algorithm.\n\nSuppose that you have two pairs of public and private keys:\n\nSET @dhp = CREATE_DH_PARAMETERS(1024);\nSET @priv1 = CREATE_ASYMMETRIC_PRIV_KEY(\'DH\', @dhp);\nSET @pub1 = CREATE_ASYMMETRIC_PUB_KEY(\'DH\', @priv1);\nSET @priv2 = CREATE_ASYMMETRIC_PRIV_KEY(\'DH\', @dhp);\nSET @pub2 = CREATE_ASYMMETRIC_PUB_KEY(\'DH\', @priv2);\n\nSuppose further that you use the private key from one pair and the\npublic key from the other pair to create a symmetric key string. Then\nthis symmetric key identity relationship holds:\n\nASYMMETRIC_DERIVE(@pub1, @priv2) = ASYMMETRIC_DERIVE(@pub2, @priv1)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (174,28,'INSERT SELECT','Syntax:\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n    [INTO] tbl_name \n    [PARTITION (partition_name,...)]\n    [(col_name,...)]\n    SELECT ...\n    [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table\nfrom one or many tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n  SELECT tbl_temp1.fld_order_id\n  FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/insert-select.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/insert-select.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (175,40,'CREATE PROCEDURE','Syntax:\nCREATE\n    [DEFINER = { user | CURRENT_USER }]\n    PROCEDURE sp_name ([proc_parameter[,...]])\n    [characteristic ...] routine_body\n\nCREATE\n    [DEFINER = { user | CURRENT_USER }]\n    FUNCTION sp_name ([func_parameter[,...]])\n    RETURNS type\n    [characteristic ...] routine_body\n\nproc_parameter:\n    [ IN | OUT | INOUT ] param_name type\n\nfunc_parameter:\n    param_name type\n\ntype:\n    Any valid MySQL data type\n\ncharacteristic:\n    COMMENT \'string\'\n  | LANGUAGE SQL\n  | [NOT] DETERMINISTIC\n  | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n  | SQL SECURITY { DEFINER | INVOKER }\n\nroutine_body:\n    Valid SQL routine statement\n\nThese statements create stored routines. By default, a routine is\nassociated with the default database. To associate the routine\nexplicitly with a given database, specify the name as db_name.sp_name\nwhen you create it.\n\nThe CREATE FUNCTION statement is also used in MySQL to support UDFs\n(user-defined functions). See\nhttp://dev.mysql.com/doc/refman/5.6/en/adding-functions.html. A UDF can\nbe regarded as an external stored function. Stored functions share\ntheir namespace with UDFs. See\nhttp://dev.mysql.com/doc/refman/5.6/en/function-resolution.html, for\nthe rules describing how the server interprets references to different\nkinds of functions.\n\nTo invoke a stored procedure, use the CALL statement (see [HELP CALL]).\nTo invoke a stored function, refer to it in an expression. The function\nreturns a value during expression evaluation.\n\nCREATE PROCEDURE and CREATE FUNCTION require the CREATE ROUTINE\nprivilege. They might also require the SUPER privilege, depending on\nthe DEFINER value, as described later in this section. If binary\nlogging is enabled, CREATE FUNCTION might require the SUPER privilege,\nas described in\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-logging.html.\n\nBy default, MySQL automatically grants the ALTER ROUTINE and EXECUTE\nprivileges to the routine creator. This behavior can be changed by\ndisabling the automatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-routines-privileges.html.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be\nused when checking access privileges at routine execution time, as\ndescribed later in this section.\n\nIf the routine name is the same as the name of a built-in SQL function,\na syntax error occurs unless you use a space between the name and the\nfollowing parenthesis when defining the routine or invoking it later.\nFor this reason, avoid using the names of existing SQL functions for\nyour own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always permissible to have spaces after a stored\nroutine name, regardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present.\nIf there are no parameters, an empty parameter list of () should be\nused. Parameter names are not case sensitive.\n\nEach parameter is an IN parameter by default. To specify otherwise for\na parameter, use the keyword OUT or INOUT before the parameter name.\n\n*Note*: Specifying a parameter as IN, OUT, or INOUT is valid only for a\nPROCEDURE. For a FUNCTION, parameters are always regarded as IN\nparameters.\n\nAn IN parameter passes a value into a procedure. The procedure might\nmodify the value, but the modification is not visible to the caller\nwhen the procedure returns. An OUT parameter passes a value from the\nprocedure back to the caller. Its initial value is NULL within the\nprocedure, and its value is visible to the caller when the procedure\nreturns. An INOUT parameter is initialized by the caller, can be\nmodified by the procedure, and any change made by the procedure is\nvisible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the\nCALL statement that invokes the procedure so that you can obtain its\nvalue when the procedure returns. If you are calling the procedure from\nwithin another stored procedure or function, you can also pass a\nroutine parameter or local routine variable as an IN or INOUT\nparameter.\n\nRoutine parameters cannot be referenced in statements prepared within\nthe routine; see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-program-restrictions.html\n.\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter:\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE simpleproc (OUT param1 INT)\n    -> BEGIN\n    ->   SELECT COUNT(*) INTO param1 FROM t;\n    -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter ;\n\nmysql> CALL simpleproc(@a);\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @a;\n+------+\n| @a   |\n+------+\n| 3    |\n+------+\n1 row in set (0.00 sec)\n\nThe example uses the mysql client delimiter command to change the\nstatement delimiter from ; to // while the procedure is being defined.\nThis enables the ; delimiter used in the procedure body to be passed\nthrough to the server rather than being interpreted by mysql itself.\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-defining.html.\n\nThe RETURNS clause may be specified only for a FUNCTION, for which it\nis mandatory. It indicates the return type of the function, and the\nfunction body must contain a RETURN value statement. If the RETURN\nstatement returns a value of a different type, the value is coerced to\nthe proper type. For example, if a function specifies an ENUM or SET\nvalue in the RETURNS clause, but the RETURN statement returns an\ninteger, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nThe following example function takes a parameter, performs an operation\nusing an SQL function, and returns the result. In this case, it is\nunnecessary to use delimiter because the function definition contains\nno internal ; statement delimiters:\n\nmysql> CREATE FUNCTION hello (s CHAR(20))\nmysql> RETURNS CHAR(50) DETERMINISTIC\n    -> RETURN CONCAT(\'Hello, \',s,\'!\');\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world!  |\n+----------------+\n1 row in set (0.00 sec)\n\nParameter types and function return types can be declared to use any\nvalid data type. The COLLATE attribute can be used if preceded by the\nCHARACTER SET attribute.\n\nThe routine_body consists of a valid SQL routine statement. This can be\na simple statement such as SELECT or INSERT, or a compound statement\nwritten using BEGIN and END. Compound statements can contain\ndeclarations, loops, and other control structure statements. The syntax\nfor these statements is described in\nhttp://dev.mysql.com/doc/refman/5.6/en/sql-syntax-compound-statements.h\ntml.\n\nMySQL permits routines to contain DDL statements, such as CREATE and\nDROP. MySQL also permits stored procedures (but not stored functions)\nto contain SQL transaction statements such as COMMIT. Stored functions\nmay not contain statements that perform explicit or implicit commit or\nrollback. Support for these statements is not required by the SQL\nstandard, which states that each DBMS vendor may decide whether to\npermit them.\n\nStatements that return a result set can be used within a stored\nprocedure but not within a stored function. This prohibition includes\nSELECT statements that do not have an INTO var_list clause and other\nstatements such as SHOW, EXPLAIN, and CHECK TABLE. For statements that\ncan be determined at function definition time to return a result set, a\nNot allowed to return a result set from a function error occurs\n(ER_SP_NO_RETSET). For statements that can be determined only at\nruntime to return a result set, a PROCEDURE %s can\'t return a result\nset in the given context error occurs (ER_SP_BADSELECT).\n\nUSE statements within stored routines are not permitted. When a routine\nis invoked, an implicit USE db_name is performed (and undone when the\nroutine terminates). The causes the routine to have the given default\ndatabase while it executes. References to objects in databases other\nthan the routine default database should be qualified with the\nappropriate database name.\n\nFor additional information about statements that are not permitted in\nstored routines, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-program-restrictions.html\n.\n\nFor information about invoking stored procedures from within programs\nwritten in a language that has a MySQL interface, see [HELP CALL].\n\nMySQL stores the sql_mode system variable setting in effect when a\nroutine is created or altered, and always executes the routine with\nthis setting in force, regardless of the current server SQL mode when\nthe routine begins executing.\n\nThe switch from the SQL mode of the invoker to that of the routine\noccurs after evaluation of arguments and assignment of the resulting\nvalues to routine parameters. If you define a routine in strict SQL\nmode but invoke it in nonstrict mode, assignment of arguments to\nroutine parameters does not take place in strict mode. If you require\nthat expressions passed to a routine be assigned in strict SQL mode,\nyou should invoke the routine with strict mode in effect.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-procedure.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (176,7,'SQL_THREAD_WAIT_AFTER_GTIDS','Syntax:\nSQL_THREAD_WAIT_AFTER_GTIDS(gtid_set[, timeout])\n\nSQL_THREAD_WAIT_AFTER_GTIDS() was added in MySQL 5.6.5, and replaced by\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() in MySQL 5.6.9. (Bug #14775984)\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (177,24,'GET DIAGNOSTICS','Syntax:\nGET [CURRENT] DIAGNOSTICS\n{\n    statement_information_item\n    [, statement_information_item] ... \n  | CONDITION condition_number\n    condition_information_item\n    [, condition_information_item] ...\n}\n\nstatement_information_item:\n    target = statement_information_item_name\n\ncondition_information_item:\n    target = condition_information_item_name\n\nstatement_information_item_name:\n    NUMBER\n  | ROW_COUNT\n\ncondition_information_item_name:\n    CLASS_ORIGIN\n  | SUBCLASS_ORIGIN\n  | RETURNED_SQLSTATE\n  | MESSAGE_TEXT\n  | MYSQL_ERRNO\n  | CONSTRAINT_CATALOG\n  | CONSTRAINT_SCHEMA\n  | CONSTRAINT_NAME\n  | CATALOG_NAME\n  | SCHEMA_NAME\n  | TABLE_NAME\n  | COLUMN_NAME\n  | CURSOR_NAME\n\ncondition_number, target:\n    (see following discussion)\n\nSQL statements produce diagnostic information that populates the\ndiagnostics area. The GET DIAGNOSTICS statement enables applications to\ninspect this information. It is available as of MySQL 5.6.4. (You can\nalso use SHOW WARNINGS or SHOW ERRORS to see conditions or errors.)\n\nNo special privileges are required to execute GET DIAGNOSTICS.\n\nThe keyword CURRENT means to retrieve information from the current\ndiagnostics area. In MySQL, it has no effect because that is the\ndefault behavior.\n\nGET DIAGNOSTICS is typically used in a handler within a stored program,\nbut it is a MySQL extension that it is permitted outside handler\ncontext to check the execution of any SQL statement. For example, if\nyou invoke the mysql client program, you can enter these statements at\nthe prompt:\n\nmysql> DROP TABLE test.no_such_table;\nERROR 1051 (42S02): Unknown table \'test.no_such_table\'\nmysql> GET DIAGNOSTICS CONDITION 1\n    ->   @p1 = RETURNED_SQLSTATE, @p2 = MESSAGE_TEXT;\nmysql> SELECT @p1, @p2;\n+-------+------------------------------------+\n| @p1   | @p2                                |\n+-------+------------------------------------+\n| 42S02 | Unknown table \'test.no_such_table\' |\n+-------+------------------------------------+\n\nFor a description of the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html. Briefly,\nit contains two kinds of information:\n\no Statement information, such as the number of conditions that occurred\n  or the affected-rows count.\n\no Condition information, such as the error code and message. If a\n  statement raises multiple conditions, this part of the diagnostics\n  area has a condition area for each one. If a statement raises no\n  conditions, this part of the diagnostics area is empty.\n\nFor a statement that produces three conditions, the diagnostics area\ncontains statement and condition information like this:\n\nStatement information:\n  row count\n  ... other statement information items ...\nCondition area list:\n  Condition area 1:\n    error code for condition 1\n    error message for condition 1\n    ... other condition information items ...\n  Condition area 2:\n    error code for condition 2:\n    error message for condition 2\n    ... other condition information items ...\n  Condition area 3:\n    error code for condition 3\n    error message for condition 3\n    ... other condition information items ...\n\nGET DIAGNOSTICS can obtain either statement or condition information,\nbut not both in the same statement:\n\no To obtain statement information, retrieve the desired statement items\n  into target variables. This instance of GET DIAGNOSTICS assigns the\n  number of available conditions and the rows-affected count to the\n  user variables @p1 and @p2:\n\nGET DIAGNOSTICS @p1 = NUMBER, @p2 = ROW_COUNT;\n\no To obtain condition information, specify the condition number and\n  retrieve the desired condition items into target variables. This\n  instance of GET DIAGNOSTICS assigns the SQLSTATE value and error\n  message to the user variables @p3 and @p4:\n\nGET DIAGNOSTICS CONDITION 1\n  @p3 = RETURNED_SQLSTATE, @p4 = MESSAGE_TEXT;\n\nThe retrieval list specifies one or more target = item_name\nassignments, separated by commas. Each assignment names a target\nvariable and either a statement_information_item_name or\ncondition_information_item_name designator, depending on whether the\nstatement retrieves statement or condition information.\n\nValid target designators for storing item information can be stored\nprocedure or function parameters, stored program local variables\ndeclared with DECLARE, or user-defined variables.\n\nValid condition_number designators can be stored procedure or function\nparameters, stored program local variables declared with DECLARE,\nuser-defined variables, system variables, or literals. A character\nliteral may include a _charset introducer. A warning occurs if the\ncondition number is not in the range from 1 to the number of condition\nareas that have information. In this case, the warning is added to the\ndiagnostics area without clearing it.\n\nCurrently, when a condition occurs, MySQL does not populate all\ncondition items recognized by GET DIAGNOSTICS. For example:\n\nmysql> GET DIAGNOSTICS CONDITION 1\n    ->   @p5 = SCHEMA_NAME, @p6 = TABLE_NAME;\nmysql> SELECT @p5, @p6;\n+------+------+\n| @p5  | @p6  |\n+------+------+\n|      |      |\n+------+------+\n\nIn standard SQL, if there are multiple conditions, the first condition\nrelates to the SQLSTATE value returned for the previous SQL statement.\nIn MySQL, this is not guaranteed. To get the main error, you cannot do\nthis:\n\nGET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;\n\nInstead, retrieve the condition count first, then use it to specify\nwhich condition number to inspect:\n\nGET DIAGNOSTICS @cno = NUMBER;\nGET DIAGNOSTICS CONDITION @cno @errno = MYSQL_ERRNO;\n\nFor information about permissible statement and condition information\nitems, and which ones are populated when a condition occurs, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html#diagnostic\ns-area-information-items.\n\nHere is an example that uses GET DIAGNOSTICS and an exception handler\nin stored procedure context to assess the outcome of an insert\noperation. If the insert was successful, the procedure uses GET\nDIAGNOSTICS to get the rows-affected count. This shows that you can use\nGET DIAGNOSTICS multiple times to retrieve information about a\nstatement as long as the diagnostics area has not been cleared.\n\nCREATE PROCEDURE do_insert(value INT)\nBEGIN\n  -- Declare variables to hold diagnostics area information\n  DECLARE code CHAR(5) DEFAULT \'00000\';\n  DECLARE msg TEXT;\n  DECLARE rows INT;\n  DECLARE result TEXT;\n  -- Declare exception handler for failed insert\n  DECLARE CONTINUE HANDLER FOR SQLEXCEPTION\n    BEGIN\n      GET DIAGNOSTICS CONDITION 1\n        code = RETURNED_SQLSTATE, msg = MESSAGE_TEXT;\n    END;\n\n  -- Perform the insert\n  INSERT INTO t1 (int_col) VALUES(value);\n  -- Check whether the insert was successful\n  IF code = \'00000\' THEN\n    GET DIAGNOSTICS rows = ROW_COUNT;\n    SET result = CONCAT(\'insert succeeded, row count = \',rows);\n  ELSE\n    SET result = CONCAT(\'insert failed, error = \',code,\', message = \',msg);\n  END IF;\n  -- Say what happened\n  SELECT result;\nEND;\n\nSuppose that t1.int_col is an integer column that is declared as NOT\nNULL. The procedure produces these results when invoked to insert\nnon-NULL and NULL values, respectively:\n\nmysql> CALL do_insert(1);\n+---------------------------------+\n| result                          |\n+---------------------------------+\n| insert succeeded, row count = 1 |\n+---------------------------------+\n\nmysql> CALL do_insert(NULL);\n+-------------------------------------------------------------------------+\n| result                                                                  |\n+-------------------------------------------------------------------------+\n| insert failed, error = 23000, message = Column \'int_col\' cannot be null |\n+-------------------------------------------------------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/get-diagnostics.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/get-diagnostics.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (178,38,'NOT REGEXP','Syntax:\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/regexp.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/regexp.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (179,24,'LEAVE','Syntax:\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the\ngiven label. If the label is for the outermost stored program block,\nLEAVE exits the program.\n\nLEAVE can be used within BEGIN ... END or loop constructs (LOOP,\nREPEAT, WHILE).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/leave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/leave.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (180,20,'NOT IN','Syntax:\nexpr NOT IN (value,...)\n\nThis is the same as NOT (expr IN (value,...)).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (181,15,'&&','Syntax:\nAND, &&\n\nLogical AND. Evaluates to 1 if all operands are nonzero and not NULL,\nto 0 if one or more operands are 0, otherwise NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT 1 && 1;\n        -> 1\nmysql> SELECT 1 && 0;\n        -> 0\nmysql> SELECT 1 && NULL;\n        -> NULL\nmysql> SELECT 0 && NULL;\n        -> 0\nmysql> SELECT NULL && 0;\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (182,11,'X','X(p)\n\nReturns the X-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html\n\n','mysql> SELECT X(POINT(56.7, 53.34));\n+-----------------------+\n| X(POINT(56.7, 53.34)) |\n+-----------------------+\n|                  56.7 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (183,17,'FOUND_ROWS','Syntax:\nFOUND_ROWS()\n\nA SELECT statement may include a LIMIT clause to restrict the number of\nrows the server returns to the client. In some cases, it is desirable\nto know how many rows the statement would have returned without the\nLIMIT, but without running the statement again. To obtain this row\ncount, include a SQL_CALC_FOUND_ROWS option in the SELECT statement,\nand then invoke FOUND_ROWS() afterward:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name\n    -> WHERE id > 100 LIMIT 10;\nmysql> SELECT FOUND_ROWS();\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (184,31,'CROSSES','Crosses(g1,g2)\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon\nor a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\no The two geometries intersect\n\no Their intersection results in a geometry that has a dimension that is\n  one less than the maximum dimension of the two given geometries\n\no Their intersection is not equal to either of the two given geometries\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (185,26,'ST_UNION','ST_Union(g1, g2)\n\nReturns a geometry that represents the point set union of the geometry\nvalues g1 and g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = GeomFromText(\'LineString(1 1, 3 3)\');\nmysql> SET @g2 = GeomFromText(\'LineString(1 3, 3 1)\');\nmysql> SELECT AsText(ST_Union(@g1, @g2));\n+--------------------------------------+\n| AsText(ST_Union(@g1, @g2))           |\n+--------------------------------------+\n| MULTILINESTRING((1 1,3 3),(3 1,1 3)) |\n+--------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (186,16,'BIT_XOR','Syntax:\nBIT_XOR(expr)\n\nReturns the bitwise XOR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (187,27,'FLUSH','Syntax:\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n    flush_option [, flush_option] ...\n\nThe FLUSH statement has several variant forms that clear or reload\nvarious internal caches, flush tables, or acquire locks. To execute\nFLUSH, you must have the RELOAD privilege. Specific flush options might\nrequire additional privileges, as described later.\n\nBy default, the server writes FLUSH statements to the binary log so\nthat they replicate to replication slaves. To suppress logging, specify\nthe optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\n*Note*: FLUSH LOGS, FLUSH TABLES WITH READ LOCK (with or without a\ntable list), and FLUSH TABLES tbl_name ... FOR EXPORT are not written\nto the binary log in any case because they would cause problems if\nreplicated to a slave.\n\nSending a SIGHUP signal to the server causes several flush operations\nto occur that are similar to various forms of the FLUSH statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-signal-response.html.\n\nThe FLUSH statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nThe RESET statement is similar to FLUSH. See [HELP RESET], for\ninformation about using the RESET statement with replication.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/flush.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/flush.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (188,24,'BEGIN END','Syntax:\n[begin_label:] BEGIN\n    [statement_list]\nEND [end_label]\n\nBEGIN ... END syntax is used for writing compound statements, which can\nappear within stored programs (stored procedures and functions,\ntriggers, and events). A compound statement can contain multiple\nstatements, enclosed by the BEGIN and END keywords. statement_list\nrepresents a list of one or more statements, each terminated by a\nsemicolon (;) statement delimiter. The statement_list itself is\noptional, so the empty compound statement (BEGIN END) is legal.\n\nBEGIN ... END blocks can be nested.\n\nUse of multiple statements requires that a client is able to send\nstatement strings containing the ; statement delimiter. In the mysql\ncommand-line client, this is handled with the delimiter command.\nChanging the ; end-of-statement delimiter (for example, to //) permit ;\nto be used in a program body. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-defining.html.\n\nA BEGIN ... END block can be labeled. See [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/begin-end.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/begin-end.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (189,27,'SHOW PROCEDURE STATUS','Syntax:\nSHOW PROCEDURE STATUS\n    [LIKE \'pattern\' | WHERE expr]\n\nThis statement is a MySQL extension. It returns characteristics of a\nstored procedure, such as the database, name, type, creator, creation\nand modification dates, and character set information. A similar\nstatement, SHOW FUNCTION STATUS, displays information about stored\nfunctions (see [HELP SHOW FUNCTION STATUS]).\n\nThe LIKE clause, if present, indicates which procedure or function\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-procedure-status.html\n\n','mysql> SHOW PROCEDURE STATUS LIKE \'sp1\'\\G\n*************************** 1. row ***************************\n                  Db: test\n                Name: sp1\n                Type: PROCEDURE\n             Definer: testuser@localhost\n            Modified: 2004-08-03 15:29:37\n             Created: 2004-08-03 15:29:37\n       Security_type: DEFINER\n             Comment:\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.6/en/show-procedure-status.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (190,16,'STDDEV_POP','Syntax:\nSTDDEV_POP(expr)\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent\nbut not standard SQL.\n\nSTDDEV_POP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (191,27,'SHOW CHARACTER SET','Syntax:\nSHOW CHARACTER SET\n    [LIKE \'pattern\' | WHERE expr]\n\nThe SHOW CHARACTER SET statement shows all available character sets.\nThe LIKE clause, if present, indicates which character set names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html. For example:\n\nmysql> SHOW CHARACTER SET LIKE \'latin%\';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description                 | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\n| latin1  | cp1252 West European        | latin1_swedish_ci |      1 |\n| latin2  | ISO 8859-2 Central European | latin2_general_ci |      1 |\n| latin5  | ISO 8859-9 Turkish          | latin5_turkish_ci |      1 |\n| latin7  | ISO 8859-13 Baltic          | latin7_general_ci |      1 |\n+---------+-----------------------------+-------------------+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-character-set.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (192,31,'INTERSECTS','Intersects(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially intersects g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (193,24,'LOOP','Syntax:\n[begin_label:] LOOP\n    statement_list\nEND LOOP [end_label]\n\nLOOP implements a simple loop construct, enabling repeated execution of\nthe statement list, which consists of one or more statements, each\nterminated by a semicolon (;) statement delimiter. The statements\nwithin the loop are repeated until the loop is terminated. Usually,\nthis is accomplished with a LEAVE statement. Within a stored function,\nRETURN can also be used, which exits the function entirely.\n\nNeglecting to include a loop-termination statement results in an\ninfinite loop.\n\nA LOOP statement can be labeled. For the rules regarding label use, see\n[HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/loop.html\n\n','CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n  label1: LOOP\n    SET p1 = p1 + 1;\n    IF p1 < 10 THEN\n      ITERATE label1;\n    END IF;\n    LEAVE label1;\n  END LOOP label1;\n  SET @x = p1;\nEND;\n','http://dev.mysql.com/doc/refman/5.6/en/loop.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (194,20,'GREATEST','Syntax:\nGREATEST(value1,value2,...)\n\nWith two or more arguments, returns the largest (maximum-valued)\nargument. The arguments are compared using the same rules as for\nLEAST().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT GREATEST(2,0);\n        -> 2\nmysql> SELECT GREATEST(34.0,3.0,5.0,767.0);\n        -> 767.0\nmysql> SELECT GREATEST(\'B\',\'A\',\'C\');\n        -> \'C\'\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (195,31,'ST_CONTAINS','ST_Contains(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2. This\ntests the opposite relationship as ST_Within().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (196,16,'BIT_AND','Syntax:\nBIT_AND(expr)\n\nReturns the bitwise AND of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (197,32,'SECOND','Syntax:\nSECOND(time)\n\nReturns the second for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SECOND(\'10:05:03\');\n        -> 3\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (198,7,'MBRCONTAINS','MBRContains(g1,g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\ncontains the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','mysql> SET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = GeomFromText(\'Point(1 1)\');\nmysql> SELECT MBRContains(@g1,@g2), MBRWithin(@g2,@g1);\n+----------------------+--------------------+\n| MBRContains(@g1,@g2) | MBRWithin(@g2,@g1) |\n+----------------------+--------------------+\n|                    1 |                  1 |\n+----------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (199,3,'COT','Syntax:\nCOT(X)\n\nReturns the cotangent of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT COT(12);\n        -> -1.5726734063977\nmysql> SELECT COT(0);\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (200,27,'SHOW CREATE EVENT','Syntax:\nSHOW CREATE EVENT event_name\n\nThis statement displays the CREATE EVENT statement needed to re-create\na given event. It requires the EVENT privilege for the database from\nwhich the event is to be shown. For example (using the same event\ne_daily defined and then altered in [HELP SHOW EVENTS]):\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-event.html\n\n','mysql> SHOW CREATE EVENT test.e_daily\\G\n*************************** 1. row ***************************\n               Event: e_daily\n            sql_mode:\n           time_zone: SYSTEM\n        Create Event: CREATE EVENT `e_daily`\n                        ON SCHEDULE EVERY 1 DAY\n                        STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n                        ON COMPLETION NOT PRESERVE\n                        ENABLE\n                        COMMENT \'Saves total number of sessions then\n                                clears the table each day\'\n                        DO BEGIN\n                          INSERT INTO site_activity.totals (time, total)\n                            SELECT CURRENT_TIMESTAMP, COUNT(*)\n                            FROM site_activity.sessions;\n                          DELETE FROM site_activity.sessions;\n                        END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n  Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-event.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (201,38,'LOAD_FILE','Syntax:\nLOAD_FILE(file_name)\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify\nthe full path name to the file, and you must have the FILE privilege.\nThe file must be readable by all and its size less than\nmax_allowed_packet bytes. If the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nIf the file does not exist or cannot be read because one of the\npreceding conditions is not satisfied, the function returns NULL.\n\nThe character_set_filesystem system variable controls interpretation of\nfile names that are given as literal strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> UPDATE t\n            SET blob_col=LOAD_FILE(\'/tmp/picture\')\n            WHERE id=1;\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (202,4,'POINTFROMTEXT','PointFromText(wkt[,srid])\n\nConstructs a Point value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (203,32,'DATE_FORMAT','Syntax:\nDATE_FORMAT(date,format)\n\nFormats the date value according to the format string.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n        -> \'Sunday October 2009\'\nmysql> SELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n        -> \'22:23:00\'\nmysql> SELECT DATE_FORMAT(\'1900-10-04 22:23:00\',\n    ->                 \'%D %y %a %d %m %b %j\');\n        -> \'4th 00 Thu 04 10 Oct 277\'\nmysql> SELECT DATE_FORMAT(\'1997-10-04 22:23:00\',\n    ->                 \'%H %k %I %r %T %S %w\');\n        -> \'22 22 10 10:23:00 PM 22:23:00 00 6\'\nmysql> SELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n        -> \'1998 52\'\nmysql> SELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n        -> \'00\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (204,32,'YEAR','Syntax:\nYEAR(date)\n\nReturns the year for date, in the range 1000 to 9999, or 0 for the\n"zero" date.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT YEAR(\'1987-01-01\');\n        -> 1987\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (205,20,'IS NULL','Syntax:\nIS NULL\n\nTests whether a value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n        -> 0, 0, 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (206,40,'ALTER SERVER','Syntax:\nALTER SERVER  server_name\n    OPTIONS (option [, option] ...)\n\nAlters the server information for server_name, adjusting any of the\noptions permitted in the CREATE SERVER statement. The corresponding\nfields in the mysql.servers table are updated accordingly. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-server.html\n\n','ALTER SERVER s OPTIONS (USER \'sally\');\n','http://dev.mysql.com/doc/refman/5.6/en/alter-server.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (207,24,'RESIGNAL','Syntax:\nRESIGNAL [condition_value]\n    [SET signal_information_item\n    [, signal_information_item] ...]\n\ncondition_value:\n    SQLSTATE [VALUE] sqlstate_value\n  | condition_name\n\nsignal_information_item:\n    condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n    CLASS_ORIGIN\n  | SUBCLASS_ORIGIN\n  | MESSAGE_TEXT\n  | MYSQL_ERRNO\n  | CONSTRAINT_CATALOG\n  | CONSTRAINT_SCHEMA\n  | CONSTRAINT_NAME\n  | CATALOG_NAME\n  | SCHEMA_NAME\n  | TABLE_NAME\n  | COLUMN_NAME\n  | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n    (see following discussion)\n\nRESIGNAL passes on the error condition information that is available\nduring execution of a condition handler within a compound statement\ninside a stored procedure or function, trigger, or event. RESIGNAL may\nchange some or all information before passing it on. RESIGNAL is\nrelated to SIGNAL, but instead of originating a condition as SIGNAL\ndoes, RESIGNAL relays existing condition information, possibly after\nmodifying it.\n\nRESIGNAL makes it possible to both handle an error and return the error\ninformation. Otherwise, by executing an SQL statement within the\nhandler, information that caused the handler\'s activation is destroyed.\nRESIGNAL also can make some procedures shorter if a given handler can\nhandle part of a situation, then pass the condition "up the line" to\nanother handler.\n\nNo special privileges are required to execute the RESIGNAL statement.\n\nAll forms of RESIGNAL require that the current context be a condition\nhandler. Otherwise, RESIGNAL is illegal and a RESIGNAL when handler not\nactive error occurs.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html.\n\nFor condition_value and signal_information_item, the definitions and\nrules are the same for RESIGNAL as for SIGNAL. For example, the\ncondition_value can be an SQLSTATE value, and the value can indicate\nerrors, warnings, or "not found." For additional information, see [HELP\nSIGNAL].\n\nThe RESIGNAL statement takes condition_value and SET clauses, both of\nwhich are optional. This leads to several possible uses:\n\no RESIGNAL alone:\n\nRESIGNAL;\n\no RESIGNAL with new signal information:\n\nRESIGNAL SET signal_information_item [, signal_information_item] ...;\n\no RESIGNAL with a condition value and possibly new signal information:\n\nRESIGNAL condition_value\n    [SET signal_information_item [, signal_information_item] ...];\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/resignal.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/resignal.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (208,32,'TIME FUNCTION','Syntax:\nTIME(expr)\n\nExtracts the time part of the time or datetime expression expr and\nreturns it as a string.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIME(\'2003-12-31 01:02:03\');\n        -> \'01:02:03\'\nmysql> SELECT TIME(\'2003-12-31 01:02:03.000123\');\n        -> \'01:02:03.000123\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (209,32,'DATE_ADD','Syntax:\nDATE_ADD(date,INTERVAL expr unit), DATE_SUB(date,INTERVAL expr unit)\n\nThese functions perform date arithmetic. The date argument specifies\nthe starting date or datetime value. expr is an expression specifying\nthe interval value to be added or subtracted from the starting date.\nexpr is a string; it may start with a "-" for negative intervals. unit\nis a keyword indicating the units in which the expression should be\ninterpreted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n        -> \'2009-01-01 00:00:00\'\nmysql> SELECT INTERVAL 1 DAY + \'2008-12-31\';\n        -> \'2009-01-01\'\nmysql> SELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n        -> \'2004-12-31 23:59:59\'\nmysql> SELECT DATE_ADD(\'2000-12-31 23:59:59\',\n    ->                 INTERVAL 1 SECOND);\n        -> \'2001-01-01 00:00:00\'\nmysql> SELECT DATE_ADD(\'2010-12-31 23:59:59\',\n    ->                 INTERVAL 1 DAY);\n        -> \'2011-01-01 23:59:59\'\nmysql> SELECT DATE_ADD(\'2100-12-31 23:59:59\',\n    ->                 INTERVAL \'1:1\' MINUTE_SECOND);\n        -> \'2101-01-01 00:01:00\'\nmysql> SELECT DATE_SUB(\'2005-01-01 00:00:00\',\n    ->                 INTERVAL \'1 1:1:1\' DAY_SECOND);\n        -> \'2004-12-30 22:58:59\'\nmysql> SELECT DATE_ADD(\'1900-01-01 00:00:00\',\n    ->                 INTERVAL \'-1 10\' DAY_HOUR);\n        -> \'1899-12-30 14:00:00\'\nmysql> SELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n        -> \'1997-12-02\'\nmysql> SELECT DATE_ADD(\'1992-12-31 23:59:59.000002\',\n    ->            INTERVAL \'1.999999\' SECOND_MICROSECOND);\n        -> \'1993-01-01 00:00:01.000001\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (210,37,'ST_ENVELOPE','ST_Envelope(g)\n\nReturns the minimum bounding rectangle (MBR) for the geometry value g.\nThe result is returned as a Polygon value that is defined by the corner\npoints of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','mysql> SELECT AsText(ST_Envelope(GeomFromText(\'LineString(1 1,2 2)\')));\n+----------------------------------------------------------+\n| AsText(ST_Envelope(GeomFromText(\'LineString(1 1,2 2)\'))) |\n+----------------------------------------------------------+\n| POLYGON((1 1,2 1,2 2,1 2,1 1))                           |\n+----------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (211,38,'LIKE','Syntax:\nexpr LIKE pat [ESCAPE \'escape_char\']\n\nPattern matching using SQL simple regular expression comparison.\nReturns 1 (TRUE) or 0 (FALSE). If either expr or pat is NULL, the\nresult is NULL.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html\n\n','mysql> SELECT \'David!\' LIKE \'David_\';\n        -> 1\nmysql> SELECT \'David!\' LIKE \'%D%v%\';\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (212,25,'MULTIPOINT','MultiPoint(pt1,pt2,...)\n\nConstructs a MultiPoint value using Point or WKB Point arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (213,19,'>>','Syntax:\n>>\n\nShifts a longlong (BIGINT) number to the right.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 4 >> 2;\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (214,24,'FETCH','Syntax:\nFETCH [[NEXT] FROM] cursor_name INTO var_name [, var_name] ...\n\nThis statement fetches the next row for the SELECT statement associated\nwith the specified cursor (which must be open), and advances the cursor\npointer. If a row exists, the fetched columns are stored in the named\nvariables. The number of columns retrieved by the SELECT statement must\nmatch the number of output variables specified in the FETCH statement.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE\nvalue \'02000\'. To detect this condition, you can set up a handler for\nit (or for a NOT FOUND condition). For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/fetch.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/fetch.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (215,30,'TRUE FALSE','The constants TRUE and FALSE evaluate to 1 and 0, respectively. The\nconstant names can be written in any lettercase.\n\nmysql> SELECT TRUE, true, FALSE, false;\n        -> 1, 1, 0, 0\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/boolean-literals.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/boolean-literals.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (216,7,'MBRWITHIN','MBRWithin(g1,g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\nis within the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','mysql> SET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nmysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n|                  1 |                  0 |\n+--------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (217,17,'SESSION_USER','Syntax:\nSESSION_USER()\n\nSESSION_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (218,27,'SHOW CREATE FUNCTION','Syntax:\nSHOW CREATE FUNCTION func_name\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored\nfunctions. See [HELP SHOW CREATE PROCEDURE].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-create-function.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (219,32,'STR_TO_DATE','Syntax:\nSTR_TO_DATE(str,format)\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string\nstr and a format string format. STR_TO_DATE() returns a DATETIME value\nif the format string contains both date and time parts, or a DATE or\nTIME value if the string contains only date or time parts. If the date,\ntime, or datetime value extracted from str is illegal, STR_TO_DATE()\nreturns NULL and produces a warning.\n\nThe server scans str attempting to match format to it. The format\nstring can contain literal characters and format specifiers beginning\nwith %. Literal characters in format must match literally in str.\nFormat specifiers in format must match a date or time part in str. For\nthe specifiers that can be used in format, see the DATE_FORMAT()\nfunction description.\n\nmysql> SELECT STR_TO_DATE(\'01,5,2013\',\'%d,%m,%Y\');\n        -> \'2013-05-01\'\nmysql> SELECT STR_TO_DATE(\'May 1, 2013\',\'%M %d,%Y\');\n        -> \'2013-05-01\'\n\nScanning starts at the beginning of str and fails if format is found\nnot to match. Extra characters at the end of str are ignored.\n\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'a%h:%i:%s\');\n        -> \'09:30:17\'\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'%h:%i:%s\');\n        -> NULL\nmysql> SELECT STR_TO_DATE(\'09:30:17a\',\'%h:%i:%s\');\n        -> \'09:30:17\'\n\nUnspecified date or time parts have a value of 0, so incompletely\nspecified values in str produce a result with some or all parts set to\n0:\n\nmysql> SELECT STR_TO_DATE(\'abc\',\'abc\');\n        -> \'0000-00-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%m\');\n        -> \'0000-09-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%s\');\n        -> \'00:00:09\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (220,11,'Y','Y(p)\n\nReturns the Y-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html\n\n','mysql> SELECT Y(POINT(56.7, 53.34));\n+-----------------------+\n| Y(POINT(56.7, 53.34)) |\n+-----------------------+\n|                 53.34 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (221,21,'CHECKSUM TABLE','Syntax:\nCHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]\n\nCHECKSUM TABLE reports a checksum for the contents of a table. During\nthe checksum operation, the table is locked with a read lock for InnoDB\nand MyISAM. You can use this statement to verify that the contents are\nthe same before and after a backup, rollback, or other operation that\nis intended to put the data back to a known state. This statement\nrequires the SELECT privilege for the table.\n\nPerformance Considerations\n\nBy default, the entire table is read row by row and the checksum is\ncalculated. For large tables, this could take a long time, thus you\nwould only perform this operation occasionally. This row-by-row\ncalculation is what you get with the EXTENDED clause, with InnoDB and\nall other storage engines other than MyISAM, and with MyISAM tables not\ncreated with the CHECKSUM=1 clause.\n\nFor MyISAM tables created with the CHECKSUM=1 clause, CHECKSUM TABLE or\nCHECKSUM TABLE ... QUICK returns the "live" table checksum that can be\nreturned very fast. If the table does not meet all these conditions,\nthe QUICK method returns NULL. See [HELP CREATE TABLE] for the syntax\nof the CHECKSUM clause.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a\nwarning.\n\nPrior to MySQL 5.6.4, CHECKSUM TABLE returned 0 for partitioned tables\nunless the EXTENDED option was used. (Bug #11933226, Bug #60681)\n\nThe checksum value depends on the table row format. If the row format\nchanges, the checksum also changes. For example, the storage format for\nVARCHAR changed between MySQL 4.1 and 5.0, so if a 4.1 table is\nupgraded to MySQL 5.0, the checksum value may change.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/checksum-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/checksum-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (222,2,'NUMINTERIORRINGS','NumInteriorRings(poly)\n\nReturns the number of interior rings in the Polygon value poly.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n    -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT NumInteriorRings(GeomFromText(@poly));\n+---------------------------------------+\n| NumInteriorRings(GeomFromText(@poly)) |\n+---------------------------------------+\n|                                     1 |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (223,2,'INTERIORRINGN','InteriorRingN(poly,N)\n\nReturns the N-th interior ring for the Polygon value poly as a\nLineString. Rings are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n    -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT AsText(InteriorRingN(GeomFromText(@poly),1));\n+----------------------------------------------+\n| AsText(InteriorRingN(GeomFromText(@poly),1)) |\n+----------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1)              |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (224,32,'UTC_TIME','Syntax:\nUTC_TIME, UTC_TIME([fsp])\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIME(), UTC_TIME() + 0;\n        -> \'18:07:53\', 180753.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (225,14,'IS_IPV4_COMPAT','Syntax:\nIS_IPV4_COMPAT(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-compatible IPv6 address, 0 otherwise.\nIPv4-compatible addresses have the form ::ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::10.0.5.9\'));\n        -> 1\nmysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::ffff:10.0.5.9\'));\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (226,40,'DROP FUNCTION','The DROP FUNCTION statement is used to drop stored functions and\nuser-defined functions (UDFs):\n\no For information about dropping stored functions, see [HELP DROP\n  PROCEDURE].\n\no For information about dropping user-defined functions, see [HELP DROP\n  FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-function.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (227,16,'STDDEV','Syntax:\nSTDDEV(expr)\n\nReturns the population standard deviation of expr. This function is\nprovided for compatibility with Oracle. The standard SQL function\nSTDDEV_POP() can be used instead.\n\nThis function returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (228,32,'PERIOD_ADD','Syntax:\nPERIOD_ADD(P,N)\n\nAdds N months to period P (in the format YYMM or YYYYMM). Returns a\nvalue in the format YYYYMM.\n\n*Note*: The period argument P is not a date value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_ADD(200801,2);\n        -> 200803\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (229,38,'RIGHT','Syntax:\nRIGHT(str,len)\n\nReturns the rightmost len characters from the string str, or NULL if\nany argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RIGHT(\'foobarbar\', 4);\n        -> \'rbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (230,40,'DROP TABLESPACE','Syntax:\nDROP TABLESPACE tablespace_name\n    ENGINE [=] engine_name\n\nThis statement drops a tablespace that was previously created using\nCREATE TABLESPACE (see [HELP CREATE TABLESPACE]).\n\n*Important*: The tablespace to be dropped must not contain any data\nfiles; in other words, before you can drop a tablespace, you must first\ndrop each of its data files using ALTER TABLESPACE ... DROP DATAFILE\n(see [HELP ALTER TABLESPACE]).\n\nThe ENGINE clause (required) specifies the storage engine used by the\ntablespace. Currently, the only accepted values for engine_name are NDB\nand NDBCLUSTER.\n\nDROP TABLESPACE is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-tablespace.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (231,21,'CHECK TABLE','Syntax:\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED}\n\nCHECK TABLE checks a table or tables for errors. CHECK TABLE works for\nInnoDB, MyISAM, ARCHIVE, and CSV tables. For MyISAM tables, the key\nstatistics are updated as well.\n\nTo check a table, you must have some privilege for it.\n\nCHECK TABLE can also check views for problems, such as tables that are\nreferenced in the view definition that no longer exist.\n\nCHECK TABLE is supported for partitioned tables, and you can use ALTER\nTABLE ... CHECK PARTITION to check one or more partitions; for more\ninformation, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/check-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/check-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (232,38,'BIN','Syntax:\nBIN(N)\n\nReturns a string representation of the binary value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,2). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT BIN(12);\n        -> \'1100\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (233,25,'MULTILINESTRING','MultiLineString(ls1,ls2,...)\n\nConstructs a MultiLineString value using LineString or WKB LineString\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (234,27,'SHOW RELAYLOG EVENTS','Syntax:\nSHOW RELAYLOG EVENTS\n   [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nShows the events in the relay log of a replication slave. If you do not\nspecify \'log_name\', the first relay log is displayed. This statement\nhas no effect on the master.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-relaylog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-relaylog-events.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (235,4,'MPOINTFROMTEXT','MPointFromText(wkt[,srid]), MultiPointFromText(wkt[,srid])\n\nConstructs a MultiPoint value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (236,38,'SUBSTR','Syntax:\nSUBSTR(str,pos), SUBSTR(str FROM pos), SUBSTR(str,pos,len), SUBSTR(str\nFROM pos FOR len)\n\nSUBSTR() is a synonym for SUBSTRING().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (237,23,'CHAR','[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA fixed-length string that is always right-padded with spaces to the\nspecified length when stored. M represents the column length in\ncharacters. The range of M is 0 to 255. If M is omitted, the length is\n1.\n\n*Note*: Trailing spaces are removed when CHAR values are retrieved\nunless the PAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (238,16,'COUNT DISTINCT','Syntax:\nCOUNT(DISTINCT expr,[expr...])\n\nReturns a count of the number of rows with different non-NULL expr\nvalues.\n\nCOUNT(DISTINCT) returns 0 if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT COUNT(DISTINCT results) FROM student;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (239,27,'SHOW CREATE VIEW','Syntax:\nSHOW CREATE VIEW view_name\n\nThis statement shows the CREATE VIEW statement that creates the named\nview.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-create-view.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (240,20,'INTERVAL','Syntax:\nINTERVAL(N,N1,N2,N3,...)\n\nReturns 0 if N < N1, 1 if N < N2 and so on or -1 if N is NULL. All\narguments are treated as integers. It is required that N1 < N2 < N3 <\n... < Nn for this function to work correctly. This is because a binary\nsearch is used (very fast).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n        -> 3\nmysql> SELECT INTERVAL(10, 1, 10, 100, 1000);\n        -> 2\nmysql> SELECT INTERVAL(22, 23, 30, 44, 200);\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (241,32,'FROM_DAYS','Syntax:\nFROM_DAYS(N)\n\nGiven a day number N, returns a DATE value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_DAYS(730669);\n        -> \'2007-07-03\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (242,40,'ALTER PROCEDURE','Syntax:\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n    COMMENT \'string\'\n  | LANGUAGE SQL\n  | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n  | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a\nstored procedure using this statement; to make such changes, you must\ndrop and re-create the procedure using DROP PROCEDURE and CREATE\nPROCEDURE.\n\nYou must have the ALTER ROUTINE privilege for the procedure. By\ndefault, that privilege is granted automatically to the procedure\ncreator. This behavior can be changed by disabling the\nautomatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-routines-privileges.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-procedure.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (243,19,'BIT_COUNT','Syntax:\nBIT_COUNT(N)\n\nReturns the number of bits that are set in the argument N.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n        -> 4, 3\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (244,31,'ST_WITHIN','ST_Within(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This\ntests the opposite relationship as ST_Contains().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (245,3,'ACOS','Syntax:\nACOS(X)\n\nReturns the arc cosine of X, that is, the value whose cosine is X.\nReturns NULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ACOS(1);\n        -> 0\nmysql> SELECT ACOS(1.0001);\n        -> NULL\nmysql> SELECT ACOS(0);\n        -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (246,8,'ISOLATION','Syntax:\nSET [GLOBAL | SESSION] TRANSACTION\n    transaction_characteristic [, transaction_characteristic] ...\n\ntransaction_characteristic:\n    ISOLATION LEVEL level\n  | READ WRITE\n  | READ ONLY\n\nlevel:\n     REPEATABLE READ\n   | READ COMMITTED\n   | READ UNCOMMITTED\n   | SERIALIZABLE\n\nThis statement specifies transaction characteristics. It takes a list\nof one or more characteristic values separated by commas. These\ncharacteristics set the transaction isolation level or access mode. The\nisolation level is used for operations on InnoDB tables. The access\nmode may be specified as of MySQL 5.6.5 and indicates whether\ntransactions operate in read/write or read-only mode.\n\nIn addition, SET TRANSACTION can include an optional GLOBAL or SESSION\nkeyword to indicate the scope of the statement.\n\nScope of Transaction Characteristics\n\nYou can set transaction characteristics globally, for the current\nsession, or for the next transaction:\n\no With the GLOBAL keyword, the statement applies globally for all\n  subsequent sessions. Existing sessions are unaffected.\n\no With the SESSION keyword, the statement applies to all subsequent\n  transactions performed within the current session.\n\no Without any SESSION or GLOBAL keyword, the statement applies to the\n  next (not started) transaction performed within the current session.\n\nA global change to transaction characteristics requires the SUPER\nprivilege. Any session is free to change its session characteristics\n(even in the middle of a transaction), or the characteristics for its\nnext transaction.\n\nSET TRANSACTION without GLOBAL or SESSION is not permitted while there\nis an active transaction:\n\nmysql> START TRANSACTION;\nQuery OK, 0 rows affected (0.02 sec)\n\nmysql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\nERROR 1568 (25001): Transaction characteristics can\'t be changed\nwhile a transaction is in progress\n\nTo set the global default isolation level at server startup, use the\n--transaction-isolation=level option to mysqld on the command line or\nin an option file. Values of level for this option use dashes rather\nthan spaces, so the permissible values are READ-UNCOMMITTED,\nREAD-COMMITTED, REPEATABLE-READ, or SERIALIZABLE. For example, to set\nthe default isolation level to REPEATABLE READ, use these lines in the\n[mysqld] section of an option file:\n\n[mysqld]\ntransaction-isolation = REPEATABLE-READ\n\nIt is possible to check or set the global and session transaction\nisolation levels at runtime by using the tx_isolation system variable:\n\nSELECT @@GLOBAL.tx_isolation, @@tx_isolation;\nSET GLOBAL tx_isolation=\'REPEATABLE-READ\';\nSET SESSION tx_isolation=\'SERIALIZABLE\';\n\nSimilarly, to set the transaction access mode at server startup or at\nruntime, use the --transaction-read-only option or tx_read_only system\nvariable. By default, these are OFF (the mode is read/write) but can be\nset to ON for a default mode of read only.\n\nSetting the global or session value of tx_isolation or tx_read_only is\nequivalent to setting the isolation level or access mode with SET\nGLOBAL TRANSACTION or SET SESSION TRANSACTION.\n\nDetails and Usage of Isolation Levels\n\nInnoDB supports each of the transaction isolation levels described here\nusing different locking strategies. You can enforce a high degree of\nconsistency with the default REPEATABLE READ level, for operations on\ncrucial data where ACID compliance is important. Or you can relax the\nconsistency rules with READ COMMITTED or even READ UNCOMMITTED, in\nsituations such as bulk reporting where precise consistency and\nrepeatable results are less important than minimizing the amount of\noverhead for locking. SERIALIZABLE enforces even stricter rules than\nREPEATABLE READ, and is used mainly in specialized situations, such as\nwith XA transactions and for troubleshooting issues with concurrency\nand deadlocks.\n\nFor full information about how these isolation levels work with InnoDB\ntransactions, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-transaction-model.html.\nIn particular, for additional information about InnoDB record-level\nlocks and how it uses them to execute various types of statements, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-record-level-locks.html\nand http://dev.mysql.com/doc/refman/5.6/en/innodb-locks-set.html.\n\nThe following list describes how MySQL supports the different\ntransaction levels. The list goes from the most commonly used level to\nthe least used.\n\no REPEATABLE READ\n\n  This is the default isolation level for InnoDB. For consistent reads,\n  there is an important difference from the READ COMMITTED isolation\n  level: All consistent reads within the same transaction read the\n  snapshot established by the first read. This convention means that if\n  you issue several plain (nonlocking) SELECT statements within the\n  same transaction, these SELECT statements are consistent also with\n  respect to each other. See\n  http://dev.mysql.com/doc/refman/5.6/en/innodb-consistent-read.html.\n\n  For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),\n  UPDATE, and DELETE statements, locking depends on whether the\n  statement uses a unique index with a unique search condition, or a\n  range-type search condition. For a unique index with a unique search\n  condition, InnoDB locks only the index record found, not the gap\n  before it. For other search conditions, InnoDB locks the index range\n  scanned, using gap locks or next-key locks to block insertions by\n  other sessions into the gaps covered by the range.\n\no READ COMMITTED\n\n  A somewhat Oracle-like isolation level with respect to consistent\n  (nonlocking) reads: Each consistent read, even within the same\n  transaction, sets and reads its own fresh snapshot. See\n  http://dev.mysql.com/doc/refman/5.6/en/innodb-consistent-read.html.\n\n  For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),\n  UPDATE statements, and DELETE statements, InnoDB locks only index\n  records, not the gaps before them, and thus permits the free\n  insertion of new records next to locked records.\n\n  *Note*: In MySQL 5.6, when READ COMMITTED isolation level is used, or\n  the deprecated innodb_locks_unsafe_for_binlog system variable is\n  enabled, there is no InnoDB gap locking except for foreign-key\n  constraint checking and duplicate-key checking. Also, record locks\n  for nonmatching rows are released after MySQL has evaluated the WHERE\n  condition. If you use READ COMMITTED or enable\n  innodb_locks_unsafe_for_binlog, you must use row-based binary\n  logging.\n\no READ UNCOMMITTED\n\n  SELECT statements are performed in a nonlocking fashion, but a\n  possible earlier version of a row might be used. Thus, using this\n  isolation level, such reads are not consistent. This is also called a\n  dirty read. Otherwise, this isolation level works like READ\n  COMMITTED.\n\no SERIALIZABLE\n\n  This level is like REPEATABLE READ, but InnoDB implicitly converts\n  all plain SELECT statements to SELECT ... LOCK IN SHARE MODE if\n  autocommitis disabled. If autocommit is enabled, the SELECT is its\n  own transaction. It therefore is known to be read only and can be\n  serialized if performed as a consistent (nonlocking) read and need\n  not block for other transactions. (To force a plain SELECT to block\n  if other transactions have modified the selected rows, disable\n  autocommit.)\n\nTransaction Access Mode\n\nAs of MySQL 5.6.5, the transaction access mode may be specified with\nSET TRANSACTION. By default, a transaction takes place in read/write\nmode, with both reads and writes permitted to tables used in the\ntransaction. This mode may be specified explicitly using an access mode\nof READ WRITE.\n\nIf the transaction access mode is set to READ ONLY, changes to tables\nare prohibited. This may enable storage engines to make performance\nimprovements that are possible when writes are not permitted.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the\nsame statement.\n\nIn read-only mode, it remains possible to change tables created with\nthe TEMPORARY keyword using DML statements. Changes made with DDL\nstatements are not permitted, just as with permanent tables.\n\nThe READ WRITE and READ ONLY access modes also may be specified for an\nindividual transaction using the START TRANSACTION statement.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-transaction.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-transaction.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (247,3,'SIN','Syntax:\nSIN(X)\n\nReturns the sine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT SIN(PI());\n        -> 1.2246063538224e-16\nmysql> SELECT ROUND(SIN(PI()));\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (248,26,'BUFFER','Buffer(g,d)\n\nReturns a geometry that represents all points whose distance from the\ngeometry value g is less than or equal to a distance of d.\n\nBuffer() supports negative distances for polygons, multipolygons, and\ngeometry collections containing polygons or multipolygons. For point,\nmultipoint, linestring, multilinestring, and geometry collections not\ncontaining any polygons or multipolygons, Buffer() with a negative\ndistance returns NULL.\n\nBuffer() was added in MySQL 5.6.1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (249,20,'IS','Syntax:\nIS boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n        -> 1, 1, 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (250,32,'GET_FORMAT','Syntax:\nGET_FORMAT({DATE|TIME|DATETIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nReturns a format string. This function is useful in combination with\nthe DATE_FORMAT() and the STR_TO_DATE() functions.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n        -> \'03.10.2003\'\nmysql> SELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n        -> \'2003-10-31\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (251,2,'ST_CENTROID','ST_Centroid(mpoly)\n\nReturns the mathematical centroid for the MultiPolygon value mpoly as a\nPoint. The result is not guaranteed to be on the MultiPolygon.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-multipolygon-property-functions.html\n\n','mysql> SET @poly =\n    -> GeomFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7,5 5))\');\nmysql> SELECT GeometryType(@poly),AsText(ST_Centroid(@poly));\n+---------------------+--------------------------------------------+\n| GeometryType(@poly) | AsText(ST_Centroid(@poly))                 |\n+---------------------+--------------------------------------------+\n| POLYGON             | POINT(4.958333333333333 4.958333333333333) |\n+---------------------+--------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-multipolygon-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (252,23,'TINYBLOB','TINYBLOB\n\nA BLOB column with a maximum length of 255 (28 - 1) bytes. Each\nTINYBLOB value is stored using a 1-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (253,17,'USER','Syntax:\nUSER()\n\nReturns the current MySQL user name and host name as a string in the\nutf8 character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT USER();\n        -> \'davida@localhost\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (254,21,'REPAIR TABLE','Syntax:\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n    tbl_name [, tbl_name] ...\n    [QUICK] [EXTENDED] [USE_FRM]\n\nREPAIR TABLE repairs a possibly corrupted table, for certain storage\nengines only. By default, it has the same effect as myisamchk --recover\ntbl_name.\n\n*Note*: REPAIR TABLE only applies to MyISAM, ARCHIVE, and CSV tables.\nSee http://dev.mysql.com/doc/refman/5.6/en/myisam-storage-engine.html,\nand http://dev.mysql.com/doc/refman/5.6/en/archive-storage-engine.html,\nand http://dev.mysql.com/doc/refman/5.6/en/csv-storage-engine.html\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nREPAIR TABLE is supported for partitioned tables. However, the USE_FRM\noption cannot be used with this statement on a partitioned table.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nYou can use ALTER TABLE ... REPAIR PARTITION to repair one or more\npartitions; for more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/repair-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/repair-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (255,18,'MERGE','The MERGE storage engine, also known as the MRG_MyISAM engine, is a\ncollection of identical MyISAM tables that can be used as one.\n"Identical" means that all tables have identical column and index\ninformation. You cannot merge MyISAM tables in which the columns are\nlisted in a different order, do not have exactly the same columns, or\nhave the indexes in different order. However, any or all of the MyISAM\ntables can be compressed with myisampack. See\nhttp://dev.mysql.com/doc/refman/5.6/en/myisampack.html. Differences in\ntable options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS do not\nmatter.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/merge-storage-engine.html\n\n','mysql> CREATE TABLE t1 (\n    ->    a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n    ->    message CHAR(20)) ENGINE=MyISAM;\nmysql> CREATE TABLE t2 (\n    ->    a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n    ->    message CHAR(20)) ENGINE=MyISAM;\nmysql> INSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\nmysql> INSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\nmysql> CREATE TABLE total (\n    ->    a INT NOT NULL AUTO_INCREMENT,\n    ->    message CHAR(20), INDEX(a))\n    ->    ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n','http://dev.mysql.com/doc/refman/5.6/en/merge-storage-engine.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (256,31,'ST_DISTANCE','ST_Distance(g1,g2)\n\nReturns the distance between g1 and g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','mysql> SET @g1 = POINT(1,1), @g2 = POINT(2,2);\nmysql> SELECT ST_Distance(@g1, @g2);\n+-----------------------+\n| ST_Distance(@g1, @g2) |\n+-----------------------+\n|    1.4142135623730951 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (257,40,'CREATE TABLE','Syntax:\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n    (create_definition,...)\n    [table_options]\n    [partition_options]\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n    [(create_definition,...)]\n    [table_options]\n    [partition_options]\n    select_statement\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n    { LIKE old_tbl_name | (LIKE old_tbl_name) }\n\ncreate_definition:\n    col_name column_definition\n  | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)\n      [index_option] ...\n  | {INDEX|KEY} [index_name] [index_type] (index_col_name,...)\n      [index_option] ...\n  | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]\n      [index_name] [index_type] (index_col_name,...)\n      [index_option] ...\n  | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)\n      [index_option] ...\n  | [CONSTRAINT [symbol]] FOREIGN KEY\n      [index_name] (index_col_name,...) reference_definition\n  | CHECK (expr)\n\ncolumn_definition:\n    data_type [NOT NULL | NULL] [DEFAULT default_value]\n      [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]\n      [COMMENT \'string\']\n      [COLUMN_FORMAT {FIXED|DYNAMIC|DEFAULT}]\n      [STORAGE {DISK|MEMORY|DEFAULT}]\n      [reference_definition]\n\ndata_type:\n    BIT[(length)]\n  | TINYINT[(length)] [UNSIGNED] [ZEROFILL]\n  | SMALLINT[(length)] [UNSIGNED] [ZEROFILL]\n  | MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]\n  | INT[(length)] [UNSIGNED] [ZEROFILL]\n  | INTEGER[(length)] [UNSIGNED] [ZEROFILL]\n  | BIGINT[(length)] [UNSIGNED] [ZEROFILL]\n  | REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]\n  | DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]\n  | FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]\n  | DECIMAL[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n  | NUMERIC[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n  | DATE\n  | TIME[(fsp)]\n  | TIMESTAMP[(fsp)]\n  | DATETIME[(fsp)]\n  | YEAR\n  | CHAR[(length)]\n      [CHARACTER SET charset_name] [COLLATE collation_name]\n  | VARCHAR(length)\n      [CHARACTER SET charset_name] [COLLATE collation_name]\n  | BINARY[(length)]\n  | VARBINARY(length)\n  | TINYBLOB\n  | BLOB\n  | MEDIUMBLOB\n  | LONGBLOB\n  | TINYTEXT [BINARY]\n      [CHARACTER SET charset_name] [COLLATE collation_name]\n  | TEXT [BINARY]\n      [CHARACTER SET charset_name] [COLLATE collation_name]\n  | MEDIUMTEXT [BINARY]\n      [CHARACTER SET charset_name] [COLLATE collation_name]\n  | LONGTEXT [BINARY]\n      [CHARACTER SET charset_name] [COLLATE collation_name]\n  | ENUM(value1,value2,value3,...)\n      [CHARACTER SET charset_name] [COLLATE collation_name]\n  | SET(value1,value2,value3,...)\n      [CHARACTER SET charset_name] [COLLATE collation_name]\n  | spatial_type\n\nindex_col_name:\n    col_name [(length)] [ASC | DESC]\n\nindex_type:\n    USING {BTREE | HASH}\n\nindex_option:\n    KEY_BLOCK_SIZE [=] value\n  | index_type\n  | WITH PARSER parser_name\n  | COMMENT \'string\'\n\nreference_definition:\n    REFERENCES tbl_name (index_col_name,...)\n      [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n      [ON DELETE reference_option]\n      [ON UPDATE reference_option]\n\nreference_option:\n    RESTRICT | CASCADE | SET NULL | NO ACTION\n\ntable_options:\n    table_option [[,] table_option] ...\n\ntable_option:\n    ENGINE [=] engine_name\n  | AUTO_INCREMENT [=] value\n  | AVG_ROW_LENGTH [=] value\n  | [DEFAULT] CHARACTER SET [=] charset_name\n  | CHECKSUM [=] {0 | 1}\n  | [DEFAULT] COLLATE [=] collation_name\n  | COMMENT [=] \'string\'\n  | CONNECTION [=] \'connect_string\'\n  | DATA DIRECTORY [=] \'absolute path to directory\'\n  | DELAY_KEY_WRITE [=] {0 | 1}\n  | INDEX DIRECTORY [=] \'absolute path to directory\'\n  | INSERT_METHOD [=] { NO | FIRST | LAST }\n  | KEY_BLOCK_SIZE [=] value\n  | MAX_ROWS [=] value\n  | MIN_ROWS [=] value\n  | PACK_KEYS [=] {0 | 1 | DEFAULT}\n  | PASSWORD [=] \'string\'\n  | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n  | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n  | STATS_PERSISTENT [=] {DEFAULT|0|1}\n  | STATS_SAMPLE_PAGES [=] value\n  | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n  | UNION [=] (tbl_name[,tbl_name]...)\n\npartition_options:\n    PARTITION BY\n        { [LINEAR] HASH(expr)\n        | [LINEAR] KEY [ALGORITHM={1|2}] (column_list)\n        | RANGE{(expr) | COLUMNS(column_list)}\n        | LIST{(expr) | COLUMNS(column_list)} }\n    [PARTITIONS num]\n    [SUBPARTITION BY\n        { [LINEAR] HASH(expr)\n        | [LINEAR] KEY [ALGORITHM={1|2}] (column_list) }\n      [SUBPARTITIONS num]\n    ]\n    [(partition_definition [, partition_definition] ...)]\n\npartition_definition:\n    PARTITION partition_name\n        [VALUES \n            {LESS THAN {(expr | value_list) | MAXVALUE} \n            | \n            IN (value_list)}]\n        [[STORAGE] ENGINE [=] engine_name]\n        [COMMENT [=] \'comment_text\' ]\n        [DATA DIRECTORY [=] \'data_dir\']\n        [INDEX DIRECTORY [=] \'index_dir\']\n        [MAX_ROWS [=] max_number_of_rows]\n        [MIN_ROWS [=] min_number_of_rows]\n        [TABLESPACE [=] tablespace_name]\n        [NODEGROUP [=] node_group_id]\n        [(subpartition_definition [, subpartition_definition] ...)]\n\nsubpartition_definition:\n    SUBPARTITION logical_name\n        [[STORAGE] ENGINE [=] engine_name]\n        [COMMENT [=] \'comment_text\' ]\n        [DATA DIRECTORY [=] \'data_dir\']\n        [INDEX DIRECTORY [=] \'index_dir\']\n        [MAX_ROWS [=] max_number_of_rows]\n        [MIN_ROWS [=] min_number_of_rows]\n        [TABLESPACE [=] tablespace_name]\n        [NODEGROUP [=] node_group_id]\n\nselect_statement:\n    [IGNORE | REPLACE] [AS] SELECT ...   (Some valid select statement)\n\nCREATE TABLE creates a table with the given name. You must have the\nCREATE privilege for the table.\n\nRules for permissible table names are given in\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html. By default,\nthe table is created in the default database, using the InnoDB storage\nengine. An error occurs if the table exists, if there is no default\ndatabase, or if the database does not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (258,32,'MICROSECOND','Syntax:\nMICROSECOND(expr)\n\nReturns the microseconds from the time or datetime expression expr as a\nnumber in the range from 0 to 999999.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MICROSECOND(\'12:00:00.123456\');\n        -> 123456\nmysql> SELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n        -> 10\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (259,40,'CREATE SERVER','Syntax:\nCREATE SERVER server_name\n    FOREIGN DATA WRAPPER wrapper_name\n    OPTIONS (option [, option] ...)\n\noption:\n  { HOST character-literal\n  | DATABASE character-literal\n  | USER character-literal\n  | PASSWORD character-literal\n  | SOCKET character-literal\n  | OWNER character-literal\n  | PORT numeric-literal }\n\nThis statement creates the definition of a server for use with the\nFEDERATED storage engine. The CREATE SERVER statement creates a new row\nin the servers table in the mysql database. This statement requires the\nSUPER privilege.\n\nThe server_name should be a unique reference to the server. Server\ndefinitions are global within the scope of the server, it is not\npossible to qualify the server definition to a specific database.\nserver_name has a maximum length of 64 characters (names longer than 64\ncharacters are silently truncated), and is case insensitive. You may\nspecify the name as a quoted string.\n\nThe wrapper_name should be mysql, and may be quoted with single\nquotation marks. Other values for wrapper_name are not currently\nsupported.\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are\nsilently truncated to 64 characters. Numeric literals must be a number\nbetween 0 and 9999, default value is 0.\n\n*Note*: The OWNER option is currently not applied, and has no effect on\nthe ownership or operation of the server connection that is created.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table\nthat can later be used with the CREATE TABLE statement when creating a\nFEDERATED table. The options that you specify will be used to populate\nthe columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-server.html\n\n','CREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\n','http://dev.mysql.com/doc/refman/5.6/en/create-server.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (260,32,'MAKETIME','Syntax:\nMAKETIME(hour,minute,second)\n\nReturns a time value calculated from the hour, minute, and second\narguments.\n\nAs of MySQL 5.6.4, the second argument can have a fractional part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MAKETIME(12,15,30);\n        -> \'12:15:30\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (261,32,'CURDATE','Syntax:\nCURDATE()\n\nReturns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT CURDATE();\n        -> \'2008-06-13\'\nmysql> SELECT CURDATE() + 0;\n        -> 20080613\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (262,10,'SET PASSWORD','Syntax:\nSET PASSWORD [FOR user] =\n    {\n        PASSWORD(\'cleartext password\')\n      | OLD_PASSWORD(\'cleartext password\')\n      | \'encrypted password\'\n    }\n\nThe SET PASSWORD statement assigns a password to a MySQL user account:\n\no With no FOR user clause, this statement sets the password for the\n  current user:\n\nSET PASSWORD = PASSWORD(\'cleartext password\');\n\n  Any client who connects to the server using a nonanonymous account\n  can change the password for that account. To see which account the\n  server authenticated you for, invoke the CURRENT_USER() function:\n\nSELECT CURRENT_USER();\n\no With a FOR user clause, this statement sets the password for the\n  named account, which must exist:\n\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'cleartext password\');\n\n  In this case, you must have the UPDATE privilege for the mysql\n  database.\n\nWhen the read_only system variable is enabled, SET PASSWORD requires\nthe SUPER privilege, in addition to any other required privileges.\n\nIf a FOR user clause is given, the account name uses the format\ndescribed in http://dev.mysql.com/doc/refman/5.6/en/account-names.html.\nThe user value should be given as \'user_name\'@\'host_name\', where\n\'user_name\' and \'host_name\' are exactly as listed in the User and Host\ncolumns of the account\'s mysql.user table row. (If you specify only a\nuser name, a host name of \'%\' is used.) For example, to set the\npassword for an account with User and Host column values of \'bob\' and\n\'%.example.org\', write the statement like this:\n\nSET PASSWORD FOR \'bob\'@\'%.example.org\' = PASSWORD(\'cleartext password\');\n\nThe password can be specified in these ways:\n\no Using the PASSWORD() function\n\n  The function argument is the cleartext (unencrypted) password.\n  PASSWORD() hashes the password and returns the encrypted password\n  string.\n\n  The old_passwords system variable value determines the hashing method\n  used by PASSWORD(). If SET PASSWORD rejects the password as not being\n  in the correct format, it may be necessary to change old_passwords to\n  change the hashing method. For example, if the account uses the\n  mysql_native_password plugin, the old_passwords value must be 0:\n\nSET old_passwords = 0;\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'mypass\');\n\n  If the old_passwords value differs from that required by the\n  authentication plugin, hashed password values returned by PASSWORD()\n  are not acceptable for that plugin and attempts to set the password\n  produce an error. For example:\n\nmysql> SET old_passwords = 1;\nmysql> SET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'mypass\');\nERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number\n\no Using the OLD_PASSWORD() function:\n\n  The function argument is the cleartext (unencrypted) password.\n  OLD_PASSWORD() hashes the password using pre-4.1 hashing and returns\n  the encrypted password string. This hashing method is appropriate\n  only for accounts that use the mysql_old_password authentication\n  plugin.\n\no Using an already encrypted password string\n\n  The password is specified as a string literal. It must represent the\n  already encrypted password value, in the hash format required by the\n  authentication method used for the account.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-password.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-password.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (263,17,'DATABASE','Syntax:\nDATABASE()\n\nReturns the default (current) database name as a string in the utf8\ncharacter set. If there is no default database, DATABASE() returns\nNULL. Within a stored routine, the default database is the database\nthat the routine is associated with, which is not necessarily the same\nas the database that is the default in the calling context.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT DATABASE();\n        -> \'test\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (264,6,'IF FUNCTION','Syntax:\nIF(expr1,expr2,expr3)\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns\nexpr2; otherwise it returns expr3. IF() returns a numeric or string\nvalue, depending on the context in which it is used.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT IF(1>2,2,3);\n        -> 3\nmysql> SELECT IF(1<2,\'yes\',\'no\');\n        -> \'yes\'\nmysql> SELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n        -> \'no\'\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (265,33,'POINTFROMWKB','PointFromWKB(wkb[,srid])\n\nConstructs a Point value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (266,3,'POWER','Syntax:\nPOWER(X,Y)\n\nThis is a synonym for POW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (267,3,'ATAN','Syntax:\nATAN(X)\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(2);\n        -> 1.1071487177941\nmysql> SELECT ATAN(-2);\n        -> -1.1071487177941\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (268,27,'SHOW PROFILE','Syntax:\nSHOW PROFILE [type [, type] ... ]\n    [FOR QUERY n]\n    [LIMIT row_count [OFFSET offset]]\n\ntype:\n    ALL\n  | BLOCK IO\n  | CONTEXT SWITCHES\n  | CPU\n  | IPC\n  | MEMORY\n  | PAGE FAULTS\n  | SOURCE\n  | SWAPS\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling\ninformation that indicates resource usage for statements executed\nduring the course of the current session.\n\n*Note*: These statements are deprecated as of MySQL 5.6.7 and will be\nremoved in a future MySQL release. Use the Performance Schema instead;\nsee http://dev.mysql.com/doc/refman/5.6/en/performance-schema.html.\n\nProfiling is controlled by the profiling session variable, which has a\ndefault value of 0 (OFF). Profiling is enabled by setting profiling to\n1 or ON:\n\nmysql> SET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nserver. The size of the list is controlled by the\nprofiling_history_size session variable, which has a default value of\n15. The maximum value is 100. Setting the value to 0 has the practical\neffect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILE and SHOW PROFILES, so\nyou will find neither of those statements in the profile list.\nMalformed statements are profiled. For example, SHOW PROFILING is an\nillegal statement, and a syntax error occurs if you try to execute it,\nbut it will show up in the profiling list.\n\nSHOW PROFILE displays detailed information about a single statement.\nWithout the FOR QUERY n clause, the output pertains to the most\nrecently executed statement. If FOR QUERY n is included, SHOW PROFILE\ndisplays information for statement n. The values of n correspond to the\nQuery_ID values displayed by SHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to\nrow_count rows. If LIMIT is given, OFFSET offset may be added to begin\nthe output offset rows into the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The\nStatus values are like the State values displayed by SHOW PROCESSLIST,\nalthough there might be some minor differences in interpretion for the\ntwo statements for some status values (see\nhttp://dev.mysql.com/doc/refman/5.6/en/thread-information.html).\n\nOptional type values may be specified to display specific additional\ntypes of information:\n\no ALL displays all information\n\no BLOCK IO displays counts for block input and output operations\n\no CONTEXT SWITCHES displays counts for voluntary and involuntary\n  context switches\n\no CPU displays user and system CPU usage times\n\no IPC displays counts for messages sent and received\n\no MEMORY is not currently implemented\n\no PAGE FAULTS displays counts for major and minor page faults\n\no SOURCE displays the names of functions from the source code, together\n  with the name and line number of the file in which the function\n  occurs\n\no SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-profile.html\n\n','mysql> SELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n|           0 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> SET profiling = 1;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> DROP TABLE IF EXISTS t1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> CREATE TABLE T1 (id INT);\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SHOW PROFILES;\n+----------+----------+--------------------------+\n| Query_ID | Duration | Query                    |\n+----------+----------+--------------------------+\n|        0 | 0.000088 | SET PROFILING = 1        |\n|        1 | 0.000136 | DROP TABLE IF EXISTS t1  |\n|        2 | 0.011947 | CREATE TABLE t1 (id INT) |\n+----------+----------+--------------------------+\n3 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE;\n+----------------------+----------+\n| Status               | Duration |\n+----------------------+----------+\n| checking permissions | 0.000040 |\n| creating table       | 0.000056 |\n| After create         | 0.011363 |\n| query end            | 0.000375 |\n| freeing items        | 0.000089 |\n| logging slow query   | 0.000019 |\n| cleaning up          | 0.000005 |\n+----------------------+----------+\n7 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE FOR QUERY 1;\n+--------------------+----------+\n| Status             | Duration |\n+--------------------+----------+\n| query end          | 0.000107 |\n| freeing items      | 0.000008 |\n| logging slow query | 0.000015 |\n| cleaning up        | 0.000006 |\n+--------------------+----------+\n4 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE CPU FOR QUERY 2;\n+----------------------+----------+----------+------------+\n| Status               | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| checking permissions | 0.000040 | 0.000038 |   0.000002 |\n| creating table       | 0.000056 | 0.000028 |   0.000028 |\n| After create         | 0.011363 | 0.000217 |   0.001571 |\n| query end            | 0.000375 | 0.000013 |   0.000028 |\n| freeing items        | 0.000089 | 0.000010 |   0.000014 |\n| logging slow query   | 0.000019 | 0.000009 |   0.000010 |\n| cleaning up          | 0.000005 | 0.000003 |   0.000002 |\n+----------------------+----------+----------+------------+\n7 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/show-profile.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (269,3,'LN','Syntax:\nLN(X)\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X.\nIf X is less than or equal to 0, then NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LN(2);\n        -> 0.69314718055995\nmysql> SELECT LN(-2);\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (270,24,'RETURN','Syntax:\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and\nreturns the value expr to the function caller. There must be at least\none RETURN statement in a stored function. There may be more than one\nif the function has multiple exit points.\n\nThis statement is not used in stored procedures, triggers, or events.\nThe LEAVE statement can be used to exit a stored program of those\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/return.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/return.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (271,8,'SET SQL_LOG_BIN','Syntax:\nSET sql_log_bin = {0|1}\n\nThe sql_log_bin variable controls whether logging to the binary log is\ndone. The default value is 1 (do logging). To change logging for the\ncurrent session, change the session value of this variable. The session\nuser must have the SUPER privilege to set this variable. Set this\nvariable to 0 for a session to temporarily disable binary logging while\nmaking changes to the master which you do not want to replicate to the\nslave.\n\nAs of MySQL 5.5, sql_log_bin can be set as a global or session\nvariable. Setting sql_log_bin globally is only detected when a new\nsession is started. Any sessions previously running are not impacted\nwhen setting sql_log_bin globally.\n\n*Warning*: Incorrect use of sql_log_bin with a global scope means any\nchanges made in an already running session are still being recorded to\nthe binary log and therefore replicated. Exercise extreme caution using\nsql_log_bin with a global scope as the above situation could cause\nunexpected results including replication failure.\n\nIn MySQL 5.6, it is not possible to set @@session.sql_log_bin within a\ntransaction or subquery. (Bug #53437)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-sql-log-bin.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-sql-log-bin.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (272,12,'AES_DECRYPT','Syntax:\nAES_DECRYPT(crypt_str,key_str[,init_vector])\n\nThis function decrypts data using the official AES (Advanced Encryption\nStandard) algorithm. For more information, see the description of\nAES_ENCRYPT().\n\nThe optional initialization vector argument, init_vector, is available\nas of MySQL 5.6.17. As of that version, statements that use\nAES_DECRYPT() are unsafe for statement-based replication and cannot be\nstored in the query cache.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (273,17,'COERCIBILITY','Syntax:\nCOERCIBILITY(str)\n\nReturns the collation coercibility value of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n        -> 0\nmysql> SELECT COERCIBILITY(USER());\n        -> 3\nmysql> SELECT COERCIBILITY(\'abc\');\n        -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (274,23,'INT','INT[(M)] [UNSIGNED] [ZEROFILL]\n\nA normal-size integer. The signed range is -2147483648 to 2147483647.\nThe unsigned range is 0 to 4294967295.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (275,13,'GLENGTH','GLength(ls)\n\nReturns a double-precision number indicating the length of the\nLineString value ls in its associated spatial reference.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT GLength(GeomFromText(@ls));\n+----------------------------+\n| GLength(GeomFromText(@ls)) |\n+----------------------------+\n|            2.8284271247462 |\n+----------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (276,38,'MAKE_SET','Syntax:\nMAKE_SET(bits,str1,str2,...)\n\nReturns a set value (a string containing substrings separated by ","\ncharacters) consisting of the strings that have the corresponding bit\nin bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL\nvalues in str1, str2, ... are not appended to the result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n        -> \'a\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n        -> \'hello,world\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n        -> \'hello\'\nmysql> SELECT MAKE_SET(0,\'a\',\'b\',\'c\');\n        -> \'\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (277,38,'FIND_IN_SET','Syntax:\nFIND_IN_SET(str,strlist)\n\nReturns a value in the range of 1 to N if the string str is in the\nstring list strlist consisting of N substrings. A string list is a\nstring composed of substrings separated by "," characters. If the first\nargument is a constant string and the second is a column of type SET,\nthe FIND_IN_SET() function is optimized to use bit arithmetic. Returns\n0 if str is not in strlist or if strlist is the empty string. Returns\nNULL if either argument is NULL. This function does not work properly\nif the first argument contains a comma (",") character.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FIND_IN_SET(\'b\',\'a,b,c,d\');\n        -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (278,16,'MIN','Syntax:\nMIN([DISTINCT] expr)\n\nReturns the minimum value of expr. MIN() may take a string argument; in\nsuch cases, it returns the minimum string value. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the minimum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nMIN() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n    ->        FROM student\n    ->        GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (279,28,'REPLACE','Syntax:\nREPLACE [LOW_PRIORITY | DELAYED]\n    [INTO] tbl_name\n    [PARTITION (partition_name,...)] \n    [(col_name,...)]\n    {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n    [INTO] tbl_name\n    [PARTITION (partition_name,...)] \n    SET col_name={expr | DEFAULT}, ...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n    [INTO] tbl_name\n    [PARTITION (partition_name,...)]  \n    [(col_name,...)]\n    SELECT ...\n\nREPLACE works exactly like INSERT, except that if an old row in the\ntable has the same value as a new row for a PRIMARY KEY or a UNIQUE\nindex, the old row is deleted before the new row is inserted. See [HELP\nINSERT].\n\nREPLACE is a MySQL extension to the SQL standard. It either inserts, or\ndeletes and inserts. For another MySQL extension to standard SQL---that\neither inserts or updates---see\nhttp://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html.\n\nNote that unless the table has a PRIMARY KEY or UNIQUE index, using a\nREPLACE statement makes no sense. It becomes equivalent to INSERT,\nbecause there is no index to be used to determine whether a new row\nduplicates another.\n\nValues for all columns are taken from the values specified in the\nREPLACE statement. Any missing columns are set to their default values,\njust as happens for INSERT. You cannot refer to values from the current\nrow and use them in the new row. If you use an assignment such as SET\ncol_name = col_name + 1, the reference to the column name on the right\nhand side is treated as DEFAULT(col_name), so the assignment is\nequivalent to SET col_name = DEFAULT(col_name) + 1.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for\nthe table.\n\nBeginning with MySQL 5.6.2, REPLACE supports explicit partition\nselection using the PARTITION option with a comma-separated list of\nnames of partitions, subpartitions, or both. As with INSERT, if it is\nnot possible to insert the new row into any of these partitions or\nsubpartitions, the REPLACE statement fails with the error Found a row\nnot matching the given partition set. See\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html, for\nmore information.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/replace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/replace.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (280,32,'CURRENT_TIMESTAMP','Syntax:\nCURRENT_TIMESTAMP, CURRENT_TIMESTAMP([fsp])\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (281,26,'ST_SYMDIFFERENCE','ST_SymDifference(g1, g2)\n\nReturns a geometry that represents the point set symmetric difference\nof the geometry values g1 and g2, which is defined as:\n\ng1 symdifference g2 := (g1 union g2) difference (g1 intersection g2)\n\nOr, in function call notation:\n\nST_SymDifference(g1, g2) = ST_Difference(ST_Union(g1, g2), ST_Intersection(g1, g2))\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = POINT(1,1), @g2 = POINT(2,2);\nmysql> SELECT AsText(ST_SymDifference(@g1, @g2));\n+-------------------------------------------+\n| AsText(ST_SymDifference(@g1, @g2))        |\n+-------------------------------------------+\n| GEOMETRYCOLLECTION(POINT(1 1),POINT(2 2)) |\n+-------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (282,7,'GTID_SUBSET','Syntax:\nGTID_SUBSET(subset,set)\n\nGiven two sets of global transaction IDs subset and set, returns true\n(1) if all GTIDs in subset are also in set. Returns false (0)\notherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','mysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23\', \n    ->     \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23\', \n    \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 1\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25\', \n    ->     \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25\', \n    \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 1\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\', \n    ->     \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\', \n    \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 0\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (283,16,'VAR_SAMP','Syntax:\nVAR_SAMP(expr)\n\nReturns the sample variance of expr. That is, the denominator is the\nnumber of rows minus one.\n\nVAR_SAMP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (284,23,'DATETIME','DATETIME[(fsp)]\n\nA date and time combination. The supported range is \'1000-01-01\n00:00:00.000000\' to \'9999-12-31 23:59:59.999999\'. MySQL displays\nDATETIME values in \'YYYY-MM-DD HH:MM:SS[.fraction]\' format, but permits\nassignment of values to DATETIME columns using either strings or\nnumbers.\n\nAs of MySQL 5.6.4, an optional fsp value in the range from 0 to 6 may\nbe given to specify fractional seconds precision. A value of 0\nsignifies that there is no fractional part. If omitted, the default\nprecision is 0.\n\nAs of MySQL 5.6.5, automatic initialization and updating to the current\ndate and time for DATETIME columns can be specified using DEFAULT and\nON UPDATE column definition clauses, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (285,23,'INTEGER','INTEGER[(M)] [UNSIGNED] [ZEROFILL]\n\nThis type is a synonym for INT.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (286,27,'SHOW COLUMNS','Syntax:\nSHOW [FULL] COLUMNS {FROM | IN} tbl_name [{FROM | IN} db_name]\n    [LIKE \'pattern\' | WHERE expr]\n\nSHOW COLUMNS displays information about the columns in a given table.\nIt also works for views. The LIKE clause, if present, indicates which\ncolumn names to match. The WHERE clause can be given to select rows\nusing more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nSHOW COLUMNS displays information only for those columns for which you\nhave some privilege.\n\nmysql> SHOW COLUMNS FROM City;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | NO   |     |         |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | NO   |     | 0       |                |\n+------------+----------+------+-----+---------+----------------+\n5 rows in set (0.00 sec)\n\nIf the data types differ from what you expect them to be based on a\nCREATE TABLE statement, note that MySQL sometimes changes data types\nwhen you create or alter a table. The conditions under which this\noccurs are described in\nhttp://dev.mysql.com/doc/refman/5.6/en/silent-column-changes.html.\n\nThe FULL keyword causes the output to include the column collation and\ncomments, as well as the privileges you have for each column.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. In other words, these two statements are equivalent:\n\nmysql> SHOW COLUMNS FROM mytable FROM mydb;\nmysql> SHOW COLUMNS FROM mydb.mytable;\n\nSHOW COLUMNS displays the following values for each table column:\n\nField indicates the column name.\n\nType indicates the column data type.\n\nCollation indicates the collation for nonbinary string columns, or NULL\nfor other columns. This value is displayed only if you use the FULL\nkeyword.\n\nThe Null field contains YES if NULL values can be stored in the column,\nNO if not.\n\nThe Key field indicates whether the column is indexed:\n\no If Key is empty, the column either is not indexed or is indexed only\n  as a secondary column in a multiple-column, nonunique index.\n\no If Key is PRI, the column is a PRIMARY KEY or is one of the columns\n  in a multiple-column PRIMARY KEY.\n\no If Key is UNI, the column is the first column of a UNIQUE index. (A\n  UNIQUE index permits multiple NULL values, but you can tell whether\n  the column permits NULL by checking the Null field.)\n\no If Key is MUL, the column is the first column of a nonunique index in\n  which multiple occurrences of a given value are permitted within the\n  column.\n\nIf more than one of the Key values applies to a given column of a\ntable, Key displays the one with the highest priority, in the order\nPRI, UNI, MUL.\n\nA UNIQUE index may be displayed as PRI if it cannot contain NULL values\nand there is no PRIMARY KEY in the table. A UNIQUE index may display as\nMUL if several columns form a composite UNIQUE index; although the\ncombination of the columns is unique, each column can still hold\nmultiple occurrences of a given value.\n\nThe Default field indicates the default value that is assigned to the\ncolumn. This is NULL if the column has an explicit default of NULL, or\nif the column definition has no DEFAULT clause.\n\nThe Extra field contains any additional information that is available\nabout a given column. The value is nonempty in these cases:\nauto_increment for columns that have the AUTO_INCREMENT attribute; on\nupdate CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns that have\nthe ON UPDATE CURRENT_TIMESTAMP attribute.\n\nPrivileges indicates the privileges you have for the column. This value\nis displayed only if you use the FULL keyword.\n\nComment indicates any comment the column has. This value is displayed\nonly if you use the FULL keyword.\n\nSHOW FIELDS is a synonym for SHOW COLUMNS. You can also list a table\'s\ncolumns with the mysqlshow db_name tbl_name command.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS.\nSee http://dev.mysql.com/doc/refman/5.6/en/describe.html.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-columns.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-columns.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (287,23,'TINYINT','TINYINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA very small integer. The signed range is -128 to 127. The unsigned\nrange is 0 to 255.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (288,14,'MASTER_POS_WAIT','Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave\'s master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when\ntimeout seconds have elapsed. timeout must be greater than 0; a zero or\nnegative timeout means no timeout.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (289,19,'^','Syntax:\n^\n\nBitwise XOR:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 1 ^ 1;\n        -> 0\nmysql> SELECT 1 ^ 0;\n        -> 1\nmysql> SELECT 11 ^ 3;\n        -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (290,40,'DROP VIEW','Syntax:\nDROP VIEW [IF EXISTS]\n    view_name [, view_name] ...\n    [RESTRICT | CASCADE]\n\nDROP VIEW removes one or more views. You must have the DROP privilege\nfor each view. If any of the views named in the argument list do not\nexist, MySQL returns an error indicating by name which nonexisting\nviews it was unable to drop, but it also drops all of the views in the\nlist that do exist.\n\nThe IF EXISTS clause prevents an error from occurring for views that\ndon\'t exist. When this clause is given, a NOTE is generated for each\nnonexistent view. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-view.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (291,32,'WEEK','Syntax:\nWEEK(date[,mode])\n\nThis function returns the week number for date. The two-argument form\nof WEEK() enables you to specify whether the week starts on Sunday or\nMonday and whether the return value should be in the range from 0 to 53\nor from 1 to 53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEK(\'2008-02-20\');\n        -> 7\nmysql> SELECT WEEK(\'2008-02-20\',0);\n        -> 7\nmysql> SELECT WEEK(\'2008-02-20\',1);\n        -> 8\nmysql> SELECT WEEK(\'2008-12-31\',1);\n        -> 53\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (292,22,'DROP FUNCTION UDF','Syntax:\nDROP FUNCTION function_name\n\nThis statement drops the user-defined function (UDF) named\nfunction_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql\ndatabase. This is because DROP FUNCTION removes a row from the\nmysql.func system table that records the function\'s name, type, and\nshared library name.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-function-udf.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (293,38,'UPDATEXML','Syntax:\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nThis function replaces a single portion of a given fragment of XML\nmarkup xml_target with a new XML fragment new_xml, and then returns the\nchanged XML. The portion of xml_target that is replaced matches an\nXPath expression xpath_expr supplied by the user. In MySQL 5.6.6 and\nearlier, the XPath expression could contain at most 127 characters.\nThis limitation is lifted in MySQL 5.6.7. (Bug #13007062, Bug #62429)\n\nIf no expression matching xpath_expr is found, or if multiple matches\nare found, the function returns the original xml_target XML fragment.\nAll three arguments should be strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html\n\n','mysql> SELECT\n    ->   UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a\', \'<e>fff</e>\') AS val1,\n    ->   UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/b\', \'<e>fff</e>\') AS val2,\n    ->   UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'//b\', \'<e>fff</e>\') AS val3,\n    ->   UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val4,\n    ->   UpdateXML(\'<a><d></d><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val5\n    -> \\G\n\n*************************** 1. row ***************************\nval1: <e>fff</e>\nval2: <a><b>ccc</b><d></d></a>\nval3: <a><e>fff</e><d></d></a>\nval4: <a><b>ccc</b><e>fff</e></a>\nval5: <a><d></d><b>ccc</b><d></d></a>\n','http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (294,8,'RESET SLAVE','Syntax:\nRESET SLAVE [ALL]\n\nRESET SLAVE makes the slave forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean\nstart: It clears the master info and relay log info repositories,\ndeletes all the relay log files, and starts a new relay log file. It\nalso resets to 0 the replication delay specified with the MASTER_DELAY\noption to CHANGE MASTER TO. To use RESET SLAVE, the slave replication\nthreads must be stopped (use STOP SLAVE if necessary).\n\n*Note*: All relay log files are deleted, even if they have not been\ncompletely executed by the slave SQL thread. (This is a condition\nlikely to exist on a replication slave if you have issued a STOP SLAVE\nstatement or if the slave is highly loaded.)\n\nIn MySQL 5.6 (unlike the case in MySQL 5.1 and earlier), RESET SLAVE\ndoes not change any replication connection parameters such as master\nhost, master port, master user, or master password, which are retained\nin memory. This means that START SLAVE can be issued without requiring\na CHANGE MASTER TO statement following RESET SLAVE.\n\nConnection parameters are reset if the slave mysqld is shut down\nfollowing RESET SLAVE. In MySQL 5.6.3 and later, you can instead use\nRESET SLAVE ALL to reset these connection parameters (Bug #11809016).\n\nRESET SLAVE ALL does not clear the IGNORE_SERVER_IDS list set by CHANGE\nMASTER TO. This issue is fixed in MySQL 5.7. (Bug #18816897)\n\nIn MySQL 5.6.7 and later, RESET SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nIf the slave SQL thread was in the middle of replicating temporary\ntables when it was stopped, and RESET SLAVE is issued, these replicated\ntemporary tables are deleted on the slave.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/reset-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/reset-slave.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (295,32,'DAY','Syntax:\nDAY(date)\n\nDAY() is a synonym for DAYOFMONTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (296,14,'UUID','Syntax:\nUUID()\n\nReturns a Universal Unique Identifier (UUID) generated according to\n"DCE 1.1: Remote Procedure Call" (Appendix A) CAE (Common Applications\nEnvironment) Specifications published by The Open Group in October 1997\n(Document Number C706,\nhttp://www.opengroup.org/public/pubs/catalog/c706.htm).\n\nA UUID is designed as a number that is globally unique in space and\ntime. Two calls to UUID() are expected to generate two different\nvalues, even if these calls are performed on two separate computers\nthat are not connected to each other.\n\nA UUID is a 128-bit number represented by a utf8 string of five\nhexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format:\n\no The first three numbers are generated from a timestamp.\n\no The fourth number preserves temporal uniqueness in case the timestamp\n  value loses monotonicity (for example, due to daylight saving time).\n\no The fifth number is an IEEE 802 node number that provides spatial\n  uniqueness. A random number is substituted if the latter is not\n  available (for example, because the host computer has no Ethernet\n  card, or we do not know how to find the hardware address of an\n  interface on your operating system). In this case, spatial uniqueness\n  cannot be guaranteed. Nevertheless, a collision should have very low\n  probability.\n\n  Currently, the MAC address of an interface is taken into account only\n  on FreeBSD and Linux. On other operating systems, MySQL uses a\n  randomly generated 48-bit number.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID();\n        -> \'6ccd780c-baba-1026-9564-0040f4311e29\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (297,25,'LINESTRING','LineString(pt1,pt2,...)\n\nConstructs a LineString value from a number of Point or WKB Point\narguments. If the number of arguments is less than two, the return\nvalue is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (298,14,'SLEEP','Syntax:\nSLEEP(duration)\n\nSleeps (pauses) for the number of seconds given by the duration\nargument, then returns 0. If SLEEP() is interrupted, it returns 1. The\nduration may have a fractional part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (299,40,'CREATE LOGFILE GROUP','Syntax:\nCREATE LOGFILE GROUP logfile_group\n    ADD UNDOFILE \'undo_file\'\n    [INITIAL_SIZE [=] initial_size]\n    [UNDO_BUFFER_SIZE [=] undo_buffer_size]\n    [REDO_BUFFER_SIZE [=] redo_buffer_size]\n    [NODEGROUP [=] nodegroup_id]\n    [WAIT]\n    [COMMENT [=] comment_text]\n    ENGINE [=] engine_name\n\nThis statement creates a new log file group named logfile_group having\na single UNDO file named \'undo_file\'. A CREATE LOGFILE GROUP statement\nhas one and only one ADD UNDOFILE clause. For rules covering the naming\nof log file groups, see\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and a log file group with the same name, or a\ntablespace and a data file with the same name.\n\nIn MySQL Cluster NDB 7.3 and later, you can have only one log file\ngroup per Cluster at any given time. (See Bug #16386)\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size;\nif not specified, it defaults to 128M (128 megabytes). The optional\nUNDO_BUFFER_SIZE parameter sets the size used by the UNDO buffer for\nthe log file group; The default value for UNDO_BUFFER_SIZE is 8M (eight\nmegabytes); this value cannot exceed the amount of system memory\navailable. Both of these parameters are specified in bytes. In MySQL\nCluster NDB 7.3.2 and later, you may optionally follow either or both\nof these with a one-letter abbreviation for an order of magnitude,\nsimilar to those used in my.cnf. Generally, this is one of the letters\nM (for megabytes) or G (for gigabytes). Prior to MySQL Cluster NDB\n7.3.2, the values for these options could only be specified using\ndigits. (Bug #13116514, Bug #16104705, Bug #62858)\n\nThe memory used for both INITIAL_SIZE and UNDO_BUFFER_SIZE comes from\nthe global pool whose size is determined by the value of the\nSharedGlobalMemory data node configuration parameter. This includes any\ndefault value implied for these options by the setting of the\nInitialLogFileGroup data node configuration parameter.\n\nThe maximum permitted for UNDO_BUFFER_SIZE is 629145600 (600 MB).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nThe minimum allowed value for INITIAL_SIZE is 1048576 (1 MB).\n\nThe ENGINE option determines the storage engine to be used by this log\nfile group, with engine_name being the name of the storage engine. In\nMySQL 5.6, this must be NDB (or NDBCLUSTER). If ENGINE is not set,\nMySQL tries to use the engine specified by the default_storage_engine\nserver system variable (formerly storage_engine). In any case, if the\nengine is not specified as NDB or NDBCLUSTER, the CREATE LOGFILE GROUP\nstatement appears to succeed but actually fails to create the log file\ngroup, as shown here:\n\nmysql> CREATE LOGFILE GROUP lg1 \n    ->     ADD UNDOFILE \'undo.dat\' INITIAL_SIZE = 10M;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+-------+------+------------------------------------------------------------------------------------------------+\n| Level | Code | Message                                                                                        |\n+-------+------+------------------------------------------------------------------------------------------------+\n| Error | 1478 | Table storage engine \'InnoDB\' does not support the create option \'TABLESPACE or LOGFILE GROUP\' |\n+-------+------+------------------------------------------------------------------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> DROP LOGFILE GROUP lg1 ENGINE = NDB;              \nERROR 1529 (HY000): Failed to drop LOGFILE GROUP\n\nmysql> CREATE LOGFILE GROUP lg1 \n    ->     ADD UNDOFILE \'undo.dat\' INITIAL_SIZE = 10M\n    ->     ENGINE = NDB;\nQuery OK, 0 rows affected (2.97 sec)\n\nThe fact that the CREATE LOGFILE GROUP statement does not actually\nreturn an error when a non-NDB storage engine is named, but rather\nappears to succeed, is a known issue which we hope to address in a\nfuture release of MySQL Cluster.\n\nREDO_BUFFER_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but ignored,\nand so have no effect in MySQL 5.6. These options are intended for\nfuture expansion.\n\nWhen used with ENGINE [=] NDB, a log file group and associated UNDO log\nfile are created on each Cluster data node. You can verify that the\nUNDO files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, LOGFILE_GROUP_NUMBER, EXTRA\n    -> FROM INFORMATION_SCHEMA.FILES\n    -> WHERE FILE_NAME = \'undo_10.dat\';\n+--------------------+----------------------+----------------+\n| LOGFILE_GROUP_NAME | LOGFILE_GROUP_NUMBER | EXTRA          |\n+--------------------+----------------------+----------------+\n| lg_3               |                   11 | CLUSTER_NODE=3 |\n| lg_3               |                   11 | CLUSTER_NODE=4 |\n+--------------------+----------------------+----------------+\n2 rows in set (0.06 sec)\n\nCREATE LOGFILE GROUP is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-logfile-group.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (300,6,'NULLIF','Syntax:\nNULLIF(expr1,expr2)\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is\nthe same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT NULLIF(1,1);\n        -> NULL\nmysql> SELECT NULLIF(1,2);\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (301,3,'ROUND','Syntax:\nROUND(X), ROUND(X,D)\n\nRounds the argument X to D decimal places. The rounding algorithm\ndepends on the data type of X. D defaults to 0 if not specified. D can\nbe negative to cause D digits left of the decimal point of the value X\nto become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ROUND(-1.23);\n        -> -1\nmysql> SELECT ROUND(-1.58);\n        -> -2\nmysql> SELECT ROUND(1.58);\n        -> 2\nmysql> SELECT ROUND(1.298, 1);\n        -> 1.3\nmysql> SELECT ROUND(1.298, 0);\n        -> 1\nmysql> SELECT ROUND(23.298, -1);\n        -> 20\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (302,32,'TIMEDIFF','Syntax:\nTIMEDIFF(expr1,expr2)\n\nTIMEDIFF() returns expr1 - expr2 expressed as a time value. expr1 and\nexpr2 are time or date-and-time expressions, but both must be of the\nsame type.\n\nThe result returned by TIMEDIFF() is limited to the range allowed for\nTIME values. Alternatively, you can use either of the functions\nTIMESTAMPDIFF() and UNIX_TIMESTAMP(), both of which return integers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMEDIFF(\'2000:01:01 00:00:00\',\n    ->                 \'2000:01:01 00:00:00.000001\');\n        -> \'-00:00:00.000001\'\nmysql> SELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\',\n    ->                 \'2008-12-30 01:01:01.000002\');\n        -> \'46:58:57.999999\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (303,8,'STOP SLAVE','Syntax:\nSTOP SLAVE [thread_types]\n\nthread_types:\n    [thread_type [, thread_type] ... ]\n\nthread_type: IO_THREAD | SQL_THREAD\n\nStops the slave threads. STOP SLAVE requires the SUPER privilege.\nRecommended best practice is to execute STOP SLAVE on the slave before\nstopping the slave server (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-shutdown.html, for more\ninformation).\n\nWhen using the row-based logging format: You should execute STOP SLAVE\nor STOP SLAVE SQL_THREAD on the slave prior to shutting down the slave\nserver if you are replicating any tables that use a nontransactional\nstorage engine (see the Note later in this section).\n\nLike START SLAVE, this statement may be used with the IO_THREAD and\nSQL_THREAD options to name the thread or threads to be stopped.\n\nIn MySQL 5.6.7 and later, STOP SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nBeginning with MySQL 5.6.11, gtid_next must be set to AUTOMATIC before\nissuing this statement (Bug #16062608).\n\nIn MySQL 5.6.13 and later, you can control how long STOP SLAVE waits\nbefore timing out by setting the rpl_stop_slave_timeout system\nvariable. This can be used to avoid deadlocks between STOP SLAVE and\nother slave SQL statements using different client connections to the\nslave. (Bug #16856735)\n\n*Note*: In MySQL 5.6, STOP SLAVE waits until the current replication\nevent group affecting one or more nontransactional tables has finished\nexecuting (if there is any such replication group), or until the user\nissues a KILL QUERY or KILL CONNECTION statement. (Bug #319, Bug\n#38205)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/stop-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/stop-slave.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (304,4,'LINEFROMTEXT','LineFromText(wkt[,srid]), LineStringFromText(wkt[,srid])\n\nConstructs a LineString value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (305,32,'ADDTIME','Syntax:\nADDTIME(expr1,expr2)\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time\nor datetime expression, and expr2 is a time expression.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n        -> \'2008-01-02 01:01:01.000001\'\nmysql> SELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n        -> \'03:00:01.999997\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (306,38,'UPPER','Syntax:\nUPPER(str)\n\nReturns the string str with all characters changed to uppercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT UPPER(\'Hej\');\n        -> \'HEJ\'\n\nSee the description of LOWER() for information that also applies to\nUPPER(). This included information about how to perform lettercase\nconversion of binary strings (BINARY, VARBINARY, BLOB) for which these\nfunctions are ineffective, and information about case folding for\nUnicode character sets.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (307,23,'MEDIUMBLOB','MEDIUMBLOB\n\nA BLOB column with a maximum length of 16,777,215 (224 - 1) bytes. Each\nMEDIUMBLOB value is stored using a 3-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (308,32,'FROM_UNIXTIME','Syntax:\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether\nthe function is used in a string or numeric context. The value is\nexpressed in the current time zone. unix_timestamp is an internal\ntimestamp value such as is produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format\nstring, which is used the same way as listed in the entry for the\nDATE_FORMAT() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_UNIXTIME(1196440219);\n        -> \'2007-11-30 10:30:19\'\nmysql> SELECT FROM_UNIXTIME(1196440219) + 0;\n        -> 20071130103019.000000\nmysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),\n    ->                      \'%Y %D %M %h:%i:%s %x\');\n        -> \'2007 30th November 10:30:59 2007\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (309,12,'SHA2','Syntax:\nSHA2(str, hash_length)\n\nCalculates the SHA-2 family of hash functions (SHA-224, SHA-256,\nSHA-384, and SHA-512). The first argument is the cleartext string to be\nhashed. The second argument indicates the desired bit length of the\nresult, which must have a value of 224, 256, 384, 512, or 0 (which is\nequivalent to 256). If either argument is NULL or the hash length is\nnot one of the permitted values, the return value is NULL. Otherwise,\nthe function result is a hash value containing the desired number of\nbits. See the notes at the beginning of this section about storing hash\nvalues efficiently.\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT SHA2(\'abc\', 224);\n        -> \'23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (310,6,'IFNULL','Syntax:\nIFNULL(expr1,expr2)\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns\nexpr2. IFNULL() returns a numeric or string value, depending on the\ncontext in which it is used.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT IFNULL(1,0);\n        -> 1\nmysql> SELECT IFNULL(NULL,10);\n        -> 10\nmysql> SELECT IFNULL(1/0,10);\n        -> 10\nmysql> SELECT IFNULL(1/0,\'yes\');\n        -> \'yes\'\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (311,27,'SHOW FUNCTION CODE','Syntax:\nSHOW FUNCTION CODE func_name\n\nThis statement is similar to SHOW PROCEDURE CODE but for stored\nfunctions. See [HELP SHOW PROCEDURE CODE].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-function-code.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-function-code.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (312,27,'SHOW ERRORS','Syntax:\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW COUNT(*) ERRORS\n\nSHOW ERRORS is a diagnostic statement that is similar to SHOW WARNINGS,\nexcept that it displays information only for errors, rather than for\nerrors, warnings, and notes.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You\ncan also retrieve this number from the error_count variable:\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nSHOW ERRORS and error_count apply only to errors, not warnings or\nnotes. In other respects, they are similar to SHOW WARNINGS and\nwarning_count. In particular, SHOW ERRORS cannot display information\nfor more than max_error_count messages, and error_count can exceed the\nvalue of max_error_count if the number of errors exceeds\nmax_error_count.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-errors.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-errors.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (313,20,'LEAST','Syntax:\nLEAST(value1,value2,...)\n\nWith two or more arguments, returns the smallest (minimum-valued)\nargument. The arguments are compared using the following rules:\n\no If any argument is NULL, the result is NULL. No comparison is needed.\n\no If the return value is used in an INTEGER context or all arguments\n  are integer-valued, they are compared as integers.\n\no If the return value is used in a REAL context or all arguments are\n  real-valued, they are compared as reals.\n\no If the arguments comprise a mix of numbers and strings, they are\n  compared as numbers.\n\no If any argument is a nonbinary (character) string, the arguments are\n  compared as nonbinary strings.\n\no In all other cases, the arguments are compared as binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT LEAST(2,0);\n        -> 0\nmysql> SELECT LEAST(34.0,3.0,5.0,767.0);\n        -> 3.0\nmysql> SELECT LEAST(\'B\',\'A\',\'C\');\n        -> \'A\'\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (314,20,'=','=\n\nEqual:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 = 0;\n        -> 0\nmysql> SELECT \'0\' = 0;\n        -> 1\nmysql> SELECT \'0.0\' = 0;\n        -> 1\nmysql> SELECT \'0.01\' = 0;\n        -> 0\nmysql> SELECT \'.01\' = 0.01;\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (315,14,'IS_IPV4_MAPPED','Syntax:\nIS_IPV4_MAPPED(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-mapped IPv6 address, 0 otherwise. IPv4-mapped\naddresses have the form ::ffff:ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::10.0.5.9\'));\n        -> 0\nmysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.5.9\'));\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (316,10,'CREATE USER','Syntax:\nCREATE USER user_specification [, user_specification] ...\n\nuser_specification:\n    user\n    [\n      | IDENTIFIED WITH auth_plugin [AS \'auth_string\']\n        IDENTIFIED BY [PASSWORD] \'password\'\n    ]\n\nThe CREATE USER statement creates new MySQL accounts. An error occurs\nfor accounts that already exist. To use this statement, you must have\nthe global CREATE USER privilege or the INSERT privilege for the mysql\ndatabase. For each account, CREATE USER creates a new row in the\nmysql.user table with no privileges and assigns the account an\nauthentication plugin. Depending on the syntax used, CREATE USER may\nalso assign the account a password.\n\nEach user_specification clause consists of an account name and\ninformation about how authentication occurs for clients that use the\naccount. This part of CREATE USER syntax is shared with GRANT, so the\ndescription here applies to GRANT as well.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nThe server assigns an authentication plugin and password to each\naccount as follows, depending on whether the user specification clause\nincludes IDENTIFIED WITH to specify a plugin or IDENTIFIED BY to\nspecify a password:\n\no With IDENTIFIED WITH, the server assigns the specified plugin and the\n  account has no password.\n\no With IDENTIFIED BY, the server assigns the plugin implicitly and\n  assigns the specified password.\n\no With neither IDENTIFIED WITH nor IDENTIFIED BY, the server assigns\n  the plugin implicitly and the account has no password.\n\nIf the account has no password, the Password column in the account\'s\nmysql.user table row remains empty, which is insecure. To set the\npassword, use SET PASSWORD. See [HELP SET PASSWORD].\n\nFor implicit authentication plugin assignment, the server uses these\nrules:\n\no As of MySQL 5.6.6, the server assigns the default plugin to the\n  account. This plugin becomes the value of the plugin column in the\n  account\'s mysql.user table row. The default plugin is\n  mysql_native_password unless the --default-authentication-plugin\n  option is set otherwise at server startup.\n\no Before MySQL 5.6.6, the server assigns no plugin to the account. The\n  plugin column in the account\'s mysql.user table row remains empty.\n\nFor client connections that use a given account, the server invokes the\nauthentication plugin assigned to the account and the client must\nprovide credentials as required by the authentication method that the\nplugin implements. If the server cannot find the plugin, either at\naccount-creation time or connect time, an error occurs.\n\nIf an account\'s mysql.user table row has a nonempty plugin column:\n\no The server authenticates client connection attempts using the named\n  plugin.\n\no Changes to the account password using SET PASSWORD with PASSWORD()\n  must be made with the old_passwords system variable set to the value\n  required by the authentication plugin, so that PASSWORD() uses the\n  appropriate password hashing method. If the plugin is\n  mysql_old_password, the password can also be changed using SET\n  PASSWORD with OLD_PASSWORD(), which uses pre-4.1 password hashing\n  regardless of the value of old_passwords.\n\nIf an account\'s mysql.user table row has an empty plugin column:\n\no The server authenticates client connection attempts using the\n  mysql_native_password or mysql_old_password authentication plugin,\n  depending on the hash format of the password stored in the Password\n  column.\n\no Changes to the account password using SET PASSWORD can be made with\n  PASSWORD(), with old_passwords set to 0 or 1 for 4.1 or pre-4.1\n  password hashing, respectively, or with OLD_PASSWORD(), which uses\n  pre-4.1 password hashing regardless of the value of old_passwords.\n\nCREATE USER examples:\n\no To specify an authentication plugin for an account, use IDENTIFIED\n  WITH auth_plugin. The plugin name can be a quoted string literal or\n  an unquoted name. \'auth_string\' is an optional quoted string literal\n  to pass to the plugin. The plugin interprets the meaning of the\n  string, so its format is plugin specific. Consult the documentation\n  for a given plugin for information about the authentication string\n  values it accepts, if any.\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED WITH mysql_native_password;\n\n  The server assigns the given authentication plugin to the account but\n  no password. Clients must provide no password when they connect.\n  However, an account with no password is insecure. To ensure that an\n  account uses a specific authentication plugin and has a password with\n  the corresponding hash format, specify the plugin explicitly with\n  IDENTIFIED WITH, then use SET PASSWORD to set the password:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED WITH mysql_native_password;\nSET old_passwords = 0;\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'mypass\');\n\n  Changes to the account password using SET PASSWORD with PASSWORD()\n  must be made with the old_passwords system variable set to the value\n  required by the account\'s authentication plugin, so that PASSWORD()\n  uses the appropriate password hashing method. Therefore, to use the\n  sha256_password or mysql_old_password plugin instead, name that\n  plugin in the CREATE USER statement and set old_passwords to 2 or 1,\n  respectively, before using SET PASSWORD. (Use of mysql_old_password\n  is not recommended. It is deprecated and support for it will be\n  removed in a future MySQL release.)\n\no To specify a password for an account at account-creation time, use\n  IDENTIFIED BY with the literal plaintext password value:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\n\n  The server assigns an authentication plugin to the account\n  implicitly, as described previously, and assigns the given password.\n  Clients must provide the given password when they connect.\n\n  If the implicitly assigned plugin is mysql_native_password, the\n  old_passwords system variable must be set to 0. Otherwise, CREATE\n  USER does not hash the password in the format required by the plugin\n  and an error occurs:\n\nmysql> SET old_passwords = 1;\nmysql> CREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\nERROR 1827 (HY000): The password hash doesn\'t have the expected\nformat. Check if the correct password algorithm is being used with\nthe PASSWORD() function.\n\nmysql> SET old_passwords = 0;\nmysql> CREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\nQuery OK, 0 rows affected (0.00 sec)\n\no To avoid specifying the plaintext password if you know its hash value\n  (the value that PASSWORD() would return for the password), specify\n  the hash value preceded by the keyword PASSWORD:\n\nCREATE USER \'jeffrey\'@\'localhost\'\nIDENTIFIED BY PASSWORD \'*90E462C37378CED12064BB3388827D2BA3A9B689\';\n\n  The server assigns an authentication plugin to the account\n  implicitly, as described previously, and assigns the given password.\n  The password hash must be in the format required by the assigned\n  plugin. Clients must provide the password when they connect.\n\no To enable the user to connect with no password, include no IDENTIFIED\n  BY clause:\n\nCREATE USER \'jeffrey\'@\'localhost\';\n\n  The server assigns an authentication plugin to the account\n  implicitly, as described previously, but no password. Clients must\n  provide no password when they connect. However, an account with no\n  password is insecure. To avoid this, use SET PASSWORD to set the\n  account password.\n\nAs mentioned previously, implicit plugin assignment depends on the\ndefault authentication plugin. Permitted values of\n--default-authentication-plugin are mysql_native_plugin and\nsha256_password, but not mysql_old_password. This means it is not\npossible to set the default plugin so as to be able to create an\naccount that uses mysql_old_password with CREATE USER ... IDENTIFIED BY\nsyntax. To create an account that uses mysql_old_password, use CREATE\nUSER ... IDENTIFIED WITH to name the plugin explicitly, then set the\npassword: CREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED WITH\nmysql_old_password; SET old_passwords = 1; SET PASSWORD FOR\n\'jeffrey\'@\'localhost\' = PASSWORD(\'mypass\');\n\nHowever, the preceding procedure is not recommended because\nmysql_old_password is deprecated.\n\nFor additional information about setting passwords and authentication\nplugins, see\nhttp://dev.mysql.com/doc/refman/5.6/en/assigning-passwords.html, and\nhttp://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-user.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (317,25,'POINT','Point(x,y)\n\nConstructs a Point using its coordinates.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (318,38,'LCASE','Syntax:\nLCASE(str)\n\nLCASE() is a synonym for LOWER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (319,7,'CREATE_DH_PARAMETERS','CREATE_DH_PARAMETERS(key_len)\n\nCreates a shared secret for generating a DH private/public key pair and\nreturns a binary string that can be passed to\nCREATE_ASYMMETRIC_PRIV_KEY(). If secret generation fails, the result is\nnull.\n\nSupported key_len values: The minimum and maximum key lengths in bits\nare 1024 and 10,000. These lengths are constraints imposed by OpenSSL.\n\nFor an example showing how to use the return value for generating\nsymmetric keys, see the description of ASYMMETRIC_DERIVE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','SET @dhp = CREATE_DH_PARAMETERS(1024);\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (320,20,'IS NOT NULL','Syntax:\nIS NOT NULL\n\nTests whether a value is not NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n        -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (321,38,'MATCH AGAINST','Syntax:\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nMySQL has support for full-text indexing and searching:\n\no A full-text index in MySQL is an index of type FULLTEXT.\n\no Full-text indexes can be used only with InnoDB or MyISAM tables, and\n  can be created only for CHAR, VARCHAR, or TEXT columns.\n\no A FULLTEXT index definition can be given in the CREATE TABLE\n  statement when a table is created, or added later using ALTER TABLE\n  or CREATE INDEX.\n\no For large data sets, it is much faster to load your data into a table\n  that has no FULLTEXT index and then create the index after that, than\n  to load data into a table that has an existing FULLTEXT index.\n\nFull-text searching is performed using MATCH() ... AGAINST syntax.\nMATCH() takes a comma-separated list that names the columns to be\nsearched. AGAINST takes a string to search for, and an optional\nmodifier that indicates what type of search to perform. The search\nstring must be a string value that is constant during query evaluation.\nThis rules out, for example, a table column because that can differ for\neach row.\n\nThere are three types of full-text searches:\n\no A natural language search interprets the search string as a phrase in\n  natural human language (a phrase in free text). There are no special\n  operators. The stopword list applies, controlled by\n  innodb_ft_enable_stopword, innodb_ft_server_stopword_table, and\n  innodb_ft_user_stopword_table for InnoDB search indexes, and\n  ft_stopword_file for MyISAM ones. For more information, see\n  http://dev.mysql.com/doc/refman/5.6/en/fulltext-stopwords.html.\n\n  Full-text searches are natural language searches if the IN NATURAL\n  LANGUAGE MODE modifier is given or if no modifier is given. For more\n  information, see\n  http://dev.mysql.com/doc/refman/5.6/en/fulltext-natural-language.html\n  .\n\no A boolean search interprets the search string using the rules of a\n  special query language. The string contains the words to search for.\n  It can also contain operators that specify requirements such that a\n  word must be present or absent in matching rows, or that it should be\n  weighted higher or lower than usual. Certain common words (stopwords)\n  are omitted from the search index and do not match if present in the\n  search string. The IN BOOLEAN MODE modifier specifies a boolean\n  search. For more information, see\n  http://dev.mysql.com/doc/refman/5.6/en/fulltext-boolean.html.\n\no A query expansion search is a modification of a natural language\n  search. The search string is used to perform a natural language\n  search. Then words from the most relevant rows returned by the search\n  are added to the search string and the search is done again. The\n  query returns the rows from the second search. The IN NATURAL\n  LANGUAGE MODE WITH QUERY EXPANSION or WITH QUERY EXPANSION modifier\n  specifies a query expansion search. For more information, see\n  http://dev.mysql.com/doc/refman/5.6/en/fulltext-query-expansion.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html\n\n','mysql> SELECT id, body, MATCH (title,body) AGAINST\n    (\'Security implications of running MySQL as root\'\n    IN NATURAL LANGUAGE MODE) AS score\n    FROM articles WHERE MATCH (title,body) AGAINST\n    (\'Security implications of running MySQL as root\'\n    IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body                                | score           |\n+----+-------------------------------------+-----------------+\n|  4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |\n|  6 | When configured properly, MySQL ... | 1.3114095926285 |\n+----+-------------------------------------+-----------------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (322,40,'CREATE EVENT','Syntax:\nCREATE\n    [DEFINER = { user | CURRENT_USER }]\n    EVENT\n    [IF NOT EXISTS]\n    event_name\n    ON SCHEDULE schedule\n    [ON COMPLETION [NOT] PRESERVE]\n    [ENABLE | DISABLE | DISABLE ON SLAVE]\n    [COMMENT \'comment\']\n    DO event_body;\n\nschedule:\n    AT timestamp [+ INTERVAL interval] ...\n  | EVERY interval\n    [STARTS timestamp [+ INTERVAL interval] ...]\n    [ENDS timestamp [+ INTERVAL interval] ...]\n\ninterval:\n    quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n              WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n              DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n\nThis statement creates and schedules a new event. The event will not\nrun unless the Event Scheduler is enabled. For information about\nchecking Event Scheduler status and enabling it if necessary, see\nhttp://dev.mysql.com/doc/refman/5.6/en/events-configuration.html.\n\nCREATE EVENT requires the EVENT privilege for the schema in which the\nevent is to be created. It might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section.\n\nThe minimum requirements for a valid CREATE EVENT statement are as\nfollows:\n\no The keywords CREATE EVENT plus an event name, which uniquely\n  identifies the event in a database schema.\n\no An ON SCHEDULE clause, which determines when and how often the event\n  executes.\n\no A DO clause, which contains the SQL statement to be executed by an\n  event.\n\nThis is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n    ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n    DO\n      UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event\nexecutes once---one hour following its creation---by running an SQL\nstatement that increments the value of the myschema.mytable table\'s\nmycol column by 1.\n\nThe event_name must be a valid MySQL identifier with a maximum length\nof 64 characters. Event names are not case sensitive, so you cannot\nhave two events named myevent and MyEvent in the same schema. In\ngeneral, the rules governing event names are the same as those for\nnames of stored routines. See\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\nAn event is associated with a schema. If no schema is indicated as part\nof event_name, the default (current) schema is assumed. To create an\nevent in a specific schema, qualify the event name with a schema using\nschema_name.event_name syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-event.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-event.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (323,7,'MBR DEFINITION','Its MBR (minimum bounding rectangle), or envelope. This is the bounding\ngeometry, formed by the minimum and maximum (X,Y) coordinates:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-class-geometry.html\n\n','((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n','http://dev.mysql.com/doc/refman/5.6/en/gis-class-geometry.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (324,26,'ST_DIFFERENCE','ST_Difference(g1, g2)\n\nReturns a geometry that represents the point set difference of the\ngeometry values g1 and g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = POINT(1,1), @g2 = POINT(2,2);\nmysql> SELECT AsText(ST_Difference(@g1, @g2));\n+---------------------------------+\n| AsText(ST_Difference(@g1, @g2)) |\n+---------------------------------+\n| POINT(1 1)                      |\n+---------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (325,25,'GEOMETRYCOLLECTION','GeometryCollection(g1,g2,...)\n\nConstructs a GeometryCollection.\n\nIf the argument contains a nonsupported geometry, the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (326,3,'*','Syntax:\n*\n\nMultiplication:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3*5;\n        -> 15\nmysql> SELECT 18014398509481984*18014398509481984.0;\n        -> 324518553658426726783156020576256.0\nmysql> SELECT 18014398509481984*18014398509481984;\n        -> out-of-range error\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (327,12,'DES_DECRYPT','Syntax:\nDES_DECRYPT(crypt_str[,key_str])\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs,\nthis function returns NULL.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.6/en/ssl-connections.html.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte\nof the encrypted string to determine the DES key number that was used\nto encrypt the original string, and then reads the key from the DES key\nfile to decrypt the message. For this to work, the user must have the\nSUPER privilege. The key file can be specified with the --des-key-file\nserver option.\n\nIf you pass this function a key_str argument, that string is used as\nthe key for decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string,\nMySQL returns the given crypt_str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (328,2,'ST_AREA','ST_Area(poly)\n\nReturns a double-precision number indicating the area of the argument,\nas measured in its spatial reference system. For arguments of dimension\n0 or 1, the result is 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly = \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\nmysql> SELECT ST_Area(GeomFromText(@poly));\n+------------------------------+\n| ST_Area(GeomFromText(@poly)) |\n+------------------------------+\n|                            4 |\n+------------------------------+\n\nmysql> SET @mpoly =\n    -> \'MultiPolygon(((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1)))\';\nmysql> SELECT ST_Area(GeomFromText(@mpoly));\n+-------------------------------+\n| ST_Area(GeomFromText(@mpoly)) |\n+-------------------------------+\n|                             8 |\n+-------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (329,13,'ENDPOINT','EndPoint(ls)\n\nReturns the Point that is the endpoint of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3)                          |\n+-------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (330,16,'COUNT','Syntax:\nCOUNT(expr)\n\nReturns a count of the number of non-NULL values of expr in the rows\nretrieved by a SELECT statement. The result is a BIGINT value.\n\nCOUNT() returns 0 if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student.student_name,COUNT(*)\n    ->        FROM student,course\n    ->        WHERE student.student_id=course.student_id\n    ->        GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (331,28,'INSERT','Syntax:\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n    [INTO] tbl_name\n    [PARTITION (partition_name,...)] \n    [(col_name,...)]\n    {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n    [ ON DUPLICATE KEY UPDATE\n      col_name=expr\n        [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n    [INTO] tbl_name\n    [PARTITION (partition_name,...)]\n    SET col_name={expr | DEFAULT}, ...\n    [ ON DUPLICATE KEY UPDATE\n      col_name=expr\n        [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n    [INTO] tbl_name\n    [PARTITION (partition_name,...)] \n    [(col_name,...)]\n    SELECT ...\n    [ ON DUPLICATE KEY UPDATE\n      col_name=expr\n        [, col_name=expr] ... ]\n\nINSERT inserts new rows into an existing table. The INSERT ... VALUES\nand INSERT ... SET forms of the statement insert rows based on\nexplicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT ... SELECT is discussed\nfurther in [HELP INSERT SELECT].\n\nIn MySQL 5.6.2 and later, when inserting into a partitioned table, you\ncan control which partitions and subpartitions accept new rows. The\nPARTITION option takes a comma-separated list of the names of one or\nmore partitions or subpartitions (or both) of the table. If any of the\nrows to be inserted by a given INSERT statement do not match one of the\npartitions listed, the INSERT statement fails with the error Found a\nrow not matching the given partition set. See\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html, for\nmore information and examples.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/insert.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/insert.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (332,4,'MLINEFROMTEXT','MLineFromText(wkt[,srid]), MultiLineStringFromText(wkt[,srid])\n\nConstructs a MultiLineString value using its WKT representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (333,33,'GEOMCOLLFROMWKB','GeomCollFromWKB(wkb[,srid]), GeometryCollectionFromWKB(wkb[,srid])\n\nConstructs a GeometryCollection value using its WKB representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (334,23,'TINYTEXT','TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 255 (28 - 1) characters. The\neffective maximum length is less if the value contains multibyte\ncharacters. Each TINYTEXT value is stored using a 1-byte length prefix\nthat indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (335,14,'DEFAULT','Syntax:\nDEFAULT(col_name)\n\nReturns the default value for a table column. An error results if the\ncolumn has no default value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> UPDATE t SET i = DEFAULT(i)+1 WHERE id < 100;\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (336,12,'DECODE','Syntax:\nDECODE(crypt_str,pass_str)\n\nDecrypts the encrypted string crypt_str using pass_str as the password.\ncrypt_str should be a string returned from ENCODE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (337,21,'OPTIMIZE TABLE','Syntax:\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n    tbl_name [, tbl_name] ...\n\nReorganizes the physical storage of table data and associated index\ndata, to reduce storage space and improve I/O efficiency when accessing\nthe table. The exact changes made to each table depend on the storage\nengine used by that table.\n\nUse OPTIMIZE TABLE in these cases, depending on the type of table:\n\no After doing substantial insert, update, or delete operations on an\n  InnoDB table that has its own .ibd file because it was created with\n  the innodb_file_per_table option enabled. The table and indexes are\n  reorganized, and disk space can be reclaimed for use by the operating\n  system.\n\no After doing substantial insert, update, or delete operations on\n  columns that are part of a FULLTEXT index in an InnoDB table. Set the\n  configuration option innodb_optimize_fulltext_only=1 first. To keep\n  the index maintenance period to a reasonable time, set the\n  innodb_ft_num_word_optimize option to specify how many words to\n  update in the search index, and run a sequence of OPTIMIZE TABLE\n  statements until the search index is fully updated.\n\no After deleting a large part of a MyISAM or ARCHIVE table, or making\n  many changes to a MyISAM or ARCHIVE table with variable-length rows\n  (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted\n  rows are maintained in a linked list and subsequent INSERT operations\n  reuse old row positions. You can use OPTIMIZE TABLE to reclaim the\n  unused space and to defragment the data file. After extensive changes\n  to a table, this statement may also improve performance of statements\n  that use the table, sometimes significantly.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nOPTIMIZE TABLE is also supported for partitioned tables. For\ninformation about using this statement with partitioned tables and\ntable partitions, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/optimize-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/optimize-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (338,20,'<=>','Syntax:\n<=>\n\nNULL-safe equal. This operator performs an equality comparison like the\n= operator, but returns 1 rather than NULL if both operands are NULL,\nand 0 rather than NULL if one operand is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n        -> 1, 1, 0\nmysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;\n        -> 1, NULL, NULL\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (339,27,'RESET','Syntax:\nRESET reset_option [, reset_option] ...\n\nThe RESET statement is used to clear the state of various server\noperations. You must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement. See [HELP\nFLUSH].\n\nThe RESET statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/reset.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/reset.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (340,14,'GET_LOCK','Syntax:\nGET_LOCK(str,timeout)\n\nTries to obtain a lock with a name given by the string str, using a\ntimeout of timeout seconds. A negative timeout value means infinite\ntimeout.\n\nReturns 1 if the lock was obtained successfully, 0 if the attempt timed\nout (for example, because another client has previously locked the\nname), or NULL if an error occurred (such as running out of memory or\nthe thread was killed with mysqladmin kill). If you have a lock\nobtained with GET_LOCK(), it is released when you execute\nRELEASE_LOCK(), execute a new GET_LOCK(), or your connection terminates\n(either normally or abnormally). Locks obtained with GET_LOCK() do not\ninteract with transactions. That is, committing a transaction does not\nrelease any such locks obtained during the transaction.\n\nGET_LOCK() can be used to implement application locks or to simulate\nrecord locks. Names are locked on a server-wide basis. If a name has\nbeen locked within one session, GET_LOCK() blocks any request by\nanother session for a lock with the same name. This enables clients\nthat agree on a given lock name to use the name to perform cooperative\nadvisory locking. But be aware that it also enables a client that is\nnot among the set of cooperating clients to lock a name, either\ninadvertently or deliberately, and thus prevent any of the cooperating\nclients from locking that name. One way to reduce the likelihood of\nthis is to use lock names that are database-specific or\napplication-specific. For example, use lock names of the form\ndb_name.str or app_name.str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT GET_LOCK(\'lock1\',10);\n        -> 1\nmysql> SELECT IS_FREE_LOCK(\'lock2\');\n        -> 1\nmysql> SELECT GET_LOCK(\'lock2\',10);\n        -> 1\nmysql> SELECT RELEASE_LOCK(\'lock2\');\n        -> 1\nmysql> SELECT RELEASE_LOCK(\'lock1\');\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (341,23,'BIGINT','BIGINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (342,32,'CURTIME','Syntax:\nCURTIME([fsp])\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext. The value is expressed in the current time zone.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT CURTIME();\n        -> \'23:50:26\'\nmysql> SELECT CURTIME() + 0;\n        -> 235026.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (343,27,'SET','Syntax:\nSET variable_assignment [, variable_assignment] ...\n\nvariable_assignment:\n      user_var_name = expr\n    | [GLOBAL | SESSION] system_var_name = expr\n    | [@@global. | @@session. | @@]system_var_name = expr\n\nThe SET statement assigns values to different types of variables that\naffect the operation of the server or your client.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-statement.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-statement.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (344,38,'TO_BASE64()','Syntax:\nTO_BASE64(str)\n\nConverts the string argument to base-64 encoded form and returns the\nresult as a character string with the connection character set and\ncollation. If the argument is not a string, it is converted to a string\nbefore conversion takes place. The result is NULL if the argument is\nNULL. Base-64 encoded strings can be decoded using the FROM_BASE64()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n        -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (345,3,'CONV','Syntax:\nCONV(N,from_base,to_base)\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base\nto_base. Returns NULL if any argument is NULL. The argument N is\ninterpreted as an integer, but may be specified as an integer or a\nstring. The minimum base is 2 and the maximum base is 36. If to_base is\na negative number, N is regarded as a signed number. Otherwise, N is\ntreated as unsigned. CONV() works with 64-bit precision.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT CONV(\'a\',16,2);\n        -> \'1010\'\nmysql> SELECT CONV(\'6E\',18,8);\n        -> \'172\'\nmysql> SELECT CONV(-17,10,-18);\n        -> \'-H\'\nmysql> SELECT CONV(10+\'10\'+\'10\'+0xa,10,10);\n        -> \'40\'\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (346,28,'LOAD XML','Syntax:\nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n    [REPLACE | IGNORE]\n    INTO TABLE [db_name.]tbl_name\n    [PARTITION (partition_name,...)]\n    [CHARACTER SET charset_name]\n    [ROWS IDENTIFIED BY \'<tagname>\']\n    [IGNORE number {LINES | ROWS}]\n    [(column_or_user_var,...)]\n    [SET col_name = expr,...]\n\nThe LOAD XML statement reads data from an XML file into a table. The\nfile_name must be given as a literal string. The tagname in the\noptional ROWS IDENTIFIED BY clause must also be given as a literal\nstring, and must be surrounded by angle brackets (< and >).\n\nLOAD XML acts as the complement of running the mysql client in XML\noutput mode (that is, starting the client with the --xml option). To\nwrite data from a table to an XML file, use a command such as the\nfollowing one from the system shell:\n\nshell> mysql --xml -e \'SELECT * FROM mytable\' > file.xml\n\nTo read the file back into a table, use LOAD XML INFILE. By default,\nthe <row> element is considered to be the equivalent of a database\ntable row; this can be changed using the ROWS IDENTIFIED BY clause.\n\nThis statement supports three different XML formats:\n\no Column names as attributes and column values as attribute values:\n\n<row column1="value1" column2="value2" .../>\n\no Column names as tags and column values as the content of these tags:\n\n<row>\n  <column1>value1</column1>\n  <column2>value2</column2>\n</row>\n\no Column names are the name attributes of <field> tags, and values are\n  the contents of these tags:\n\n<row>\n  <field name=\'column1\'>value1</field>\n  <field name=\'column2\'>value2</field>\n</row>\n\n  This is the format used by other MySQL tools, such as mysqldump.\n\nAll three formats can be used in the same XML file; the import routine\nautomatically detects the format for each row and interprets it\ncorrectly. Tags are matched based on the tag or attribute name and the\ncolumn name.\n\nThe following clauses work essentially the same way for LOAD XML as\nthey do for LOAD DATA:\n\no LOW_PRIORITY or CONCURRENT\n\no LOCAL\n\no REPLACE or IGNORE\n\no PARTITION\n\no CHARACTER SET\n\no (column_or_user_var,...)\n\no SET\n\nSee [HELP LOAD DATA], for more information about these clauses.\n\nThe IGNORE number LINES or IGNORE number ROWS clause causes the first\nnumber rows in the XML file to be skipped. It is analogous to the LOAD\nDATA statement\'s IGNORE ... LINES clause.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/load-xml.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/load-xml.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (347,15,'ASSIGN-VALUE','Syntax:\n:=\n\nAssignment operator. Causes the user variable on the left hand side of\nthe operator to take on the value to its right. The value on the right\nhand side may be a literal value, another variable storing a value, or\nany legal expression that yields a scalar value, including the result\nof a query (provided that this value is a scalar value). You can\nperform multiple assignments in the same SET statement. You can perform\nmultiple assignments in the same statement-\n\nUnlike =, the := operator is never interpreted as a comparison\noperator. This means you can use := in any valid SQL statement (not\njust in SET statements) to assign a value to a variable.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n        -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n        -> 1, NULL\nmysql> SELECT @var1, @var2;\n        -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n        -> 1, 1\nmysql> SELECT @var1, @var2;\n        -> 1, 1\n\nmysql> SELECT @var1:=COUNT(*) FROM t1;\n        -> 4\nmysql> SELECT @var1;\n        -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (348,27,'SHOW OPEN TABLES','Syntax:\nSHOW OPEN TABLES [{FROM | IN} db_name]\n    [LIKE \'pattern\' | WHERE expr]\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open\nin the table cache. See\nhttp://dev.mysql.com/doc/refman/5.6/en/table-cache.html. The FROM\nclause, if present, restricts the tables shown to those present in the\ndb_name database. The LIKE clause, if present, indicates which table\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-open-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-open-tables.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (349,32,'EXTRACT','Syntax:\nEXTRACT(unit FROM date)\n\nThe EXTRACT() function uses the same kinds of unit specifiers as\nDATE_ADD() or DATE_SUB(), but extracts parts from the date rather than\nperforming date arithmetic.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT EXTRACT(YEAR FROM \'2009-07-02\');\n       -> 2009\nmysql> SELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n       -> 200907\nmysql> SELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n       -> 20102\nmysql> SELECT EXTRACT(MICROSECOND\n    ->                FROM \'2003-01-02 10:30:00.000123\');\n        -> 123\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (350,12,'ENCRYPT','Syntax:\nENCRYPT(str[,salt])\n\nEncrypts str using the Unix crypt() system call and returns a binary\nstring. The salt argument must be a string with at least two characters\nor the result will be NULL. If no salt argument is given, a random\nvalue is used.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT ENCRYPT(\'hello\');\n        -> \'VxuFAJXVARROc\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (351,27,'SHOW STATUS','Syntax:\nSHOW [GLOBAL | SESSION] STATUS\n    [LIKE \'pattern\' | WHERE expr]\n\nSHOW STATUS provides server status information. This information also\ncan be obtained using the mysqladmin extended-status command. The LIKE\nclause, if present, indicates which variable names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern:\n\nmysql> SHOW STATUS LIKE \'Key%\';\n+--------------------+----------+\n| Variable_name      | Value    |\n+--------------------+----------+\n| Key_blocks_used    | 14955    |\n| Key_read_requests  | 96854827 |\n| Key_reads          | 162040   |\n| Key_write_requests | 7589728  |\n| Key_writes         | 3813196  |\n+--------------------+----------+\n\nWith the GLOBAL modifier, SHOW STATUS displays the status values for\nall connections to MySQL. With SESSION, it displays the status values\nfor the current connection. If no modifier is present, the default is\nSESSION. LOCAL is a synonym for SESSION.\n\nSome status variables have only a global value. For these, you get the\nsame value for both GLOBAL and SESSION. The scope for each status\nvariable is listed at\nhttp://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html.\n\nEach invocation of the SHOW STATUS statement uses an internal temporary\ntable and increments the global Created_tmp_tables value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-status.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (352,14,'INET6_ATON','Syntax:\nINET6_ATON(expr)\n\nGiven an IPv6 or IPv4 network address as a string, returns a binary\nstring that represents the numeric value of the address in network byte\norder (big endian). Because numeric-format IPv6 addresses require more\nbytes than the largest integer type, the representation returned by\nthis function has the VARBINARY data type: VARBINARY(16) for IPv6\naddresses and VARBINARY(4) for IPv4 addresses. If the argument is not a\nvalid address, INET6_ATON() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT HEX(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n        -> \'FDFE0000000000005A55CAFFFEFA9089\'\nmysql> SELECT HEX(INET6_ATON(\'10.0.5.9\'));\n        -> \'0A000509\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (353,27,'SHOW SLAVE HOSTS','Syntax:\nSHOW SLAVE HOSTS\n\nDisplays a list of replication slaves currently registered with the\nmaster.\n\nSHOW SLAVE HOSTS should be executed on a server that acts as a\nreplication master. The statement displays information about servers\nthat are or have been connected as replication slaves, with each row of\nthe result corresponding to one slave server, as shown here:\n\nmysql> SHOW SLAVE HOSTS;\n+-----------+-----------+-------+-----------+--------------------------------------+\n| Server_id | Host      | Port  | Master_id | Slave_UUID                           |\n+-----------+-----------+-------+-----------+--------------------------------------+\n|  192168010 | iconnect2 | 3306 | 192168011 | 14cb6624-7f93-11e0-b2c0-c80aa9429562 |\n| 1921680101 | athena    | 3306 | 192168011 | 07af4990-f41f-11df-a566-7ac56fdaf645 |\n+------------+-----------+------+-----------+--------------------------------------+\n\no Server_id: The unique server ID of the slave server, as configured in\n  the slave server\'s option file, or on the command line with\n  --server-id=value.\n\no Host: The host name of the slave server, as configured in the slave\n  server\'s option file, or on the command line with\n  --report-host=host_name. Note that this can differ from the machine\n  name as configured in the operating system.\n\no Port: The port on the master to which the slave server is listening.\n\n  In MySQL 5.6.5 and later, a zero in this column means that the slave\n  port (--report-port) was not set. Prior to MySQL 5.6.5, 3306 was used\n  as the default in such cases (Bug #13333431).\n\no Master_id: The unique server ID of the master server that the slave\n  server is replicating from. This is the server ID of the server on\n  which SHOW SLAVE HOSTS is executed, so this same value is listed for\n  each row in the result.\n\no Slave_UUID: The globally unique ID of this slave, as generated on the\n  slave and found in the slave\'s auto.cnf file.\n\n  This column was added in MySQL 5.6.0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-slave-hosts.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-slave-hosts.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (354,8,'START TRANSACTION','Syntax:\nSTART TRANSACTION\n    [transaction_characteristic [, transaction_characteristic] ...]\n\ntransaction_characteristic:\n    WITH CONSISTENT SNAPSHOT\n  | READ WRITE\n  | READ ONLY\n\nBEGIN [WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\nThese statements provide control over use of transactions:\n\no START TRANSACTION or BEGIN start a new transaction.\n\no COMMIT commits the current transaction, making its changes permanent.\n\no ROLLBACK rolls back the current transaction, canceling its changes.\n\no SET autocommit disables or enables the default autocommit mode for\n  the current session.\n\nBy default, MySQL runs with autocommit mode enabled. This means that as\nsoon as you execute a statement that updates (modifies) a table, MySQL\nstores the update on disk to make it permanent. The change cannot be\nrolled back.\n\nTo disable autocommit mode implicitly for a single series of\nstatements, use the START TRANSACTION statement:\n\nSTART TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n\nWith START TRANSACTION, autocommit remains disabled until you end the\ntransaction with COMMIT or ROLLBACK. The autocommit mode then reverts\nto its previous state.\n\nSTART TRANSACTION permits several modifiers that control transaction\ncharacteristics. To specify multiple modifiers, separate them by\ncommas.\n\no The WITH CONSISTENT SNAPSHOT modifier starts a consistent read for\n  storage engines that are capable of it. This applies only to InnoDB.\n  The effect is the same as issuing a START TRANSACTION followed by a\n  SELECT from any InnoDB table. See\n  http://dev.mysql.com/doc/refman/5.6/en/innodb-consistent-read.html.\n  The WITH CONSISTENT SNAPSHOT modifier does not change the current\n  transaction isolation level, so it provides a consistent snapshot\n  only if the current isolation level is one that permits a consistent\n  read. The only isolation level that permits a consistent read is\n  REPEATABLE READ. For all other isolation levels, the WITH CONSISTENT\n  SNAPSHOT clause is ignored.\n\no The READ WRITE and READ ONLY modifiers set the transaction access\n  mode. They permit or prohibit changes to tables used in the\n  transaction. The READ ONLY restriction prevents the transaction from\n  modifying or locking both transactional and nontransactional tables\n  that are visible to other transactions; the transaction can still\n  modify or lock temporary tables. These modifiers are available as of\n  MySQL 5.6.5.\n\n  MySQL enables extra optimizations for queries on InnoDB tables when\n  the transaction is known to be read-only. Specifying READ ONLY\n  ensures these optimizations are applied in cases where the read-only\n  status cannot be determined automatically. See\n  http://dev.mysql.com/doc/refman/5.6/en/innodb-performance-ro-txn.html\n  for more information.\n\n  If no access mode is specified, the default mode applies. Unless the\n  default has been changed, it is read/write. It is not permitted to\n  specify both READ WRITE and READ ONLY in the same statement.\n\n  In read-only mode, it remains possible to change tables created with\n  the TEMPORARY keyword using DML statements. Changes made with DDL\n  statements are not permitted, just as with permanent tables.\n\n  For additional information about transaction access mode, including\n  ways to change the default mode, see [HELP ISOLATION].\n\n  If the read_only system variable is enabled, explicitly starting a\n  transaction with START TRANSACTION READ WRITE requires the SUPER\n  privilege.\n\n*Important*: Many APIs used for writing MySQL client applications (such\nas JDBC) provide their own methods for starting transactions that can\n(and sometimes should) be used instead of sending a START TRANSACTION\nstatement from the client. See\nhttp://dev.mysql.com/doc/refman/5.6/en/connectors-apis.html, or the\ndocumentation for your API, for more information.\n\nTo disable autocommit mode explicitly, use the following statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to\nzero, changes to transaction-safe tables (such as those for InnoDB or\nNDB) are not made permanent immediately. You must use COMMIT to store\nyour changes to disk or ROLLBACK to ignore the changes.\n\nautocommit is a session variable and must be set for each session. To\ndisable autocommit mode for each new connection, see the description of\nthe autocommit system variable at\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nBEGIN and BEGIN WORK are supported as aliases of START TRANSACTION for\ninitiating a transaction. START TRANSACTION is standard SQL syntax, is\nthe recommended way to start an ad-hoc transaction, and permits\nmodifiers that BEGIN does not.\n\nThe BEGIN statement differs from the use of the BEGIN keyword that\nstarts a BEGIN ... END compound statement. The latter does not begin a\ntransaction. See [HELP BEGIN END].\n\n*Note*: Within all stored programs (stored procedures and functions,\ntriggers, and events), the parser treats BEGIN [WORK] as the beginning\nof a BEGIN ... END block. Begin a transaction in this context with\nSTART TRANSACTION instead.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are\nthe CHAIN and RELEASE clauses. CHAIN and RELEASE can be used for\nadditional control over transaction completion. The value of the\ncompletion_type system variable determines the default completion\nbehavior. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the\ncurrent one ends, and the new transaction has the same isolation level\nas the just-terminated transaction. The RELEASE clause causes the\nserver to disconnect the current client session after terminating the\ncurrent transaction. Including the NO keyword suppresses CHAIN or\nRELEASE completion, which can be useful if the completion_type system\nvariable is set to cause chaining or release completion by default.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/commit.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/commit.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (355,32,'TIME_FORMAT','Syntax:\nTIME_FORMAT(time,format)\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, seconds, and\nmicroseconds. Other specifiers produce a NULL value or 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n        -> \'100 100 04 04 4\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (356,40,'CREATE DATABASE','Syntax:\nCREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n    [create_specification] ...\n\ncreate_specification:\n    [DEFAULT] CHARACTER SET [=] charset_name\n  | [DEFAULT] COLLATE [=] collation_name\n\nCREATE DATABASE creates a database with the given name. To use this\nstatement, you need the CREATE privilege for the database. CREATE\nSCHEMA is a synonym for CREATE DATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-database.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-database.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (357,16,'VAR_POP','Syntax:\nVAR_POP(expr)\n\nReturns the population standard variance of expr. It considers rows as\nthe whole population, not as a sample, so it has the number of rows as\nthe denominator. You can also use VARIANCE(), which is equivalent but\nis not standard SQL.\n\nVAR_POP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (358,38,'CONCAT_WS','Syntax:\nCONCAT_WS(separator,str1,str2,...)\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form\nof CONCAT(). The first argument is the separator for the rest of the\narguments. The separator is added between the strings to be\nconcatenated. The separator can be a string, as can the rest of the\narguments. If the separator is NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n        -> \'First name,Second name,Last Name\'\nmysql> SELECT CONCAT_WS(\',\',\'First name\',NULL,\'Last Name\');\n        -> \'First name,Last Name\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (359,23,'TEXT','TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 65,535 (216 - 1) characters. The\neffective maximum length is less if the value contains multibyte\ncharacters. Each TEXT value is stored using a 2-byte length prefix that\nindicates the number of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest TEXT type large enough to hold\nvalues M characters long.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (360,19,'~','Syntax:\n~\n\nInvert all bits.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 5 & ~1;\n        -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (361,3,'ASIN','Syntax:\nASIN(X)\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ASIN(0.2);\n        -> 0.20135792079033\nmysql> SELECT ASIN(\'foo\');\n\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n|           0 |\n+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level   | Code | Message                                 |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (362,17,'ROW_COUNT','Syntax:\nROW_COUNT()\n\nIn MySQL 5.6, ROW_COUNT() returns a value as follows:\n\no DDL statements: 0. This applies to statements such as CREATE TABLE or\n  DROP TABLE.\n\no DML statements other than SELECT: The number of affected rows. This\n  applies to statements such as UPDATE, INSERT, or DELETE (as before),\n  but now also to statements such as ALTER TABLE and LOAD DATA INFILE.\n\no SELECT: -1 if the statement returns a result set, or the number of\n  rows "affected" if it does not. For example, for SELECT * FROM t1,\n  ROW_COUNT() returns -1. For SELECT * FROM t1 INTO OUTFILE\n  \'file_name\', ROW_COUNT() returns the number of rows written to the\n  file.\n\no SIGNAL statements: 0.\n\nFor UPDATE statements, the affected-rows value by default is the number\nof rows actually changed. If you specify the CLIENT_FOUND_ROWS flag to\nmysql_real_connect() when connecting to mysqld, the affected-rows value\nis the number of rows "found"; that is, matched by the WHERE clause.\n\nFor REPLACE statements, the affected-rows value is 2 if the new row\nreplaced an old row, because in this case, one row was inserted after\nthe duplicate was deleted.\n\nFor INSERT ... ON DUPLICATE KEY UPDATE statements, the affected-rows\nvalue per row is 1 if the row is inserted as a new row, 2 if an\nexisting row is updated, and 0 if an existing row is set to its current\nvalues. If you specify the CLIENT_FOUND_ROWS flag, the affected-rows\nvalue is 1 (not 0) if an existing row is set to its current values.\n\nThe ROW_COUNT() value is similar to the value from the\nmysql_affected_rows() C API function and the row count that the mysql\nclient displays following statement execution.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3  Duplicates: 0  Warnings: 0\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n|           3 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> DELETE FROM t WHERE i IN(1,2);\nQuery OK, 2 rows affected (0.00 sec)\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n|           2 |\n+-------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (363,3,'SIGN','Syntax:\nSIGN(X)\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X\nis negative, zero, or positive.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT SIGN(-32);\n        -> -1\nmysql> SELECT SIGN(0);\n        -> 0\nmysql> SELECT SIGN(234);\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (364,23,'FLOAT','FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA small (single-precision) floating-point number. Permissible values\nare -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to\n3.402823466E+38. These are the theoretical limits, based on the IEEE\nstandard. The actual range might be slightly smaller depending on your\nhardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A single-precision floating-point\nnumber is accurate to approximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all\ncalculations in MySQL are done with double precision. See\nhttp://dev.mysql.com/doc/refman/5.6/en/no-matching-rows.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (365,17,'CHARSET','Syntax:\nCHARSET(str)\n\nReturns the character set of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT CHARSET(\'abc\');\n        -> \'latin1\'\nmysql> SELECT CHARSET(CONVERT(\'abc\' USING utf8));\n        -> \'utf8\'\nmysql> SELECT CHARSET(USER());\n        -> \'utf8\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (366,7,'ASYMMETRIC_VERIFY','Syntax:\nASYMMETRIC_VERIFY(algorithm, digest_str, sig_str, pub_key_str,\ndigest_type)\n\nVerifies whether the signature string matches the digest string, and\nreturns 1 or 0 to indicate whether verification succeeded or failed.\n\ndigest_str is the digest string. It can be generated by calling\nCREATE_DIGEST(). digest_type indicates the digest algorithm used to\ngenerate the digest string.\n\nsig_str is the signature string. It can be generated by calling\nASYMMETRIC_SIGN().\n\npub_key_str is the public key string of the signer. It corresponds to\nthe private key passed to ASYMMETRIC_SIGN() to generate the signature\nstring and must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\'\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','-- Set the encryption algorithm and digest type\nSET @algo = \'RSA\';\nSET @dig_type = \'SHA224\';\n\n-- Create private/public key pair\nSET @priv = CREATE_ASYMMETRIC_PRIV_KEY(@algo, 1024);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(@algo, @priv);\n\n-- Generate digest from string\nSET @dig = CREATE_DIGEST(@dig_type, \'The quick brown fox\');\n\n-- Generate signature for digest and verify signature against digest\nSET @sig = ASYMMETRIC_SIGN(@algo, @dig, @priv, @dig_type);\nSET @verf = ASYMMETRIC_VERIFY(@algo, @dig, @sig, @pub, @dig_type);\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (367,32,'SUBDATE','Syntax:\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE()\nis a synonym for DATE_SUB(). For information on the INTERVAL unit\nargument, see the discussion for DATE_ADD().\n\nmysql> SELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n        -> \'2007-12-02\'\nmysql> SELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n        -> \'2007-12-02\'\n\nThe second form enables the use of an integer value for days. In such\ncases, it is interpreted as the number of days to be subtracted from\nthe date or datetime expression expr.\n\nmysql> SELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n        -> \'2007-12-02 12:00:00\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (368,32,'DAYOFYEAR','Syntax:\nDAYOFYEAR(date)\n\nReturns the day of the year for date, in the range 1 to 366.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFYEAR(\'2007-02-03\');\n        -> 34\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (369,3,'%','Syntax:\nN % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M. For more\ninformation, see the description for the MOD() function in\nhttp://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (370,4,'ASTEXT','AsText(g), AsWKT(g)\n\nConverts a value in internal geometry format to its WKT representation\nand returns the string result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html\n\n','mysql> SET @g = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(GeomFromText(@g));\n+--------------------------+\n| AsText(GeomFromText(@g)) |\n+--------------------------+\n| LINESTRING(1 1,2 2,3 3)  |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (371,24,'DECLARE CONDITION','Syntax:\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value:\n    mysql_error_code\n  | SQLSTATE [VALUE] sqlstate_value\n\nThe DECLARE ... CONDITION statement declares a named error condition,\nassociating a name with a condition that needs specific handling. The\nname can be referred to in a subsequent DECLARE ... HANDLER statement\n(see [HELP DECLARE HANDLER]).\n\nCondition declarations must appear before cursor or handler\ndeclarations.\n\nThe condition_value for DECLARE ... CONDITION can be a MySQL error code\n(a number) or an SQLSTATE value (a 5-character string literal). You\nshould not use MySQL error code 0 or SQLSTATE values that begin with\n\'00\', because those indicate success rather than an error condition.\nFor a list of MySQL error codes and SQLSTATE values, see\nhttp://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-condition.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/declare-condition.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (372,32,'MONTHNAME','Syntax:\nMONTHNAME(date)\n\nReturns the full name of the month for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.6/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MONTHNAME(\'2008-02-03\');\n        -> \'February\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (373,26,'NUMGEOMETRIES','NumGeometries(gc)\n\nReturns the number of geometries in the GeometryCollection value gc.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT NumGeometries(GeomFromText(@gc));\n+----------------------------------+\n| NumGeometries(GeomFromText(@gc)) |\n+----------------------------------+\n|                                2 |\n+----------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (374,32,'TIMESTAMP FUNCTION','Syntax:\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nWith a single argument, this function returns the date or datetime\nexpression expr as a datetime value. With two arguments, it adds the\ntime expression expr2 to the date or datetime expression expr1 and\nreturns the result as a datetime value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMP(\'2003-12-31\');\n        -> \'2003-12-31 00:00:00\'\nmysql> SELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'12:00:00\');\n        -> \'2004-01-01 00:00:00\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (375,40,'DROP DATABASE','Syntax:\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDROP DATABASE drops all tables in the database and deletes the\ndatabase. Be very careful with this statement! To use DROP DATABASE,\nyou need the DROP privilege on the database. DROP SCHEMA is a synonym\nfor DROP DATABASE.\n\n*Important*: When a database is dropped, user privileges on the\ndatabase are not automatically dropped. See [HELP GRANT].\n\nIF EXISTS is used to prevent an error from occurring if the database\ndoes not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-database.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-database.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (376,8,'CHANGE MASTER TO','Syntax:\nCHANGE MASTER TO option [, option] ...\n\noption:\n    MASTER_BIND = \'interface_name\'\n  | MASTER_HOST = \'host_name\'\n  | MASTER_USER = \'user_name\'\n  | MASTER_PASSWORD = \'password\'\n  | MASTER_PORT = port_num\n  | MASTER_CONNECT_RETRY = interval\n  | MASTER_RETRY_COUNT = count\n  | MASTER_DELAY = interval\n  | MASTER_HEARTBEAT_PERIOD = interval\n  | MASTER_LOG_FILE = \'master_log_name\'\n  | MASTER_LOG_POS = master_log_pos\n  | MASTER_AUTO_POSITION = {0|1}\n  | RELAY_LOG_FILE = \'relay_log_name\'\n  | RELAY_LOG_POS = relay_log_pos\n  | MASTER_SSL = {0|1}\n  | MASTER_SSL_CA = \'ca_file_name\'\n  | MASTER_SSL_CAPATH = \'ca_directory_name\'\n  | MASTER_SSL_CERT = \'cert_file_name\'\n  | MASTER_SSL_CRL = \'crl_file_name\'\n  | MASTER_SSL_CRLPATH = \'crl_directory_name\'\n  | MASTER_SSL_KEY = \'key_file_name\'\n  | MASTER_SSL_CIPHER = \'cipher_list\'\n  | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n  | IGNORE_SERVER_IDS = (server_id_list)\n\nserver_id_list:\n    [server_id [, server_id] ... ]\n\nCHANGE MASTER TO changes the parameters that the slave server uses for\nconnecting to the master server, for reading the master binary log, and\nreading the slave relay log. It also updates the contents of the master\ninfo and relay log info repositories (see\nhttp://dev.mysql.com/doc/refman/5.6/en/slave-logs.html). To use CHANGE\nMASTER TO, the slave replication threads must be stopped (use STOP\nSLAVE if necessary). In MySQL 5.6.11 and later, gtid_next must also be\nset to AUTOMATIC (Bug #16062608).\n\nOptions not specified retain their value, except as indicated in the\nfollowing discussion. Thus, in most cases, there is no need to specify\noptions that do not change. For example, if the password to connect to\nyour MySQL master has changed, you just need to issue these statements\nto tell the slave about the new password:\n\nSTOP SLAVE; -- if replication was running\nCHANGE MASTER TO MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE; -- if you want to restart replication\n\nMASTER_HOST, MASTER_USER, MASTER_PASSWORD, and MASTER_PORT provide\ninformation to the slave about how to connect to its master:\n\no MASTER_HOST and MASTER_PORT are the host name (or IP address) of the\n  master host and its TCP/IP port.\n\n  *Note*: Replication cannot use Unix socket files. You must be able to\n  connect to the master MySQL server using TCP/IP.\n\n  If you specify the MASTER_HOST or MASTER_PORT option, the slave\n  assumes that the master server is different from before (even if the\n  option value is the same as its current value.) In this case, the old\n  values for the master binary log file name and position are\n  considered no longer applicable, so if you do not specify\n  MASTER_LOG_FILE and MASTER_LOG_POS in the statement,\n  MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4 are silently appended to it.\n\n  Setting MASTER_HOST=\'\' (that is, setting its value explicitly to an\n  empty string) is not the same as not setting MASTER_HOST at all.\n  Beginning with MySQL 5.5, trying to set MASTER_HOST to an empty\n  string fails with an error. Previously, setting MASTER_HOST to an\n  empty string caused START SLAVE subsequently to fail. (Bug #28796)\n\n  In MySQL 5.6.5 and later, values used for MASTER_HOST and other\n  CHANGE MASTER TO options are checked for linefeed (\\n or 0x0A)\n  characters; the presence of such characters in these values causes\n  the statement to fail with ER_MASTER_INFO. (Bug #11758581, Bug\n  #50801)\n\no MASTER_USER and MASTER_PASSWORD are the user name and password of the\n  account to use for connecting to the master.\n\n  In MySQL 5.6.4 and later, MASTER_USER cannot be made empty; setting\n  MASTER_USER = \'\' or leaving it unset when setting a value for\n  MASTER_PASSWORD causes an error (Bug #13427949).\n\n  The password used for a MySQL Replication slave account in a CHANGE\n  MASTER TO statement is limited to 32 characters in length; if the\n  password is longer, the statement succeeds, but any excess characters\n  are silently truncated. This is an issue specific to MySQL\n  Replication, which is fixed in MySQL 5.7. (Bug #11752299, Bug #43439)\n\n  The text of a running CHANGE MASTER TO statement, including values\n  for MASTER_USER and MASTER_PASSWORD, can be seen in the output of a\n  concurrent SHOW PROCESSLIST statement. (The complete text of a START\n  SLAVE statement is also visible to SHOW PROCESSLIST.)\n\nThe MASTER_SSL_xxx options provide information about using SSL for the\nconnection. They correspond to the --ssl-xxx options described in\nhttp://dev.mysql.com/doc/refman/5.6/en/ssl-options.html, and\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-solutions-ssl.html.\nThese options can be changed even on slaves that are compiled without\nSSL support. They are saved to the master info repository, but are\nignored if the slave does not have SSL support enabled. MASTER_SSL_CRL\nand MASTER_SSL_CRLPATH were added in MySQL 5.6.3.\n\nMASTER_CONNECT_RETRY specifies how many seconds to wait between connect\nretries. The default is 60.\n\nMASTER_RETRY_COUNT, added in MySQL 5.6.1, limits the number of\nreconnection attempts and updates the value of the Master_Retry_Count\ncolumn in the output of SHOW SLAVE STATUS (also added in MySQL 5.6.1).\nThe default value is 24 * 3600 = 86400. MASTER_RETRY_COUNT is intended\nto replace the older --master-retry-count server option, and is now the\npreferred method for setting this limit. You are encouraged not to rely\non --master-retry-count in new applications and, when upgrading to\nMySQL 5.6.1 or later from earlier versions of MySQL, to update any\nexisting applications that rely on it, so that they use CHANGE MASTER\nTO ... MASTER_RETRY_COUNT instead.\n\nMASTER_DELAY specifies how many seconds behind the master the slave\nmust lag. An event received from the master is not executed until at\nleast interval seconds later than its execution on the master. The\ndefault is 0. An error occurs if interval is not a nonnegative integer\nin the range from 0 to 231-1. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-delayed.html. This\noption was added in MySQL 5.6.0.\n\nMASTER_BIND is for use on replication slaves having multiple network\ninterfaces, and determines which of the slave\'s network interfaces is\nchosen for connecting to the master.\n\nThe address configured with this option, if any, can be seen in the\nMaster_Bind column of the output from SHOW SLAVE STATUS. If you are\nusing slave status log tables (server started with\n--master-info-repository=TABLE), the value can also be seen as the\nMaster_bind column of the mysql.slave_master_info table.\n\nThe ability to bind a replication slave to a specific network interface\nwas added in MySQL 5.6.2. This is also supported by MySQL Cluster NDB\n7.3.1 and later.\n\nMASTER_HEARTBEAT_PERIOD sets the interval in seconds between\nreplication heartbeats. Whenever the master\'s binary log is updated\nwith an event, the waiting period for the next heartbeat is reset.\ninterval is a decimal value having the range 0 to 4294967 seconds and a\nresolution in milliseconds; the smallest nonzero value is 0.001.\nHeartbeats are sent by the master only if there are no unsent events in\nthe binary log file for a period longer than interval.\n\nIf you are logging master connection information to tables,\nMASTER_HEARTBEAT_PERIOD can be seen as the value of the Heartbeat\ncolumn of the mysql.slave_master_info table.\n\nSetting interval to 0 disables heartbeats altogether. The default value\nfor interval is equal to the value of slave_net_timeout divided by 2.\n\nSetting @@global.slave_net_timeout to a value less than that of the\ncurrent heartbeat interval results in a warning being issued. The\neffect of issuing RESET SLAVE on the heartbeat interval is to reset it\nto the default value.\n\nMASTER_LOG_FILE and MASTER_LOG_POS are the coordinates at which the\nslave I/O thread should begin reading from the master the next time the\nthread starts. RELAY_LOG_FILE and RELAY_LOG_POS are the coordinates at\nwhich the slave SQL thread should begin reading from the relay log the\nnext time the thread starts. If you specify either of MASTER_LOG_FILE\nor MASTER_LOG_POS, you cannot specify RELAY_LOG_FILE or RELAY_LOG_POS.\nIn MySQL 5.6.5 and later, if you specify either of MASTER_LOG_FILE or\nMASTER_LOG_POS, you also cannot specify MASTER_AUTO_POSITION = 1\n(described later in this section). If neither of MASTER_LOG_FILE or\nMASTER_LOG_POS is specified, the slave uses the last coordinates of the\nslave SQL thread before CHANGE MASTER TO was issued. This ensures that\nthere is no discontinuity in replication, even if the slave SQL thread\nwas late compared to the slave I/O thread, when you merely want to\nchange, say, the password to use.\n\nMASTER_AUTO_POSITION was added in MySQL 5.6.5. If MASTER_AUTO_POSITION\n= 1 is used with CHANGE MASTER TO, the slave attempts to connect to the\nmaster using the GTID-based replication protocol.\n\nWhen using GTIDs, the slave tells the master which transactions it has\nalready received, executed, or both. To compute this set, it reads the\nglobal value of gtid_executed and the value of the Retrieved_gtid_set\ncolumn from SHOW SLAVE STATUS. Since the GTID of the last transmitted\ntransaction is included in Retrieved_gtid_set even if the transaction\nwas only partially transmitted, the last received GTID is subtracted\nfrom this set. Thus, the slave computes the following set:\n\nUNION(@@global.gtid_executed, Retrieved_gtid_set - last_received_GTID)\n\nThis set is sent to the master as part of the initial handshake, and\nthe master sends back all transactions that it has executed which are\nnot part of the set. If any of these transactions have been already\npurged from the master\'s binary log, the master sends the error\nER_MASTER_HAS_PURGED_REQUIRED_GTIDS to the slave, and replication does\nnot start.\n\nWhen GTID-based replication is employed, the coordinates represented by\nMASTER_LOG_FILE and MASTER_LOG_POS are not used, and global transaction\nidentifiers are used instead. Thus the use of either or both of these\noptions together with MASTER_AUTO_POSITION causes an error.\n\nBeginning with MySQL 5.6.10, you can see whether replication is running\nwith autopositioning enabled by checking the output of SHOW SLAVE\nSTATUS. (Bug #15992220)\n\ngtid_mode must also be enabled before issuing CHANGE MASTER TO ...\nMASTER_AUTO_POSITION = 1. Otherwise, the statement fails with an error.\n\nTo revert to the older file-based replication protocol after using\nGTIDs, you can issue a new CHANGE MASTER TO statement that specifies\nMASTER_AUTO_POSITION = 0, as well as at least one of MASTER_LOG_FILE or\nMASTER_LOG_POSITION.\n\nCHANGE MASTER TO deletes all relay log files and starts a new one,\nunless you specify RELAY_LOG_FILE or RELAY_LOG_POS. In that case, relay\nlog files are kept; the relay_log_purge global variable is set silently\nto 0.\n\nPrior to MySQL 5.6.2, RELAY_LOG_FILE required an absolute path.\nBeginning with MySQL 5.6.2, the path can be relative, in which case it\nis assumed to be relative to the slave\'s data directory. (Bug #12190)\n\nIGNORE_SERVER_IDS takes a comma-separated list of 0 or more server IDs.\nEvents originating from the corresponding servers are ignored, with the\nexception of log rotation and deletion events, which are still recorded\nin the relay log.\n\nIn circular replication, the originating server normally acts as the\nterminator of its own events, so that they are not applied more than\nonce. Thus, this option is useful in circular replication when one of\nthe servers in the circle is removed. Suppose that you have a circular\nreplication setup with 4 servers, having server IDs 1, 2, 3, and 4, and\nserver 3 fails. When bridging the gap by starting replication from\nserver 2 to server 4, you can include IGNORE_SERVER_IDS = (3) in the\nCHANGE MASTER TO statement that you issue on server 4 to tell it to use\nserver 2 as its master instead of server 3. Doing so causes it to\nignore and not to propagate any statements that originated with the\nserver that is no longer in use.\n\nWhen a CHANGE MASTER TO statement is issued without any\nIGNORE_SERVER_IDS option, any existing list is preserved. To clear the\nlist of ignored servers, it is necessary to use the option with an\nempty list:\n\nCHANGE MASTER TO IGNORE_SERVER_IDS = ();\n\nRESET SLAVE ALL has no effect on the server ID list. This issue is\nfixed in MySQL 5.7. (Bug #18816897)\n\nIf IGNORE_SERVER_IDS contains the server\'s own ID and the server was\nstarted with the --replicate-same-server-id option enabled, an error\nresults.\n\nIn MySQL 5.6, the master info repository and the output of SHOW SLAVE\nSTATUS provide the list of servers that are currently ignored. For more\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.6/en/slave-logs-status.html, and\n[HELP SHOW SLAVE STATUS].\n\nIn MySQL 5.6, invoking CHANGE MASTER TO causes the previous values for\nMASTER_HOST, MASTER_PORT, MASTER_LOG_FILE, and MASTER_LOG_POS to be\nwritten to the error log, along with other information about the\nslave\'s state prior to execution.\n\nIn MySQL 5.6.7 and later, CHANGE MASTER TO causes an implicit commit of\nan ongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nCHANGE MASTER TO is useful for setting up a slave when you have the\nsnapshot of the master and have recorded the master binary log\ncoordinates corresponding to the time of the snapshot. After loading\nthe snapshot into the slave to synchronize it with the master, you can\nrun CHANGE MASTER TO MASTER_LOG_FILE=\'log_name\', MASTER_LOG_POS=log_pos\non the slave to specify the coordinates at which the slave should begin\nreading the master binary log.\n\nThe following example changes the master server the slave uses and\nestablishes the master binary log coordinates from which the slave\nbegins reading. This is used when you want to set up the slave to\nreplicate the master:\n\nCHANGE MASTER TO\n  MASTER_HOST=\'master2.mycompany.com\',\n  MASTER_USER=\'replication\',\n  MASTER_PASSWORD=\'bigs3cret\',\n  MASTER_PORT=3306,\n  MASTER_LOG_FILE=\'master2-bin.001\',\n  MASTER_LOG_POS=4,\n  MASTER_CONNECT_RETRY=10;\n\nThe next example shows an operation that is less frequently employed.\nIt is used when the slave has relay log files that you want it to\nexecute again for some reason. To do this, the master need not be\nreachable. You need only use CHANGE MASTER TO and start the SQL thread\n(START SLAVE SQL_THREAD):\n\nCHANGE MASTER TO\n  RELAY_LOG_FILE=\'slave-relay-bin.006\',\n  RELAY_LOG_POS=4025;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/change-master-to.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/change-master-to.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (377,27,'SHOW GRANTS','Syntax:\nSHOW GRANTS [FOR user]\n\nThis statement lists the GRANT statement or statements that must be\nissued to duplicate the privileges that are granted to a MySQL user\naccount. The account is named using the same format as for the GRANT\nstatement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used.\nFor additional information about specifying account names, see [HELP\nGRANT].\n\nmysql> SHOW GRANTS FOR \'root\'@\'localhost\';\n+---------------------------------------------------------------------+\n| Grants for root@localhost                                           |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION |\n+---------------------------------------------------------------------+\n\nTo list the privileges granted to the account that you are using to\nconnect to the server, you can use any of the following statements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is\nused in DEFINER context, such as within a stored procedure that is\ndefined with SQL SECURITY DEFINER), the grants displayed are those of\nthe definer and not the invoker.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-grants.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-grants.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (378,3,'CRC32','Syntax:\nCRC32(expr)\n\nComputes a cyclic redundancy check value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is\nexpected to be a string and (if possible) is treated as one if it is\nnot.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT CRC32(\'MySQL\');\n        -> 3259397556\nmysql> SELECT CRC32(\'mysql\');\n        -> 2501908538\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (379,13,'STARTPOINT','StartPoint(ls)\n\nReturns the Point that is the start point of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(StartPoint(GeomFromText(@ls)));\n+---------------------------------------+\n| AsText(StartPoint(GeomFromText(@ls))) |\n+---------------------------------------+\n| POINT(1 1)                            |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (380,4,'MPOLYFROMTEXT','MPolyFromText(wkt[,srid]), MultiPolygonFromText(wkt[,srid])\n\nConstructs a MultiPolygon value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (381,24,'DECLARE VARIABLE','Syntax:\nDECLARE var_name [, var_name] ... type [DEFAULT value]\n\nThis statement declares local variables within stored programs. To\nprovide a default value for a variable, include a DEFAULT clause. The\nvalue can be specified as an expression; it need not be a constant. If\nthe DEFAULT clause is missing, the initial value is NULL.\n\nLocal variables are treated like stored routine parameters with respect\nto data type and overflow checking. See [HELP CREATE PROCEDURE].\n\nVariable declarations must appear before cursor or handler\ndeclarations.\n\nLocal variable names are not case sensitive. Permissible characters and\nquoting rules are the same as for other identifiers, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\nThe scope of a local variable is the BEGIN ... END block within which\nit is declared. The variable can be referred to in blocks nested within\nthe declaring block, except those blocks that declare a variable with\nthe same name.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-local-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/declare-local-variable.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (382,20,'NOT BETWEEN','Syntax:\nexpr NOT BETWEEN min AND max\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (383,32,'YEARWEEK','Syntax:\nYEARWEEK(date), YEARWEEK(date,mode)\n\nReturns year and week for a date. The mode argument works exactly like\nthe mode argument to WEEK(). The year in the result may be different\nfrom the year in the date argument for the first and the last week of\nthe year.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT YEARWEEK(\'1987-01-01\');\n        -> 198653\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (384,16,'BIT_OR','Syntax:\nBIT_OR(expr)\n\nReturns the bitwise OR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (385,3,'LOG10','Syntax:\nLOG10(X)\n\nReturns the base-10 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LOG10(2);\n        -> 0.30102999566398\nmysql> SELECT LOG10(100);\n        -> 2\nmysql> SELECT LOG10(-100);\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (386,23,'DECIMAL','DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nA packed "exact" fixed-point number. M is the total number of digits\n(the precision) and D is the number of digits after the decimal point\n(the scale). The decimal point and (for negative numbers) the "-" sign\nare not counted in M. If D is 0, values have no decimal point or\nfractional part. The maximum number of digits (M) for DECIMAL is 65.\nThe maximum number of supported decimals (D) is 30. If D is omitted,\nthe default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with\na precision of 65 digits.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (387,40,'CREATE FUNCTION','The CREATE FUNCTION statement is used to create stored functions and\nuser-defined functions (UDFs):\n\no For information about creating stored functions, see [HELP CREATE\n  PROCEDURE].\n\no For information about creating user-defined functions, see [HELP\n  CREATE FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-function.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (388,20,'<','Syntax:\n<\n\nLess than:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 < 2;\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (389,12,'MD5','Syntax:\nMD5(str)\n\nCalculates an MD5 128-bit checksum for the string. The value is\nreturned as a string of 32 hex digits, or NULL if the argument was\nNULL. The return value can, for example, be used as a hash key. See the\nnotes at the beginning of this section about storing hash values\nefficiently.\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT MD5(\'testing\');\n        -> \'ae2b1fca515949e5d54fb22b8ed95575\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (390,32,'DAYOFMONTH','Syntax:\nDAYOFMONTH(date)\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for\ndates such as \'0000-00-00\' or \'2008-00-00\' that have a zero day part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFMONTH(\'2007-02-03\');\n        -> 3\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (391,32,'UNIX_TIMESTAMP','Syntax:\nUNIX_TIMESTAMP(), UNIX_TIMESTAMP(date)\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC) as an unsigned integer. If UNIX_TIMESTAMP()\nis called with a date argument, it returns the value of the argument as\nseconds since \'1970-01-01 00:00:00\' UTC. date may be a DATE string, a\nDATETIME string, a TIMESTAMP, or a number in the format YYMMDD or\nYYYYMMDD. The server interprets date as a value in the current time\nzone and converts it to an internal value in UTC. Clients can set their\ntime zone as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/time-zone-support.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UNIX_TIMESTAMP();\n        -> 1196440210\nmysql> SELECT UNIX_TIMESTAMP(\'2007-11-30 10:30:19\');\n        -> 1196440219\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (392,26,'ST_INTERSECTION','ST_Intersection(g1, g2)\n\nReturns a geometry that represents the point set intersection of the\ngeometry values g1 and g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = GeomFromText(\'LineString(1 1, 3 3)\');\nmysql> SET @g2 = GeomFromText(\'LineString(1 3, 3 1)\');\nmysql> SELECT AsText(ST_Intersection(@g1, @g2));\n+-----------------------------------+\n| AsText(ST_Intersection(@g1, @g2)) |\n+-----------------------------------+\n| POINT(2 2)                        |\n+-----------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (393,10,'RENAME USER','Syntax:\nRENAME USER old_user TO new_user\n    [, old_user TO new_user] ...\n\nThe RENAME USER statement renames existing MySQL accounts. An error\noccurs for old accounts that do not exist or new accounts that already\nexist. To use this statement, you must have the global CREATE USER\nprivilege or the UPDATE privilege for the mysql database.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nRENAME USER \'jeffrey\'@\'localhost\' TO \'jeff\'@\'127.0.0.1\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nRENAME USER causes the privileges held by the old user to be those held\nby the new user. However, RENAME USER does not automatically drop or\ninvalidate databases or objects within them that the old user created.\nThis includes stored programs or views for which the DEFINER attribute\nnames the old user. Attempts to access such objects may produce an\nerror if they execute in definer security context. (For information\nabout security context, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-security.html.)\n\nThe privilege changes take effect as indicated in\nhttp://dev.mysql.com/doc/refman/5.6/en/privilege-changes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/rename-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/rename-user.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (394,13,'NUMPOINTS','NumPoints(ls)\n\nReturns the number of Point objects in the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT NumPoints(GeomFromText(@ls));\n+------------------------------+\n| NumPoints(GeomFromText(@ls)) |\n+------------------------------+\n|                            3 |\n+------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (395,40,'ALTER LOGFILE GROUP','Syntax:\nALTER LOGFILE GROUP logfile_group\n    ADD UNDOFILE \'file_name\'\n    [INITIAL_SIZE [=] size]\n    [WAIT]\n    ENGINE [=] engine_name\n\nThis statement adds an UNDO file named \'file_name\' to an existing log\nfile group logfile_group. An ALTER LOGFILE GROUP statement has one and\nonly one ADD UNDOFILE clause. No DROP UNDOFILE clause is currently\nsupported.\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and an undo log file with the same name, or an undo\nlog file and a data file with the same name.\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size\nin bytes; if not specified, the initial size defaults to 134217728 (128\nMB). Prior to MySQL Cluster NDB 7.3.2, this value was required to be\nspecified using digits; in MySQL Cluster NDB 7.3.2 and later, you may\noptionally follow size with a one-letter abbreviation for an order of\nmagnitude, similar to those used in my.cnf. Generally, this is one of\nthe letters M (megabytes) or G (gigabytes). (Bug #13116514, Bug\n#16104705, Bug #62858)\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nThe minimum allowed value for INITIAL_SIZE is 1048576 (1 MB). (Bug\n#29574)\n\n*Note*: WAIT is parsed but otherwise ignored. This keyword currently\nhas no effect, and is intended for future expansion.\n\nThe ENGINE parameter (required) determines the storage engine which is\nused by this log file group, with engine_name being the name of the\nstorage engine. Currently, the only accepted values for engine_name are\n"NDBCLUSTER" and "NDB". The two values are equivalent.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-logfile-group.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (396,32,'LOCALTIMESTAMP','Syntax:\nLOCALTIMESTAMP, LOCALTIMESTAMP([fsp])\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (397,32,'ADDDATE','Syntax:\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE()\nis a synonym for DATE_ADD(). The related function SUBDATE() is a\nsynonym for DATE_SUB(). For information on the INTERVAL unit argument,\nsee the discussion for DATE_ADD().\n\nmysql> SELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n        -> \'2008-02-02\'\nmysql> SELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n        -> \'2008-02-02\'\n\nWhen invoked with the days form of the second argument, MySQL treats it\nas an integer number of days to be added to expr.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT ADDDATE(\'2008-01-02\', 31);\n        -> \'2008-02-02\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (398,7,'CREATE_DIGEST','Syntax:\nCREATE_DIGEST(digest_type, str)\n\nCreates a digest from the given string using the given digest type, and\nreturns the digest as a binary string. If digest generation fails, the\nresult is NULL.\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','SET @dig = CREATE_DIGEST(\'SHA512\', The quick brown fox\');\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (399,40,'ALTER FUNCTION','Syntax:\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n    COMMENT \'string\'\n  | LANGUAGE SQL\n  | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n  | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nfunction. More than one change may be specified in an ALTER FUNCTION\nstatement. However, you cannot change the parameters or body of a\nstored function using this statement; to make such changes, you must\ndrop and re-create the function using DROP FUNCTION and CREATE\nFUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That\nprivilege is granted automatically to the function creator.) If binary\nlogging is enabled, the ALTER FUNCTION statement might also require the\nSUPER privilege, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-logging.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-function.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (400,14,'IS_FREE_LOCK','Syntax:\nIS_FREE_LOCK(str)\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock\nis in use, and NULL if an error occurs (such as an incorrect argument).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (401,8,'DEALLOCATE PREPARE','Syntax:\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nTo deallocate a prepared statement produced with PREPARE, use a\nDEALLOCATE PREPARE statement that refers to the prepared statement\nname. Attempting to execute a prepared statement after deallocating it\nresults in an error. If too many prepared statements are created and\nnot deallocated by either the DEALLOCATE PREPARE statement or the end\nof the session, you might encounter the upper limit enforced by the\nmax_prepared_stmt_count system variable.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/deallocate-prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/deallocate-prepare.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (402,31,'TOUCHES','Touches(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two\ngeometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either\nthe boundary or the interior of the other.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (403,23,'AUTO_INCREMENT','The AUTO_INCREMENT attribute can be used to generate a unique identity\nfor new rows:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/example-auto-increment.html\n\n','CREATE TABLE animals (\n     id MEDIUMINT NOT NULL AUTO_INCREMENT,\n     name CHAR(30) NOT NULL,\n     PRIMARY KEY (id)\n);\n\nINSERT INTO animals (name) VALUES\n    (\'dog\'),(\'cat\'),(\'penguin\'),\n    (\'lax\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n','http://dev.mysql.com/doc/refman/5.6/en/example-auto-increment.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (404,12,'UNCOMPRESS','Syntax:\nUNCOMPRESS(string_to_uncompress)\n\nUncompresses a string compressed by the COMPRESS() function. If the\nargument is not a compressed value, the result is NULL. This function\nrequires MySQL to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESS(COMPRESS(\'any string\'));\n        -> \'any string\'\nmysql> SELECT UNCOMPRESS(\'any string\');\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (405,4,'GEOMCOLLFROMTEXT','GeomCollFromText(wkt[,srid]), GeometryCollectionFromText(wkt[,srid])\n\nConstructs a GeometryCollection value using its WKT representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (406,17,'LAST_INSERT_ID','Syntax:\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nWith no argument, LAST_INSERT_ID() returns a 64-bit value representing\nthe first automatically generated value successfully inserted for an\nAUTO_INCREMENT column as a result of the most recently executed INSERT\nstatement. The value has a type of BIGINT UNSIGNED as of MySQL 5.6.9,\nBIGINT (signed) before that. The value of LAST_INSERT_ID() remains\nunchanged if no rows are successfully inserted.\n\nWith an argument, LAST_INSERT_ID() returns an unsigned integer as of\nMySQL 5.6.9, a signed integer before that.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT\nvalue, you can get the value like this:\n\nmysql> SELECT LAST_INSERT_ID();\n        -> 195\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value\nwith one statement, and then refer to LAST_INSERT_ID() in a\nmultiple-row INSERT statement that inserts rows into a table with its\nown AUTO_INCREMENT column. The value of LAST_INSERT_ID() will remain\nstable in the second statement; its value for the second and later rows\nis not affected by the earlier row insertions. (However, if you mix\nreferences to LAST_INSERT_ID() and LAST_INSERT_ID(expr), the effect is\nundefined.)\n\nIf the previous statement returned an error, the value of\nLAST_INSERT_ID() is undefined. For transactional tables, if the\nstatement is rolled back due to an error, the value of LAST_INSERT_ID()\nis left undefined. For manual ROLLBACK, the value of LAST_INSERT_ID()\nis not restored to that before the transaction; it remains as it was at\nthe point of the ROLLBACK.\n\nPrior to MySQL 5.6.15, this function was not replicated correctly if\nreplication filtering rules were in use. (Bug #17234370, Bug #69861)\n\nWithin the body of a stored routine (procedure or function) or a\ntrigger, the value of LAST_INSERT_ID() changes the same way as for\nstatements executed outside the body of these kinds of objects. The\neffect of a stored routine or trigger upon the value of\nLAST_INSERT_ID() that is seen by following statements depends on the\nkind of routine:\n\no If a stored procedure executes statements that change the value of\n  LAST_INSERT_ID(), the changed value is seen by statements that follow\n  the procedure call.\n\no For stored functions and triggers that change the value, the value is\n  restored when the function or trigger ends, so following statements\n  will not see a changed value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (407,3,'FLOOR','Syntax:\nFLOOR(X)\n\nReturns the largest integer value not greater than X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT FLOOR(1.23);\n        -> 1\nmysql> SELECT FLOOR(-1.23);\n        -> -2\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (408,3,'COS','Syntax:\nCOS(X)\n\nReturns the cosine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT COS(PI());\n        -> -1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (409,16,'STD','Syntax:\nSTD(expr)\n\nReturns the population standard deviation of expr. This is an extension\nto standard SQL. The standard SQL function STDDEV_POP() can be used\ninstead.\n\nThis function returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (410,32,'DATE FUNCTION','Syntax:\nDATE(expr)\n\nExtracts the date part of the date or datetime expression expr.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATE(\'2003-12-31 01:02:03\');\n        -> \'2003-12-31\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (411,3,'TAN','Syntax:\nTAN(X)\n\nReturns the tangent of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT TAN(PI());\n        -> -1.2246063538224e-16\nmysql> SELECT TAN(PI()+1);\n        -> 1.5574077246549\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (412,32,'WEEKOFYEAR','Syntax:\nWEEKOFYEAR(date)\n\nReturns the calendar week of the date as a number in the range from 1\nto 53. WEEKOFYEAR() is a compatibility function that is equivalent to\nWEEK(date,3).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKOFYEAR(\'2008-02-20\');\n        -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (413,32,'SUBTIME','Syntax:\nSUBTIME(expr1,expr2)\n\nSUBTIME() returns expr1 - expr2 expressed as a value in the same format\nas expr1. expr1 is a time or datetime expression, and expr2 is a time\nexpression.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n        -> \'2007-12-30 22:58:58.999997\'\nmysql> SELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n        -> \'-00:59:59.999999\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (414,3,'LOG2','Syntax:\nLOG2(X)\n\nReturns the base-2 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LOG2(65536);\n        -> 16\nmysql> SELECT LOG2(-100);\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (415,12,'UNCOMPRESSED_LENGTH','Syntax:\nUNCOMPRESSED_LENGTH(compressed_string)\n\nReturns the length that the compressed string had before being\ncompressed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n        -> 30\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (416,3,'POW','Syntax:\nPOW(X,Y)\n\nReturns the value of X raised to the power of Y.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT POW(2,2);\n        -> 4\nmysql> SELECT POW(2,-2);\n        -> 0.25\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (417,40,'DROP TABLE','Syntax:\nDROP [TEMPORARY] TABLE [IF EXISTS]\n    tbl_name [, tbl_name] ...\n    [RESTRICT | CASCADE]\n\nDROP TABLE removes one or more tables. You must have the DROP privilege\nfor each table. All table data and the table definition are removed, so\nbe careful with this statement! If any of the tables named in the\nargument list do not exist, MySQL returns an error indicating by name\nwhich nonexisting tables it was unable to drop, but it also drops all\nof the tables in the list that do exist.\n\n*Important*: When a table is dropped, user privileges on the table are\nnot automatically dropped. See [HELP GRANT].\n\nNote that for a partitioned table, DROP TABLE permanently removes the\ntable definition, all of its partitions, and all of the data which was\nstored in those partitions. It also removes the partitioning definition\n(.par) file associated with the dropped table.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not\nexist. A NOTE is generated for each nonexistent table when using IF\nEXISTS. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE are permitted to make porting easier. In MySQL\n5.6, they do nothing.\n\n*Note*: DROP TABLE automatically commits the current active\ntransaction, unless you use the TEMPORARY keyword.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (418,32,'NOW','Syntax:\nNOW([fsp])\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context. The value is expressed in the current time\nzone.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT NOW();\n        -> \'2007-12-15 23:50:26\'\nmysql> SELECT NOW() + 0;\n        -> 20071215235026.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (419,27,'SHOW ENGINES','Syntax:\nSHOW [STORAGE] ENGINES\n\nSHOW ENGINES displays status information about the server\'s storage\nengines. This is particularly useful for checking whether a storage\nengine is supported, or to see what the default engine is. This\ninformation can also be obtained from the INFORMATION_SCHEMA ENGINES\ntable. See http://dev.mysql.com/doc/refman/5.6/en/engines-table.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-engines.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-engines.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (420,14,'IS_IPV6','Syntax:\nIS_IPV6(expr)\n\nReturns 1 if the argument is a valid IPv6 address specified as a\nstring, 0 otherwise. This function does not consider IPv4 addresses to\nbe valid IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV6(\'10.0.5.9\'), IS_IPV6(\'::1\');\n        -> 0, 1\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (421,23,'LONGBLOB','LONGBLOB\n\nA BLOB column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\nbytes. The effective maximum length of LONGBLOB columns depends on the\nconfigured maximum packet size in the client/server protocol and\navailable memory. Each LONGBLOB value is stored using a 4-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (422,31,'ST_OVERLAPS','ST_Overlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (423,23,'YEAR DATA TYPE','YEAR[(2|4)]\n\nA year in two-digit or four-digit format. The default is four-digit\nformat. YEAR(2) or YEAR(4) differ in display format, but have the same\nrange of values. In four-digit format, values display as 1901 to 2155,\nand 0000. In two-digit format, values display as 70 to 69, representing\nyears from 1970 to 2069. MySQL displays YEAR values in YYYY or YY\nformat, but permits assignment of values to YEAR columns using either\nstrings or numbers.\n\n*Note*: The YEAR(2) data type has certain issues that you should\nconsider before choosing to use it. As of MySQL 5.6.6, YEAR(2) is\ndeprecated. YEAR(2) columns in existing tables are treated as before,\nbut YEAR(2) in new or altered tables are converted to YEAR(4). For more\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.6/en/migrating-to-year4.html.\n\nFor additional information about YEAR display format and interpretation\nof input values, see http://dev.mysql.com/doc/refman/5.6/en/year.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (424,16,'SUM','Syntax:\nSUM([DISTINCT] expr)\n\nReturns the sum of expr. If the return set has no rows, SUM() returns\nNULL. The DISTINCT keyword can be used to sum only the distinct values\nof expr.\n\nSUM() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (425,38,'REPEAT FUNCTION','Syntax:\nREPEAT(str,count)\n\nReturns a string consisting of the string str repeated count times. If\ncount is less than 1, returns an empty string. Returns NULL if str or\ncount are NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT REPEAT(\'MySQL\', 3);\n        -> \'MySQLMySQLMySQL\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (426,38,'SOUNDEX','Syntax:\nSOUNDEX(str)\n\nReturns a soundex string from str. Two strings that sound almost the\nsame should have identical soundex strings. A standard soundex string\nis four characters long, but the SOUNDEX() function returns an\narbitrarily long string. You can use SUBSTRING() on the result to get a\nstandard soundex string. All nonalphabetic characters in str are\nignored. All international alphabetic characters outside the A-Z range\nare treated as vowels.\n\n*Important*: When using SOUNDEX(), you should be aware of the following\nlimitations:\n\no This function, as currently implemented, is intended to work well\n  with strings that are in the English language only. Strings in other\n  languages may not produce reliable results.\n\no This function is not guaranteed to provide consistent results with\n  strings that use multibyte character sets, including utf-8.\n\n  We hope to remove these limitations in a future release. See Bug\n  #22638 for more information.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SOUNDEX(\'Hello\');\n        -> \'H400\'\nmysql> SELECT SOUNDEX(\'Quadratically\');\n        -> \'Q36324\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (427,7,'MBRTOUCHES','MBRTouches(g1,g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 touch. Two geometries spatially touch if\nthe interiors of the geometries do not intersect, but the boundary of\none of the geometries intersects either the boundary or the interior of\nthe other.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (428,40,'DROP EVENT','Syntax:\nDROP EVENT [IF EXISTS] event_name\n\nThis statement drops the event named event_name. The event immediately\nceases being active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown\nevent \'event_name\' results. You can override this and cause the\nstatement to generate a warning for nonexistent events instead using IF\nEXISTS.\n\nThis statement requires the EVENT privilege for the schema to which the\nevent to be dropped belongs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-event.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-event.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (429,23,'VARBINARY','VARBINARY(M)\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary\nbyte strings rather than nonbinary character strings. M represents the\nmaximum column length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (430,27,'LOAD INDEX','Syntax:\nLOAD INDEX INTO CACHE\n  tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n  tbl_name\n    [PARTITION (partition_list | ALL)]\n    [[INDEX|KEY] (index_name[, index_name] ...)]\n    [IGNORE LEAVES]\n\npartition_list:\n    partition_name[, partition_name][, ...]\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key\ncache to which it has been assigned by an explicit CACHE INDEX\nstatement, or into the default key cache otherwise.\n\nLOAD INDEX INTO CACHE is used only for MyISAM tables. In MySQL 5.6, it\nis also supported for partitioned MyISAM tables; in addition, indexes\non partitioned tables can be preloaded for one, several, or all\npartitions.\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of\nthe index to be preloaded.\n\nIGNORE LEAVES is also supported for partitioned MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/load-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/load-index.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (431,28,'UNION','Syntax:\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n\nUNION is used to combine the result from multiple SELECT statements\ninto a single result set.\n\nThe column names from the first SELECT statement are used as the column\nnames for the results returned. Selected columns listed in\ncorresponding positions of each SELECT statement should have the same\ndata type. (For example, the first column selected by the first\nstatement should have the same type as the first column selected by the\nother statements.)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/union.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/union.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (432,32,'TO_DAYS','Syntax:\nTO_DAYS(date)\n\nGiven a date date, returns a day number (the number of days since year\n0).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TO_DAYS(950501);\n        -> 728779\nmysql> SELECT TO_DAYS(\'2007-10-07\');\n        -> 733321\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (433,27,'SHOW INDEX','Syntax:\nSHOW {INDEX | INDEXES | KEYS}\n    {FROM | IN} tbl_name\n    [{FROM | IN} db_name]\n    [WHERE expr]\n\nSHOW INDEX returns table index information. The format resembles that\nof the SQLStatistics call in ODBC. This statement requires some\nprivilege for any column in the table.\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. These two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nThe WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nYou can also list a table\'s indexes with the mysqlshow -k db_name\ntbl_name command.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-index.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (434,27,'SHOW CREATE DATABASE','Syntax:\nSHOW CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n\nShows the CREATE DATABASE statement that creates the named database. If\nthe SHOW statement includes an IF NOT EXISTS clause, the output too\nincludes such a clause. SHOW CREATE SCHEMA is a synonym for SHOW CREATE\nDATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-database.html\n\n','mysql> SHOW CREATE DATABASE test\\G\n*************************** 1. row ***************************\n       Database: test\nCreate Database: CREATE DATABASE `test`\n                 /*!40100 DEFAULT CHARACTER SET latin1 */\n\nmysql> SHOW CREATE SCHEMA test\\G\n*************************** 1. row ***************************\n       Database: test\nCreate Database: CREATE DATABASE `test`\n                 /*!40100 DEFAULT CHARACTER SET latin1 */\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-database.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (435,15,'!','Syntax:\nNOT, !\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnonzero, and NOT NULL returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT NOT 10;\n        -> 0\nmysql> SELECT NOT 0;\n        -> 1\nmysql> SELECT NOT NULL;\n        -> NULL\nmysql> SELECT ! (1+1);\n        -> 0\nmysql> SELECT ! 1+1;\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (436,23,'DOUBLE','DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA normal-size (double-precision) floating-point number. Permissible\nvalues are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and\n2.2250738585072014E-308 to 1.7976931348623157E+308. These are the\ntheoretical limits, based on the IEEE standard. The actual range might\nbe slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A double-precision floating-point\nnumber is accurate to approximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (437,24,'DECLARE HANDLER','Syntax:\nDECLARE handler_action HANDLER\n    FOR condition_value [, condition_value] ...\n    statement\n\nhandler_action:\n    CONTINUE\n  | EXIT\n  | UNDO\n\ncondition_value:\n    mysql_error_code\n  | SQLSTATE [VALUE] sqlstate_value\n  | condition_name\n  | SQLWARNING\n  | NOT FOUND\n  | SQLEXCEPTION\n\nThe DECLARE ... HANDLER statement specifies a handler that deals with\none or more conditions. If one of these conditions occurs, the\nspecified statement executes. statement can be a simple statement such\nas SET var_name = value, or a compound statement written using BEGIN\nand END (see [HELP BEGIN END]).\n\nHandler declarations must appear after variable or condition\ndeclarations.\n\nThe handler_action value indicates what action the handler takes after\nexecution of the handler statement:\n\no CONTINUE: Execution of the current program continues.\n\no EXIT: Execution terminates for the BEGIN ... END compound statement\n  in which the handler is declared. This is true even if the condition\n  occurs in an inner block.\n\no UNDO: Not supported.\n\nThe condition_value for DECLARE ... HANDLER indicates the specific\ncondition or class of conditions that activates the handler:\n\no A MySQL error code (a number) or an SQLSTATE value (a 5-character\n  string literal). You should not use MySQL error code 0 or SQLSTATE\n  values that begin with \'00\', because those indicate success rather\n  than an error condition. For a list of MySQL error codes and SQLSTATE\n  values, see\n  http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html.\n\no A condition name previously specified with DECLARE ... CONDITION. A\n  condition name can be associated with a MySQL error code or SQLSTATE\n  value. See [HELP DECLARE CONDITION].\n\no SQLWARNING is shorthand for the class of SQLSTATE values that begin\n  with \'01\'.\n\no NOT FOUND is shorthand for the class of SQLSTATE values that begin\n  with \'02\'. This is relevant within the context of cursors and is used\n  to control what happens when a cursor reaches the end of a data set.\n  If no more rows are available, a No Data condition occurs with\n  SQLSTATE value \'02000\'. To detect this condition, you can set up a\n  handler for it (or for a NOT FOUND condition). For an example, see\n  http://dev.mysql.com/doc/refman/5.6/en/cursors.html. This condition\n  also occurs for SELECT ... INTO var_list statements that retrieve no\n  rows.\n\no SQLEXCEPTION is shorthand for the class of SQLSTATE values that do\n  not begin with \'00\', \'01\', or \'02\'.\n\nFor information about how the server chooses handlers when a condition\noccurs, see http://dev.mysql.com/doc/refman/5.6/en/handler-scope.html.\n\nIf a condition occurs for which no handler has been declared, the\naction taken depends on the condition class:\n\no For SQLEXCEPTION conditions, the stored program terminates at the\n  statement that raised the condition, as if there were an EXIT\n  handler. If the program was called by another stored program, the\n  calling program handles the condition using the handler selection\n  rules applied to its own handlers.\n\no For SQLWARNING conditions, the program continues executing, as if\n  there were a CONTINUE handler.\n\no For NOT FOUND conditions, if the condition was raised normally, the\n  action is CONTINUE. If it was raised by SIGNAL or RESIGNAL, the\n  action is EXIT.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-handler.html\n\n','mysql> CREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE handlerdemo ()\n    -> BEGIN\n    ->   DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n    ->   SET @x = 1;\n    ->   INSERT INTO test.t VALUES (1);\n    ->   SET @x = 2;\n    ->   INSERT INTO test.t VALUES (1);\n    ->   SET @x = 3;\n    -> END;\n    -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL handlerdemo()//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n    +------+\n    | @x   |\n    +------+\n    | 3    |\n    +------+\n    1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/declare-handler.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (438,23,'TIME','TIME[(fsp)]\n\nA time. The range is \'-838:59:59.000000\' to \'838:59:59.000000\'. MySQL\ndisplays TIME values in \'HH:MM:SS[.fraction]\' format, but permits\nassignment of values to TIME columns using either strings or numbers.\n\nAs of MySQL 5.6.4, an optional fsp value in the range from 0 to 6 may\nbe given to specify fractional seconds precision. A value of 0\nsignifies that there is no fractional part. If omitted, the default\nprecision is 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (439,17,'SYSTEM_USER','Syntax:\nSYSTEM_USER()\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (440,32,'CURRENT_DATE','Syntax:\nCURRENT_DATE, CURRENT_DATE()\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (441,40,'TRUNCATE TABLE','Syntax:\nTRUNCATE [TABLE] tbl_name\n\nTRUNCATE TABLE empties a table completely. It requires the DROP\nprivilege.\n\nLogically, TRUNCATE TABLE is similar to a DELETE statement that deletes\nall rows, or a sequence of DROP TABLE and CREATE TABLE statements. To\nachieve high performance, it bypasses the DML method of deleting data.\nThus, it cannot be rolled back, it does not cause ON DELETE triggers to\nfire, and it cannot be performed for InnoDB tables with parent-child\nforeign key relationships.\n\nAlthough TRUNCATE TABLE is similar to DELETE, it is classified as a DDL\nstatement rather than a DML statement. It differs from DELETE in the\nfollowing ways in MySQL 5.6:\n\no Truncate operations drop and re-create the table, which is much\n  faster than deleting rows one by one, particularly for large tables.\n\no Truncate operations cause an implicit commit, and so cannot be rolled\n  back.\n\no Truncation operations cannot be performed if the session holds an\n  active table lock.\n\no TRUNCATE TABLE fails for an InnoDB table if there are any FOREIGN KEY\n  constraints from other tables that reference the table. Foreign key\n  constraints between columns of the same table are permitted.\n\no Truncation operations do not return a meaningful value for the number\n  of deleted rows. The usual result is "0 rows affected," which should\n  be interpreted as "no information."\n\no As long as the table format file tbl_name.frm is valid, the table can\n  be re-created as an empty table with TRUNCATE TABLE, even if the data\n  or index files have become corrupted.\n\no Any AUTO_INCREMENT value is reset to its start value. This is true\n  even for MyISAM and InnoDB, which normally do not reuse sequence\n  values.\n\no When used with partitioned tables, TRUNCATE TABLE preserves the\n  partitioning; that is, the data and index files are dropped and\n  re-created, while the partition definitions (.par) file is\n  unaffected.\n\no The TRUNCATE TABLE statement does not invoke ON DELETE triggers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (442,2,'AREA','Area(poly)\n\nST_Area() and Area() are synonyms. For more information, see the\ndescription of ST_Area().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (443,8,'START SLAVE','Syntax:\nSTART SLAVE [thread_types] [until_option] [connection_options]\n\nthread_types:\n    [thread_type [, thread_type] ... ]\n\nthread_type: \n    IO_THREAD | SQL_THREAD\n\nuntil_option:\n    UNTIL {   {SQL_BEFORE_GTIDS | SQL_AFTER_GTIDS} = gtid_set\n          |   MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\n          |   RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\n          |   SQL_AFTER_MTS_GAPS  }\n\nconnection_options: \n    [USER=\'user_name\'] [PASSWORD=\'user_pass\'] [DEFAULT_AUTH=\'plugin_name\'] [PLUGIN_DIR=\'plugin_dir\']\n\n\ngtid_set:\n    uuid_set [, uuid_set] ...\n    | \'\'\n\nuuid_set:\n    uuid:interval[:interval]...\n\nuuid:\n    hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh\n\nh:\n    [0-9,A-F]\n\ninterval:\n    n[-n]\n\n    (n >= 1) \n\nSTART SLAVE with no thread_type options starts both of the slave\nthreads. The I/O thread reads events from the master server and stores\nthem in the relay log. The SQL thread reads events from the relay log\nand executes them. START SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns\nwithout any error. However, even in that case, it might be that the\nslave threads start and then later stop (for example, because they do\nnot manage to connect to the master or read its binary log, or some\nother problem). START SLAVE does not warn you about this. You must\ncheck the slave\'s error log for error messages generated by the slave\nthreads, or check that they are running satisfactorily with SHOW SLAVE\nSTATUS.\n\nIn MySQL 5.6.7 and later, START SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nBeginning with MySQL 5.6.11, gtid_next must be set to AUTOMATIC before\nissuing this statement (Bug #16062608).\n\nMySQL 5.6.4 and later supports pluggable user-password authentication\nwith START SLAVE with the USER, PASSWORD, DEFAULT_AUTH and PLUGIN_DIR\noptions, as described in the following list:\n\no USER: User name. Cannot be set to an empty or null string, or left\n  unset if PASSWORD is used.\n\no PASSWORD: Password.\n\no DEFAULT_AUTH: Name of plugin; default is MySQL native authentication.\n\no PLUGIN_DIR: Location of plugin.\n\nStarting with MySQL 5.6.4, you cannot use the SQL_THREAD option when\nspecifying any of USER, PASSWORD, DEFAULT_AUTH, or PLUGIN_DIR, unless\nthe IO_THREAD option is also provided (Bug #13083642).\n\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html,\nfor more information.\n\nIf an insecure connection is used with any these options, the server\nissues the warning Sending passwords in plain text without SSL/TLS is\nextremely insecure.\n\nStarting with MySQL 5.6.6, START SLAVE ... UNTIL supports two\nadditional options for use with global transaction identifiers (GTIDs)\n(see http://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html).\nEach of these takes a set of one or more global transaction identifiers\ngtid_set as an argument (see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html#\nreplication-gtids-concepts-gtid-sets, for more information).\n\nWhen no thread_type is specified, START SLAVE UNTIL SQL_BEFORE_GTIDS\ncauses the slave SQL thread to process transactions until it has\nreached the first transaction whose GTID is listed in the gtid_set.\nSTART SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads to process\nall transactions until the last transaction in the gtid_set has been\nprocessed by both threads. In other words, START SLAVE UNTIL\nSQL_BEFORE_GTIDS causes the slave SQL thread to process all\ntransactions occurring before the first GTID in the gtid_set is\nreached, and START SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads\nto handle all transactions, including those whose GTIDs are found in\ngtid_set, until each has encountered a transaction whose GTID is not\npart of the set. SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS each support the\nSQL_THREAD and IO_THREAD options, although using IO_THREAD with them\ncurrently has no effect.\n\nFor example, START SLAVE SQL_THREAD UNTIL SQL_BEFORE_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56 causes the slave SQL thread\nto process all transactions originating from the master whose\nserver_uuid is 3E11FA47-71CA-11E1-9E33-C80AA9429562 until it encounters\nthe transaction having sequence number 11; it then stops without\nprocessing this transaction. In other words, all transactions up to and\nincluding the transaction with sequence number 10 are processed.\nExecuting START SLAVE SQL_THREAD UNTIL SQL_AFTER_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56, on the other hand, would\ncause the slave SQL thread to obtain all transactions just mentioned\nfrom the master, including all of the transactions having the sequence\nnumbers 11 through 56, and then to stop without processing any\nadditional transactions; that is, the transaction having sequence\nnumber 56 would be the last transaction fetched by the slave SQL\nthread.\n\nPrior to MySQL 5.6.14, SQL_AFTER_GTIDS did not stop the slave once the\nindicated transaction was completed, but waited until another GTID\nevent was received (Bug #14767986).\n\n*Note*: The SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS keywords are present\nin the MySQL 5.6.5 server; however, neither of them functioned\ncorrectly as options with START SLAVE [SQL_THREAD | IO_THREAD] UNTIL in\nthat version, and are therefore supported beginning only with MySQL\n5.6.6. (Bug#13810456)\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS is available in MySQL 5.6.6 or\nlater. This statement causes a multi-threaded slave\'s SQL threads to\nrun until no more gaps are found in the relay log, and then to stop.\nThis statement can take an SQL_THREAD option, but the effects of the\nstatement remain unchanged. It has no effect on the slave I/O thread\n(and cannot be used with the IO_THREAD option). START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS should be used before switching the slave from\nmulti-threaded mode to single-threaded mode (that is, when resetting\nslave_parallel_workers back to 0 from a positive, nonzero value) after\nslave has failed with errors in multi-threaded mode.\n\nTo change a failed multi-threaded slave to single-threaded mode, you\ncan issue the following series of statements, in the order shown:\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS;\n\nSET @@GLOBAL.slave_parallel_workers = 0;\n\nSTART SLAVE SQL_THREAD;\n\nIf you were running the failed multi-threaded slave with\nrelay_log_recovery enabled, then you must issue START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS prior to executing CHANGE MASTER TO. Otherwise the\nlatter statement fails.\n\n*Note*: It is possible to view the entire text of a running START SLAVE\n... statement, including any USER or PASSWORD values used, in the\noutput of SHOW PROCESSLIST. This is also true for the text of a running\nCHANGE MASTER TO statement, including any values it employs for\nMASTER_USER or MASTER_PASSWORD.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/start-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/start-slave.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (444,27,'SHOW WARNINGS','Syntax:\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW COUNT(*) WARNINGS\n\nSHOW WARNINGS is a diagnostic statement that displays information about\nthe conditions (errors, warnings, and notes) resulting from executing a\nstatement in the current session. Warnings are generated for DML\nstatements such as INSERT, UPDATE, and LOAD DATA INFILE as well as DDL\nstatements such as CREATE TABLE and ALTER TABLE.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nSHOW WARNINGS is also used following EXPLAIN EXTENDED, to display the\nextra information generated by EXPLAIN when the EXTENDED keyword is\nused. See http://dev.mysql.com/doc/refman/5.6/en/explain-extended.html.\n\nSHOW WARNINGS displays information about the conditions resulting from\nthe most recent statement in the current session that generated\nmessages. It shows nothing if the most recent statement used a table\nand generated no messages. (That is, statements that use a table but\ngenerate no messages clear the message list.) Statements that do not\nuse tables and do not generate messages have no effect on the message\nlist.\n\nThe SHOW COUNT(*) WARNINGS diagnostic statement displays the total\nnumber of errors, warnings, and notes. You can also retrieve this\nnumber from the warning_count system variable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nA related diagnostic statement, SHOW ERRORS, shows only error\nconditions (it excludes warnings and notes), and SHOW COUNT(*) ERRORS\nstatement displays the total number of errors. See [HELP SHOW ERRORS].\nGET DIAGNOSTICS can be used to examine information for individual\nconditions. See [HELP GET DIAGNOSTICS].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-warnings.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-warnings.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (445,10,'DROP USER','Syntax:\nDROP USER user [, user] ...\n\nThe DROP USER statement removes one or more MySQL accounts and their\nprivileges. It removes privilege rows for the account from all grant\ntables. An error occurs for accounts that do not exist. To use this\nstatement, you must have the global CREATE USER privilege or the DELETE\nprivilege for the mysql database.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nDROP USER \'jeffrey\'@\'localhost\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-user.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (446,38,'SUBSTRING','Syntax:\nSUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nThe forms without a len argument return a substring from string str\nstarting at position pos. The forms with a len argument return a\nsubstring len characters long from string str, starting at position\npos. The forms that use FROM are standard SQL syntax. It is also\npossible to use a negative value for pos. In this case, the beginning\nof the substring is pos characters from the end of the string, rather\nthan the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nFor all forms of SUBSTRING(), the position of the first character in\nthe string from which the substring is to be extracted is reckoned as\n1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SUBSTRING(\'Quadratically\',5);\n        -> \'ratically\'\nmysql> SELECT SUBSTRING(\'foobarbar\' FROM 4);\n        -> \'barbar\'\nmysql> SELECT SUBSTRING(\'Quadratically\',5,6);\n        -> \'ratica\'\nmysql> SELECT SUBSTRING(\'Sakila\', -3);\n        -> \'ila\'\nmysql> SELECT SUBSTRING(\'Sakila\', -5, 3);\n        -> \'aki\'\nmysql> SELECT SUBSTRING(\'Sakila\' FROM -4 FOR 2);\n        -> \'ki\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (447,37,'ISEMPTY','IsEmpty(g)\n\nThis function is a placeholder that returns 0 for any valid geometry\nvalue, 1 for any invalid geometry value or NULL.\n\nMySQL does not support GIS EMPTY values such as POINT EMPTY.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (448,27,'SHOW FUNCTION STATUS','Syntax:\nSHOW FUNCTION STATUS\n    [LIKE \'pattern\' | WHERE expr]\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored\nfunctions. See [HELP SHOW PROCEDURE STATUS].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-function-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-function-status.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (449,38,'LTRIM','Syntax:\nLTRIM(str)\n\nReturns the string str with leading space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LTRIM(\'  barbar\');\n        -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (450,31,'ST_CROSSES','ST_Crosses(g1,g2)\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon\nor a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\no The two geometries intersect\n\no Their intersection results in a geometry that has a dimension that is\n  one less than the maximum dimension of the two given geometries\n\no Their intersection is not equal to either of the two given geometries\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (451,7,'MBRDISJOINT','MBRDisjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are disjoint (do not intersect).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (452,14,'VALUES','Syntax:\nVALUES(col_name)\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column\nvalues from the INSERT portion of the statement. In other words,\nVALUES(col_name) in the UPDATE clause refers to the value of col_name\nthat would be inserted, had no duplicate-key conflict occurred. This\nfunction is especially useful in multiple-row inserts. The VALUES()\nfunction is meaningful only in the ON DUPLICATE KEY UPDATE clause of\nINSERT statements and returns NULL otherwise. See\nhttp://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n    -> ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (453,28,'CALL','Syntax:\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nThe CALL statement invokes a stored procedure that was defined\npreviously with CREATE PROCEDURE.\n\nStored procedures that take no arguments can be invoked without\nparentheses. That is, CALL p() and CALL p are equivalent.\n\nCALL can pass back values to its caller using parameters that are\ndeclared as OUT or INOUT parameters. When the procedure returns, a\nclient program can also obtain the number of rows affected for the\nfinal statement executed within the routine: At the SQL level, call the\nROW_COUNT() function; from the C API, call the mysql_affected_rows()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/call.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/call.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (454,12,'ENCODE','Syntax:\nENCODE(str,pass_str)\n\nEncrypt str using pass_str as the password. The result is a binary\nstring of the same length as str. To decrypt the result, use DECODE().\n\nThe ENCODE() function should no longer be used. If you still need to\nuse ENCODE(), a salt value must be used with it to reduce risk. For\nexample:\n\nENCODE(\'plaintext\', CONCAT(\'my_random_salt\',\'my_secret_password\'))\n\nA new random salt value must be used whenever a password is updated.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (455,38,'SUBSTRING_INDEX','Syntax:\nSUBSTRING_INDEX(str,delim,count)\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the\nfinal delimiter (counting from the left) is returned. If count is\nnegative, everything to the right of the final delimiter (counting from\nthe right) is returned. SUBSTRING_INDEX() performs a case-sensitive\nmatch when searching for delim.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', 2);\n        -> \'www.mysql\'\nmysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', -2);\n        -> \'mysql.com\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (456,32,'TIMESTAMPADD','Syntax:\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument,\nwhich should be one of the following values: MICROSECOND\n(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or\nYEAR.\n\nThe unit value may be specified using one of keywords as shown, or with\na prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n        -> \'2003-01-02 00:01:00\'\nmysql> SELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n        -> \'2003-01-09\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (457,3,'TRUNCATE','Syntax:\nTRUNCATE(X,D)\n\nReturns the number X, truncated to D decimal places. If D is 0, the\nresult has no decimal point or fractional part. D can be negative to\ncause D digits left of the decimal point of the value X to become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT TRUNCATE(1.223,1);\n        -> 1.2\nmysql> SELECT TRUNCATE(1.999,1);\n        -> 1.9\nmysql> SELECT TRUNCATE(1.999,0);\n        -> 1\nmysql> SELECT TRUNCATE(-1.999,1);\n        -> -1.9\nmysql> SELECT TRUNCATE(122,-2);\n       -> 100\nmysql> SELECT TRUNCATE(10.28*100,0);\n       -> 1028\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (458,27,'SHOW','SHOW has many forms that provide information about databases, tables,\ncolumns, or status information about the server. This section describes\nthose following:\n\nSHOW AUTHORS\nSHOW {BINARY | MASTER} LOGS\nSHOW BINLOG EVENTS [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\nSHOW CHARACTER SET [like_or_where]\nSHOW COLLATION [like_or_where]\nSHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\nSHOW CONTRIBUTORS\nSHOW CREATE DATABASE db_name\nSHOW CREATE EVENT event_name\nSHOW CREATE FUNCTION func_name\nSHOW CREATE PROCEDURE proc_name\nSHOW CREATE TABLE tbl_name\nSHOW CREATE TRIGGER trigger_name\nSHOW CREATE VIEW view_name\nSHOW DATABASES [like_or_where]\nSHOW ENGINE engine_name {STATUS | MUTEX}\nSHOW [STORAGE] ENGINES\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW EVENTS\nSHOW FUNCTION CODE func_name\nSHOW FUNCTION STATUS [like_or_where]\nSHOW GRANTS FOR user\nSHOW INDEX FROM tbl_name [FROM db_name]\nSHOW MASTER STATUS\nSHOW OPEN TABLES [FROM db_name] [like_or_where]\nSHOW PLUGINS\nSHOW PROCEDURE CODE proc_name\nSHOW PROCEDURE STATUS [like_or_where]\nSHOW PRIVILEGES\nSHOW [FULL] PROCESSLIST\nSHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\nSHOW PROFILES\nSHOW SLAVE HOSTS\nSHOW SLAVE STATUS\nSHOW [GLOBAL | SESSION] STATUS [like_or_where]\nSHOW TABLE STATUS [FROM db_name] [like_or_where]\nSHOW [FULL] TABLES [FROM db_name] [like_or_where]\nSHOW TRIGGERS [FROM db_name] [like_or_where]\nSHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\nSHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n    LIKE \'pattern\'\n  | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\'\npart, \'pattern\' is a string that can contain the SQL "%" and "_"\nwildcard characters. The pattern is useful for restricting statement\noutput to matching values.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (459,27,'SHOW VARIABLES','Syntax:\nSHOW [GLOBAL | SESSION] VARIABLES\n    [LIKE \'pattern\' | WHERE expr]\n\nSHOW VARIABLES shows the values of MySQL system variables. This\ninformation also can be obtained using the mysqladmin variables\ncommand. The LIKE clause, if present, indicates which variable names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html. This\nstatement does not require any privilege. It requires only the ability\nto connect to the server.\n\nWith the GLOBAL modifier, SHOW VARIABLES displays the values that are\nused for new connections to MySQL. In MySQL 5.6, if a variable has no\nglobal value, no value is displayed. With SESSION, SHOW VARIABLES\ndisplays the values that are in effect for the current connection. If\nno modifier is present, the default is SESSION. LOCAL is a synonym for\nSESSION.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern. To obtain the row for a\nspecific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'max_join_size\';\nSHOW SESSION VARIABLES LIKE \'max_join_size\';\n\nTo get a list of variables whose name match a pattern, use the "%"\nwildcard character in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%size%\';\nSHOW GLOBAL VARIABLES LIKE \'%size%\';\n\nWildcard characters can be used in any position within the pattern to\nbe matched. Strictly speaking, because "_" is a wildcard that matches\nany single character, you should escape it as "\\_" to match it\nliterally. In practice, this is rarely necessary.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-variables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-variables.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (460,27,'BINLOG','Syntax:\nBINLOG \'str\'\n\nBINLOG is an internal-use statement. It is generated by the mysqlbinlog\nprogram as the printable representation of certain events in binary log\nfiles. (See http://dev.mysql.com/doc/refman/5.6/en/mysqlbinlog.html.)\nThe \'str\' value is a base 64-encoded string the that server decodes to\ndetermine the data change indicated by the corresponding event. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/binlog.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/binlog.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (461,31,'ST_DISJOINT','ST_Disjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does\nnot intersect) g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (462,3,'ATAN2','Syntax:\nATAN(Y,X), ATAN2(Y,X)\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both\narguments are used to determine the quadrant of the result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(-2,2);\n        -> -0.78539816339745\nmysql> SELECT ATAN2(PI(),0);\n        -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (463,32,'HOUR','Syntax:\nHOUR(time)\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much\nlarger, so HOUR can return values greater than 23.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT HOUR(\'10:05:03\');\n        -> 10\nmysql> SELECT HOUR(\'272:59:59\');\n        -> 272\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (464,28,'SELECT','Syntax:\nSELECT\n    [ALL | DISTINCT | DISTINCTROW ]\n      [HIGH_PRIORITY]\n      [STRAIGHT_JOIN]\n      [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n      [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n    select_expr [, select_expr ...]\n    [FROM table_references\n      [PARTITION partition_list]\n    [WHERE where_condition]\n    [GROUP BY {col_name | expr | position}\n      [ASC | DESC], ... [WITH ROLLUP]]\n    [HAVING where_condition]\n    [ORDER BY {col_name | expr | position}\n      [ASC | DESC], ...]\n    [LIMIT {[offset,] row_count | row_count OFFSET offset}]\n    [PROCEDURE procedure_name(argument_list)]\n    [INTO OUTFILE \'file_name\'\n        [CHARACTER SET charset_name]\n        export_options\n      | INTO DUMPFILE \'file_name\'\n      | INTO var_name [, var_name]]\n    [FOR UPDATE | LOCK IN SHARE MODE]]\n\nSELECT is used to retrieve rows selected from one or more tables, and\ncan include UNION statements and subqueries. See [HELP UNION], and\nhttp://dev.mysql.com/doc/refman/5.6/en/subqueries.html.\n\nThe most commonly used clauses of SELECT statements are these:\n\no Each select_expr indicates a column that you want to retrieve. There\n  must be at least one select_expr.\n\no table_references indicates the table or tables from which to retrieve\n  rows. Its syntax is described in [HELP JOIN].\n\no Starting in MySQL 5.6.2, SELECT supports explicit partition selection\n  using the PARTITION keyword with a list of partitions or\n  subpartitions (or both) following the name of the table in a\n  table_reference (see [HELP JOIN]). In this case, rows are selected\n  only from the partitions listed, and any other partitions of the\n  table are ignored. For more information and examples, see\n  http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html.\n\n  In MySQL 5.6.6 and later, SELECT ... PARTITION from tables using\n  storage engines such as MyISAM that perform table-level locks (and\n  thus partition locks) lock only the partitions or subpartitions named\n  by the PARTITION option.\n\n  See\n  http://dev.mysql.com/doc/refman/5.6/en/partitioning-limitations-locki\n  ng.html, for more information.\n\no The WHERE clause, if given, indicates the condition or conditions\n  that rows must satisfy to be selected. where_condition is an\n  expression that evaluates to true for each row to be selected. The\n  statement selects all rows if there is no WHERE clause.\n\n  In the WHERE expression, you can use any of the functions and\n  operators that MySQL supports, except for aggregate (summary)\n  functions. See\n  http://dev.mysql.com/doc/refman/5.6/en/expressions.html, and\n  http://dev.mysql.com/doc/refman/5.6/en/functions.html.\n\nSELECT can also be used to retrieve rows computed without reference to\nany table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/select.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (465,16,'GROUP_CONCAT','Syntax:\nGROUP_CONCAT(expr)\n\nThis function returns a string result with the concatenated non-NULL\nvalues from a group. It returns NULL if there are no non-NULL values.\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n             [ORDER BY {unsigned_integer | col_name | expr}\n                 [ASC | DESC] [,col_name ...]]\n             [SEPARATOR str_val])\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name,\n    ->     GROUP_CONCAT(test_score)\n    ->     FROM student\n    ->     GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (466,17,'BENCHMARK','Syntax:\nBENCHMARK(count,expr)\n\nThe BENCHMARK() function executes the expression expr repeatedly count\ntimes. It may be used to time how quickly MySQL processes the\nexpression. The result value is always 0. The intended use is from\nwithin the mysql client, which reports query execution times:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\'));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\')) |\n+----------------------------------------------+\n|                                            0 |\n+----------------------------------------------+\n1 row in set (4.74 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (467,27,'SHOW ENGINE','Syntax:\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nSHOW ENGINE displays operational information about a storage engine. It\nrequires the PROCESS privilege. The statement has these variants:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE {NDB | NDBCLUSTER} STATUS\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n\nSHOW ENGINE INNODB STATUS displays extensive information from the\nstandard InnoDB Monitor about the state of the InnoDB storage engine.\nFor information about the standard monitor and other InnoDB Monitors\nthat provide information about InnoDB processing, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-monitors.html.\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex and rw-lock statistics.\nStatement output has the following columns:\n\n*Note*: Most SHOW ENGINE INNODB MUTEX output is removed in 5.6.14. SHOW\nENGINE INNODB MUTEX output is removed entirely in MySQL 5.7.2.\nComparable information can be generated by creating views on\nPerformance Schema tables.\n\no Type\n\n  Always InnoDB.\n\no Name\n\n  The source file where the mutex is implemented, and the line number\n  in the file where the mutex is created. The line number is specific\n  to your version of MySQL.\n\no Status\n\n  The mutex status. This field displays several values if WITH_DEBUG\n  was defined at MySQL compilation time. If WITH_DEBUG was not defined,\n  the statement displays only the os_waits value. In the latter case\n  (without WITH_DEBUG), the information on which the output is based is\n  insufficient to distinguish regular mutexes and mutexes that protect\n  rw-locks (which permit multiple readers or a single writer).\n  Consequently, the output may appear to contain multiple rows for the\n  same mutex.\n\n  o count indicates how many times the mutex was requested.\n\n  o spin_waits indicates how many times the spinlock had to run.\n\n  o spin_rounds indicates the number of spinlock rounds. (spin_rounds\n    divided by spin_waits provides the average round count.)\n\n  o os_waits indicates the number of operating system waits. This\n    occurs when the spinlock did not work (the mutex was not locked\n    during the spinlock and it was necessary to yield to the operating\n    system and wait).\n\n  o os_yields indicates the number of times a thread trying to lock a\n    mutex gave up its timeslice and yielded to the operating system (on\n    the presumption that permitting other threads to run will free the\n    mutex so that it can be locked).\n\n  o os_wait_times indicates the amount of time (in ms) spent in\n    operating system waits. In MySQL 5.6 timing is disabled and this\n    value is always 0.\n\nSHOW ENGINE INNODB MUTEX skips the mutexes and rw-locks of buffer pool\nblocks, as the amount of output can be overwhelming on systems with a\nlarge buffer pool. (There is one mutex and one rw-lock in each 16K\nbuffer pool block, and there are 65,536 blocks per gigabyte.) SHOW\nENGINE INNODB MUTEX also does not list any mutexes or rw-locks that\nhave never been waited on (os_waits=0). Thus, SHOW ENGINE INNODB MUTEX\nonly displays information about mutexes and rw-locks outside of the\nbuffer pool that have caused at least one OS-level wait.\n\nSHOW ENGINE INNODB MUTEX information can be used to diagnose system\nproblems. For example, large values of spin_waits and spin_rounds may\nindicate scalability problems.\n\nUse SHOW ENGINE PERFORMANCE_SCHEMA STATUS to inspect the internal\noperation of the Performance Schema code:\n\nmysql> SHOW ENGINE PERFORMANCE_SCHEMA STATUS\\G\n...\n*************************** 3. row ***************************\n  Type: performance_schema\n  Name: events_waits_history.row_size\nStatus: 76\n*************************** 4. row ***************************\n  Type: performance_schema\n  Name: events_waits_history.row_count\nStatus: 10000\n*************************** 5. row ***************************\n  Type: performance_schema\n  Name: events_waits_history.memory\nStatus: 760000\n...\n*************************** 57. row ***************************\n  Type: performance_schema\n  Name: performance_schema.memory\nStatus: 26459600\n...\n\nThis statement is intended to help the DBA understand the effects that\ndifferent Performance Schema options have on memory requirements.\n\nName values consist of two parts, which name an internal buffer and a\nbuffer attribute, respectively. Interpret buffer names as follows:\n\no An internal buffer that is not exposed as a table is named within\n  parentheses. Examples: (pfs_cond_class).row_size,\n  (pfs_mutex_class).memory.\n\no An internal buffer that is exposed as a table in the\n  performance_schema database is named after the table, without\n  parentheses. Examples: events_waits_history.row_size,\n  mutex_instances.row_count.\n\no A value that applies to the Performance Schema as a whole begins with\n  performance_schema. Example: performance_schema.memory.\n\nBuffer attributes have these meanings:\n\no row_size is the size of the internal record used by the\n  implementation, such as the size of a row in a table. row_size values\n  cannot be changed.\n\no row_count is the number of internal records, such as the number of\n  rows in a table. row_count values can be changed using Performance\n  Schema configuration options.\n\no For a table, tbl_name.memory is the product of row_size and\n  row_count. For the Performance Schema as a whole,\n  performance_schema.memory is the sum of all the memory used (the sum\n  of all other memory values).\n\nIn some cases, there is a direct relationship between a Performance\nSchema configuration parameter and a SHOW ENGINE value. For example,\nevents_waits_history_long.row_count corresponds to\nperformance_schema_events_waits_history_long_size. In other cases, the\nrelationship is more complex. For example,\nevents_waits_history.row_count corresponds to\nperformance_schema_events_waits_history_size (the number of rows per\nthread) multiplied by performance_schema_max_thread_instances ( the\nnumber of threads).\n\nSHOW ENGINE NDB STATUS If the server has the NDB storage engine\nenabled, SHOW ENGINE NDB STATUS displays cluster status information\nsuch as the number of connected data nodes, the cluster connectstring,\nand cluster binary log epochs, as well as counts of various Cluster API\nobjects created by the MySQL Server when connected to the cluster.\nSample output from this statement is shown here:\n\nmysql> SHOW ENGINE NDB STATUS;\n+------------+-----------------------+--------------------------------------------------+\n| Type       | Name                  | Status                                           |\n+------------+-----------------------+--------------------------------------------------+\n| ndbcluster | connection            | cluster_node_id=7,\n  connected_host=192.168.0.103, connected_port=1186, number_of_data_nodes=4,\n  number_of_ready_data_nodes=3, connect_count=0                                         |\n| ndbcluster | NdbTransaction        | created=6, free=0, sizeof=212                    |\n| ndbcluster | NdbOperation          | created=8, free=8, sizeof=660                    |\n| ndbcluster | NdbIndexScanOperation | created=1, free=1, sizeof=744                    |\n| ndbcluster | NdbIndexOperation     | created=0, free=0, sizeof=664                    |\n| ndbcluster | NdbRecAttr            | created=1285, free=1285, sizeof=60               |\n| ndbcluster | NdbApiSignal          | created=16, free=16, sizeof=136                  |\n| ndbcluster | NdbLabel              | created=0, free=0, sizeof=196                    |\n| ndbcluster | NdbBranch             | created=0, free=0, sizeof=24                     |\n| ndbcluster | NdbSubroutine         | created=0, free=0, sizeof=68                     |\n| ndbcluster | NdbCall               | created=0, free=0, sizeof=16                     |\n| ndbcluster | NdbBlob               | created=1, free=1, sizeof=264                    |\n| ndbcluster | NdbReceiver           | created=4, free=0, sizeof=68                     |\n| ndbcluster | binlog                | latest_epoch=155467, latest_trans_epoch=148126,\n  latest_received_binlog_epoch=0, latest_handled_binlog_epoch=0,\n  latest_applied_binlog_epoch=0                                                         |\n+------------+-----------------------+--------------------------------------------------+\n\nThe rows with connection and binlog in the Name column were added to\nthe output of this statement in MySQL 5.1. The Status column in each of\nthese rows provides information about the MySQL server\'s connection to\nthe cluster and about the cluster binary log\'s status, respectively.\nThe Status information is in the form of comma-delimited set of\nname/value pairs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-engine.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-engine.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (468,14,'NAME_CONST','Syntax:\nNAME_CONST(name,value)\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments\nshould be constants.\n\nmysql> SELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n|     14 |\n+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (469,14,'RELEASE_LOCK','Syntax:\nRELEASE_LOCK(str)\n\nReleases the lock named by the string str that was obtained with\nGET_LOCK(). Returns 1 if the lock was released, 0 if the lock was not\nestablished by this thread (in which case the lock is not released),\nand NULL if the named lock did not exist. The lock does not exist if it\nwas never obtained by a call to GET_LOCK() or if it has previously been\nreleased.\n\nThe DO statement is convenient to use with RELEASE_LOCK(). See [HELP\nDO].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (470,32,'WEEKDAY','Syntax:\nWEEKDAY(date)\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =\nSunday).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKDAY(\'2008-02-03 22:23:00\');\n        -> 6\nmysql> SELECT WEEKDAY(\'2007-11-06\');\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (471,32,'TIME_TO_SEC','Syntax:\nTIME_TO_SEC(time)\n\nReturns the time argument, converted to seconds.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_TO_SEC(\'22:23:00\');\n        -> 80580\nmysql> SELECT TIME_TO_SEC(\'00:39:38\');\n        -> 2378\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (472,32,'CONVERT_TZ','Syntax:\nCONVERT_TZ(dt,from_tz,to_tz)\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by\nfrom_tz to the time zone given by to_tz and returns the resulting\nvalue. Time zones are specified as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/time-zone-support.html. This\nfunction returns NULL if the arguments are invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'GMT\',\'MET\');\n        -> \'2004-01-01 13:00:00\'\nmysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n        -> \'2004-01-01 22:00:00\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (473,38,'EXPORT_SET','Syntax:\nEXPORT_SET(bits,on,off[,separator[,number_of_bits]])\n\nReturns a string such that for every bit set in the value bits, you get\nan on string and for every bit not set in the value, you get an off\nstring. Bits in bits are examined from right to left (from low-order to\nhigh-order bits). Strings are added to the result from left to right,\nseparated by the separator string (the default being the comma\ncharacter ","). The number of bits examined is given by number_of_bits,\nwhich has a default of 64 if not specified. number_of_bits is silently\nclipped to 64 if larger than 64. It is treated as an unsigned integer,\nso a value of -1 is effectively the same as 64.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n        -> \'Y,N,Y,N\'\nmysql> SELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n        -> \'0,1,1,0,0,0,0,0,0,0\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (474,38,'CAST','Syntax:\nCAST(expr AS type)\n\nThe CAST() function takes an expression of any type and produces a\nresult value of a specified type, similar to CONVERT(). See the\ndescription of CONVERT() for more information.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (475,38,'SOUNDS LIKE','Syntax:\nexpr1 SOUNDS LIKE expr2\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (476,32,'PERIOD_DIFF','Syntax:\nPERIOD_DIFF(P1,P2)\n\nReturns the number of months between periods P1 and P2. P1 and P2\nshould be in the format YYMM or YYYYMM. Note that the period arguments\nP1 and P2 are not date values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_DIFF(200802,200703);\n        -> 11\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (477,16,'AVG','Syntax:\nAVG([DISTINCT] expr)\n\nReturns the average value of expr. The DISTINCT option can be used to\nreturn the average of the distinct values of expr.\n\nAVG() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name, AVG(test_score)\n    ->        FROM student\n    ->        GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (478,38,'QUOTE','Syntax:\nQUOTE(str)\n\nQuotes a string to produce a result that can be used as a properly\nescaped data value in an SQL statement. The string is returned enclosed\nby single quotation marks and with each instance of backslash ("\\"),\nsingle quote ("\'"), ASCII NUL, and Control+Z preceded by a backslash.\nIf the argument is NULL, the return value is the word "NULL" without\nenclosing single quotation marks.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT QUOTE(\'Don\\\'t!\');\n        -> \'Don\\\'t!\'\nmysql> SELECT QUOTE(NULL);\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (479,20,'IN','Syntax:\nexpr IN (value,...)\n\nReturns 1 if expr is equal to any of the values in the IN list, else\nreturns 0. If all values are constants, they are evaluated according to\nthe type of expr and sorted. The search for the item then is done using\na binary search. This means IN is very quick if the IN value list\nconsists entirely of constants. Otherwise, type conversion takes place\naccording to the rules described in\nhttp://dev.mysql.com/doc/refman/5.6/en/type-conversion.html, but\napplied to all the arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 IN (0,3,5,7);\n        -> 0\nmysql> SELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (480,32,'QUARTER','Syntax:\nQUARTER(date)\n\nReturns the quarter of the year for date, in the range 1 to 4.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT QUARTER(\'2008-04-01\');\n        -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (481,27,'HELP COMMAND','Syntax:\nmysql> help search_string\n\nIf you provide an argument to the help command, mysql uses it as a\nsearch string to access server-side help from the contents of the MySQL\nReference Manual. The proper operation of this command requires that\nthe help tables in the mysql database be initialized with help topic\ninformation (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-side-help-support.html).\n\nIf there is no match for the search string, the search fails:\n\nmysql> help me\n\nNothing found\nPlease try to run \'help contents\' for a list of all accessible topics\n\nUse help contents to see a list of the help categories:\n\nmysql> help contents\nYou asked for help about help category: "Contents"\nFor more information, type \'help <item>\', where <item> is one of the\nfollowing categories:\n   Account Management\n   Administration\n   Data Definition\n   Data Manipulation\n   Data Types\n   Functions\n   Functions and Modifiers for Use with GROUP BY\n   Geographic Features\n   Language Structure\n   Plugins\n   Storage Engines\n   Stored Routines\n   Table Maintenance\n   Transactions\n   Triggers\n\nIf the search string matches multiple items, mysql shows a list of\nmatching topics:\n\nmysql> help logs\nMany help items for your request exist.\nTo make a more specific request, please type \'help <item>\',\nwhere <item> is one of the following topics:\n   SHOW\n   SHOW BINARY LOGS\n   SHOW ENGINE\n   SHOW LOGS\n\nUse a topic as the search string to see the help entry for that topic:\n\nmysql> help show binary logs\nName: \'SHOW BINARY LOGS\'\nDescription:\nSyntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [purge-binary-logs], that shows how\nto determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name      | File_size |\n+---------------+-----------+\n| binlog.000015 |    724935 |\n| binlog.000016 |    733481 |\n+---------------+-----------+\n\nThe search string can contain the wildcard characters "%" and "_".\nThese have the same meaning as for pattern-matching operations\nperformed with the LIKE operator. For example, HELP rep% returns a list\nof topics that begin with rep:\n\nmysql> HELP rep%\nMany help items for your request exist.\nTo make a more specific request, please type \'help <item>\',\nwhere <item> is one of the following\ntopics:\n   REPAIR TABLE\n   REPEAT FUNCTION\n   REPEAT LOOP\n   REPLACE\n   REPLACE FUNCTION\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mysql-server-side-help.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/mysql-server-side-help.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (482,38,'POSITION','Syntax:\nPOSITION(substr IN str)\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (483,14,'IS_USED_LOCK','Syntax:\nIS_USED_LOCK(str)\n\nChecks whether the lock named str is in use (that is, locked). If so,\nit returns the connection identifier of the client that holds the lock.\nOtherwise, it returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (484,4,'POLYFROMTEXT','PolyFromText(wkt[,srid]), PolygonFromText(wkt[,srid])\n\nConstructs a Polygon value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (485,12,'DES_ENCRYPT','Syntax:\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.6/en/ssl-connections.html.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from\nthe DES key file is used. With a key_num argument, the given key number\n(0 to 9) from the DES key file is used. With a key_str argument, the\ngiven key string is used to encrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is\nCHAR(128 | key_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If\nyou use a string key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in\nthe file may be in any order. des_key_str is the string that is used to\nencrypt the message. There should be at least one space between the\nnumber and the key. The first key is the default key that is used if\nyou do not specify any key argument to DES_ENCRYPT().\n\nYou can tell MySQL to read new key values from the key file with the\nFLUSH DES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives\napplications a way to check for the existence of encrypted column\nvalues, without giving the end user the right to decrypt those values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT customer_address FROM customer_table \n     > WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (486,10,'ALTER USER','Syntax:\nALTER USER user_specification [, user_specification] ...\n\nuser_specification:\n    user PASSWORD EXPIRE\n\nThe ALTER USER statement alters MySQL accounts. To use it, you must\nhave the global CREATE USER privilege or the INSERT privilege for the\nmysql database.\n\n*Warning*: ALTER USER was added in MySQL 5.6.6. However, in 5.6.6,\nALTER USER also sets the Password column to the empty string, so do not\nuse this statement until 5.6.7.\n\nFor each account, ALTER USER expires its password. For example:\n\nALTER USER \'jeffrey\'@\'localhost\' PASSWORD EXPIRE;\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. If you\nspecify only the user name part of the account name, a host name part\nof \'%\' is used.\n\nPassword expiration for an account affects the corresponding row of the\nmysql.user table: The server sets the password_expired column to \'Y\'.\n\nA client session operates in restricted mode if the account password\nhas been expired. In restricted mode, operations performed in the\nsession result in an error until the user issues a SET PASSWORD\nstatement to establish a new account password:\n\nmysql> SELECT 1;\nERROR 1820 (HY000): You must SET PASSWORD before executing this statement\n\nmysql> SET PASSWORD = PASSWORD(\'new_password\');\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SELECT 1;\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n1 row in set (0.00 sec)\n\nAs of MySQL 5.6.8, this restricted mode of operation permits SET\nstatements, which is useful if the account password uses a hashing\nformat that requires old_passwords to be set to a value different from\nits default.\n\nIt is also possible for an administrative user to reset the account\npassword, but any existing sessions for the account remain restricted.\nClients using the account must disconnect and reconnect before\nstatements can be executed successfully.\n\n*Note*: It is possible to "reset" a password with SET PASSWORD by\nsetting it to its current value. As a matter of good policy, it is\npreferable to choose a different password.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-user.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (487,3,'CEIL','Syntax:\nCEIL(X)\n\nCEIL() is a synonym for CEILING().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (488,7,'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS','Syntax:\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(gtid_set[, timeout])\n\nWait until the slave SQL thread has executed all of the transactions\nwhose global transaction identifiers are contained in gtid_set (see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html,\nfor a definition of "GTID sets"), or until timeout seconds have\nelapsed, whichever occurs first. timeout is optional; the default\ntimeout is 0 seconds, in which case the master simply waits until all\nof the transactions in the GTID set have been executed.\n\nPrior to MySQL 5.6.9, WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() was named\nSQL_THREAD_WAIT_AFTER_GTIDS(). (Bug #14775984)\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','mysql> SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\');\n        -> 5\n','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (489,38,'LENGTH','Syntax:\nLENGTH(str)\n\nReturns the length of the string str, measured in bytes. A multibyte\ncharacter counts as multiple bytes. This means that for a string\ncontaining five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LENGTH(\'text\');\n        -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (490,38,'WEIGHT_STRING','Syntax:\nWEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels] [flags])\n\nlevels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ...\n\nThis function returns the weight string for the input string. The\nreturn value is a binary string that represents the sorting and\ncomparison value of the string. It has these properties:\n\no If WEIGHT_STRING(str1) = WEIGHT_STRING(str2), then str1 = str2 (str1\n  and str2 are considered equal)\n\no If WEIGHT_STRING(str1) < WEIGHT_STRING(str2), then str1 < str2 (str1\n  sorts before str2)\n\nWEIGHT_STRING() can be used for testing and debugging of collations,\nespecially if you are adding a new collation. See\nhttp://dev.mysql.com/doc/refman/5.6/en/adding-collation.html.\n\nThe input string, str, is a string expression. If the input is a\nnonbinary (character) string such as a CHAR, VARCHAR, or TEXT value,\nthe return value contains the collation weights for the string. If the\ninput is a binary (byte) string such as a BINARY, VARBINARY, or BLOB\nvalue, the return value is the same as the input (the weight for each\nbyte in a binary string is the byte value). If the input is NULL,\nWEIGHT_STRING() returns NULL.\n\nExamples:\n\nmysql> SET @s = _latin1 \'AB\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s   | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB   | 4142    | 4142                   |\n+------+---------+------------------------+\n\nmysql> SET @s = _latin1 \'ab\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s   | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab   | 6162    | 4142                   |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'AB\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s   | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB   | 4142    | 4142                   |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'ab\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s   | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab   | 6162    | 6162                   |\n+------+---------+------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (491,31,'ST_EQUALS','ST_Equals(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (492,40,'ALTER EVENT','Syntax:\nALTER\n    [DEFINER = { user | CURRENT_USER }]\n    EVENT event_name\n    [ON SCHEDULE schedule]\n    [ON COMPLETION [NOT] PRESERVE]\n    [RENAME TO new_event_name]\n    [ENABLE | DISABLE | DISABLE ON SLAVE]\n    [COMMENT \'comment\']\n    [DO event_body]\n\nThe ALTER EVENT statement changes one or more of the characteristics of\nan existing event without the need to drop and recreate it. The syntax\nfor each of the DEFINER, ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE /\nDISABLE, and DO clauses is exactly the same as when used with CREATE\nEVENT. (See [HELP CREATE EVENT].)\n\nAny user can alter an event defined on a database for which that user\nhas the EVENT privilege. When a user executes a successful ALTER EVENT\nstatement, that user becomes the definer for the affected event.\n\nALTER EVENT works only with an existing event:\n\nmysql> ALTER EVENT no_such_event \n     >     ON SCHEDULE \n     >       EVERY \'2:3\' DAY_HOUR;\nERROR 1517 (HY000): Unknown event \'no_such_event\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-event.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-event.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (493,32,'DATE_SUB','Syntax:\nDATE_SUB(date,INTERVAL expr unit)\n\nSee the description for DATE_ADD().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (494,19,'|','Syntax:\n|\n\nBitwise OR:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 29 | 15;\n        -> 31\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (495,7,'ASYMMETRIC_SIGN','Syntax:\nASYMMETRIC_SIGN(algorithm, digest_str, priv_key_str, digest_type)\n\nSigns a digest string using a private key string, and returns the\nsignature as a binary string. If signing fails, the result is NULL.\n\ndigest_str is the digest string. It can be generated by calling\nCREATE_DIGEST(). digest_type indicates the digest algorithm used to\ngenerate the digest string.\n\npriv_key_str is the private key string to use for signing the digest\nstring. It must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\'\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nFor a usage example, see the description of ASYMMETRIC_VERIFY().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (496,4,'GEOMFROMTEXT','GeomFromText(wkt[,srid]), GeometryFromText(wkt[,srid])\n\nConstructs a geometry value of any type using its WKT representation\nand SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (497,14,'UUID_SHORT','Syntax:\nUUID_SHORT()\n\nReturns a "short" universal identifier as a 64-bit unsigned integer\n(rather than a string-form 128-bit identifier as returned by the UUID()\nfunction).\n\nThe value of UUID_SHORT() is guaranteed to be unique if the following\nconditions hold:\n\no The server_id of the current host is unique among your set of master\n  and slave servers\n\no server_id is between 0 and 255\n\no You do not set back your system time for your server between mysqld\n  restarts\n\no You do not invoke UUID_SHORT() on average more than 16 million times\n  per second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n  (server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID_SHORT();\n        -> 92395783831158784\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (498,32,'DATEDIFF','Syntax:\nDATEDIFF(expr1,expr2)\n\nDATEDIFF() returns expr1 - expr2 expressed as a value in days from one\ndate to the other. expr1 and expr2 are date or date-and-time\nexpressions. Only the date parts of the values are used in the\ncalculation.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n        -> 1\nmysql> SELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n        -> -31\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (499,40,'DROP PROCEDURE','Syntax:\nDROP {PROCEDURE | FUNCTION} [IF EXISTS] sp_name\n\nThis statement is used to drop a stored procedure or function. That is,\nthe specified routine is removed from the server. You must have the\nALTER ROUTINE privilege for the routine. (If the\nautomatic_sp_privileges system variable is enabled, that privilege and\nEXECUTE are granted automatically to the routine creator when the\nroutine is created and dropped from the creator when the routine is\ndropped. See\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-routines-privileges.html.\n)\n\nThe IF EXISTS clause is a MySQL extension. It prevents an error from\noccurring if the procedure or function does not exist. A warning is\nproduced that can be viewed with SHOW WARNINGS.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-procedure.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (500,5,'INSTALL PLUGIN','Syntax:\nINSTALL PLUGIN plugin_name SONAME \'shared_library_name\'\n\nThis statement installs a server plugin. It requires the INSERT\nprivilege for the mysql.plugin table.\n\nplugin_name is the name of the plugin as defined in the plugin\ndescriptor structure contained in the library file (see\nhttp://dev.mysql.com/doc/refman/5.6/en/plugin-data-structures.html).\nPlugin names are not case sensitive. For maximal compatibility, plugin\nnames should be limited to ASCII letters, digits, and underscore\nbecause they are used in C source files, shell command lines, M4 and\nBourne shell scripts, and SQL environments.\n\nshared_library_name is the name of the shared library that contains the\nplugin code. The name includes the file name extension (for example,\nlibmyplugin.so, libmyplugin.dll, or libmyplugin.dylib).\n\nThe shared library must be located in the plugin directory (the\ndirectory named by the plugin_dir system variable). The library must be\nin the plugin directory itself, not in a subdirectory. By default,\nplugin_dir is the plugin directory under the directory named by the\npkglibdir configuration variable, but it can be changed by setting the\nvalue of plugin_dir at server startup. For example, set its value in a\nmy.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\n\nIf the value of plugin_dir is a relative path name, it is taken to be\nrelative to the MySQL base directory (the value of the basedir system\nvariable).\n\nINSTALL PLUGIN loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its\ninitialization function, which handles any setup that the plugin must\nperform before it can be used. When the server shuts down, it executes\nthe deinitialization function for each plugin that is loaded so that\nthe plugin has a chance to perform any final cleanup.\n\nINSTALL PLUGIN also registers the plugin by adding a line that\nindicates the plugin name and library file name to the mysql.plugin\ntable. At server startup, the server loads and initializes any plugin\nthat is listed in the mysql.plugin table. This means that a plugin is\ninstalled with INSTALL PLUGIN only once, not every time the server\nstarts. Plugin loading at startup does not occur if the server is\nstarted with the --skip-grant-tables option.\n\nA plugin library can contain multiple plugins. For each of them to be\ninstalled, use a separate INSTALL PLUGIN statement. Each statement\nnames a different plugin, but all of them specify the same library\nname.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/install-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/install-plugin.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (501,28,'LOAD DATA','Syntax:\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n    [REPLACE | IGNORE]\n    INTO TABLE tbl_name\n    [PARTITION (partition_name,...)]\n    [CHARACTER SET charset_name]\n    [{FIELDS | COLUMNS}\n        [TERMINATED BY \'string\']\n        [[OPTIONALLY] ENCLOSED BY \'char\']\n        [ESCAPED BY \'char\']\n    ]\n    [LINES\n        [STARTING BY \'string\']\n        [TERMINATED BY \'string\']\n    ]\n    [IGNORE number {LINES | ROWS}]\n    [(col_name_or_user_var,...)]\n    [SET col_name = expr,...]\n\nThe LOAD DATA INFILE statement reads rows from a text file into a table\nat a very high speed. LOAD DATA INFILE is the complement of SELECT ...\nINTO OUTFILE. (See\nhttp://dev.mysql.com/doc/refman/5.6/en/select-into.html.) To write data\nfrom a table to a file, use SELECT ... INTO OUTFILE. To read the file\nback into a table, use LOAD DATA INFILE. The syntax of the FIELDS and\nLINES clauses is the same for both statements. Both clauses are\noptional, but FIELDS must precede LINES if both are specified.\n\nYou can also load data files by using the mysqlimport utility; it\noperates by sending a LOAD DATA INFILE statement to the server. The\n--local option causes mysqlimport to read data files from the client\nhost. You can specify the --compress option to get better performance\nover slow networks if the client and server support the compressed\nprotocol. See http://dev.mysql.com/doc/refman/5.6/en/mysqlimport.html.\n\nFor more information about the efficiency of INSERT versus LOAD DATA\nINFILE and speeding up LOAD DATA INFILE, see\nhttp://dev.mysql.com/doc/refman/5.6/en/insert-speed.html.\n\nThe file name must be given as a literal string. On Windows, specify\nbackslashes in path names as forward slashes or doubled backslashes.\nThe character_set_filesystem system variable controls the\ninterpretation of the file name.\n\nIn MySQL 5.6.2 and later, LOAD DATA supports explicit partition\nselection using the PARTITION option with a comma-separated list of\nmore or more names of partitions, subpartitions, or both. When this\noption is used, if any rows from the file cannot be inserted into any\nof the partitions or subpartitions named in the list, the statement\nfails with the error Found a row not matching the given partition set.\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html.\n\nFor partitioned tables using storage engines that employ table locks,\nsuch as MyISAM, LOAD DATA cannot prune any partition locks. This does\nnot apply to tables using storage engines which employ row-level\nlocking, such as InnoDB. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-limitations-locking\n.html.\n\nThe server uses the character set indicated by the\ncharacter_set_database system variable to interpret the information in\nthe file. SET NAMES and the setting of character_set_client do not\naffect interpretation of input. If the contents of the input file use a\ncharacter set that differs from the default, it is usually preferable\nto specify the character set of the file by using the CHARACTER SET\nclause. A character set of binary specifies "no conversion."\n\nLOAD DATA INFILE interprets all fields in the file as having the same\ncharacter set, regardless of the data types of the columns into which\nfield values are loaded. For proper interpretation of file contents,\nyou must ensure that it was written with the correct character set. For\nexample, if you write a data file with mysqldump -T or by issuing a\nSELECT ... INTO OUTFILE statement in mysql, be sure to use a\n--default-character-set option so that output is written in the\ncharacter set to be used when the file is loaded with LOAD DATA INFILE.\n\n*Note*: It is not possible to load data files that use the ucs2, utf16,\nutf16le, or utf32 character set.\n\nIf you use LOW_PRIORITY, execution of the LOAD DATA statement is\ndelayed until no other clients are reading from the table. This affects\nonly storage engines that use only table-level locking (such as MyISAM,\nMEMORY, and MERGE).\n\nIf you specify CONCURRENT with a MyISAM table that satisfies the\ncondition for concurrent inserts (that is, it contains no free blocks\nin the middle), other threads can retrieve data from the table while\nLOAD DATA is executing. This option affects the performance of LOAD\nDATA a bit, even if no other thread is using the table at the same\ntime.\n\nWith row-based replication, CONCURRENT is replicated regardless of\nMySQL version. With statement-based replication CONCURRENT is not\nreplicated prior to MySQL 5.5.1 (see Bug #34628). For more information,\nsee\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-features-load-data.h\ntml.\n\nThe LOCAL keyword affects expected location of the file and error\nhandling, as described later. LOCAL works only if your server and your\nclient both have been configured to permit it. For example, if mysqld\nwas started with --local-infile=0, LOCAL does not work. See\nhttp://dev.mysql.com/doc/refman/5.6/en/load-data-local.html.\n\nThe LOCAL keyword affects where the file is expected to be found:\n\no If LOCAL is specified, the file is read by the client program on the\n  client host and sent to the server. The file can be given as a full\n  path name to specify its exact location. If given as a relative path\n  name, the name is interpreted relative to the directory in which the\n  client program was started.\n\n  When using LOCAL with LOAD DATA, a copy of the file is created in the\n  server\'s temporary directory. This is not the directory determined by\n  the value of tmpdir or slave_load_tmpdir, but rather the operating\n  system\'s temporary directory, and is not configurable in the MySQL\n  Server. (Typically the system temporary directory is /tmp on Linux\n  systems and C:\\WINDOWS\\TEMP on Windows.) Lack of sufficient space for\n  the copy in this directory can cause the LOAD DATA LOCAL statement to\n  fail.\n\no If LOCAL is not specified, the file must be located on the server\n  host and is read directly by the server. The server uses the\n  following rules to locate the file:\n\n  o If the file name is an absolute path name, the server uses it as\n    given.\n\n  o If the file name is a relative path name with one or more leading\n    components, the server searches for the file relative to the\n    server\'s data directory.\n\n  o If a file name with no leading components is given, the server\n    looks for the file in the database directory of the default\n    database.\n\nIn the non-LOCAL case, these rules mean that a file named as\n./myfile.txt is read from the server\'s data directory, whereas the file\nnamed as myfile.txt is read from the database directory of the default\ndatabase. For example, if db1 is the default database, the following\nLOAD DATA statement reads the file data.txt from the database directory\nfor db1, even though the statement explicitly loads the file into a\ntable in the db2 database:\n\nLOAD DATA INFILE \'data.txt\' INTO TABLE db2.my_table;\n\nFor security reasons, when reading text files located on the server,\nthe files must either reside in the database directory or be readable\nby all. Also, to use LOAD DATA INFILE on server files, you must have\nthe FILE privilege. See\nhttp://dev.mysql.com/doc/refman/5.6/en/privileges-provided.html. For\nnon-LOCAL load operations, if the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nUsing LOCAL is a bit slower than letting the server access the files\ndirectly, because the contents of the file must be sent over the\nconnection by the client to the server. On the other hand, you do not\nneed the FILE privilege to load local files.\n\nLOCAL also affects error handling:\n\no With LOAD DATA INFILE, data-interpretation and duplicate-key errors\n  terminate the operation.\n\no With LOAD DATA LOCAL INFILE, data-interpretation and duplicate-key\n  errors become warnings and the operation continues because the server\n  has no way to stop transmission of the file in the middle of the\n  operation. For duplicate-key errors, this is the same as if IGNORE is\n  specified. IGNORE is explained further later in this section.\n\nThe REPLACE and IGNORE keywords control handling of input rows that\nduplicate existing rows on unique key values:\n\no If you specify REPLACE, input rows replace existing rows. In other\n  words, rows that have the same value for a primary key or unique\n  index as an existing row. See [HELP REPLACE].\n\no If you specify IGNORE, rows that duplicate an existing row on a\n  unique key value are discarded.\n\no If you do not specify either option, the behavior depends on whether\n  the LOCAL keyword is specified. Without LOCAL, an error occurs when a\n  duplicate key value is found, and the rest of the text file is\n  ignored. With LOCAL, the default behavior is the same as if IGNORE is\n  specified; this is because the server has no way to stop transmission\n  of the file in the middle of the operation.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/load-data.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/load-data.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (502,24,'DECLARE CURSOR','Syntax:\nDECLARE cursor_name CURSOR FOR select_statement\n\nThis statement declares a cursor and associates it with a SELECT\nstatement that retrieves the rows to be traversed by the cursor. To\nfetch the rows later, use a FETCH statement. The number of columns\nretrieved by the SELECT statement must match the number of output\nvariables specified in the FETCH statement.\n\nThe SELECT statement cannot have an INTO clause.\n\nCursor declarations must appear before handler declarations and after\nvariable and condition declarations.\n\nA stored program may contain multiple cursor declarations, but each\ncursor declared in a given block must have a unique name. For an\nexample, see http://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nFor information available through SHOW statements, it is possible in\nmany cases to obtain equivalent information by using a cursor with an\nINFORMATION_SCHEMA table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-cursor.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/declare-cursor.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (503,32,'LOCALTIME','Syntax:\nLOCALTIME, LOCALTIME([fsp])\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (504,12,'SHA1','Syntax:\nSHA1(str), SHA(str)\n\nCalculates an SHA-1 160-bit checksum for the string, as described in\nRFC 3174 (Secure Hash Algorithm). The value is returned as a string of\n40 hex digits, or NULL if the argument was NULL. One of the possible\nuses for this function is as a hash key. See the notes at the beginning\nof this section about storing hash values efficiently. You can also use\nSHA1() as a cryptographic function for storing passwords. SHA() is\nsynonymous with SHA1().\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT SHA1(\'abc\');\n        -> \'a9993e364706816aba3e25717850c26c9cd0d89d\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (505,23,'BLOB','BLOB[(M)]\n\nA BLOB column with a maximum length of 65,535 (216 - 1) bytes. Each\nBLOB value is stored using a 2-byte length prefix that indicates the\nnumber of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest BLOB type large enough to hold\nvalues M bytes long.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (506,12,'PASSWORD','Syntax:\nPASSWORD(str)\n\nReturns a hashed password string calculated from the cleartext password\nstr. The return value is a nonbinary string in the connection character\nset, or NULL if the argument is NULL. This function is the SQL\ninterface to the algorithm used by the server to encrypt MySQL\npasswords for storage in the mysql.user grant table.\n\nThe old_passwords system variable controls the password hashing method\nused by the PASSWORD() function. It also influences password hashing\nperformed by CREATE USER and GRANT statements that specify a password\nusing an IDENTIFIED BY clause.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SET old_passwords = 0;\nmysql> SELECT PASSWORD(\'mypass\'), OLD_PASSWORD(\'mypass\');\n+-------------------------------------------+------------------------+\n| PASSWORD(\'mypass\')                        | OLD_PASSWORD(\'mypass\') |\n+-------------------------------------------+------------------------+\n| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 | 6f8c114b58f2ce9e       |\n+-------------------------------------------+------------------------+\n\nmysql> SET old_passwords = 1;\nmysql> SELECT PASSWORD(\'mypass\'), OLD_PASSWORD(\'mypass\');\n+--------------------+------------------------+\n| PASSWORD(\'mypass\') | OLD_PASSWORD(\'mypass\') |\n+--------------------+------------------------+\n| 6f8c114b58f2ce9e   | 6f8c114b58f2ce9e       |\n+--------------------+------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (507,32,'UTC_DATE','Syntax:\nUTC_DATE, UTC_DATE()\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or\nnumeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_DATE(), UTC_DATE() + 0;\n        -> \'2003-08-14\', 20030814\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (508,37,'DIMENSION','Dimension(g)\n\nReturns the inherent dimension of the geometry value g. The result can\nbe -1, 0, 1, or 2. The meaning of these values is given in\nhttp://dev.mysql.com/doc/refman/5.6/en/gis-class-geometry.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','mysql> SELECT Dimension(GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------+\n| Dimension(GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------+\n|                                              1 |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (509,23,'BIT','BIT[(M)]\n\nA bit-field type. M indicates the number of bits per value, from 1 to\n64. The default is 1 if M is omitted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (510,31,'EQUALS','Equals(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (511,8,'XA','Syntax:\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER\n\nFor XA START, the JOIN and RESUME clauses are not supported.\n\nFor XA END the SUSPEND [FOR MIGRATE] clause is not supported.\n\nEach XA statement begins with the XA keyword, and most of them require\nan xid value. An xid is an XA transaction identifier. It indicates\nwhich transaction the statement applies to. xid values are supplied by\nthe client, or generated by the MySQL server. An xid value has from one\nto three parts:\n\nxid: gtrid [, bqual [, formatID ]]\n\ngtrid is a global transaction identifier, bqual is a branch qualifier,\nand formatID is a number that identifies the format used by the gtrid\nand bqual values. As indicated by the syntax, bqual and formatID are\noptional. The default bqual value is \'\' if not given. The default\nformatID value is 1 if not given.\n\ngtrid and bqual must be string literals, each up to 64 bytes (not\ncharacters) long. gtrid and bqual can be specified in several ways. You\ncan use a quoted string (\'ab\'), hex string (0x6162, X\'ab\'), or bit\nvalue (b\'nnnn\').\n\nformatID is an unsigned integer.\n\nThe gtrid and bqual values are interpreted in bytes by the MySQL\nserver\'s underlying XA support routines. However, while an SQL\nstatement containing an XA statement is being parsed, the server works\nwith some specific character set. To be safe, write gtrid and bqual as\nhex strings.\n\nxid values typically are generated by the Transaction Manager. Values\ngenerated by one TM must be different from values generated by other\nTMs. A given TM must be able to recognize its own xid values in a list\nof values returned by the XA RECOVER statement.\n\nFor XA START xid starts an XA transaction with the given xid value.\nEach XA transaction must have a unique xid value, so the value must not\ncurrently be used by another XA transaction. Uniqueness is assessed\nusing the gtrid and bqual values. All following XA statements for the\nXA transaction must be specified using the same xid value as that given\nin the XA START statement. If you use any of those statements but\nspecify an xid value that does not correspond to some existing XA\ntransaction, an error occurs.\n\nOne or more XA transactions can be part of the same global transaction.\nAll XA transactions within a given global transaction must use the same\ngtrid value in the xid value. For this reason, gtrid values must be\nglobally unique so that there is no ambiguity about which global\ntransaction a given XA transaction is part of. The bqual part of the\nxid value must be different for each XA transaction within a global\ntransaction. (The requirement that bqual values be different is a\nlimitation of the current MySQL XA implementation. It is not part of\nthe XA specification.)\n\nThe XA RECOVER statement returns information for those XA transactions\non the MySQL server that are in the PREPARED state. (See\nhttp://dev.mysql.com/doc/refman/5.6/en/xa-states.html.) The output\nincludes a row for each such XA transaction on the server, regardless\nof which client started it.\n\nXA RECOVER output rows look like this (for an example xid value\nconsisting of the parts \'abc\', \'def\', and 7):\n\nmysql> XA RECOVER;\n+----------+--------------+--------------+--------+\n| formatID | gtrid_length | bqual_length | data   |\n+----------+--------------+--------------+--------+\n|        7 |            3 |            3 | abcdef |\n+----------+--------------+--------------+--------+\n\nThe output columns have the following meanings:\n\no formatID is the formatID part of the transaction xid\n\no gtrid_length is the length in bytes of the gtrid part of the xid\n\no bqual_length is the length in bytes of the bqual part of the xid\n\no data is the concatenation of the gtrid and bqual parts of the xid\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (512,2,'CENTROID','Centroid(mpoly)\n\nST_Centroid() and Centroid() are synonyms. For more information, see\nthe description of ST_Centroid().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-multipolygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-multipolygon-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (513,38,'OCTET_LENGTH','Syntax:\nOCTET_LENGTH(str)\n\nOCTET_LENGTH() is a synonym for LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (514,32,'UTC_TIMESTAMP','Syntax:\nUTC_TIMESTAMP, UTC_TIMESTAMP([fsp])\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether the function\nis used in a string or numeric context.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n        -> \'2003-08-14 18:08:04\', 20030814180804.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (515,12,'AES_ENCRYPT','Syntax:\nAES_ENCRYPT(str,key_str[,init_vector])\n\nAES_ENCRYPT() and AES_DECRYPT() implement encryption and decryption of\ndata using the official AES (Advanced Encryption Standard) algorithm,\npreviously known as "Rijndael." The AES standard permits various key\nlengths. By default these functions implement AES with a 128-bit key\nlength. As of MySQL 5.6.17, key lengths of 196 or 256 bits can be used,\nas described later. The key length is a trade off between performance\nand security.\n\nAES_ENCRYPT() encrypts the string str using the key string key_str and\nreturns a binary string containing the encrypted output. AES_DECRYPT()\ndecrypts the encrypted string crypt_str using the key string key_str\nand returns the original plaintext string. If either function argument\nis NULL, the function returns NULL.\n\nThe str and crypt_str arguments can be any length, and padding is\nautomatically added to str so it is a multiple of a block as required\nby block-based algorithms such as AES. This padding is automatically\nremoved by the AES_DECRYPT() function. The length of crypt_str can be\ncalculated using this formula:\n\n16 * (trunc(string_length / 16) + 1)\n\nFor a key length of 128 bits, the most secure way to pass a key to the\nkey_str argument is to create a truly random 128-bit value and pass it\nas a binary value. For example:\n\nINSERT INTO t\nVALUES (1,AES_ENCRYPT(\'text\',UNHEX(\'F3229A0B371ED2D9441B830D21A390C3\')));\n\nA passphrase can be used to generate an AES key by hashing the\npassphrase. For example:\n\nINSERT INTO t VALUES (1,AES_ENCRYPT(\'text\', SHA2(\'My secret passphrase\',512)));\n\nDo not pass a password or passphrase directly to crypt_str, hash it\nfirst. Previous versions of this documentation suggested the former\napproach, but it is no longer recommended as the examples shown here\nare more secure.\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns\nNULL. However, it is possible for AES_DECRYPT() to return a non-NULL\nvalue (possibly garbage) if the input data or the key is invalid.\n\nAs of MySQL 5.6.17, AES_ENCRYPT() and AES_DECRYPT() permit control of\nthe block encryption mode and take an optional init_vector\ninitialization vector argument:\n\no The block_encryption_mode system variable controls the mode for\n  block-based encryption algorithms. Its default value is aes-128-ecb,\n  which signifies encryption using a key length of 128 bits and ECB\n  mode. For a description of the permitted values of this variable, see\n  http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\no The optional init_vector argument provides an initialization vector\n  for block encryption modes that require it.\n\nFor modes that require the optional init_vector argument, it must be 16\nbytes or longer (bytes in excess of 16 are ignored). An error occurs if\ninit_vector is missing.\n\nFor modes that do not require init_vector, it is ignored and a warning\nis generated if it is specified.\n\nA random string of bytes to use for the initialization vector can be\nproduced by calling RANDOM_BYTES(16). For encryption modes that require\nan initialization vector, the same vector must be used for encryption\nand decryption.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SET block_encryption_mode = \'aes-256-cbc\';\nmysql> SET @key_str = SHA2(\'My secret passphrase\',512);\nmysql> SET @init_vector = RANDOM_BYTES(16);\nmysql> SET @crypt_str = AES_ENCRYPT(\'text\',@key_str,@init_vector);\nmysql> SELECT AES_DECRYPT(@crypt_str,@key_str,@init_vector);\n+-----------------------------------------------+\n| AES_DECRYPT(@crypt_str,@key_str,@init_vector) |\n+-----------------------------------------------+\n| text                                          |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (516,3,'+','Syntax:\n+\n\nAddition:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3+5;\n        -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (517,7,'GTID_SUBTRACT','Syntax:\nGTID_SUBTRACT(set,subset)\n\nGiven two sets of global transaction IDs subset and set, returns only\nthose GTIDs from set that are not in subset.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','mysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\', \n    ->     \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\', \n    \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:22-57\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\', \n    ->     \'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\', \n    \'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:26-57\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\', \n    ->     \'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\', \n    \'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:21-22:25-57\n1 row in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (518,14,'INET_NTOA','Syntax:\nINET_NTOA(expr)\n\nGiven a numeric IPv4 network address in network byte order, returns the\ndotted-quad string representation of the address as a nonbinary string\nin the connection character set. INET_NTOA() returns NULL if it does\nnot understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_NTOA(167773449);\n        -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (519,32,'DAYOFWEEK','Syntax:\nDAYOFWEEK(date)\n\nReturns the weekday index for date (1 = Sunday, 2 = Monday, ..., 7 =\nSaturday). These index values correspond to the ODBC standard.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFWEEK(\'2007-02-03\');\n        -> 7\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (520,3,'CEILING','Syntax:\nCEILING(X)\n\nReturns the smallest integer value not less than X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT CEILING(1.23);\n        -> 2\nmysql> SELECT CEILING(-1.23);\n        -> -1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (521,27,'SHOW PROCESSLIST','Syntax:\nSHOW [FULL] PROCESSLIST\n\nSHOW PROCESSLIST shows you which threads are running. You can also get\nthis information from the INFORMATION_SCHEMA PROCESSLIST table or the\nmysqladmin processlist command. If you have the PROCESS privilege, you\ncan see all threads. Otherwise, you can see only your own threads (that\nis, threads associated with the MySQL account that you are using). If\nyou do not use the FULL keyword, only the first 100 characters of each\nstatement are shown in the Info field.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-processlist.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-processlist.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (522,33,'LINEFROMWKB','LineFromWKB(wkb[,srid]), LineStringFromWKB(wkb[,srid])\n\nConstructs a LineString value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (523,37,'GEOMETRYTYPE','GeometryType(g)\n\nReturns a binary string indicating the name of the geometry type of\nwhich the geometry instance g is a member. The name corresponds to one\nof the instantiable Geometry subclasses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','mysql> SELECT GeometryType(GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------+\n| GeometryType(GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------+\n| POINT                                    |\n+------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (524,40,'CREATE VIEW','Syntax:\nCREATE\n    [OR REPLACE]\n    [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n    [DEFINER = { user | CURRENT_USER }]\n    [SQL SECURITY { DEFINER | INVOKER }]\n    VIEW view_name [(column_list)]\n    AS select_statement\n    [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThe CREATE VIEW statement creates a new view, or replaces an existing\none if the OR REPLACE clause is given. If the view does not exist,\nCREATE OR REPLACE VIEW is the same as CREATE VIEW. If the view does\nexist, CREATE OR REPLACE VIEW is the same as ALTER VIEW.\n\nThe select_statement is a SELECT statement that provides the definition\nof the view. (When you select from the view, you select in effect using\nthe SELECT statement.) select_statement can select from base tables or\nother views.\n\nThe view definition is "frozen" at creation time, so changes to the\nunderlying tables afterward do not affect the view definition. For\nexample, if a view is defined as SELECT * on a table, new columns added\nto the table later do not become part of the view.\n\nThe ALGORITHM clause affects how MySQL processes the view. The DEFINER\nand SQL SECURITY clauses specify the security context to be used when\nchecking access privileges at view invocation time. The WITH CHECK\nOPTION clause can be given to constrain inserts or updates to rows in\ntables referenced by the view. These clauses are described later in\nthis section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the\nview, and some privilege for each column selected by the SELECT\nstatement. For columns used elsewhere in the SELECT statement you must\nhave the SELECT privilege. If the OR REPLACE clause is present, you\nmust also have the DROP privilege for the view. CREATE VIEW might also\nrequire the SUPER privilege, depending on the DEFINER value, as\ndescribed later in this section.\n\nWhen a view is referenced, privilege checking occurs as described later\nin this section.\n\nA view belongs to a database. By default, a new view is created in the\ndefault database. To create the view explicitly in a given database,\nspecify the name as db_name.view_name when you create it:\n\nmysql> CREATE VIEW test.v AS SELECT * FROM t;\n\nWithin a database, base tables and views share the same namespace, so a\nbase table and a view cannot have the same name.\n\nColumns retrieved by the SELECT statement can be simple references to\ntable columns. They can also be expressions that use functions,\nconstant values, operators, and so forth.\n\nViews must have unique column names with no duplicates, just like base\ntables. By default, the names of the columns retrieved by the SELECT\nstatement are used for the view column names. To define explicit names\nfor the view columns, the optional column_list clause can be given as a\nlist of comma-separated identifiers. The number of names in column_list\nmust be the same as the number of columns retrieved by the SELECT\nstatement.\n\nUnqualified table or view names in the SELECT statement are interpreted\nwith respect to the default database. A view can refer to tables or\nviews in other databases by qualifying the table or view name with the\nproper database name.\n\nA view can be created from many kinds of SELECT statements. It can\nrefer to base tables or other views. It can use joins, UNION, and\nsubqueries. The SELECT need not even refer to any tables. The following\nexample defines a view that selects two columns from another table, as\nwell as an expression calculated from those columns:\n\nmysql> CREATE TABLE t (qty INT, price INT);\nmysql> INSERT INTO t VALUES(3, 50);\nmysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\nmysql> SELECT * FROM v;\n+------+-------+-------+\n| qty  | price | value |\n+------+-------+-------+\n|    3 |    50 |   150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\no The SELECT statement cannot contain a subquery in the FROM clause.\n\no The SELECT statement cannot refer to system or user variables.\n\no Within a stored program, the definition cannot refer to program\n  parameters or local variables.\n\no The SELECT statement cannot refer to prepared statement parameters.\n\no Any table or view referred to in the definition must exist. However,\n  after a view has been created, it is possible to drop a table or view\n  that the definition refers to. In this case, use of the view results\n  in an error. To check a view definition for problems of this kind,\n  use the CHECK TABLE statement.\n\no The definition cannot refer to a TEMPORARY table, and you cannot\n  create a TEMPORARY view.\n\no Any tables named in the view definition must exist at definition\n  time.\n\no You cannot associate a trigger with a view.\n\no Aliases for column names in the SELECT statement are checked against\n  the maximum column length of 64 characters (not the maximum alias\n  length of 256 characters).\n\nORDER BY is permitted in a view definition, but it is ignored if you\nselect from a view using a statement that has its own ORDER BY.\n\nFor other options or clauses in the definition, they are added to the\noptions or clauses of the statement that references the view, but the\neffect is undefined. For example, if a view definition includes a LIMIT\nclause, and you select from the view using a statement that has its own\nLIMIT clause, it is undefined which limit applies. This same principle\napplies to options such as ALL, DISTINCT, or SQL_SMALL_RESULT that\nfollow the SELECT keyword, and to clauses such as INTO, FOR UPDATE,\nLOCK IN SHARE MODE, and PROCEDURE.\n\nIf you create a view and then change the query processing environment\nby changing system variables, that may affect the results that you get\nfrom the view:\n\nmysql> CREATE VIEW v (mycol) AS SELECT \'abc\';\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SET sql_mode = \'\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol |\n+-------+\n1 row in set (0.01 sec)\n\nmysql> SET sql_mode = \'ANSI_QUOTES\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc   |\n+-------+\n1 row in set (0.00 sec)\n\nThe DEFINER and SQL SECURITY clauses determine which MySQL account to\nuse when checking access privileges for the view when a statement is\nexecuted that references the view. The valid SQL SECURITY\ncharacteristic values are DEFINER and INVOKER. These indicate that the\nrequired privileges must be held by the user who defined or invoked the\nview, respectively. The default SQL SECURITY value is DEFINER.\n\nIf a user value is given for the DEFINER clause, it should be a MySQL\naccount specified as \'user_name\'@\'host_name\' (the same format used in\nthe GRANT statement), CURRENT_USER, or CURRENT_USER(). The default\nDEFINER value is the user who executes the CREATE VIEW statement. This\nis the same as specifying DEFINER = CURRENT_USER explicitly.\n\nIf you specify the DEFINER clause, these rules determine the valid\nDEFINER user values:\n\no If you do not have the SUPER privilege, the only valid user value is\n  your own account, either specified literally or by using\n  CURRENT_USER. You cannot set the definer to some other account.\n\no If you have the SUPER privilege, you can specify any syntactically\n  valid account name. If the account does not actually exist, a warning\n  is generated.\n\no Although it is possible to create a view with a nonexistent DEFINER\n  account, an error occurs when the view is referenced if the SQL\n  SECURITY value is DEFINER but the definer account does not exist.\n\nFor more information about view security, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-security.html.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value\nby default. For views defined with the SQL SECURITY INVOKER\ncharacteristic, CURRENT_USER returns the account for the view\'s\ninvoker. For information about user auditing within views, see\nhttp://dev.mysql.com/doc/refman/5.6/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This\nalso affects a view defined within such a routine, if the view\ndefinition contains a DEFINER value of CURRENT_USER.\n\nView privileges are checked like this:\n\no At view definition time, the view creator must have the privileges\n  needed to use the top-level objects accessed by the view. For\n  example, if the view definition refers to table columns, the creator\n  must have some privilege for each column in the select list of the\n  definition, and the SELECT privilege for each column used elsewhere\n  in the definition. If the definition refers to a stored function,\n  only the privileges needed to invoke the function can be checked. The\n  privileges required at function invocation time can be checked only\n  as it executes: For different invocations, different execution paths\n  within the function might be taken.\n\no The user who references a view must have appropriate privileges to\n  access it (SELECT to select from it, INSERT to insert into it, and so\n  forth.)\n\no When a view has been referenced, privileges for objects accessed by\n  the view are checked against the privileges held by the view DEFINER\n  account or invoker, depending on whether the SQL SECURITY\n  characteristic is DEFINER or INVOKER, respectively.\n\no If reference to a view causes execution of a stored function,\n  privilege checking for statements executed within the function depend\n  on whether the function SQL SECURITY characteristic is DEFINER or\n  INVOKER. If the security characteristic is DEFINER, the function runs\n  with the privileges of the DEFINER account. If the characteristic is\n  INVOKER, the function runs with the privileges determined by the\n  view\'s SQL SECURITY characteristic.\n\nExample: A view might depend on a stored function, and that function\nmight invoke other stored routines. For example, the following view\ninvokes a stored function f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n  CALL p1();\nELSE\n  CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be\nchecked when f() executes. This might mean that privileges are needed\nfor p1() or p2(), depending on the execution path within f(). Those\nprivileges must be checked at runtime, and the user who must possess\nthe privileges is determined by the SQL SECURITY values of the view v\nand the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to\nstandard SQL. In standard SQL, views are handled using the rules for\nSQL SECURITY DEFINER. The standard says that the definer of the view,\nwhich is the same as the owner of the view\'s schema, gets applicable\nprivileges on the view (for example, SELECT) and may grant them. MySQL\nhas no concept of a schema "owner", so MySQL adds a clause to identify\nthe definer. The DEFINER clause is an extension where the intent is to\nhave what the standard has; that is, a permanent record of who defined\nthe view. This is why the default DEFINER value is the account of the\nview creator.\n\nThe optional ALGORITHM clause is a MySQL extension to standard SQL. It\naffects how MySQL processes the view. ALGORITHM takes three values:\nMERGE, TEMPTABLE, or UNDEFINED. The default algorithm is UNDEFINED if\nno ALGORITHM clause is present. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/view-algorithms.html.\n\nSome views are updatable. That is, you can use them in statements such\nas UPDATE, DELETE, or INSERT to update the contents of the underlying\ntable. For a view to be updatable, there must be a one-to-one\nrelationship between the rows in the view and the rows in the\nunderlying table. There are also certain other constructs that make a\nview nonupdatable.\n\nThe WITH CHECK OPTION clause can be given for an updatable view to\nprevent inserts or updates to rows except those for which the WHERE\nclause in the select_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and\nCASCADED keywords determine the scope of check testing when the view is\ndefined in terms of another view. The LOCAL keyword restricts the CHECK\nOPTION only to the view being defined. CASCADED causes the checks for\nunderlying views to be evaluated as well. When neither keyword is\ngiven, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION\nclause, see\nhttp://dev.mysql.com/doc/refman/5.6/en/view-updatability.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-view.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (525,38,'TRIM','Syntax:\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nReturns the string str with all remstr prefixes or suffixes removed. If\nnone of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is\nassumed. remstr is optional and, if not specified, spaces are removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT TRIM(\'  bar   \');\n        -> \'bar\'\nmysql> SELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\');\n        -> \'barxxx\'\nmysql> SELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\');\n        -> \'bar\'\nmysql> SELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\');\n        -> \'barx\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (526,14,'INET6_NTOA','Syntax:\nINET6_NTOA(expr)\n\nGiven an IPv6 or IPv4 network address represented in numeric form as a\nbinary string, returns the string representation of the address as a\nnonbinary string in the connection character set. If the argument is\nnot a valid address, INET6_NTOA() returns NULL.\n\nINET6_NTOA() has these properties:\n\no It does not use operating system functions to perform conversions,\n  thus the output string is platform independent.\n\no The return string has a maximum length of 39 (4 x 8 + 7). Given this\n  statement:\n\nCREATE TABLE t AS SELECT INET6_NTOA(expr) AS c1;\n\n  The resulting table would have this definition:\n\nCREATE TABLE t (c1 VARCHAR(39) CHARACTER SET utf8 DEFAULT NULL);\n\no The return string uses lowercase letters for IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET6_NTOA(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n        -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(INET6_ATON(\'10.0.5.9\'));\n        -> \'10.0.5.9\'\n\nmysql> SELECT INET6_NTOA(UNHEX(\'FDFE0000000000005A55CAFFFEFA9089\'));\n        -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(UNHEX(\'0A000509\'));\n        -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (527,24,'SIGNAL','Syntax:\nSIGNAL condition_value\n    [SET signal_information_item\n    [, signal_information_item] ...]\n\ncondition_value:\n    SQLSTATE [VALUE] sqlstate_value\n  | condition_name\n\nsignal_information_item:\n    condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n    CLASS_ORIGIN\n  | SUBCLASS_ORIGIN\n  | MESSAGE_TEXT\n  | MYSQL_ERRNO\n  | CONSTRAINT_CATALOG\n  | CONSTRAINT_SCHEMA\n  | CONSTRAINT_NAME\n  | CATALOG_NAME\n  | SCHEMA_NAME\n  | TABLE_NAME\n  | COLUMN_NAME\n  | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n    (see following discussion)\n\nSIGNAL is the way to "return" an error. SIGNAL provides error\ninformation to a handler, to an outer portion of the application, or to\nthe client. Also, it provides control over the error\'s characteristics\n(error number, SQLSTATE value, message). Without SIGNAL, it is\nnecessary to resort to workarounds such as deliberately referring to a\nnonexistent table to cause a routine to return an error.\n\nNo special privileges are required to execute the SIGNAL statement.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html.\n\nThe condition_value in a SIGNAL statement indicates the error value to\nbe returned. It can be an SQLSTATE value (a 5-character string literal)\nor a condition_name that refers to a named condition previously defined\nwith DECLARE ... CONDITION (see [HELP DECLARE CONDITION]).\n\nAn SQLSTATE value can indicate errors, warnings, or "not found." The\nfirst two characters of the value indicate its error class, as\ndiscussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/signal.html#signal-condition-inf\normation-items. Some signal values cause statement termination; see\nhttp://dev.mysql.com/doc/refman/5.6/en/signal.html#signal-effects.\n\nThe SQLSTATE value for a SIGNAL statement should not start with \'00\'\nbecause such values indicate success and are not valid for signaling an\nerror. This is true whether the SQLSTATE value is specified directly in\nthe SIGNAL statement or in a named condition referred to in the\nstatement. If the value is invalid, a Bad SQLSTATE error occurs.\n\nTo signal a generic SQLSTATE value, use \'45000\', which means "unhandled\nuser-defined exception."\n\nThe SIGNAL statement optionally includes a SET clause that contains\nmultiple signal items, in a comma-separated list of\ncondition_information_item_name = simple_value_specification\nassignments.\n\nEach condition_information_item_name may be specified only once in the\nSET clause. Otherwise, a Duplicate condition information item error\noccurs.\n\nValid simple_value_specification designators can be specified using\nstored procedure or function parameters, stored program local variables\ndeclared with DECLARE, user-defined variables, system variables, or\nliterals. A character literal may include a _charset introducer.\n\nFor information about permissible condition_information_item_name\nvalues, see\nhttp://dev.mysql.com/doc/refman/5.6/en/signal.html#signal-condition-inf\normation-items.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/signal.html\n\n','CREATE PROCEDURE p (pval INT)\nBEGIN\n  DECLARE specialty CONDITION FOR SQLSTATE \'45000\';\n  IF pval = 0 THEN\n    SIGNAL SQLSTATE \'01000\';\n  ELSEIF pval = 1 THEN\n    SIGNAL SQLSTATE \'45000\'\n      SET MESSAGE_TEXT = \'An error occurred\';\n  ELSEIF pval = 2 THEN\n    SIGNAL specialty\n      SET MESSAGE_TEXT = \'An error occurred\';\n  ELSE\n    SIGNAL SQLSTATE \'01000\'\n      SET MESSAGE_TEXT = \'A warning occurred\', MYSQL_ERRNO = 1000;\n    SIGNAL SQLSTATE \'45000\'\n      SET MESSAGE_TEXT = \'An error occurred\', MYSQL_ERRNO = 1001;\n  END IF;\nEND;\n','http://dev.mysql.com/doc/refman/5.6/en/signal.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (528,8,'SAVEPOINT','Syntax:\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT,\nRELEASE SAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/savepoint.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/savepoint.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (529,33,'MPOINTFROMWKB','MPointFromWKB(wkb[,srid]), MultiPointFromWKB(wkb[,srid])\n\nConstructs a MultiPoint value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (530,40,'ALTER TABLE','Syntax:\nALTER [ONLINE|OFFLINE] [IGNORE] TABLE tbl_name\n    [alter_specification [, alter_specification] ...]\n    [partition_options]\n\nalter_specification:\n    table_options\n  | ADD [COLUMN] col_name column_definition\n        [FIRST | AFTER col_name ]\n  | ADD [COLUMN] (col_name column_definition,...)\n  | ADD {INDEX|KEY} [index_name]\n        [index_type] (index_col_name,...) [index_option] ...\n  | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n        [index_type] (index_col_name,...) [index_option] ...\n  | ADD [CONSTRAINT [symbol]]\n        UNIQUE [INDEX|KEY] [index_name]\n        [index_type] (index_col_name,...) [index_option] ...\n  | ADD FULLTEXT [INDEX|KEY] [index_name]\n        (index_col_name,...) [index_option] ...\n  | ADD SPATIAL [INDEX|KEY] [index_name]\n        (index_col_name,...) [index_option] ...\n  | ADD [CONSTRAINT [symbol]]\n        FOREIGN KEY [index_name] (index_col_name,...)\n        reference_definition\n  | ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n  | ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}\n  | CHANGE [COLUMN] old_col_name new_col_name column_definition\n        [FIRST|AFTER col_name]\n  | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n  | MODIFY [COLUMN] col_name column_definition\n        [FIRST | AFTER col_name]\n  | DROP [COLUMN] col_name\n  | DROP PRIMARY KEY\n  | DROP {INDEX|KEY} index_name\n  | DROP FOREIGN KEY fk_symbol\n  | DISABLE KEYS\n  | ENABLE KEYS\n  | RENAME [TO|AS] new_tbl_name\n  | ORDER BY col_name [, col_name] ...\n  | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n  | [DEFAULT] CHARACTER SET [=] charset_name [COLLATE [=] collation_name]\n  | DISCARD TABLESPACE\n  | IMPORT TABLESPACE\n  | FORCE\n  | ADD PARTITION (partition_definition)\n  | DROP PARTITION partition_names\n  | TRUNCATE PARTITION {partition_names | ALL}\n  | COALESCE PARTITION number\n  | REORGANIZE PARTITION partition_names INTO (partition_definitions)\n  | EXCHANGE PARTITION partition_name WITH TABLE tbl_name\n  | ANALYZE PARTITION {partition_names | ALL}\n  | CHECK PARTITION {partition_names | ALL}\n  | OPTIMIZE PARTITION {partition_names | ALL}\n  | REBUILD PARTITION {partition_names | ALL}\n  | REPAIR PARTITION {partition_names | ALL}\n  | REMOVE PARTITIONING\n\nindex_col_name:\n    col_name [(length)] [ASC | DESC]\n\nindex_type:\n    USING {BTREE | HASH}\n\nindex_option:\n    KEY_BLOCK_SIZE [=] value\n  | index_type\n  | WITH PARSER parser_name\n  | COMMENT \'string\'\n\ntable_options:\n    table_option [[,] table_option] ...  (see CREATE TABLE options)\n\npartition_options:\n    (see CREATE TABLE options)\n\nALTER TABLE changes the structure of a table. For example, you can add\nor delete columns, create or destroy indexes, change the type of\nexisting columns, or rename columns or the table itself. You can also\nchange characteristics such as the storage engine used for the table or\nthe table comment.\n\nFollowing the table name, specify the alterations to be made. If none\nare given, ALTER TABLE does nothing.\n\nThe syntax for many of the permissible alterations is similar to\nclauses of the CREATE TABLE statement. See [HELP CREATE TABLE], for\nmore information.\n\ntable_options signifies table options of the kind that can be used in\nthe CREATE TABLE statement, such as ENGINE, AUTO_INCREMENT,\nAVG_ROW_LENGTH, MAX_ROWS, or ROW_FORMAT. For a list of all table\noptions and a description of each, see [HELP CREATE TABLE]. However,\nALTER TABLE ignores the DATA DIRECTORY and INDEX DIRECTORY table\noptions.\n\npartition_options signifies options that can be used with partitioned\ntables for repartitioning, for adding, dropping, merging, and splitting\npartitions, and for performing partitioning maintenance. It is possible\nfor an ALTER TABLE statement to contain a PARTITION BY or REMOVE\nPARTITIONING clause in an addition to other alter specifications, but\nthe PARTITION BY or REMOVE PARTITIONING clause must be specified last\nafter any other specifications. The ADD PARTITION, DROP PARTITION,\nCOALESCE PARTITION, REORGANIZE PARTITION, EXCHANGE PARTITION, ANALYZE\nPARTITION, CHECK PARTITION, and REPAIR PARTITION options cannot be\ncombined with other alter specifications in a single ALTER TABLE, since\nthe options just listed act on individual partitions. For more\ninformation about partition options, see [HELP CREATE TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/alter-table-partition-operations\n.html. For information about and examples of ALTER TABLE ... EXCHANGE\nPARTITION statements, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-management-range-li\nst.html.\n\nSome operations may result in warnings if attempted on a table for\nwhich the storage engine does not support the operation. These warnings\ncan be displayed with SHOW WARNINGS. See [HELP SHOW WARNINGS].\n\nFor information on troubleshooting ALTER TABLE, see\nhttp://dev.mysql.com/doc/refman/5.6/en/alter-table-problems.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (531,24,'LABELS','Syntax:\n[begin_label:] BEGIN\n    [statement_list]\nEND [end_label]\n\n[begin_label:] LOOP\n    statement_list\nEND LOOP [end_label]\n\n[begin_label:] REPEAT\n    statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\n[begin_label:] WHILE search_condition DO\n    statement_list\nEND WHILE [end_label]\n\nLabels are permitted for BEGIN ... END blocks and for the LOOP, REPEAT,\nand WHILE statements. Label use for those statements follows these\nrules:\n\no begin_label must be followed by a colon.\n\no begin_label can be given without end_label. If end_label is present,\n  it must be the same as begin_label.\n\no end_label cannot be given without begin_label.\n\no Labels at the same nesting level must be distinct.\n\no Labels can be up to 16 characters long.\n\nTo refer to a label within the labeled construct, use an ITERATE or\nLEAVE statement. The following example uses those statements to\ncontinue iterating or terminate the loop:\n\nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n  label1: LOOP\n    SET p1 = p1 + 1;\n    IF p1 < 10 THEN ITERATE label1; END IF;\n    LEAVE label1;\n  END LOOP label1;\nEND;\n\nThe scope of a block label does not include the code for handlers\ndeclared within the block. For details, see [HELP DECLARE HANDLER].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/statement-labels.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/statement-labels.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (532,23,'CHAR BYTE','The CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (533,20,'>','Syntax:\n>\n\nGreater than:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 > 2;\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (534,21,'ANALYZE TABLE','Syntax:\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n    tbl_name [, tbl_name] ...\n\nANALYZE TABLE analyzes and stores the key distribution for a table.\nDuring the analysis, the table is locked with a read lock for InnoDB\nand MyISAM. This statement works with InnoDB, NDB, and MyISAM tables.\nFor MyISAM tables, this statement is equivalent to using myisamchk\n--analyze.\n\nFor more information on how the analysis works within InnoDB, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-persistent-stats.html and\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-analyze-table-complexity.\nhtml. Also see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html. In\nparticular, when you enable the innodb_stats_persistent option, you\nmust run ANALYZE TABLE after loading substantial data into an InnoDB\ntable, or creating a new index for one.\n\nMySQL uses the stored key distribution to decide the order in which\ntables should be joined when you perform a join on something other than\na constant. In addition, key distributions can be used when deciding\nwhich indexes to use for a specific table within a query.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nANALYZE TABLE is supported for partitioned tables, and you can use\nALTER TABLE ... ANALYZE PARTITION to analyze one or more partitions;\nfor more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/analyze-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/analyze-table.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (535,38,'FIELD','Syntax:\nFIELD(str,str1,str2,str3,...)\n\nReturns the index (position) of str in the str1, str2, str3, ... list.\nReturns 0 if str is not found.\n\nIf all arguments to FIELD() are strings, all arguments are compared as\nstrings. If all arguments are numbers, they are compared as numbers.\nOtherwise, the arguments are compared as double.\n\nIf str is NULL, the return value is 0 because NULL fails equality\ncomparison with any value. FIELD() is the complement of ELT().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n        -> 2\nmysql> SELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (536,40,'CONSTRAINT','MySQL supports foreign keys, which let you cross-reference related data\nacross tables, and foreign key constraints, which help keep this\nspread-out data consistent. The essential syntax for a foreign key\nconstraint definition in a CREATE TABLE or ALTER TABLE statement looks\nlike this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n    [index_name] (index_col_name, ...)\n    REFERENCES tbl_name (index_col_name,...)\n    [ON DELETE reference_option]\n    [ON UPDATE reference_option]\n\nreference_option:\n    RESTRICT | CASCADE | SET NULL | NO ACTION\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html\n\n','CREATE TABLE product (\n    category INT NOT NULL, id INT NOT NULL,\n    price DECIMAL,\n    PRIMARY KEY(category, id)\n)   ENGINE=INNODB;\n\nCREATE TABLE customer (\n    id INT NOT NULL,\n    PRIMARY KEY (id)\n)   ENGINE=INNODB;\n\nCREATE TABLE product_order (\n    no INT NOT NULL AUTO_INCREMENT,\n    product_category INT NOT NULL,\n    product_id INT NOT NULL,\n    customer_id INT NOT NULL,\n\n    PRIMARY KEY(no),\n    INDEX (product_category, product_id),\n    INDEX (customer_id),\n\n    FOREIGN KEY (product_category, product_id)\n      REFERENCES product(category, id)\n      ON UPDATE CASCADE ON DELETE RESTRICT,\n\n    FOREIGN KEY (customer_id)\n      REFERENCES customer(id)\n)   ENGINE=INNODB;\n','http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (537,7,'CREATE_ASYMMETRIC_PRIV_KEY','Syntax:\nCREATE_ASYMMETRIC_PRIV_KEY(algorithm, {key_len|dh_secret})\n\nCreates a private key using the given algorithm and key length or DH\nsecret, and returns the key as a binary string in PEM format. If key\ngeneration fails, the result is NULL.\n\nSupported algorithm values: \'RSA\', \'DSA\', \'DH\'\n\nSupported key_len values: The minimum key length in bits is 1024. The\nmaximum key length depends on the algorithm: 16,384 for RSA and 10,000\nfor DSA. These lengths are constraints imposed by OpenSSL.\n\nFor DH keys, pass a shared DH secret instead of a key length. To create\nthe secret, pass the key length to CREATE_DH_PARAMETERS().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','SET @priv = CREATE_ASYMMETRIC_PRIV_KEY(\'DSA\', 2048);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(\'DSA\', @priv);\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (538,40,'ALTER TABLESPACE','Syntax:\nALTER TABLESPACE tablespace_name\n    {ADD|DROP} DATAFILE \'file_name\'\n    [INITIAL_SIZE [=] size]\n    [WAIT]\n    ENGINE [=] engine_name\n\nThis statement can be used either to add a new data file, or to drop a\ndata file from a tablespace.\n\nThe ADD DATAFILE variant enables you to specify an initial size using\nan INITIAL_SIZE clause, where size is measured in bytes; the default\nvalue is 134217728 (128 MB). Prior to MySQL Cluster NDB 7.3.2, this\nvalue was required to be specified using digits (Bug #13116514, Bug\n#16104705, Bug #62858); in MySQL Cluster NDB 7.3.2 and later, you may\noptionally follow size with a one-letter abbreviation for an order of\nmagnitude, similar to those used in my.cnf. Generally, this is one of\nthe letters M (megabytes) or G (gigabytes).\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and an data file with the same name, or an undo log\nfile and a tablespace with the same name.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nINITIAL_SIZE is rounded, explicitly, as for CREATE TABLESPACE.\n\nOnce a data file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using additional ALTER\nTABLESPACE ... ADD DATAFILE statements.\n\nUsing DROP DATAFILE with ALTER TABLESPACE drops the data file\n\'file_name\' from the tablespace. You cannot drop a data file from a\ntablespace which is in use by any table; in other words, the data file\nmust be empty (no extents used). See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data-objects.\nhtml. In addition, any data file to be dropped must previously have\nbeen added to the tablespace with CREATE TABLESPACE or ALTER\nTABLESPACE.\n\nBoth ALTER TABLESPACE ... ADD DATAFILE and ALTER TABLESPACE ... DROP\nDATAFILE require an ENGINE clause which specifies the storage engine\nused by the tablespace. Currently, the only accepted values for\nengine_name are NDB and NDBCLUSTER.\n\nWAIT is parsed but otherwise ignored, and so has no effect in MySQL\n5.6. It is intended for future expansion.\n\nWhen ALTER TABLESPACE ... ADD DATAFILE is used with ENGINE = NDB, a\ndata file is created on each Cluster data node. You can verify that the\ndata files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example, the following query\nshows all data files belonging to the tablespace named newts:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n    -> FROM INFORMATION_SCHEMA.FILES\n    -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+--------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME    | EXTRA          |\n+--------------------+--------------+----------------+\n| lg_3               | newdata.dat  | CLUSTER_NODE=3 |\n| lg_3               | newdata.dat  | CLUSTER_NODE=4 |\n| lg_3               | newdata2.dat | CLUSTER_NODE=3 |\n| lg_3               | newdata2.dat | CLUSTER_NODE=4 |\n+--------------------+--------------+----------------+\n2 rows in set (0.03 sec)\n\nSee http://dev.mysql.com/doc/refman/5.6/en/files-table.html.\n\nALTER TABLESPACE is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-tablespace.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (539,23,'ENUM','ENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nAn enumeration. A string object that can have only one value, chosen\nfrom the list of values \'value1\', \'value2\', ..., NULL or the special \'\'\nerror value. ENUM values are represented internally as integers.\n\nAn ENUM column can have a maximum of 65,535 distinct elements. (The\npractical limit is less than 3000.) A table can have no more than 255\nunique element list definitions among its ENUM and SET columns\nconsidered as a group. For more information on these limits, see\nhttp://dev.mysql.com/doc/refman/5.6/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (540,38,'STRCMP','Syntax:\nSTRCMP(expr1,expr2)\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first\nargument is smaller than the second according to the current sort\norder, and 1 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html\n\n','mysql> SELECT STRCMP(\'text\', \'text2\');\n        -> -1\nmysql> SELECT STRCMP(\'text2\', \'text\');\n        -> 1\nmysql> SELECT STRCMP(\'text\', \'text\');\n        -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (541,28,'INSERT DELAYED','Syntax:\nINSERT DELAYED ...\n\nThe DELAYED option for the INSERT statement is a MySQL extension to\nstandard SQL that can be used for certain kinds of tables (such as\nMyISAM). When a client uses INSERT DELAYED, it gets an okay from the\nserver at once, and the row is queued to be inserted when the table is\nnot in use by any other thread.\n\n*Note*: INSERT DELAYED is slower than a normal INSERT if the table is\nnot otherwise in use. There is also the additional overhead for the\nserver to handle a separate thread for each table for which there are\ndelayed rows. This means that you should use INSERT DELAYED only when\nyou are really sure that you need it. As of MySQL 5.6.6, INSERT DELAYED\nis deprecated, and will be removed in a future release. Use INSERT\n(without DELAYED) instead.\n\nThe queued rows are held only in memory until they are inserted into\nthe table. This means that if you terminate mysqld forcibly (for\nexample, with kill -9) or if mysqld dies unexpectedly, any queued rows\nthat have not been written to disk are lost.\n\nThere are some constraints on the use of DELAYED:\n\no INSERT DELAYED works only with MyISAM, MEMORY, ARCHIVE, and BLACKHOLE\n  tables. For engines that do not support DELAYED, an error occurs.\n\no An error occurs for INSERT DELAYED if used with a table that has been\n  locked with LOCK TABLES because the insert must be handled by a\n  separate thread, not by the session that holds the lock.\n\no For MyISAM tables, if there are no free blocks in the middle of the\n  data file, concurrent SELECT and INSERT statements are supported.\n  Under these circumstances, you very seldom need to use INSERT DELAYED\n  with MyISAM.\n\no INSERT DELAYED should be used only for INSERT statements that specify\n  value lists. The server ignores DELAYED for INSERT ... SELECT or\n  INSERT ... ON DUPLICATE KEY UPDATE statements.\n\no Because the INSERT DELAYED statement returns immediately, before the\n  rows are inserted, you cannot use LAST_INSERT_ID() to get the\n  AUTO_INCREMENT value that the statement might generate.\n\no DELAYED rows are not visible to SELECT statements until they actually\n  have been inserted.\n\no Prior to MySQL 5.6, INSERT DELAYED was treated as a normal INSERT if\n  the statement inserted multiple rows, binary logging was enabled, and\n  the global logging format was statement-based (that is, whenever\n  binlog_format was set to STATEMENT). Beginning with MySQL 5.6, INSERT\n  DELAYED is always handled as a simple INSERT (that is, without the\n  DELAYED option) whenever the value of binlog_format is STATEMENT or\n  MIXED. (In the latter case, the statement no longer triggers a switch\n  to row-based logging, and so is logged using the statement-based\n  format.)\n\n  This does not apply when using row-based binary logging mode\n  (binlog_format set to ROW), in which INSERT DELAYED statements are\n  always executed using the DELAYED option as specified, and logged as\n  row-update events.\n\no DELAYED is ignored on slave replication servers, so that INSERT\n  DELAYED is treated as a normal INSERT on slaves. This is because\n  DELAYED could cause the slave to have different data than the master.\n\no Pending INSERT DELAYED statements are lost if a table is write locked\n  and ALTER TABLE is used to modify the table structure.\n\no INSERT DELAYED is not supported for views.\n\no INSERT DELAYED is not supported for partitioned tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/insert-delayed.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/insert-delayed.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (542,27,'SHOW PROCEDURE CODE','Syntax:\nSHOW PROCEDURE CODE proc_name\n\nThis statement is a MySQL extension that is available only for servers\nthat have been built with debugging support. It displays a\nrepresentation of the internal implementation of the named stored\nprocedure. A similar statement, SHOW FUNCTION CODE, displays\ninformation about stored functions (see [HELP SHOW FUNCTION CODE]).\n\nTo use either statement, you must be the owner of the routine or have\nSELECT access to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result\nset. Each row in the result set corresponds to one "instruction" in the\nroutine. The first column is Pos, which is an ordinal number beginning\nwith 0. The second column is Instruction, which contains an SQL\nstatement (usually changed from the original source), or a directive\nwhich has meaning only to the stored-routine handler.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-procedure-code.html\n\n','mysql> DELIMITER //\nmysql> CREATE PROCEDURE p1 ()\n    -> BEGIN\n    ->   DECLARE fanta INT DEFAULT 55;\n    ->   DROP TABLE t2;\n    ->   LOOP\n    ->     INSERT INTO t3 VALUES (fanta);\n    ->     END LOOP;\n    ->   END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction                            |\n+-----+----------------------------------------+\n|   0 | set fanta@0 55                         |\n|   1 | stmt 9 "DROP TABLE t2"                 |\n|   2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |\n|   3 | jump 2                                 |\n+-----+----------------------------------------+\n4 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/show-procedure-code.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (543,23,'MEDIUMTEXT','MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 16,777,215 (224 - 1) characters.\nThe effective maximum length is less if the value contains multibyte\ncharacters. Each MEDIUMTEXT value is stored using a 3-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (544,3,'LOG','Syntax:\nLOG(X), LOG(B,X)\n\nIf called with one parameter, this function returns the natural\nlogarithm of X. If X is less than or equal to 0, then NULL is returned.\n\nThe inverse of this function (when called with a single argument) is\nthe EXP() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LOG(2);\n        -> 0.69314718055995\nmysql> SELECT LOG(-2);\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (545,27,'SHOW COLLATION','Syntax:\nSHOW COLLATION\n    [LIKE \'pattern\' | WHERE expr]\n\nThis statement lists collations supported by the server. By default,\nthe output from SHOW COLLATION includes all available collations. The\nLIKE clause, if present, indicates which collation names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html. For example:\n\nmysql> SHOW COLLATION LIKE \'latin1%\';\n+-------------------+---------+----+---------+----------+---------+\n| Collation         | Charset | Id | Default | Compiled | Sortlen |\n+-------------------+---------+----+---------+----------+---------+\n| latin1_german1_ci | latin1  |  5 |         |          |       0 |\n| latin1_swedish_ci | latin1  |  8 | Yes     | Yes      |       0 |\n| latin1_danish_ci  | latin1  | 15 |         |          |       0 |\n| latin1_german2_ci | latin1  | 31 |         | Yes      |       2 |\n| latin1_bin        | latin1  | 47 |         | Yes      |       0 |\n| latin1_general_ci | latin1  | 48 |         |          |       0 |\n| latin1_general_cs | latin1  | 49 |         |          |       0 |\n| latin1_spanish_ci | latin1  | 94 |         |          |       0 |\n+-------------------+---------+----+---------+----------+---------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-collation.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-collation.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (546,20,'!=','Syntax:\n<>, !=\n\nNot equal:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT \'.01\' <> \'0.01\';\n        -> 1\nmysql> SELECT .01 <> \'0.01\';\n        -> 0\nmysql> SELECT \'zapp\' <> \'zappp\';\n        -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (547,24,'WHILE','Syntax:\n[begin_label:] WHILE search_condition DO\n    statement_list\nEND WHILE [end_label]\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition expression is true. statement_list consists of one or\nmore SQL statements, each terminated by a semicolon (;) statement\ndelimiter.\n\nA WHILE statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/while.html\n\n','CREATE PROCEDURE dowhile()\nBEGIN\n  DECLARE v1 INT DEFAULT 5;\n\n  WHILE v1 > 0 DO\n    ...\n    SET v1 = v1 - 1;\n  END WHILE;\nEND;\n','http://dev.mysql.com/doc/refman/5.6/en/while.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (548,32,'DAYNAME','Syntax:\nDAYNAME(date)\n\nReturns the name of the weekday for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.6/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYNAME(\'2007-02-03\');\n        -> \'Saturday\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (549,3,'RADIANS','Syntax:\nRADIANS(X)\n\nReturns the argument X, converted from degrees to radians.\n\n*Note*: π radians equals 180 degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT RADIANS(90);\n        -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (550,17,'COLLATION','Syntax:\nCOLLATION(str)\n\nReturns the collation of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT COLLATION(\'abc\');\n        -> \'latin1_swedish_ci\'\nmysql> SELECT COLLATION(_utf8\'abc\');\n        -> \'utf8_general_ci\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (551,20,'COALESCE','Syntax:\nCOALESCE(value,...)\n\nReturns the first non-NULL value in the list, or NULL if there are no\nnon-NULL values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT COALESCE(NULL,1);\n        -> 1\nmysql> SELECT COALESCE(NULL,NULL,NULL);\n        -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html');
-INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (552,17,'VERSION','Syntax:\nVERSION()\n\nReturns a string that indicates the MySQL server version. The string\nuses the utf8 character set. The value might have a suffix in addition\nto the version number. See the description of the version system\nvariable in\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT VERSION();\n        -> \'5.6.23-standard\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html');
-
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (0,'JOIN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (1,'HOST');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (2,'REPEAT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (3,'SERIALIZABLE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (4,'REPLACE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (5,'AT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (6,'SCHEDULE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (7,'RETURNS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (8,'ST_SYMDIFFERENCE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (9,'STARTS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (10,'MASTER_SSL_CA');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (11,'NCHAR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (12,'ONLY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (13,'COLUMNS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (14,'COMPLETION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (15,'WORK');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (16,'DATETIME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (17,'MODE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (18,'OPEN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (19,'INTEGER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (20,'ESCAPE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (21,'VALUE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (22,'MASTER_SSL_VERIFY_SERVER_CERT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (23,'SQL_BIG_RESULT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (24,'DROP');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (25,'GEOMETRYCOLLECTIONFROMWKB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (26,'EVENTS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (27,'MONTH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (28,'PROFILES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (29,'DUPLICATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (30,'REPLICATION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (31,'UNLOCK');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (32,'STATS_PERSISTENT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (33,'INNODB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (34,'YEAR_MONTH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (35,'SUBJECT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (36,'MASTER_RETRY_COUNT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (37,'PREPARE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (38,'LOCK');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (39,'NDB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (40,'CHECK');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (41,'FULL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (42,'INT4');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (43,'BY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (44,'NO');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (45,'MINUTE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (46,'PARTITION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (47,'DATA');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (48,'DAY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (49,'SHARE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (50,'REAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (51,'SEPARATOR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (52,'MESSAGE_TEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (53,'MASTER_HEARTBEAT_PERIOD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (54,'DELETE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (55,'ON');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (56,'COLUMN_NAME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (57,'CONNECTION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (58,'CLOSE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (59,'MASTER_SSL_CRLPATH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (60,'X509');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (61,'USE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (62,'SUBCLASS_ORIGIN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (63,'WHERE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (64,'PRIVILEGES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (65,'SPATIAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (66,'EVENT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (67,'SUPER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (68,'SQL_BUFFER_RESULT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (69,'IGNORE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (70,'SHA2');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (71,'QUICK');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (72,'SIGNED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (73,'SECURITY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (74,'AUTOEXTEND_SIZE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (75,'NDBCLUSTER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (76,'POLYGONFROMWKB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (77,'FALSE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (78,'LEVEL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (79,'FORCE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (80,'BINARY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (81,'TO');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (82,'CHANGE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (83,'CURRENT_USER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (84,'HOUR_MINUTE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (85,'CREATE_DH_PARAMETERS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (86,'UPDATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (87,'PRESERVE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (88,'TABLE_NAME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (89,'INTO');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (90,'FEDERATED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (91,'VARYING');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (92,'MAX_SIZE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (93,'HOUR_SECOND');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (94,'SQL_AFTER_GTIDS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (95,'ST_DIFFERENCE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (96,'VARIABLE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (97,'ROLLBACK');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (98,'PROCEDURE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (99,'TIMESTAMP');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (100,'IMPORT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (101,'AGAINST');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (102,'CHECKSUM');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (103,'ST_AREA');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (104,'SQL_BEFORE_GTIDS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (105,'COUNT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (106,'INSERT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (107,'LONGBINARY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (108,'THEN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (109,'ENGINES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (110,'HANDLER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (111,'PORT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (112,'DAY_SECOND');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (113,'EXISTS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (114,'MUTEX');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (115,'HELP_DATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (116,'RELEASE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (117,'BOOLEAN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (118,'MOD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (119,'DEFAULT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (120,'TYPE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (121,'NO_WRITE_TO_BINLOG');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (122,'OPTIMIZE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (123,'SQLSTATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (124,'RESET');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (125,'CLASS_ORIGIN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (126,'INSTALL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (127,'ITERATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (128,'DO');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (129,'BIGINT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (130,'SET');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (131,'ISSUER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (132,'DATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (133,'STATUS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (134,'FULLTEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (135,'COMMENT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (136,'MASTER_CONNECT_RETRY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (137,'INNER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (138,'RELAYLOG');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (139,'STOP');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (140,'MASTER_LOG_FILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (141,'MRG_MYISAM');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (142,'PRECISION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (143,'REQUIRE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (144,'TRAILING');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (145,'PARTITIONS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (146,'LONG');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (147,'OPTION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (148,'REORGANIZE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (149,'ELSE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (150,'DEALLOCATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (151,'IO_THREAD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (152,'CASE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (153,'CIPHER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (154,'STATS_AUTO_RECALC');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (155,'CONTINUE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (156,'FROM');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (157,'READ');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (158,'LEFT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (159,'ELSEIF');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (160,'MINUTE_SECOND');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (161,'COMPACT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (162,'DEC');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (163,'FOR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (164,'WARNINGS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (165,'MIN_ROWS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (166,'STRING');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (167,'CONDITION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (168,'ROW_COUNT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (169,'ENCLOSED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (170,'FUNCTION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (171,'AGGREGATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (172,'NUMBER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (173,'FIELDS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (174,'INT3');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (175,'ARCHIVE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (176,'AVG_ROW_LENGTH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (177,'ADD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (178,'KILL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (179,'FLOAT4');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (180,'TABLESPACE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (181,'VIEW');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (182,'ALGORITHM');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (183,'REPEATABLE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (184,'INFILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (185,'HELP_VERSION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (186,'ORDER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (187,'MASTER_SSL_CRL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (188,'USING');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (189,'CONSTRAINT_CATALOG');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (190,'MIDDLEINT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (191,'GRANT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (192,'UNSIGNED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (193,'DECIMAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (194,'GEOMETRYFROMTEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (195,'INDEXES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (196,'DEFAULT_AUTH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (197,'FOREIGN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (198,'ST_INTERSECTION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (199,'CACHE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (200,'HOSTS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (201,'MYSQL_ERRNO');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (202,'COMMIT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (203,'SCHEMAS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (204,'LEADING');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (205,'SNAPSHOT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (206,'CONSTRAINT_NAME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (207,'DECLARE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (208,'LOAD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (209,'SQL_CACHE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (210,'CONVERT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (211,'DYNAMIC');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (212,'COLLATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (213,'POLYGONFROMTEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (214,'BYTE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (215,'ENVELOPE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (216,'GLOBAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (217,'LINESTRINGFROMWKB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (218,'WHEN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (219,'HAVING');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (220,'AS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (221,'STARTING');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (222,'RELOAD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (223,'AUTOCOMMIT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (224,'REVOKE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (225,'GRANTS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (226,'OUTER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (227,'CURSOR_NAME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (228,'RANDOM_BYTES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (229,'EXPIRE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (230,'SQL_AFTER_MTS_GAPS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (231,'FLOOR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (232,'EXPLAIN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (233,'WITH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (234,'AFTER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (235,'STD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (236,'CSV');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (237,'DISABLE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (238,'UNINSTALL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (239,'OUTFILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (240,'LOW_PRIORITY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (241,'FILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (242,'NODEGROUP');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (243,'SCHEMA');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (244,'SONAME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (245,'POW');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (246,'DUAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (247,'INDEX');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (248,'MULTIPOINTFROMWKB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (249,'MULTIPOINTFROMTEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (250,'DEFINER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (251,'MASTER_BIND');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (252,'REMOVE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (253,'EXTENDED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (254,'MULTILINESTRINGFROMWKB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (255,'CROSS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (256,'CONTRIBUTORS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (257,'NATIONAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (258,'GROUP');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (259,'SHA');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (260,'UNDO');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (261,'IGNORE_SERVER_IDS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (262,'MASTER_AUTO_POSITION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (263,'ZEROFILL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (264,'CLIENT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (265,'MASTER_PASSWORD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (266,'OWNER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (267,'RELAY_LOG_FILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (268,'TRUE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (269,'CHARACTER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (270,'MASTER_USER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (271,'SCHEMA_NAME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (272,'TABLE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (273,'ENGINE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (274,'INSERT_METHOD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (275,'CASCADE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (276,'RELAY_LOG_POS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (277,'SQL_CALC_FOUND_ROWS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (278,'UNION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (279,'MYISAM');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (280,'LEAVE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (281,'MODIFY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (282,'MATCH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (283,'MASTER_LOG_POS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (284,'DISTINCTROW');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (285,'DESC');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (286,'TIME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (287,'NUMERIC');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (288,'EXPANSION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (289,'CODE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (290,'CURSOR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (291,'ST_UNION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (292,'GEOMETRYCOLLECTIONFROMTEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (293,'AREA');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (294,'CHAIN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (295,'LOGFILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (296,'FLUSH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (297,'CREATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (298,'DESCRIBE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (299,'EXTENT_SIZE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (300,'MAX_UPDATES_PER_HOUR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (301,'INT2');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (302,'PROCESSLIST');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (303,'ENDS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (304,'LOGS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (305,'RECOVER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (306,'DISCARD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (307,'HEAP');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (308,'RETURNED_SQLSTATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (309,'EXCHANGE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (310,'SOUNDS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (311,'BETWEEN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (312,'MULTILINESTRINGFROMTEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (313,'REPAIR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (314,'PACK_KEYS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (315,'FAST');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (316,'VALUES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (317,'CALL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (318,'GET');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (319,'LOOP');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (320,'VARCHARACTER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (321,'BEFORE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (322,'TRUNCATE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (323,'SHOW');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (324,'ALL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (325,'REDUNDANT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (326,'USER_RESOURCES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (327,'PARTIAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (328,'BINLOG');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (329,'END');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (330,'SECOND');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (331,'AND');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (332,'FLOAT8');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (333,'PREV');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (334,'HOUR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (335,'SELECT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (336,'DATABASES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (337,'OR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (338,'IDENTIFIED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (339,'WRAPPER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (340,'MASTER_SSL_CIPHER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (341,'SQL_SLAVE_SKIP_COUNTER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (342,'BOOL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (343,'BOTH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (344,'YEAR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (345,'MASTER_PORT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (346,'CONCURRENT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (347,'HELP');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (348,'UNIQUE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (349,'TRIGGERS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (350,'PROCESS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (351,'OPTIONS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (352,'RESIGNAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (353,'CONSISTENT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (354,'MASTER_SSL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (355,'DATE_ADD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (356,'MAX_CONNECTIONS_PER_HOUR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (357,'ST_ENVELOPE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (358,'LIKE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (359,'PLUGIN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (360,'FETCH');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (361,'IN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (362,'COLUMN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (363,'DIAGNOSTICS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (364,'DUMPFILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (365,'USAGE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (366,'EXECUTE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (367,'MEMORY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (368,'CEIL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (369,'QUERY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (370,'MASTER_HOST');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (371,'LINES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (372,'PLUGIN_DIR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (373,'SQL_THREAD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (374,'SERVER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (375,'MAX_QUERIES_PER_HOUR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (376,'MASTER_SSL_CERT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (377,'MULTIPOLYGONFROMWKB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (378,'TRANSACTION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (379,'DAY_MINUTE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (380,'DATE_SUB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (381,'STDDEV');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (382,'REBUILD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (383,'GEOMETRYFROMWKB');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (384,'INT1');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (385,'RENAME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (386,'PARSER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (387,'RIGHT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (388,'ALTER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (389,'MAX_ROWS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (390,'SOCKET');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (391,'STRAIGHT_JOIN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (392,'NATURAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (393,'VARIABLES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (394,'ESCAPED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (395,'SHA1');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (396,'KEY_BLOCK_SIZE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (397,'PASSWORD');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (398,'OFFSET');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (399,'CHAR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (400,'NEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (401,'ERRORS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (402,'SQL_LOG_BIN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (403,'TEMPORARY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (404,'COMMITTED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (405,'SQL_SMALL_RESULT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (406,'UPGRADE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (407,'XA');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (408,'BEGIN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (409,'DELAY_KEY_WRITE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (410,'PROFILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (411,'MEDIUM');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (412,'INTERVAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (413,'CENTROID');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (414,'SSL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (415,'DAY_HOUR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (416,'NAME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (417,'REFERENCES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (418,'AES_ENCRYPT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (419,'STORAGE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (420,'ISOLATION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (421,'CEILING');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (422,'EVERY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (423,'INT8');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (424,'AUTHORS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (425,'STATS_SAMPLE_PAGES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (426,'RESTRICT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (427,'UNCOMMITTED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (428,'LINESTRINGFROMTEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (429,'IS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (430,'ST_CENTROID');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (431,'NOT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (432,'ANALYSE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (433,'DATAFILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (434,'DES_KEY_FILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (435,'SIGNAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (436,'COMPRESSED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (437,'START');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (438,'PLUGINS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (439,'SAVEPOINT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (440,'IF');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (441,'ROWS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (442,'PRIMARY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (443,'PURGE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (444,'LAST');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (445,'USER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (446,'EXIT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (447,'LIMIT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (448,'KEYS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (449,'KEY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (450,'ST_DISTANCE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (451,'MERGE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (452,'UNTIL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (453,'SQL_NO_CACHE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (454,'DELAYED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (455,'CONSTRAINT_SCHEMA');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (456,'ANALYZE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (457,'CONSTRAINT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (458,'SERIAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (459,'ACTION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (460,'WRITE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (461,'INITIAL_SIZE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (462,'SESSION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (463,'DATABASE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (464,'NULL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (465,'POWER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (466,'USE_FRM');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (467,'TERMINATED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (468,'SLAVE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (469,'NVARCHAR');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (470,'ASC');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (471,'RETURN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (472,'OPTIONALLY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (473,'ENABLE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (474,'DIRECTORY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (475,'MAX_USER_CONNECTIONS');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (476,'WHILE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (477,'LOCAL');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (478,'AES_DECRYPT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (479,'DISTINCT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (480,'MASTER_SSL_KEY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (481,'NONE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (482,'TABLES');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (483,'<>');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (484,'EXPORT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (485,'RLIKE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (486,'TRIGGER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (487,'COLLATION');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (488,'SHUTDOWN');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (489,'HIGH_PRIORITY');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (490,'BTREE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (491,'FIRST');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (492,'COALESCE');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (493,'WAIT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (494,'CATALOG_NAME');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (495,'MASTER');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (496,'FIXED');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (497,'MULTIPOLYGONFROMTEXT');
-INSERT INTO help_keyword (help_keyword_id,name) VALUES (498,'ROW_FORMAT');
-
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,0);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,0);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,1);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (130,2);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,3);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,4);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,4);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,4);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,5);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,6);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,6);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,7);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,8);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,9);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,10);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,11);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,12);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,12);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,12);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,13);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (286,13);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,13);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,13);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,13);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,14);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,14);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,15);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (129,16);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,17);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,17);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (14,18);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (348,18);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,18);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,18);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (274,19);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,19);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (211,20);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,21);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,21);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,21);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,21);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,21);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,22);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,23);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (401,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (428,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (6,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (230,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (499,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (150,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (226,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,24);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (333,25);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (234,26);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,26);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,26);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,27);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (50,28);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,29);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,30);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,31);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,32);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,33);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,33);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,34);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,35);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,36);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (27,37);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (401,37);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,37);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,38);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,38);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,38);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,38);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,38);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,39);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,40);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,40);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,40);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,41);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (286,41);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (169,41);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,41);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,41);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (274,42);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (51,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (316,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,43);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,44);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,44);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,45);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,46);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,46);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,46);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,46);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,46);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,46);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,46);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,46);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,46);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,47);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,47);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,47);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,47);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,48);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,49);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (436,50);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,50);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,51);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,52);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,52);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,52);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,53);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,54);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,54);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,54);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,55);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,55);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,55);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,55);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,56);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,56);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,56);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (101,57);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,57);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (36,58);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,58);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,59);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,60);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,61);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (38,61);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,61);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,62);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,62);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,62);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,63);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (51,63);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,63);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,64);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (140,64);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,64);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,65);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,65);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,66);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,66);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (428,66);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,66);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,67);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,68);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,69);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,69);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,69);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,69);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (51,69);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,69);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,69);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (309,70);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,71);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,71);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,71);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (129,72);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,73);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,74);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,75);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (57,76);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (265,76);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,77);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,78);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,79);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,80);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (154,80);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (129,80);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (154,81);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (528,81);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,81);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,82);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,82);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,83);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,83);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,84);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (319,85);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,86);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,86);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,86);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (51,86);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,87);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,87);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,88);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,88);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,88);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (430,89);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,89);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,89);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,89);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,90);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,91);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,92);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,93);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,94);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (324,95);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,96);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,97);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (528,97);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,97);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (13,98);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,98);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (242,98);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (175,98);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,98);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (499,98);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,98);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (107,98);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,98);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,99);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (62,99);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,100);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,100);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,101);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (221,102);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,102);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (328,103);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,104);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (312,105);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (238,105);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (444,105);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (112,106);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,106);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,106);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,106);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (421,107);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (52,108);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (39,108);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (23,108);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,109);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (419,109);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,110);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,110);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,111);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,112);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,113);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,113);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,113);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (428,113);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,113);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (6,113);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,113);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,114);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,114);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (67,115);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,116);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (528,116);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,116);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,117);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (287,117);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,118);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (369,118);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,119);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,119);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,119);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (381,119);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,119);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,119);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,119);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,119);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,120);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,121);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,121);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (337,121);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,121);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (337,122);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,122);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,123);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,123);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,124);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,124);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (151,124);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,124);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,125);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,125);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,125);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,126);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (75,127);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,128);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,128);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (76,128);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (547,128);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,129);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (191,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (51,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (105,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (262,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,130);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,131);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (410,132);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (78,132);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (129,132);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,132);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,133);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (448,133);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,133);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,133);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,133);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,133);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,133);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,133);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,134);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,134);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,134);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,135);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,135);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,135);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,135);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,135);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,136);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,137);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (234,138);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,139);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,140);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,141);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (436,142);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,143);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (525,144);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (145,145);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (421,146);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (140,147);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,147);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,148);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (52,149);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (39,149);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (401,150);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,151);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,151);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (52,152);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (39,152);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,153);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,154);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,155);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (234,156);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,156);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (525,156);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,156);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,156);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,156);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,157);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,157);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,157);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,157);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,157);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,158);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (23,159);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,160);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,161);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (386,162);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,163);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,163);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,163);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (371,163);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,163);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (502,163);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,164);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (444,164);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,165);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,166);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (371,167);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,168);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,169);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (311,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (448,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (175,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (499,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (218,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (387,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (226,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (399,170);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,171);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,172);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,173);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,173);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (142,174);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,175);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,176);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,176);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,177);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,177);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (43,177);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,177);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (101,178);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (364,179);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,180);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,180);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (230,180);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,180);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (524,181);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,181);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (95,181);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,182);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,182);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,182);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,183);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,184);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,184);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (108,185);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,186);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,186);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (51,186);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,186);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,186);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,187);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,188);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (53,188);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,188);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,189);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,189);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,189);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (142,190);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (140,191);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,191);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (436,192);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (274,192);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (386,192);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (129,192);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (287,192);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (364,192);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (341,192);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (93,193);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,193);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (129,193);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (496,194);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,195);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,196);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,197);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,197);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,197);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,197);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (392,198);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (430,199);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,199);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,199);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (353,200);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,200);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,201);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,201);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,201);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,202);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,202);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,203);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (96,203);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (525,204);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,205);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,205);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,206);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,206);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,206);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,207);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (371,207);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (502,207);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (381,207);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (430,208);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,208);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,209);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (129,210);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (474,210);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,211);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,212);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,212);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,212);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,213);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (532,214);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (134,215);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,216);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,216);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (105,216);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (459,216);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,216);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (522,217);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (52,218);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (39,218);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,219);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,220);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,220);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,220);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,221);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,222);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,223);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (140,224);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,225);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,225);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,226);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,227);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,227);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,227);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,228);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (486,229);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,230);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,231);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (145,232);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,233);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,233);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,233);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,233);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,233);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,234);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (409,235);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,236);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,236);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,237);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,237);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,237);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,238);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,239);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,240);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,240);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,240);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,240);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,240);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (51,240);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,240);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,241);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,242);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,243);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,243);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,243);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,243);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,243);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,244);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,245);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (160,246);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (430,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (43,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (433,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,247);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (529,248);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (235,249);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,250);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,250);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,251);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,252);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,253);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (145,253);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (158,254);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,255);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,256);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (4,256);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,257);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,257);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,258);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (299,258);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (395,258);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,258);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (504,259);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,260);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,261);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,262);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (436,263);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (274,263);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (386,263);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (287,263);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (364,263);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (341,263);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,264);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,265);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,266);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,267);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,268);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (191,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,269);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,270);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,271);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,271);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,271);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (68,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (337,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (159,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (221,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (43,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,272);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,273);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,273);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,273);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,273);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,273);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (230,273);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,273);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,274);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,275);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,275);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,275);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,275);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,276);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,277);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (431,278);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,279);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (179,280);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,281);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,282);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,283);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,284);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,285);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (145,285);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,285);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (438,286);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (208,286);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (129,286);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (386,287);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,288);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (311,289);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,289);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (502,290);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (185,291);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (405,292);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,293);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,294);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,295);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (299,295);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (395,295);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,296);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,296);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (524,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (175,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (159,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (387,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (316,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (13,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (299,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (17,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (218,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (43,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,297);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (145,298);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,299);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,300);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,301);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,302);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,302);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,303);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,304);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,304);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (154,304);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,305);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,306);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,307);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,308);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,309);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (475,310);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (86,311);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,312);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,313);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,313);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,314);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,315);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,316);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,316);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (453,317);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,318);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (193,319);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,320);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (154,321);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,322);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,322);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (311,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (191,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (312,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (448,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (4,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (348,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (159,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (7,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (419,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (13,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (286,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (459,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (50,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (20,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (353,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (169,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (234,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (96,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (545,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (433,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (218,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (444,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,323);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,324);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (431,324);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (140,324);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,324);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,324);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,325);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,326);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,327);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,328);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,328);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (39,329);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (52,329);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (188,329);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (23,329);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,329);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (193,329);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (130,329);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (547,329);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,330);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (86,331);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (181,331);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (436,332);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,333);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,334);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,335);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,335);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,335);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,335);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (145,335);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,336);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (96,336);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,337);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,338);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,338);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (316,338);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,339);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,340);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (105,341);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,342);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (287,342);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (525,343);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,344);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,345);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,346);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,346);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (481,347);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (71,347);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,348);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (20,349);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,349);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,350);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (206,351);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,351);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,352);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,353);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,353);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,354);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,355);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,356);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (210,357);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,358);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (475,358);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,359);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,359);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,359);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (214,360);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (234,361);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,361);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,361);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,361);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,362);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,363);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,364);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,365);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (53,366);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,366);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,367);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (487,368);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,369);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (101,369);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,369);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,370);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,371);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,371);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,372);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,373);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,373);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (206,374);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,374);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (6,374);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,375);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,376);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (74,377);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,378);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,378);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,379);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,380);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (227,381);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,382);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (85,383);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (287,384);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,385);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (68,385);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (393,385);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,385);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,386);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,386);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,386);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,387);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (242,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (95,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (206,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (395,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (43,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (486,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (399,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,388);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,389);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,390);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,391);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,391);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,392);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,393);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (459,393);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,394);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (504,395);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,396);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,397);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (262,397);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (486,397);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,397);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (316,397);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,397);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,398);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (532,399);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (129,399);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,400);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (312,401);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,401);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,402);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,403);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,404);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,405);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,406);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,406);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,407);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,408);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (188,408);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,408);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,409);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,410);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,411);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,412);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,412);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (512,413);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,414);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,415);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,416);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,417);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,417);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,417);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (515,418);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (419,419);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,420);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (520,421);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,422);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (341,423);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (7,424);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,424);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,425);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,426);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,426);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,426);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,427);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (304,428);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (320,429);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,429);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (249,429);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (205,429);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (251,430);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (320,431);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,431);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,431);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,431);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (435,431);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (107,432);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,433);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,433);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,434);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,435);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,436);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,437);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,437);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,437);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,438);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (528,439);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (264,440);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,440);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (428,440);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (6,440);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,440);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (23,440);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,440);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,440);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,440);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,441);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,442);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (154,443);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,444);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,445);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (393,445);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (486,445);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,445);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (316,445);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,445);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,446);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (234,447);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,447);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,447);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,447);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (51,447);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,447);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,448);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (433,448);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,448);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,449);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (43,449);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,449);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,449);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,449);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (256,450);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,451);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (130,452);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,453);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,454);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,454);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,454);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,455);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,455);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,455);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,456);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,456);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,457);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,457);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,458);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,458);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,459);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,459);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,460);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,460);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,460);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,460);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,461);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,461);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,462);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,462);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (459,462);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,462);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,463);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,463);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,463);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,463);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,463);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,463);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (320,464);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,464);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (205,464);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,465);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,466);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,467);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (353,468);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,468);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,468);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,468);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,468);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,468);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,468);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,469);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,470);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,470);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (270,471);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,472);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,473);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,473);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,473);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,474);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,474);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,475);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (547,476);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,477);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,477);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,477);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (346,477);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (337,477);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (501,477);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,477);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (272,478);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (278,479);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (60,479);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (477,479);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (424,479);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (238,479);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (431,479);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,479);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,479);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,480);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,481);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (348,482);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,482);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (169,482);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,482);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (546,483);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,484);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (22,485);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,486);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (17,486);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (150,486);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,487);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (545,487);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,488);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,489);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (331,489);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,490);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,491);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,491);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,491);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,492);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,493);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,493);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,494);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,494);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,494);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,495);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,495);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (154,495);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,495);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (151,495);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (386,496);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,496);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (380,497);
-INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,498);
-
-
-COMMIT;
+-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 
+-- fill_help_tables.sql - this file is a placeholder to satisfy build dependencies -
+-- it will be replaced with the appropriate content by the Boostrap script that
+-- creates the official source distribution.
index 0ab07ebc7a686a96b02e3f04f0a2e27eda74f646..98a41d2624a1f09d1e24d44be05cb3ec0972b6f5 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# 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
@@ -113,7 +113,9 @@ fi
 # We intentionally add a space to the beginning and end of lib strings, simplifies replace later
 libs=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
 libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ "
+libs="$libs @QUOTED_CMAKE_C_LINK_FLAGS@"
 libs_r=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqlclient @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ "
+libs_r="$libs_r @QUOTED_CMAKE_C_LINK_FLAGS@"
 embedded_libs=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ "
 embedded_libs="$embedded_libs @QUOTED_CMAKE_CXX_LINK_FLAGS@"
 
index 3af188580071d4a10a768e5f38ccbd59c3b23ada..c975843fbbea983dff64045d2b2ff4f40fcf5b48 100644 (file)
@@ -144,7 +144,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)
@@ -172,6 +172,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
@@ -227,7 +299,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 ;;
 
       *)
@@ -766,7 +844,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"
 
@@ -777,13 +856,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
@@ -853,6 +947,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/mysql-wsrep-5.6/scripts/wsrep_sst_common.sh b/mysql-wsrep-5.6/scripts/wsrep_sst_common.sh
new file mode 100644 (file)
index 0000000..25ec0ba
--- /dev/null
@@ -0,0 +1,204 @@
+# Copyright (C) 2012-2015 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_CONF_SUFFIX=""
+WSREP_SST_OPT_DATA=""
+WSREP_SST_OPT_AUTH=${WSREP_SST_OPT_AUTH:-}
+WSREP_SST_OPT_USER=${WSREP_SST_OPT_USER:-}
+WSREP_SST_OPT_PSWD=${WSREP_SST_OPT_PSWD:-}
+
+while [ $# -gt 0 ]; do
+case "$1" in
+    '--address')
+        readonly WSREP_SST_OPT_ADDR="$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')
+        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
+readonly WSREP_SST_OPT_CONF_SUFFIX
+
+# 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
+
+wsrep_auth_not_set()
+{
+    [ -z "$WSREP_SST_OPT_AUTH" -o "$WSREP_SST_OPT_AUTH" = "(null)" ]
+}
+
+# For Bug:1200727
+if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF sst | grep -q "wsrep_sst_auth"
+then
+    if wsrep_auth_not_set
+    then
+        WSREP_SST_OPT_AUTH=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF sst | grep -- "--wsrep_sst_auth" | cut -d= -f2)
+    fi
+fi
+readonly WSREP_SST_OPT_AUTH
+
+# Splitting AUTH into potential user:password pair
+if ! wsrep_auth_not_set
+then
+    readonly AUTH_VEC=(${WSREP_SST_OPT_AUTH//:/ })
+    WSREP_SST_OPT_USER="${AUTH_VEC[0]:-}"
+    WSREP_SST_OPT_PSWD="${AUTH_VEC[1]:-}"
+fi
+readonly WSREP_SST_OPT_USER
+readonly WSREP_SST_OPT_PSWD
+
+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 || true
+}
+
+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/mysql-wsrep-5.6/scripts/wsrep_sst_mysqldump.sh b/mysql-wsrep-5.6/scripts/wsrep_sst_mysqldump.sh
new file mode 100644 (file)
index 0000000..af3950d
--- /dev/null
@@ -0,0 +1,142 @@
+#!/bin/bash -ue
+# Copyright (C) 2009-2015 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_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_CLIENT --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
+
+[ -n "$WSREP_SST_OPT_USER" ] && AUTH="-u$WSREP_SST_OPT_USER" || AUTH=
+
+# Refs https://github.com/codership/mysql-wsrep/issues/141
+# Passing password in MYSQL_PWD environment variable is considered
+# "extremely insecure" by MySQL Guidelines for Password Security
+# (https://dev.mysql.com/doc/refman/5.6/en/password-security-user.html)
+# that is even less secure than passing it on a command line! It is doubtful:
+# the whole command line is easily observable by any unprivileged user via ps,
+# whereas (at least on Linux) unprivileged user can't see process environment
+# that he does not own. So while it may be not secure in the NSA sense of the
+# word, it is arguably more secure than passing password on the command line.
+[ -n "$WSREP_SST_OPT_PSWD" ] && export MYSQL_PWD="$WSREP_SST_OPT_PSWD"
+
+STOP_WSREP="SET wsrep_on=OFF;"
+
+# NOTE: we don't use --routines here because we're dumping mysql.proc table
+MYSQLDUMP="$MYSQLDUMP --defaults-extra-file=$WSREP_SST_OPT_CONF \
+$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 --defaults-extra-file=$WSREP_SST_OPT_CONF "\
+"$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/mysql-wsrep-5.6/scripts/wsrep_sst_rsync.sh b/mysql-wsrep-5.6/scripts/wsrep_sst_rsync.sh
new file mode 100644 (file)
index 0000000..d6dd04f
--- /dev/null
@@ -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()
+{
+    local PID=$(cat "$RSYNC_PID" 2>/dev/null || echo 0)
+    wsrep_log_info "Joiner cleanup. rsync PID: $PID"
+    [ "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/mysql-wsrep-5.6/scripts/wsrep_sst_xtrabackup-v2.sh b/mysql-wsrep-5.6/scripts/wsrep_sst_xtrabackup-v2.sh
new file mode 100644 (file)
index 0000000..079ef8b
--- /dev/null
@@ -0,0 +1,1013 @@
+#!/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
+ssyslog=""
+ssystag=""
+XTRABACKUP_PID=""
+SST_PORT=""
+REMOTEIP=""
+tcert=""
+tpem=""
+tkey=""
+sockopt=""
+progress=""
+ttime=0
+totime=0
+lsn=""
+ecmd=""
+rlimit=""
+# Initially
+stagemsg="${WSREP_SST_OPT_ROLE}"
+cpat=""
+speciald=1
+ib_home_dir=""
+ib_log_dir=""
+ib_undo_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=""
+
+# Required for backup locks
+# For backup locks it is 1 sent by joiner
+# 5.6.21 PXC and later can't donate to an older joiner
+sst_ver=1
+
+if which pv &>/dev/null && pv --help | grep -q FORMAT;then 
+    pvopts+=$pvformat
+fi
+pcmd="pv $pvopts"
+declare -a RC
+
+INNOBACKUPEX_BIN=innobackupex
+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
+            if nc -h | grep -q ncat;then 
+                tcmd="nc -l ${TSST_PORT}"
+            else 
+                tcmd="nc -dl ${TSST_PORT}"
+            fi
+        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
+    # print the default settings for given group using my_print_default.
+    # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin)
+    # then grep for needed variable
+    # finally get the variable value (if variables has been specified multiple time use the last value only)
+    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- | tail -1)
+    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 [[ ! -x `which pv` ]];then 
+        wsrep_log_error "pv not found in path: $PATH"
+        wsrep_log_error "Disabling all progress/rate-limiting"
+        pcmd=""
+        rlimit=""
+        progress=""
+        return
+    fi
+
+    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$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$')
+    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)
+    ssyslog=$(parse_cnf sst sst-syslog 0)
+    ssystag=$(parse_cnf mysqld_safe syslog-tag "${SST_SYSLOG_TAG:-}")
+    ssystag+="-"
+
+    if [[ $speciald -eq 0 ]];then 
+        wsrep_log_error "sst-special-dirs equal to 0 is not supported, falling back to 1"
+        speciald=1
+    fi 
+
+    if [[ $ssyslog -ne -1 ]];then 
+        if my_print_defaults -c $WSREP_SST_OPT_CONF mysqld_safe | tr '_' '-' | grep -q -- "--syslog";then 
+            ssyslog=1
+        fi
+    fi
+}
+
+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"
+    elif [ "${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
+
+    # Final cleanup 
+    pgid=$(ps -o pgid= $$ | grep -o '[0-9]*')
+
+    # This means no setsid done in mysqld.
+    # We don't want to kill mysqld here otherwise.
+    if [[ $$ -eq $pgid ]];then
+
+        # This means a signal was delivered to the process.
+        # So, more cleanup. 
+        if [[ $estatus -ge 128 ]];then 
+            kill -KILL -$$ || true
+        fi
+
+    fi
+
+    exit $estatus
+}
+
+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
+
+    # Final cleanup 
+    pgid=$(ps -o pgid= $$ | grep -o '[0-9]*')
+
+    # This means no setsid done in mysqld.
+    # We don't want to kill mysqld here otherwise.
+    if [[ $$ -eq $pgid ]];then
+
+        # This means a signal was delivered to the process.
+        # So, more cleanup. 
+        if [[ $estatus -ge 128 ]];then 
+            kill -KILL -$$ || true
+        fi
+
+    fi
+
+    exit $estatus
+
+}
+
+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 }')
+        sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }')
+    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
+    echo "ready ${ADDR}/${MODULE}//$sst_ver"
+}
+
+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 checkf=$4
+    local ltcmd
+
+    if [[ ! -d ${dir} ]];then
+        # This indicates that IST is in progress
+        return
+    fi
+
+    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 -s9 $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 [[ $checkf -eq 1 && ! -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
+
+if ${INNOBACKUPEX_BIN} /tmp --help 2>/dev/null | grep -q -- '--version-check'; then 
+    disver="--no-version-check"
+fi
+
+if [[ ${FORCE_FTWRL:-0} -eq 1 ]];then 
+    wsrep_log_info "Forcing FTWRL due to environment variable FORCE_FTWRL equal to $FORCE_FTWRL"
+    iopts+=" --no-backup-locks "
+fi
+
+
+INNOEXTRA=""
+
+if [[ $ssyslog -eq 1 ]];then 
+
+    if [[ ! -x `which logger` ]];then 
+        wsrep_log_error "logger not in path: $PATH. Ignoring"
+    else
+
+        wsrep_log_info "Logging all stderr of SST/Innobackupex to syslog"
+
+        exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE)
+
+        wsrep_log_error()
+        {
+            logger  -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@" 
+        }
+
+        wsrep_log_info()
+        {
+            logger  -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@" 
+        }
+
+        INNOAPPLY="${INNOBACKUPEX_BIN} $disver $iapts --apply-log \$rebuildcmd \${DATA} 2>&1  | logger -p daemon.err -t ${ssystag}innobackupex-apply "
+        INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $impts  --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move "
+        INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
+    fi
+
+else 
+    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"
+fi
+
+get_stream
+get_transfer
+
+if [ "$WSREP_SST_OPT_ROLE" = "donor" ]
+then
+    trap cleanup_donor EXIT
+
+    if [ $WSREP_SST_OPT_BYPASS -eq 0 ]
+    then
+        usrst=0
+        if [[ -z $sst_ver ]];then 
+            wsrep_log_error "Upgrade joiner to 5.6.21 or higher for backup locks support"
+            wsrep_log_error "The joiner is not supported for this version of donor"
+            exit 93
+        fi
+
+        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 [[ -n "${WSREP_SST_OPT_USER:-}" && "$WSREP_SST_OPT_USER" != "(null)" ]]; then
+           INNOEXTRA+=" --user=$WSREP_SST_OPT_USER"
+           usrst=1
+        fi
+
+        if [ -n "${WSREP_SST_OPT_PSWD:-}" ]; then
+           INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
+        elif [[ $usrst -eq 1 ]];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
+
+
+        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
+
+    ib_home_dir=$(parse_cnf mysqld innodb-data-home-dir "")
+    ib_log_dir=$(parse_cnf mysqld innodb-log-group-home-dir "")
+    ib_undo_dir=$(parse_cnf mysqld innodb-undo-directory "")
+
+    stagemsg="Joiner-Recv"
+
+
+    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
+
+    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 1
+
+
+    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
+
+        if [[ -d ${DATA}/.sst ]];then
+            wsrep_log_info "WARNING: Stale temporary SST directory: ${DATA}/.sst from previous state transfer. Removing"
+            rm -rf ${DATA}/.sst
+        fi
+        mkdir -p ${DATA}/.sst
+        (recv_joiner $DATA/.sst "${stagemsg}-SST" 0 0) &
+        jpid=$!
+        wsrep_log_info "Proceeding with SST"
+
+
+        wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories"
+        find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1  -regex $cpat  -prune  -o -exec rm -rfv {} 1>&2 \+
+
+        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 \+ || true
+                rm $binlog_dir/*.index || true
+            fi
+        fi
+
+
+
+        TDATA=${DATA}
+        DATA="${DATA}/.sst"
+
+
+        MAGIC_FILE="${DATA}/${INFO_FILE}"
+        wsrep_log_info "Waiting for SST streaming to complete!"
+        wait $jpid
+
+        get_proc
+
+        if [[ ! -s ${DATA}/xtrabackup_checkpoints ]];then 
+            wsrep_log_error "xtrabackup_checkpoints missing, failed innobackupex/SST on donor"
+            exit 2
+        fi
+
+        # 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
+
+
+        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
+
+        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"
+            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
+    wsrep_log_info "Galera co-ords from recovery: $(cat ${MAGIC_FILE})"
+    cat "${MAGIC_FILE}" # output UUID:seqno
+    wsrep_log_info "Total time on joiner: $totime seconds"
+fi
+
+exit 0
diff --git a/mysql-wsrep-5.6/scripts/wsrep_sst_xtrabackup.sh b/mysql-wsrep-5.6/scripts/wsrep_sst_xtrabackup.sh
new file mode 100644 (file)
index 0000000..79a7476
--- /dev/null
@@ -0,0 +1,720 @@
+#!/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
+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
+            if nc -h | grep -q ncat;then 
+                tcmd="nc -l ${TSST_PORT}"
+            else 
+                tcmd="nc -dl ${TSST_PORT}"
+            fi
+        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
+        usrst=0
+        TMPDIR="${TMPDIR:-/tmp}"
+
+        if [[ -n "${WSREP_SST_OPT_USER:-}" && "$WSREP_SST_OPT_USER" != "(null)" ]]; then
+           INNOEXTRA+=" --user=$WSREP_SST_OPT_USER"
+           usrst=1
+        fi
+
+        if [ -n "${WSREP_SST_OPT_PSWD:-}" ]; then
+           INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
+        elif [[ $usrst -eq 1 ]];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
index 8fd07fc71d75ffacd69c0896149b493b17b194f7..cc2e05c01546ba9a6fa18343f3c3881e0f01b0ad 100644 (file)
-#This file is automaticly generated by crash-me 1.37
-
-NEG=yes                                        # update of column= -column
-alter_add_col=yes                      # Alter table add column
-alter_add_multi_col=without add                # Alter table add many columns
-alter_alter_col=no                     # Alter table alter column
-alter_change_col=no                    # Alter table change column
-alter_drop_col=yes                     # Alter table drop column
-alter_modify_col=no                    # Alter table modify column
-alter_rename_table=no                  # Alter table rename table
-atomic_updates=no                      # atomic updates
-binary_items=yes                       # binary items (0x41)
-case_insensitive_strings=yes           # case insensitive compare
-char_is_space_filled=no                        # char are space filled
-column_alias=yes                       # Column alias
-columns_in_group_by=11                 # number of columns in group by
-columns_in_order_by=11                 # number of columns in order by
-comment_#=no                           # # as comment
-comment_--=no                          # -- as comment
-comment_/**/=no                                # /* */ as comment
-comment_//=no                          # // as comment
-compute=no                             # Compute
-connections=64                         # Simultaneous connections
-constraint_check=no                    # CHECK constraint
-constraint_null=yes                    # NULL constraint (SyBase style)
-crash_me_safe=no                       # crash me safe
-crash_me_version=1.37                  # crash me version
-create_default=no                      # default value for column
-create_default_func=no                 # default value function for column
-create_if_not_exists=no                        # create table if not exists
-create_index=yes                       # create index
-create_table_select=no                 # create table from select
-cross_join=no                          # cross join (same as from a,b)
-date_as_string=error                   # String functions on date columns
-date_with_YY=yes                       # Supports YY-MM-DD 2000 compilant dates
-date_zero=no                           # Supports 0000-00-00 dates
-double_quotes=yes                      # Double '' as ' in strings
-drop_if_exists=no                      # drop table if exists
-drop_index=with 'ON'                   # drop index
-end_colon=yes                          # allows end ';'
-except=no                              # except
-except_all=no                          # except all
-float_int_expr=yes                     # mixing of integer and float in expression
-foreign_key_syntax=no                  # foreign key syntax
-full_outer_join=no                     # full outer join
-func_extra_!=no                                # Function NOT as '!' in SELECT
-func_extra_%=no                                # Function MOD as %
-func_extra_&=error                     # Function & (bitwise and)
-func_extra_&&=no                       # Function AND as '&&'
-func_extra_<>=yes                      # Function <> in SELECT
-func_extra_==yes                       # Function =
-func_extra_add_months=no               # Function ADD_MONTHS
-func_extra_and_or=yes                  # Function AND and OR in SELECT
-func_extra_atn2=no                     # Function ATN2
-func_extra_auto_num2string=no          # Function automatic num->string convert
-func_extra_auto_string2num=yes         # Function automatic string->num convert
-func_extra_between=yes                 # Function BETWEEN in SELECT
-func_extra_binary_shifts=no            # Function << and >> (bitwise shifts)
-func_extra_bit_count=no                        # Function BIT_COUNT
-func_extra_ceil=no                     # Function CEIL
-func_extra_charindex=no                        # Function CHARINDEX
-func_extra_chr=yes                     # Function CHR
-func_extra_coalesce=no                 # Function COALESCE
-func_extra_concat_as_+=yes             # Function concatenation with +
-func_extra_concat_list=no              # Function CONCAT(list)
-func_extra_convert=no                  # Function CONVERT
-func_extra_cosh=no                     # Function COSH
-func_extra_date_format=no              # Function DATE_FORMAT
-func_extra_dateadd=no                  # Function DATEADD
-func_extra_datediff=no                 # Function DATEDIFF
-func_extra_datename=no                 # Function DATENAME
-func_extra_datepart=no                 # Function DATEPART
-func_extra_elt=no                      # Function ELT
-func_extra_encrypt=no                  # Function ENCRYPT
-func_extra_field=no                    # Function FIELD
-func_extra_format=error                        # Function FORMAT
-func_extra_from_days=no                        # Function FROM_DAYS
-func_extra_from_unixtime=no            # Function FROM_UNIXTIME
-func_extra_getdate=no                  # Function GETDATE
-func_extra_greatest=no                 # Function GREATEST
-func_extra_if=no                       # Function IF
-func_extra_in_num=yes                  # Function IN on numbers in SELECT
-func_extra_in_str=yes                  # Function IN on strings in SELECT
-func_extra_initcap=no                  # Function INITCAP
-func_extra_instr=yes                   # Function LOCATE as INSTR
-func_extra_instr_oracle=no             # Function INSTR (Oracle syntax)
-func_extra_instrb=no                   # Function INSTRB
-func_extra_interval=no                 # Function INTERVAL
-func_extra_last_day=no                 # Function LAST_DAY
-func_extra_last_insert_id=no           # Function LAST_INSERT_ID
-func_extra_least=no                    # Function LEAST
-func_extra_lengthb=no                  # Function LENGTHB
-func_extra_like=yes                    # Function LIKE in SELECT
-func_extra_like_escape=no              # Function LIKE ESCAPE in SELECT
-func_extra_ln=no                       # Function LN
-func_extra_log(m_n)=no                 # Function LOG(m,n)
-func_extra_logn=no                     # Function LOGN
-func_extra_lpad=no                     # Function LPAD
-func_extra_mdy=no                      # Function MDY
-func_extra_mid=yes                     # Function SUBSTRING as MID
-func_extra_months_between=no           # Function MONTHS_BETWEEN
-func_extra_not=yes                     # Function NOT in SELECT
-func_extra_not_between=yes             # Function NOT BETWEEN in SELECT
-func_extra_not_like=yes                        # Function NOT LIKE in SELECT
-func_extra_odbc_convert=no             # Function ODBC CONVERT
-func_extra_password=no                 # Function PASSWORD
-func_extra_patindex=no                 # Function PATINDEX
-func_extra_period_add=no               # Function PERIOD_ADD
-func_extra_period_diff=no              # Function PERIOD_DIFF
-func_extra_pow=no                      # Function POW
-func_extra_range=no                    # Function RANGE
-func_extra_regexp=no                   # Function REGEXP in SELECT
-func_extra_replicate=no                        # Function REPLICATE
-func_extra_reverse=no                  # Function REVERSE
-func_extra_root=no                     # Function ROOT
-func_extra_round1=yes                  # Function ROUND(1 arg)
-func_extra_rpad=no                     # Function RPAD
-func_extra_sec_to_time=no              # Function SEC_TO_TIME
-func_extra_sinh=no                     # Function SINH
-func_extra_str=no                      # Function STR
-func_extra_strcmp=no                   # Function STRCMP
-func_extra_stuff=no                    # Function STUFF
-func_extra_substrb=no                  # Function SUBSTRB
-func_extra_substring_index=no          # Function SUBSTRING_INDEX
-func_extra_sysdate=no                  # Function SYSDATE
-func_extra_tanh=no                     # Function TANH
-func_extra_time_to_sec=no              # Function TIME_TO_SEC
-func_extra_to_days=no                  # Function TO_DAYS
-func_extra_translate=no                        # Function TRANSLATE
-func_extra_trim_many_char=no           # Function TRIM; Many char extension
-func_extra_trim_substring=no           # Function TRIM; Substring extension
-func_extra_trunc=no                    # Function TRUNC
-func_extra_uid=no                      # Function UID
-func_extra_unix_timestamp=no           # Function UNIX_TIMESTAMP
-func_extra_userenv=no                  # Function USERENV
-func_extra_version=no                  # Function VERSION
-func_extra_weekday=error               # Function WEEKDAY
-func_extra_|=no                                # Function | (bitwise or)
-func_extra_||=no                       # Function OR as '||'
-func_odbc_abs=yes                      # Function ABS
-func_odbc_acos=no                      # Function ACOS
-func_odbc_ascii=no                     # Function ASCII
-func_odbc_asin=no                      # Function ASIN
-func_odbc_atan=no                      # Function ATAN
-func_odbc_atan2=no                     # Function ATAN2
-func_odbc_ceiling=no                   # Function CEILING
-func_odbc_char=no                      # Function CHAR
-func_odbc_concat=no                    # Function CONCAT(2 arg)
-func_odbc_cos=yes                      # Function COS
-func_odbc_cot=no                       # Function COT
-func_odbc_curdate=no                   # Function CURDATE
-func_odbc_curtime=no                   # Function CURTIME
-func_odbc_database=no                  # Function DATABASE
-func_odbc_dayname=no                   # Function DAYNAME
-func_odbc_dayofmonth=no                        # Function DAYOFMONTH
-func_odbc_dayofweek=no                 # Function DAYOFWEEK
-func_odbc_dayofyear=no                 # Function DAYOFYEAR
-func_odbc_degrees=no                   # Function DEGREES
-func_odbc_difference=no                        # Function DIFFERENCE()
-func_odbc_exp=yes                      # Function EXP
-func_odbc_extract=no                   # Function EXTRACT
-func_odbc_floor=no                     # Function FLOOR
-func_odbc_fn_left=yes                  # Function ODBC syntax LEFT & RIGHT
-func_odbc_hour=yes                     # Function HOUR
-func_odbc_hour_time=no                 # Function ANSI HOUR
-func_odbc_ifnull=no                    # Function IFNULL
-func_odbc_insert=no                    # Function INSERT
-func_odbc_lcase=yes                    # Function LCASE
-func_odbc_left=yes                     # Function LEFT
-func_odbc_length=no                    # Function REAL LENGTH
-func_odbc_length_without_space=no      # Function ODBC LENGTH
-func_odbc_locate_2=no                  # Function LOCATE(2 arg)
-func_odbc_locate_3=no                  # Function LOCATE(3 arg)
-func_odbc_log=yes                      # Function LOG
-func_odbc_log10=no                     # Function LOG10
-func_odbc_ltrim=yes                    # Function LTRIM
-func_odbc_minute=yes                   # Function MINUTE
-func_odbc_mod=no                       # Function MOD
-func_odbc_month=yes                    # Function MONTH
-func_odbc_monthname=no                 # Function MONTHNAME
-func_odbc_now=yes                      # Function NOW
-func_odbc_pi=no                                # Function PI
-func_odbc_power=no                     # Function POWER
-func_odbc_quarter=no                   # Function QUARTER
-func_odbc_radians=no                   # Function RADIANS
-func_odbc_rand=no                      # Function RAND
-func_odbc_repeat=no                    # Function REPEAT
-func_odbc_replace=no                   # Function REPLACE
-func_odbc_right=yes                    # Function RIGHT
-func_odbc_round=yes                    # Function ROUND(2 arg)
-func_odbc_rtrim=yes                    # Function RTRIM
-func_odbc_second=yes                   # Function SECOND
-func_odbc_sign=no                      # Function SIGN
-func_odbc_sin=yes                      # Function SIN
-func_odbc_soundex=no                   # Function SOUNDEX
-func_odbc_space=yes                    # Function SPACE
-func_odbc_sqrt=no                      # Function SQRT
-func_odbc_substring=no                 # Function ODBC SUBSTRING
-func_odbc_tan=yes                      # Function TAN
-func_odbc_timestampadd=no              # Function TIMESTAMPADD
-func_odbc_timestampdiff=no             # Function TIMESTAMPDIFF
-func_odbc_truncate=no                  # Function TRUNCATE
-func_odbc_ucase=yes                    # Function UCASE
-func_odbc_user()=no                    # Function USER()
-func_odbc_week=no                      # Function WEEK
-func_odbc_year=yes                     # Function YEAR
-func_sql_+=yes                         # Function +, -, * and /
-func_sql_bit_length=no                 # Function BIT_LENGTH
-func_sql_case=no                       # Function CASE
-func_sql_cast=no                       # Function CAST
-func_sql_char_length=no                        # Function CHAR_LENGTH
-func_sql_char_length(constant)=no      # Function CHAR_LENGTH(constant)
-func_sql_character_length=no           # Function CHARACTER_LENGTH
-func_sql_concat_as_||=no               # Function concatenation with ||
-func_sql_current_date=no               # Function CURRENT_DATE
-func_sql_current_time=no               # Function CURRENT_TIME
-func_sql_current_timestamp=no          # Function CURRENT_TIMESTAMP
-func_sql_current_user=no               # Function CURRENT_USER
-func_sql_lower=no                      # Function LOWER
-func_sql_octet_length=no               # Function OCTET_LENGTH
-func_sql_position=no                   # Function POSITION
-func_sql_session_user=no               # Function SESSION_USER
-func_sql_substring=no                  # Function ANSI SQL SUBSTRING
-func_sql_system_user=no                        # Function SYSTEM_USER
-func_sql_trim=no                       # Function TRIM
-func_sql_upper=no                      # Function UPPER
-func_sql_user=no                       # Function USER
-func_where_between=yes                 # Function BETWEEN
-func_where_eq_all=yes                  # Function = ALL
-func_where_eq_any=yes                  # Function = ANY
-func_where_eq_some=yes                 # Function = SOME
-func_where_exists=yes                  # Function EXISTS
-func_where_in_num=yes                  # Function IN on numbers
-func_where_like=yes                    # Function LIKE
-func_where_like_escape=no              # Function LIKE ESCAPE
-func_where_match=no                    # Function MATCH
-func_where_match_unique=no             # Function MATCH UNIQUE
-func_where_matches=no                  # Function MATCHES
-func_where_not_between=yes             # Function NOT BETWEEN
-func_where_not_exists=yes              # Function NOT EXISTS
-func_where_not_like=yes                        # Function NOT LIKE
-func_where_not_unique=no               # Function NOT UNIQUE
-func_where_unique=no                   # Function UNIQUE
-functions=yes                          # Functions
-group_by=yes                           # Group by
-group_by_alias=no                      # Group by alias
-group_by_null=yes                      # group on column with null values
-group_by_position=no                   # Group by position
-group_distinct_functions=no            # Group functions with distinct
-group_func_extra_bit_and=no            # Group function BIT_AND
-group_func_extra_bit_or=no             # Group function BIT_OR
-group_func_extra_count_distinct_list=no        # Group function COUNT(DISTINCT expr,expr,...)
-group_func_extra_std=no                        # Group function STD
-group_func_extra_stddev=no             # Group function STDDEV
-group_func_extra_variance=no           # Group function VARIANCE
-group_func_sql_avg=yes                 # Group function AVG
-group_func_sql_count_*=yes             # Group function COUNT (*)
-group_func_sql_count_column=yes                # Group function COUNT column name
-group_func_sql_count_distinct=no       # Group function COUNT(DISTINCT expr)
-group_func_sql_max=yes                 # Group function MAX on numbers
-group_func_sql_max_str=yes             # Group function MAX on strings
-group_func_sql_min=yes                 # Group function MIN on numbers
-group_func_sql_min_str=yes             # Group function MIN on strings
-group_func_sql_sum=yes                 # Group function SUM
-group_functions=yes                    # Group functions
-having=yes                             # Having
-having_with_alias=no                   # Having on alias
-having_with_group=yes                  # Having with group function
-ignore_end_space=yes                   # ignore end space in compare
-index_in_create=no                     # index in create table
-index_namespace=yes                    # different namespace for index
-index_parts=no                         # index on column part (extension)
-insert_empty_string=yes                        # insert empty string
-insert_select=no                       # insert INTO ... SELECT ...
-insert_with_set=no                     # INSERT with set syntax
-intersect=no                           # intersect
-intersect_all=no                       # intersect all
-join_tables=32                         # tables in join
-left_outer_join=yes                    # left outer join
-left_outer_join_using=no               # left outer join using
-like_with_column=yes                   # column LIKE column
-like_with_number=yes                   # LIKE on numbers
-lock_tables=no                         # lock table
-logical_value=-1                       # Value of logical operation (1=1)
-max_big_expressions=1                  # big expressions
-max_char_size=255                      # max char() size
-max_column_name=59                     # column name length
-max_columns=255                                # Columns in table
-max_conditions=97                      # OR and AND in WHERE
-max_expressions=+10000                 # simple expressions
-max_index=32                           # max index
-max_index_length=2026                  # index length
-max_index_name=64                      # index name length
-max_index_part_length=255              # max index part length
-max_index_parts=10                     # index parts
-max_index_varchar_part_length=85       # index varchar part length
-max_row_length=2025                    # max table row length (without blobs)
-max_row_length_with_null=2025          # table row length with nulls (without blobs)
-max_select_alias_name=64               # select alias name length
-max_stack_expression=14                        # stacked expressions
-max_table_alias_name=253               # table alias name length
-max_table_name=64                      # table name length
-max_text_size=17                       # max text or blob size
-max_unique_index=32                    # unique indexes
-max_varchar_size=85                    # max varchar() size
-minus=no                               # minus
-minus_neg=yes                          # Calculate 1--1
-multi_drop=yes                         # many tables to drop table
-multi_strings=no                       # Multiple line strings
-multi_table_delete=yes                 # DELETE FROM table1,table2...
-multi_table_update=yes                 # Update with many tables
+#This file is automaticly generated by crash-me 1.37\r
+\r
+NEG=yes                                        # update of column= -column\r
+alter_add_col=yes                      # Alter table add column\r
+alter_add_multi_col=without add                # Alter table add many columns\r
+alter_alter_col=no                     # Alter table alter column\r
+alter_change_col=no                    # Alter table change column\r
+alter_drop_col=yes                     # Alter table drop column\r
+alter_modify_col=no                    # Alter table modify column\r
+alter_rename_table=no                  # Alter table rename table\r
+atomic_updates=no                      # atomic updates\r
+binary_items=yes                       # binary items (0x41)\r
+case_insensitive_strings=yes           # case insensitive compare\r
+char_is_space_filled=no                        # char are space filled\r
+column_alias=yes                       # Column alias\r
+columns_in_group_by=11                 # number of columns in group by\r
+columns_in_order_by=11                 # number of columns in order by\r
+comment_#=no                           # # as comment\r
+comment_--=no                          # -- as comment\r
+comment_/**/=no                                # /* */ as comment\r
+comment_//=no                          # // as comment\r
+compute=no                             # Compute\r
+connections=64                         # Simultaneous connections\r
+constraint_check=no                    # CHECK constraint\r
+constraint_null=yes                    # NULL constraint (SyBase style)\r
+crash_me_safe=no                       # crash me safe\r
+crash_me_version=1.37                  # crash me version\r
+create_default=no                      # default value for column\r
+create_default_func=no                 # default value function for column\r
+create_if_not_exists=no                        # create table if not exists\r
+create_index=yes                       # create index\r
+create_table_select=no                 # create table from select\r
+cross_join=no                          # cross join (same as from a,b)\r
+date_as_string=error                   # String functions on date columns\r
+date_with_YY=yes                       # Supports YY-MM-DD 2000 compilant dates\r
+date_zero=no                           # Supports 0000-00-00 dates\r
+double_quotes=yes                      # Double '' as ' in strings\r
+drop_if_exists=no                      # drop table if exists\r
+drop_index=with 'ON'                   # drop index\r
+end_colon=yes                          # allows end ';'\r
+except=no                              # except\r
+except_all=no                          # except all\r
+float_int_expr=yes                     # mixing of integer and float in expression\r
+foreign_key_syntax=no                  # foreign key syntax\r
+full_outer_join=no                     # full outer join\r
+func_extra_!=no                                # Function NOT as '!' in SELECT\r
+func_extra_%=no                                # Function MOD as %\r
+func_extra_&=error                     # Function & (bitwise and)\r
+func_extra_&&=no                       # Function AND as '&&'\r
+func_extra_<>=yes                      # Function <> in SELECT\r
+func_extra_==yes                       # Function =\r
+func_extra_add_months=no               # Function ADD_MONTHS\r
+func_extra_and_or=yes                  # Function AND and OR in SELECT\r
+func_extra_atn2=no                     # Function ATN2\r
+func_extra_auto_num2string=no          # Function automatic num->string convert\r
+func_extra_auto_string2num=yes         # Function automatic string->num convert\r
+func_extra_between=yes                 # Function BETWEEN in SELECT\r
+func_extra_binary_shifts=no            # Function << and >> (bitwise shifts)\r
+func_extra_bit_count=no                        # Function BIT_COUNT\r
+func_extra_ceil=no                     # Function CEIL\r
+func_extra_charindex=no                        # Function CHARINDEX\r
+func_extra_chr=yes                     # Function CHR\r
+func_extra_coalesce=no                 # Function COALESCE\r
+func_extra_concat_as_+=yes             # Function concatenation with +\r
+func_extra_concat_list=no              # Function CONCAT(list)\r
+func_extra_convert=no                  # Function CONVERT\r
+func_extra_cosh=no                     # Function COSH\r
+func_extra_date_format=no              # Function DATE_FORMAT\r
+func_extra_dateadd=no                  # Function DATEADD\r
+func_extra_datediff=no                 # Function DATEDIFF\r
+func_extra_datename=no                 # Function DATENAME\r
+func_extra_datepart=no                 # Function DATEPART\r
+func_extra_elt=no                      # Function ELT\r
+func_extra_encrypt=no                  # Function ENCRYPT\r
+func_extra_field=no                    # Function FIELD\r
+func_extra_format=error                        # Function FORMAT\r
+func_extra_from_days=no                        # Function FROM_DAYS\r
+func_extra_from_unixtime=no            # Function FROM_UNIXTIME\r
+func_extra_getdate=no                  # Function GETDATE\r
+func_extra_greatest=no                 # Function GREATEST\r
+func_extra_if=no                       # Function IF\r
+func_extra_in_num=yes                  # Function IN on numbers in SELECT\r
+func_extra_in_str=yes                  # Function IN on strings in SELECT\r
+func_extra_initcap=no                  # Function INITCAP\r
+func_extra_instr=yes                   # Function LOCATE as INSTR\r
+func_extra_instr_oracle=no             # Function INSTR (Oracle syntax)\r
+func_extra_instrb=no                   # Function INSTRB\r
+func_extra_interval=no                 # Function INTERVAL\r
+func_extra_last_day=no                 # Function LAST_DAY\r
+func_extra_last_insert_id=no           # Function LAST_INSERT_ID\r
+func_extra_least=no                    # Function LEAST\r
+func_extra_lengthb=no                  # Function LENGTHB\r
+func_extra_like=yes                    # Function LIKE in SELECT\r
+func_extra_like_escape=no              # Function LIKE ESCAPE in SELECT\r
+func_extra_ln=no                       # Function LN\r
+func_extra_log(m_n)=no                 # Function LOG(m,n)\r
+func_extra_logn=no                     # Function LOGN\r
+func_extra_lpad=no                     # Function LPAD\r
+func_extra_mdy=no                      # Function MDY\r
+func_extra_mid=yes                     # Function SUBSTRING as MID\r
+func_extra_months_between=no           # Function MONTHS_BETWEEN\r
+func_extra_not=yes                     # Function NOT in SELECT\r
+func_extra_not_between=yes             # Function NOT BETWEEN in SELECT\r
+func_extra_not_like=yes                        # Function NOT LIKE in SELECT\r
+func_extra_odbc_convert=no             # Function ODBC CONVERT\r
+func_extra_password=no                 # Function PASSWORD\r
+func_extra_patindex=no                 # Function PATINDEX\r
+func_extra_period_add=no               # Function PERIOD_ADD\r
+func_extra_period_diff=no              # Function PERIOD_DIFF\r
+func_extra_pow=no                      # Function POW\r
+func_extra_range=no                    # Function RANGE\r
+func_extra_regexp=no                   # Function REGEXP in SELECT\r
+func_extra_replicate=no                        # Function REPLICATE\r
+func_extra_reverse=no                  # Function REVERSE\r
+func_extra_root=no                     # Function ROOT\r
+func_extra_round1=yes                  # Function ROUND(1 arg)\r
+func_extra_rpad=no                     # Function RPAD\r
+func_extra_sec_to_time=no              # Function SEC_TO_TIME\r
+func_extra_sinh=no                     # Function SINH\r
+func_extra_str=no                      # Function STR\r
+func_extra_strcmp=no                   # Function STRCMP\r
+func_extra_stuff=no                    # Function STUFF\r
+func_extra_substrb=no                  # Function SUBSTRB\r
+func_extra_substring_index=no          # Function SUBSTRING_INDEX\r
+func_extra_sysdate=no                  # Function SYSDATE\r
+func_extra_tanh=no                     # Function TANH\r
+func_extra_time_to_sec=no              # Function TIME_TO_SEC\r
+func_extra_to_days=no                  # Function TO_DAYS\r
+func_extra_translate=no                        # Function TRANSLATE\r
+func_extra_trim_many_char=no           # Function TRIM; Many char extension\r
+func_extra_trim_substring=no           # Function TRIM; Substring extension\r
+func_extra_trunc=no                    # Function TRUNC\r
+func_extra_uid=no                      # Function UID\r
+func_extra_unix_timestamp=no           # Function UNIX_TIMESTAMP\r
+func_extra_userenv=no                  # Function USERENV\r
+func_extra_version=no                  # Function VERSION\r
+func_extra_weekday=error               # Function WEEKDAY\r
+func_extra_|=no                                # Function | (bitwise or)\r
+func_extra_||=no                       # Function OR as '||'\r
+func_odbc_abs=yes                      # Function ABS\r
+func_odbc_acos=no                      # Function ACOS\r
+func_odbc_ascii=no                     # Function ASCII\r
+func_odbc_asin=no                      # Function ASIN\r
+func_odbc_atan=no                      # Function ATAN\r
+func_odbc_atan2=no                     # Function ATAN2\r
+func_odbc_ceiling=no                   # Function CEILING\r
+func_odbc_char=no                      # Function CHAR\r
+func_odbc_concat=no                    # Function CONCAT(2 arg)\r
+func_odbc_cos=yes                      # Function COS\r
+func_odbc_cot=no                       # Function COT\r
+func_odbc_curdate=no                   # Function CURDATE\r
+func_odbc_curtime=no                   # Function CURTIME\r
+func_odbc_database=no                  # Function DATABASE\r
+func_odbc_dayname=no                   # Function DAYNAME\r
+func_odbc_dayofmonth=no                        # Function DAYOFMONTH\r
+func_odbc_dayofweek=no                 # Function DAYOFWEEK\r
+func_odbc_dayofyear=no                 # Function DAYOFYEAR\r
+func_odbc_degrees=no                   # Function DEGREES\r
+func_odbc_difference=no                        # Function DIFFERENCE()\r
+func_odbc_exp=yes                      # Function EXP\r
+func_odbc_extract=no                   # Function EXTRACT\r
+func_odbc_floor=no                     # Function FLOOR\r
+func_odbc_fn_left=yes                  # Function ODBC syntax LEFT & RIGHT\r
+func_odbc_hour=yes                     # Function HOUR\r
+func_odbc_hour_time=no                 # Function ANSI HOUR\r
+func_odbc_ifnull=no                    # Function IFNULL\r
+func_odbc_insert=no                    # Function INSERT\r
+func_odbc_lcase=yes                    # Function LCASE\r
+func_odbc_left=yes                     # Function LEFT\r
+func_odbc_length=no                    # Function REAL LENGTH\r
+func_odbc_length_without_space=no      # Function ODBC LENGTH\r
+func_odbc_locate_2=no                  # Function LOCATE(2 arg)\r
+func_odbc_locate_3=no                  # Function LOCATE(3 arg)\r
+func_odbc_log=yes                      # Function LOG\r
+func_odbc_log10=no                     # Function LOG10\r
+func_odbc_ltrim=yes                    # Function LTRIM\r
+func_odbc_minute=yes                   # Function MINUTE\r
+func_odbc_mod=no                       # Function MOD\r
+func_odbc_month=yes                    # Function MONTH\r
+func_odbc_monthname=no                 # Function MONTHNAME\r
+func_odbc_now=yes                      # Function NOW\r
+func_odbc_pi=no                                # Function PI\r
+func_odbc_power=no                     # Function POWER\r
+func_odbc_quarter=no                   # Function QUARTER\r
+func_odbc_radians=no                   # Function RADIANS\r
+func_odbc_rand=no                      # Function RAND\r
+func_odbc_repeat=no                    # Function REPEAT\r
+func_odbc_replace=no                   # Function REPLACE\r
+func_odbc_right=yes                    # Function RIGHT\r
+func_odbc_round=yes                    # Function ROUND(2 arg)\r
+func_odbc_rtrim=yes                    # Function RTRIM\r
+func_odbc_second=yes                   # Function SECOND\r
+func_odbc_sign=no                      # Function SIGN\r
+func_odbc_sin=yes                      # Function SIN\r
+func_odbc_soundex=no                   # Function SOUNDEX\r
+func_odbc_space=yes                    # Function SPACE\r
+func_odbc_sqrt=no                      # Function SQRT\r
+func_odbc_substring=no                 # Function ODBC SUBSTRING\r
+func_odbc_tan=yes                      # Function TAN\r
+func_odbc_timestampadd=no              # Function TIMESTAMPADD\r
+func_odbc_timestampdiff=no             # Function TIMESTAMPDIFF\r
+func_odbc_truncate=no                  # Function TRUNCATE\r
+func_odbc_ucase=yes                    # Function UCASE\r
+func_odbc_user()=no                    # Function USER()\r
+func_odbc_week=no                      # Function WEEK\r
+func_odbc_year=yes                     # Function YEAR\r
+func_sql_+=yes                         # Function +, -, * and /\r
+func_sql_bit_length=no                 # Function BIT_LENGTH\r
+func_sql_case=no                       # Function CASE\r
+func_sql_cast=no                       # Function CAST\r
+func_sql_char_length=no                        # Function CHAR_LENGTH\r
+func_sql_char_length(constant)=no      # Function CHAR_LENGTH(constant)\r
+func_sql_character_length=no           # Function CHARACTER_LENGTH\r
+func_sql_concat_as_||=no               # Function concatenation with ||\r
+func_sql_current_date=no               # Function CURRENT_DATE\r
+func_sql_current_time=no               # Function CURRENT_TIME\r
+func_sql_current_timestamp=no          # Function CURRENT_TIMESTAMP\r
+func_sql_current_user=no               # Function CURRENT_USER\r
+func_sql_lower=no                      # Function LOWER\r
+func_sql_octet_length=no               # Function OCTET_LENGTH\r
+func_sql_position=no                   # Function POSITION\r
+func_sql_session_user=no               # Function SESSION_USER\r
+func_sql_substring=no                  # Function ANSI SQL SUBSTRING\r
+func_sql_system_user=no                        # Function SYSTEM_USER\r
+func_sql_trim=no                       # Function TRIM\r
+func_sql_upper=no                      # Function UPPER\r
+func_sql_user=no                       # Function USER\r
+func_where_between=yes                 # Function BETWEEN\r
+func_where_eq_all=yes                  # Function = ALL\r
+func_where_eq_any=yes                  # Function = ANY\r
+func_where_eq_some=yes                 # Function = SOME\r
+func_where_exists=yes                  # Function EXISTS\r
+func_where_in_num=yes                  # Function IN on numbers\r
+func_where_like=yes                    # Function LIKE\r
+func_where_like_escape=no              # Function LIKE ESCAPE\r
+func_where_match=no                    # Function MATCH\r
+func_where_match_unique=no             # Function MATCH UNIQUE\r
+func_where_matches=no                  # Function MATCHES\r
+func_where_not_between=yes             # Function NOT BETWEEN\r
+func_where_not_exists=yes              # Function NOT EXISTS\r
+func_where_not_like=yes                        # Function NOT LIKE\r
+func_where_not_unique=no               # Function NOT UNIQUE\r
+func_where_unique=no                   # Function UNIQUE\r
+functions=yes                          # Functions\r
+group_by=yes                           # Group by\r
+group_by_alias=no                      # Group by alias\r
+group_by_null=yes                      # group on column with null values\r
+group_by_position=no                   # Group by position\r
+group_distinct_functions=no            # Group functions with distinct\r
+group_func_extra_bit_and=no            # Group function BIT_AND\r
+group_func_extra_bit_or=no             # Group function BIT_OR\r
+group_func_extra_count_distinct_list=no        # Group function COUNT(DISTINCT expr,expr,...)\r
+group_func_extra_std=no                        # Group function STD\r
+group_func_extra_stddev=no             # Group function STDDEV\r
+group_func_extra_variance=no           # Group function VARIANCE\r
+group_func_sql_avg=yes                 # Group function AVG\r
+group_func_sql_count_*=yes             # Group function COUNT (*)\r
+group_func_sql_count_column=yes                # Group function COUNT column name\r
+group_func_sql_count_distinct=no       # Group function COUNT(DISTINCT expr)\r
+group_func_sql_max=yes                 # Group function MAX on numbers\r
+group_func_sql_max_str=yes             # Group function MAX on strings\r
+group_func_sql_min=yes                 # Group function MIN on numbers\r
+group_func_sql_min_str=yes             # Group function MIN on strings\r
+group_func_sql_sum=yes                 # Group function SUM\r
+group_functions=yes                    # Group functions\r
+having=yes                             # Having\r
+having_with_alias=no                   # Having on alias\r
+having_with_group=yes                  # Having with group function\r
+ignore_end_space=yes                   # ignore end space in compare\r
+index_in_create=no                     # index in create table\r
+index_namespace=yes                    # different namespace for index\r
+index_parts=no                         # index on column part (extension)\r
+insert_empty_string=yes                        # insert empty string\r
+insert_select=no                       # insert INTO ... SELECT ...\r
+insert_with_set=no                     # INSERT with set syntax\r
+intersect=no                           # intersect\r
+intersect_all=no                       # intersect all\r
+join_tables=32                         # tables in join\r
+left_outer_join=yes                    # left outer join\r
+left_outer_join_using=no               # left outer join using\r
+like_with_column=yes                   # column LIKE column\r
+like_with_number=yes                   # LIKE on numbers\r
+lock_tables=no                         # lock table\r
+logical_value=-1                       # Value of logical operation (1=1)\r
+max_big_expressions=1                  # big expressions\r
+max_char_size=255                      # max char() size\r
+max_column_name=59                     # column name length\r
+max_columns=255                                # Columns in table\r
+max_conditions=97                      # OR and AND in WHERE\r
+max_expressions=+10000                 # simple expressions\r
+max_index=32                           # max index\r
+max_index_length=2026                  # index length\r
+max_index_name=64                      # index name length\r
+max_index_part_length=255              # max index part length\r
+max_index_parts=10                     # index parts\r
+max_index_varchar_part_length=85       # index varchar part length\r
+max_row_length=2025                    # max table row length (without blobs)\r
+max_row_length_with_null=2025          # table row length with nulls (without blobs)\r
+max_select_alias_name=64               # select alias name length\r
+max_stack_expression=14                        # stacked expressions\r
+max_table_alias_name=253               # table alias name length\r
+max_table_name=64                      # table name length\r
+max_text_size=17                       # max text or blob size\r
+max_unique_index=32                    # unique indexes\r
+max_varchar_size=85                    # max varchar() size\r
+minus=no                               # minus\r
+minus_neg=yes                          # Calculate 1--1\r
+multi_drop=yes                         # many tables to drop table\r
+multi_strings=no                       # Multiple line strings\r
+multi_table_delete=yes                 # DELETE FROM table1,table2...\r
+multi_table_update=yes                 # Update with many tables\r
 insert_multi_value=no                  # Value lists in INSERT
-natural_join=no                                # natural join
-natural_left_outer_join=no             # natural left outer join
-no_primary_key=yes                     # Tables without primary key
-null_in_index=yes                      # null in index
-null_in_unique=yes                     # null in unique
-odbc_left_outer_join=yes               # left outer join odbc style
-operating_system=Windows 98 [Version 4.10.1998]        # crash-me tested on
-order_by=yes                           # Order by
-order_by_alias=no                      # Order by alias
-order_by_function=yes                  # Order by function
-order_by_position=yes                  # Order by position
-order_by_remember_desc=no              # Order by DESC is remembered
-primary_key_in_create=yes              # primary key in create table
-query_size=16777216                    # query size
-quote_ident_with_"=yes                 # " as identifier quote (ANSI SQL)
-quote_ident_with_[=yes                 # [] as identifier quote
-quote_ident_with_`=yes                 # ` as identifier quote
-quote_with_"=no                                # Allows ' and " as string markers
-recursive_subqueries=49                        # recursive subqueries
-remember_end_space=no                  # Remembers end space in char()
-remember_end_space_varchar=yes         # Remembers end space in varchar()
-right_outer_join=yes                   # right outer join
-rowid=no                               # Type for row id
-select_constants=yes                   # Select constants
-select_limit=no                                # SELECT with LIMIT
-select_limit2=no                       # SELECT with LIMIT #,#
-select_string_size=516076              # constant string size in SELECT
-select_table_update=no                 # Update with sub select
-select_without_from=yes                        # SELECT without FROM
-server_version=Access 2000             # server version
-simple_joins=yes                       # ANSI SQL simple joins
-subqueries=yes                         # subqueries
-table_alias=yes                                # Table alias
-table_name_case=yes                    # case independent table names
-table_wildcard=yes                     # Select table_name.*
-tempoary_table=no                      # temporary tables
-transactions=yes                       # transactions
-type_extra_abstime=no                  # Type abstime
-type_extra_bfile=no                    # Type bfile
-type_extra_blob=no                     # Type blob
-type_extra_bool=no                     # Type bool
-type_extra_box=no                      # Type box
-type_extra_byte=yes                    # Type byte
-type_extra_char(1_arg)_binary=no       # Type char(1 arg) binary
-type_extra_circle=no                   # Type circle
-type_extra_clob=no                     # Type clob
-type_extra_datetime=yes                        # Type datetime
-type_extra_double=yes                  # Type double
-type_extra_enum(1_arg)=no              # Type enum(1 arg)
-type_extra_float(2_arg)=no             # Type float(2 arg)
-type_extra_float4=yes                  # Type float4
-type_extra_float8=yes                  # Type float8
-type_extra_image=yes                   # Type image
-type_extra_int(1_arg)_zerofill=no      # Type int(1 arg) zerofill
-type_extra_int1=no                     # Type int1
-type_extra_int2=no                     # Type int2
-type_extra_int3=no                     # Type int3
-type_extra_int4=no                     # Type int4
-type_extra_int8=no                     # Type int8
-type_extra_int_auto_increment=no       # Type int not null auto_increment
-type_extra_int_unsigned=no             # Type int unsigned
-type_extra_interval=no                 # Type interval
-type_extra_line=no                     # Type line
-type_extra_long=yes                    # Type long
-type_extra_long_raw=no                 # Type long raw
-type_extra_long_varbinary=no           # Type long varbinary
-type_extra_long_varchar(1_arg)=no      # Type long varchar(1 arg)
-type_extra_lseg=no                     # Type lseg
-type_extra_mediumint=no                        # Type mediumint
-type_extra_mediumtext=no               # Type mediumtext
-type_extra_middleint=no                        # Type middleint
-type_extra_mlslabel=no                 # Type mlslabel
-type_extra_money=yes                   # Type money
-type_extra_nclob=no                    # Type nclob
-type_extra_number=yes                  # Type number
-type_extra_number(1_arg)=no            # Type number(1 arg)
-type_extra_number(2_arg)=no            # Type number(2 arg)
-type_extra_nvarchar2(1_arg)=no         # Type nvarchar2(1 arg)
-type_extra_path=no                     # Type path
-type_extra_point=no                    # Type point
-type_extra_polygon=no                  # Type polygon
-type_extra_raw(1_arg)=no               # Type raw(1 arg)
-type_extra_reltime=no                  # Type reltime
-type_extra_rowid=no                    # Type rowid
-type_extra_serial=no                   # Type serial
-type_extra_set(1_arg)=no               # Type set(1 arg)
-type_extra_smalldatetime=no            # Type smalldatetime
-type_extra_smallfloat=no               # Type smallfloat
-type_extra_smallmoney=no               # Type smallmoney
-type_extra_text=yes                    # Type text
-type_extra_text(1_arg)=yes             # Type text(1 arg)
-type_extra_timespan=no                 # Type timespan
-type_extra_uint=no                     # Type uint
-type_extra_varchar2(1_arg)=no          # Type varchar2(1 arg)
-type_extra_year=no                     # Type year
-type_odbc_bigint=no                    # Type bigint
-type_odbc_binary(1_arg)=yes            # Type binary(1 arg)
-type_odbc_datetime=yes                 # Type datetime
-type_odbc_tinyint=no                   # Type tinyint
-type_odbc_varbinary(1_arg)=yes         # Type varbinary(1 arg)
-type_sql_bit=yes                       # Type bit
-type_sql_bit(1_arg)=no                 # Type bit(1 arg)
-type_sql_bit_varying(1_arg)=no         # Type bit varying(1 arg)
-type_sql_char(1_arg)=yes               # Type char(1 arg)
-type_sql_char_varying(1_arg)=no                # Type char varying(1 arg)
-type_sql_character(1_arg)=no           # Type character(1 arg)
-type_sql_character_varying(1_arg)=no   # Type character varying(1 arg)
-type_sql_date=yes                      # Type date
-type_sql_dec(2_arg)=no                 # Type dec(2 arg)
-type_sql_decimal(2_arg)=no             # Type decimal(2 arg)
-type_sql_double_precision=no           # Type double precision
-type_sql_float=yes                     # Type float
-type_sql_float(1_arg)=no               # Type float(1 arg)
-type_sql_int=yes                       # Type int
-type_sql_integer=yes                   # Type integer
-type_sql_interval_day_to_second=no     # Type interval day to second
-type_sql_interval_year=no              # Type interval year
-type_sql_interval_year_to_month=no     # Type interval year to month
-type_sql_national_char_varying(1_arg)=no       # Type national char varying(1 arg)
-type_sql_national_character(1_arg)=no  # Type national character(1 arg)
-type_sql_national_character_varying(1_arg)=no  # Type national character varying(1 arg)
-type_sql_nchar(1_arg)=no               # Type nchar(1 arg)
-type_sql_nchar_varying(1_arg)=no       # Type nchar varying(1 arg)
-type_sql_numeric(2_arg)=no             # Type numeric(2 arg)
-type_sql_real=yes                      # Type real
-type_sql_smallint=yes                  # Type smallint
-type_sql_time=yes                      # Type time
-type_sql_timestamp=yes                 # Type timestamp
-type_sql_timestamp_with_time_zone=no   # Type timestamp with time zone
-type_sql_varchar(1_arg)=yes            # Type varchar(1 arg)
-union=yes                              # union
-union_all=yes                          # union all
-unique_in_create=yes                   # unique in create table
-unique_null_in_create=yes              # unique null in create
-views=no                               # views
-where_string_size=258035               # constant string size in where
+natural_join=no                                # natural join\r
+natural_left_outer_join=no             # natural left outer join\r
+no_primary_key=yes                     # Tables without primary key\r
+null_in_index=yes                      # null in index\r
+null_in_unique=yes                     # null in unique\r
+odbc_left_outer_join=yes               # left outer join odbc style\r
+operating_system=Windows 98 [Version 4.10.1998]        # crash-me tested on\r
+order_by=yes                           # Order by\r
+order_by_alias=no                      # Order by alias\r
+order_by_function=yes                  # Order by function\r
+order_by_position=yes                  # Order by position\r
+order_by_remember_desc=no              # Order by DESC is remembered\r
+primary_key_in_create=yes              # primary key in create table\r
+query_size=16777216                    # query size\r
+quote_ident_with_"=yes                 # " as identifier quote (ANSI SQL)\r
+quote_ident_with_[=yes                 # [] as identifier quote\r
+quote_ident_with_`=yes                 # ` as identifier quote\r
+quote_with_"=no                                # Allows ' and " as string markers\r
+recursive_subqueries=49                        # recursive subqueries\r
+remember_end_space=no                  # Remembers end space in char()\r
+remember_end_space_varchar=yes         # Remembers end space in varchar()\r
+right_outer_join=yes                   # right outer join\r
+rowid=no                               # Type for row id\r
+select_constants=yes                   # Select constants\r
+select_limit=no                                # SELECT with LIMIT\r
+select_limit2=no                       # SELECT with LIMIT #,#\r
+select_string_size=516076              # constant string size in SELECT\r
+select_table_update=no                 # Update with sub select\r
+select_without_from=yes                        # SELECT without FROM\r
+server_version=Access 2000             # server version\r
+simple_joins=yes                       # ANSI SQL simple joins\r
+subqueries=yes                         # subqueries\r
+table_alias=yes                                # Table alias\r
+table_name_case=yes                    # case independent table names\r
+table_wildcard=yes                     # Select table_name.*\r
+tempoary_table=no                      # temporary tables\r
+transactions=yes                       # transactions\r
+type_extra_abstime=no                  # Type abstime\r
+type_extra_bfile=no                    # Type bfile\r
+type_extra_blob=no                     # Type blob\r
+type_extra_bool=no                     # Type bool\r
+type_extra_box=no                      # Type box\r
+type_extra_byte=yes                    # Type byte\r
+type_extra_char(1_arg)_binary=no       # Type char(1 arg) binary\r
+type_extra_circle=no                   # Type circle\r
+type_extra_clob=no                     # Type clob\r
+type_extra_datetime=yes                        # Type datetime\r
+type_extra_double=yes                  # Type double\r
+type_extra_enum(1_arg)=no              # Type enum(1 arg)\r
+type_extra_float(2_arg)=no             # Type float(2 arg)\r
+type_extra_float4=yes                  # Type float4\r
+type_extra_float8=yes                  # Type float8\r
+type_extra_image=yes                   # Type image\r
+type_extra_int(1_arg)_zerofill=no      # Type int(1 arg) zerofill\r
+type_extra_int1=no                     # Type int1\r
+type_extra_int2=no                     # Type int2\r
+type_extra_int3=no                     # Type int3\r
+type_extra_int4=no                     # Type int4\r
+type_extra_int8=no                     # Type int8\r
+type_extra_int_auto_increment=no       # Type int not null auto_increment\r
+type_extra_int_unsigned=no             # Type int unsigned\r
+type_extra_interval=no                 # Type interval\r
+type_extra_line=no                     # Type line\r
+type_extra_long=yes                    # Type long\r
+type_extra_long_raw=no                 # Type long raw\r
+type_extra_long_varbinary=no           # Type long varbinary\r
+type_extra_long_varchar(1_arg)=no      # Type long varchar(1 arg)\r
+type_extra_lseg=no                     # Type lseg\r
+type_extra_mediumint=no                        # Type mediumint\r
+type_extra_mediumtext=no               # Type mediumtext\r
+type_extra_middleint=no                        # Type middleint\r
+type_extra_mlslabel=no                 # Type mlslabel\r
+type_extra_money=yes                   # Type money\r
+type_extra_nclob=no                    # Type nclob\r
+type_extra_number=yes                  # Type number\r
+type_extra_number(1_arg)=no            # Type number(1 arg)\r
+type_extra_number(2_arg)=no            # Type number(2 arg)\r
+type_extra_nvarchar2(1_arg)=no         # Type nvarchar2(1 arg)\r
+type_extra_path=no                     # Type path\r
+type_extra_point=no                    # Type point\r
+type_extra_polygon=no                  # Type polygon\r
+type_extra_raw(1_arg)=no               # Type raw(1 arg)\r
+type_extra_reltime=no                  # Type reltime\r
+type_extra_rowid=no                    # Type rowid\r
+type_extra_serial=no                   # Type serial\r
+type_extra_set(1_arg)=no               # Type set(1 arg)\r
+type_extra_smalldatetime=no            # Type smalldatetime\r
+type_extra_smallfloat=no               # Type smallfloat\r
+type_extra_smallmoney=no               # Type smallmoney\r
+type_extra_text=yes                    # Type text\r
+type_extra_text(1_arg)=yes             # Type text(1 arg)\r
+type_extra_timespan=no                 # Type timespan\r
+type_extra_uint=no                     # Type uint\r
+type_extra_varchar2(1_arg)=no          # Type varchar2(1 arg)\r
+type_extra_year=no                     # Type year\r
+type_odbc_bigint=no                    # Type bigint\r
+type_odbc_binary(1_arg)=yes            # Type binary(1 arg)\r
+type_odbc_datetime=yes                 # Type datetime\r
+type_odbc_tinyint=no                   # Type tinyint\r
+type_odbc_varbinary(1_arg)=yes         # Type varbinary(1 arg)\r
+type_sql_bit=yes                       # Type bit\r
+type_sql_bit(1_arg)=no                 # Type bit(1 arg)\r
+type_sql_bit_varying(1_arg)=no         # Type bit varying(1 arg)\r
+type_sql_char(1_arg)=yes               # Type char(1 arg)\r
+type_sql_char_varying(1_arg)=no                # Type char varying(1 arg)\r
+type_sql_character(1_arg)=no           # Type character(1 arg)\r
+type_sql_character_varying(1_arg)=no   # Type character varying(1 arg)\r
+type_sql_date=yes                      # Type date\r
+type_sql_dec(2_arg)=no                 # Type dec(2 arg)\r
+type_sql_decimal(2_arg)=no             # Type decimal(2 arg)\r
+type_sql_double_precision=no           # Type double precision\r
+type_sql_float=yes                     # Type float\r
+type_sql_float(1_arg)=no               # Type float(1 arg)\r
+type_sql_int=yes                       # Type int\r
+type_sql_integer=yes                   # Type integer\r
+type_sql_interval_day_to_second=no     # Type interval day to second\r
+type_sql_interval_year=no              # Type interval year\r
+type_sql_interval_year_to_month=no     # Type interval year to month\r
+type_sql_national_char_varying(1_arg)=no       # Type national char varying(1 arg)\r
+type_sql_national_character(1_arg)=no  # Type national character(1 arg)\r
+type_sql_national_character_varying(1_arg)=no  # Type national character varying(1 arg)\r
+type_sql_nchar(1_arg)=no               # Type nchar(1 arg)\r
+type_sql_nchar_varying(1_arg)=no       # Type nchar varying(1 arg)\r
+type_sql_numeric(2_arg)=no             # Type numeric(2 arg)\r
+type_sql_real=yes                      # Type real\r
+type_sql_smallint=yes                  # Type smallint\r
+type_sql_time=yes                      # Type time\r
+type_sql_timestamp=yes                 # Type timestamp\r
+type_sql_timestamp_with_time_zone=no   # Type timestamp with time zone\r
+type_sql_varchar(1_arg)=yes            # Type varchar(1 arg)\r
+union=yes                              # union\r
+union_all=yes                          # union all\r
+unique_in_create=yes                   # unique in create table\r
+unique_null_in_create=yes              # unique null in create\r
+views=no                               # views\r
+where_string_size=258035               # constant string size in where\r
index c52bdd3c60a9cb2aa193e110e0d09826a2cbe4ed..4f5f85f0de95ef13c3bd24a1f1a731cbfdde9e37 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 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
@@ -1834,35 +1834,39 @@ mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
 static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const char **errptr)
 {
   SSL *ssl;
-  X509 *server_cert;
-  char *cp1, *cp2;
-  char buf[256];
+  X509 *server_cert= NULL;
+  char *cn= NULL;
+  int cn_loc= -1;
+  ASN1_STRING *cn_asn1= NULL;
+  X509_NAME_ENTRY *cn_entry= NULL;
+  X509_NAME *subject= NULL;
+  int ret_validation= 1;
+
   DBUG_ENTER("ssl_verify_server_cert");
   DBUG_PRINT("enter", ("server_hostname: %s", server_hostname));
 
   if (!(ssl= (SSL*)vio->ssl_arg))
   {
     *errptr= "No SSL pointer found";
-    DBUG_RETURN(1);
+    goto error;
   }
 
   if (!server_hostname)
   {
     *errptr= "No server hostname supplied";
-    DBUG_RETURN(1);
+    goto error;
   }
 
   if (!(server_cert= SSL_get_peer_certificate(ssl)))
   {
     *errptr= "Could not get server certificate";
-    DBUG_RETURN(1);
+    goto error;
   }
 
   if (X509_V_OK != SSL_get_verify_result(ssl))
   {
     *errptr= "Failed to verify the server certificate";
-    X509_free(server_cert);
-    DBUG_RETURN(1);
+    goto error;
   }
   /*
     We already know that the certificate exchanged was valid; the SSL library
@@ -1870,27 +1874,61 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c
     are what we expect.
   */
 
-  X509_NAME_oneline(X509_get_subject_name(server_cert), buf, sizeof(buf));
-  X509_free (server_cert);
+  /*
+   Some notes for future development
+   We should check host name in alternative name first and then if needed check in common name.
+   Currently yssl doesn't support alternative name.
+   openssl 1.0.2 support X509_check_host method for host name validation, we may need to start using
+   X509_check_host in the future.
+  */
 
-  DBUG_PRINT("info", ("hostname in cert: %s", buf));
-  cp1= strstr(buf, "/CN=");
-  if (cp1)
+  subject= X509_get_subject_name((X509 *) server_cert);
+  // Find the CN location in the subject
+  cn_loc= X509_NAME_get_index_by_NID(subject, NID_commonName, -1);
+  if (cn_loc < 0)
   {
-    cp1+= 4; /* Skip the "/CN=" that we found */
-    /* Search for next / which might be the delimiter for email */
-    cp2= strchr(cp1, '/');
-    if (cp2)
-      *cp2= '\0';
-    DBUG_PRINT("info", ("Server hostname in cert: %s", cp1));
-    if (!strcmp(cp1, server_hostname))
-    {
-      /* Success */
-      DBUG_RETURN(0);
-    }
+    *errptr= "Failed to get CN location in the certificate subject";
+    goto error;
   }
+
+  // Get the CN entry for given location
+  cn_entry= X509_NAME_get_entry(subject, cn_loc);
+  if (cn_entry == NULL)
+  {
+    *errptr= "Failed to get CN entry using CN location";
+    goto error;
+  }
+
+  // Get CN from common name entry
+  cn_asn1 = X509_NAME_ENTRY_get_data(cn_entry);
+  if (cn_asn1 == NULL)
+  {
+    *errptr= "Failed to get CN from CN entry";
+    goto error;
+  }
+
+  cn= (char *) ASN1_STRING_data(cn_asn1);
+
+  // There should not be any NULL embedded in the CN
+  if ((size_t)ASN1_STRING_length(cn_asn1) != strlen(cn))
+  {
+    *errptr= "NULL embedded in the certificate CN";
+    goto error;
+  }
+
+  DBUG_PRINT("info", ("Server hostname in cert: %s", cn));
+  if (!strcmp(cn, server_hostname))
+  {
+    /* Success */
+    ret_validation= 0;
+  }
+
   *errptr= "SSL certificate validation failure";
-  DBUG_RETURN(1);
+
+error:
+  if (server_cert != NULL)
+    X509_free (server_cert);
+  DBUG_RETURN(ret_validation);
 }
 
 #endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
@@ -3557,8 +3595,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
       */
       saved_error= socket_errno;
 
-      DBUG_PRINT("info", ("No success, close socket, try next address."));
-      closesocket(sock);
+      DBUG_PRINT("info", ("No success, try next address."));
     }
     DBUG_PRINT("info",
                ("End of connect attempts, sock: %d  status: %d  error: %d",
index 3eeb07d90fbb8f2b27a538d5b08e30679d968c2f..6610f75f84dce2f1976cab44b4d4ace8035fd284 100644 (file)
@@ -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
 # 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
@@ -28,8 +33,24 @@ SET(GEN_SOURCES
   ${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc
   ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h 
 )
+SET(GEN_DIGEST_SOURCES
+  ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h 
+)
+
+SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES}
+                            ${GEN_DIGEST_SOURCES}
+                            PROPERTIES GENERATED 1)
 
-SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1)
+# Gen_lex_token
+# Make sure sql_yacc.h is generated before compiling gen_lex_token
+ADD_EXECUTABLE(gen_lex_token gen_lex_token.cc)
+ADD_DEPENDENCIES(gen_lex_token GenServerSource)
+
+ADD_CUSTOM_COMMAND(
+  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
+  COMMAND gen_lex_token > lex_token.h
+  DEPENDS gen_lex_token
+)
 
 ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER) 
 IF(SSL_DEFINES)
@@ -116,6 +137,7 @@ SET(SQL_SHARED_SOURCES
   sql_db.cc
   sql_delete.cc
   sql_derived.cc
+  sql_digest.cc
   sql_do.cc 
   sql_error.cc
   sql_executor.cc
@@ -171,8 +193,27 @@ SET(SQL_SHARED_SOURCES
 
 SET(SQL_EXPORTED_SOURCES ${SQL_SHARED_SOURCES} PARENT_SCOPE)
 
+IF(WITH_WSREP)
+ SET(WSREP_SOURCES
+   wsrep_utils.cc
+   wsrep_xid.cc
+   wsrep_check_opts.cc
+   wsrep_hton.cc
+   wsrep_mysqld.cc
+   wsrep_notify.cc
+   wsrep_sst.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}
+  ${GEN_DIGEST_SOURCES}
   ${MYSYS_LIBWRAP_SOURCE}
   ${SQL_SHARED_SOURCES}
   ../libmysql/errmsg.c
@@ -204,10 +245,12 @@ RECOMPILE_FOR_EMBEDDED)
 
 ADD_LIBRARY(sql STATIC ${SQL_SOURCE})
 ADD_DEPENDENCIES(sql GenServerSource)
+ADD_DEPENDENCIES(sql GenDigestServerSource)
 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 +289,6 @@ ADD_LIBRARY(sqlgunitlib
   )
 ADD_DEPENDENCIES(sqlgunitlib GenError)
 
-
 IF(WIN32)
   SET(MYSQLD_SOURCE main.cc nt_servc.cc nt_servc.h message.rc)
 ELSE()
@@ -380,6 +422,11 @@ ADD_CUSTOM_TARGET(
         DEPENDS ${GEN_SOURCES}
 )
 
+ADD_CUSTOM_TARGET( 
+        GenDigestServerSource
+        DEPENDS ${GEN_DIGEST_SOURCES}
+)
+
 #Need this only for embedded
 SET_TARGET_PROPERTIES(GenServerSource PROPERTIES EXCLUDE_FROM_ALL TRUE)
 
@@ -395,6 +442,8 @@ IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED)
   ELSE()
     # udf_example is using safemutex exported by mysqld
     TARGET_LINK_LIBRARIES(udf_example mysqld)
+    SET_TARGET_PROPERTIES(udf_example
+      PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}")
   ENDIF()
 ENDIF()
 
index d1babfec19baebd1ee71ad74a477a1b4afd04e6b..1e0fa53c63930630e481c3cce2b44552054005f9 100644 (file)
@@ -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
 #include <string>
 #include <my_stacktrace.h>
 
+#ifdef WITH_WSREP
+#include "wsrep_xid.h"
+#endif /* WITH_WSREP */
+
 using std::max;
 using std::min;
 using std::string;
@@ -60,7 +64,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;
@@ -155,9 +163,12 @@ static void print_system_time()
   Helper class to perform a thread excursion.
 
   This class is used to temporarily switch to another session (THD
-  structure). It will set up the PSI structures and other "globals"
-  correctly (e.g., thread-specific variables) so that the POSIX thread
-  looks exactly like the session attached to.
+  structure). It will set up thread specific "globals" correctly
+  so that the POSIX thread looks exactly like the session attached to.
+  However, PSI_thread info is not touched as it is required to show
+  the actual physial view in PFS instrumentation i.e., it should
+  depict as the real thread doing the work instead of thread it switched
+  to.
 
   On destruction, the original session (which is supplied to the
   constructor) will be re-attached automatically. For example, with
@@ -180,17 +191,10 @@ class Thread_excursion
 public:
   Thread_excursion(THD *thd)
     : m_original_thd(thd)
-#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
-    , m_saved_psi(PSI_server ? PSI_server->get_thread() : NULL)
-#endif
   {
   }
 
   ~Thread_excursion() {
-#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
-    if (PSI_server)
-      PSI_server->set_thread(m_saved_psi);
-#endif
 #ifndef EMBEDDED_LIBRARY
     if (unlikely(setup_thread_globals(m_original_thd)))
       DBUG_ASSERT(0);                           // Out of memory?!
@@ -253,18 +257,10 @@ private:
    */
   int attach_to(THD *thd)
   {
-#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
-    if (PSI_server)
-      PSI_server->set_thread(thd_get_psi(thd));
-#endif
 #ifndef EMBEDDED_LIBRARY
     if (DBUG_EVALUATE_IF("simulate_session_attach_error", 1, 0)
         || unlikely(setup_thread_globals(thd)))
     {
-#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
-      if (PSI_server)
-        PSI_server->set_thread(m_saved_psi);
-#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
       /*
         Indirectly uses pthread_setspecific, which can only return
         ENOMEM or EINVAL. Since store_globals are using correct keys,
@@ -296,7 +292,6 @@ exit0:
   }
 
   THD *m_original_thd;
-  PSI_thread *m_saved_psi;
 };
 
 
@@ -749,6 +744,17 @@ public:
     return stmt_cache.is_binlog_empty() && trx_cache.is_binlog_empty();
   }
 
+  /*
+    clear stmt_cache and trx_cache if they are not empty
+  */
+  void reset()
+  {
+    if (!stmt_cache.is_binlog_empty())
+      stmt_cache.reset();
+    if (!trx_cache.is_binlog_empty())
+      trx_cache.reset();
+  }
+
 #ifndef DBUG_OFF
   bool dbug_any_finalized() const {
     return stmt_cache.dbug_is_finalized() || trx_cache.dbug_is_finalized();
@@ -770,7 +776,7 @@ public:
   {
     my_off_t stmt_bytes= 0;
     my_off_t trx_bytes= 0;
-    DBUG_ASSERT(stmt_cache.has_xid() == 0 && trx_cache.has_xid() <= 1);
+    DBUG_ASSERT(stmt_cache.has_xid() == 0);
     if (int error= stmt_cache.flush(thd, &stmt_bytes, wrote_xid))
       return error;
     if (int error= trx_cache.flush(thd, &trx_bytes, wrote_xid))
@@ -795,7 +801,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 +889,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 +909,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 +933,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 (%llu bytes) @ connection close %llu",
+               (unsigned long long) len, (unsigned long long) 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 (%llu bytes) @ connection close %llu",
+               (unsigned long long) len, (unsigned long long) 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());
@@ -1225,6 +1266,8 @@ binlog_cache_data::flush(THD *thd, my_off_t *bytes_written, bool *wrote_xid)
      */
     if (!(error= gtid_before_write_cache(thd, this)))
       error= mysql_bin_log.write_cache(thd, this);
+    else
+      thd->commit_error= THD::CE_FLUSH_ERROR;
 
     if (flags.with_xid && error == 0)
       *wrote_xid= true;
@@ -1666,7 +1709,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
@@ -1722,7 +1769,13 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv)
 {
   DBUG_ENTER("binlog_savepoint_set");
   int error= 1;
-
+#ifdef WITH_WSREP
+  /*
+    Clear table maps before writing SAVEPOINT event. This enforces
+    recreation of table map events for the following row event.
+   */
+  thd->clear_binlog_table_maps();
+#endif /* WITH_WSREP */
   String log_query;
   if (log_query.append(STRING_WITH_LEN("SAVEPOINT ")))
     DBUG_RETURN(error);
@@ -1779,6 +1832,16 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)
   }
   // Otherwise, we truncate the cache
   cache_mngr->trx_cache.restore_savepoint(pos);
+  /*
+    When a SAVEPOINT is executed inside a stored function/trigger we force the
+    pending event to be flushed with a STMT_END_F flag and clear the table maps
+    as well to ensure that following DMLs will have a clean state to start
+    with. ROLLBACK inside a stored routine has to finalize possibly existing
+    current row-based pending event with cleaning up table maps. That ensures
+    that following DMLs will have a clean state to start with.
+   */
+  if (thd->in_sub_stmt)
+    thd->clear_binlog_table_maps();
   if (cache_mngr->trx_cache.is_binlog_empty())
     cache_mngr->trx_cache.group_cache.clear();
   DBUG_RETURN(0);
@@ -2295,6 +2358,25 @@ bool show_binlog_events(THD *thd, MYSQL_BIN_LOG *binary_log)
     if ((file=open_binlog_file(&log, linfo.log_file_name, &errmsg)) < 0)
       goto err;
 
+    my_off_t end_pos;
+    /*
+      Acquire LOCK_log only for the duration to calculate the
+      log's end position. LOCK_log should be acquired even while
+      we are checking whether the log is active log or not.
+    */
+    mysql_mutex_lock(log_lock);
+    if (binary_log->is_active(linfo.log_file_name))
+    {
+      LOG_INFO li;
+      binary_log->get_current_log(&li, false /*LOCK_log is already acquired*/);
+      end_pos= li.pos;
+    }
+    else
+    {
+      end_pos= my_b_filelength(&log);
+    }
+    mysql_mutex_unlock(log_lock);
+
     /*
       to account binlog event header size
     */
@@ -2302,8 +2384,6 @@ bool show_binlog_events(THD *thd, MYSQL_BIN_LOG *binary_log)
 
     DEBUG_SYNC(thd, "after_show_binlog_event_found_file");
 
-    mysql_mutex_lock(log_lock);
-
     /*
       open_binlog_file() sought to position 4.
       Read the first event in case it's a Format_description_log_event, to
@@ -2338,6 +2418,7 @@ bool show_binlog_events(THD *thd, MYSQL_BIN_LOG *binary_log)
                                          description_event,
                                          opt_master_verify_checksum)); )
     {
+      DEBUG_SYNC(thd, "wait_in_show_binlog_events_loop");
       if (ev->get_type_code() == FORMAT_DESCRIPTION_EVENT)
         description_event->checksum_alg= ev->checksum_alg;
 
@@ -2346,25 +2427,22 @@ bool show_binlog_events(THD *thd, MYSQL_BIN_LOG *binary_log)
       {
        errmsg = "Net error";
        delete ev;
-        mysql_mutex_unlock(log_lock);
        goto err;
       }
 
       pos = my_b_tell(&log);
       delete ev;
 
-      if (++event_count >= limit_end)
+      if (++event_count >= limit_end || pos >= end_pos)
        break;
     }
 
     if (event_count < limit_end && log.error)
     {
       errmsg = "Wrong offset or I/O error";
-      mysql_mutex_unlock(log_lock);
       goto err;
     }
 
-    mysql_mutex_unlock(log_lock);
   }
   // Check that linfo is still on the function scope.
   DEBUG_SYNC(thd, "after_show_binlog_events");
@@ -3362,18 +3440,9 @@ err:
   log_state= LOG_CLOSED;
   if (binlog_error_action == ABORT_SERVER)
   {
-    THD *thd= current_thd;
-    /*
-      On fatal error when code enters here we should forcefully clear the
-      previous errors so that a new critical error message can be pushed
-      to the client side.
-     */
-    thd->clear_error();
-    my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), "Either disk is full or "
-             "file system is read only while opening the binlog. Aborting the "
-             "server");
-    thd->protocol->end_statement();
-    _exit(EXIT_FAILURE);
+    exec_binlog_error_action_abort("Either disk is full or file system is read "
+                                   "only while opening the binlog. Aborting the"
+                                   " server.");
   }
   else
     sql_print_error("Could not use %s for logging (error %d). "
@@ -3512,18 +3581,20 @@ err:
   DBUG_RETURN(-1);
 }
 
-int MYSQL_BIN_LOG::get_current_log(LOG_INFO* linfo)
+int MYSQL_BIN_LOG::get_current_log(LOG_INFO* linfo, bool need_lock_log/*true*/)
 {
-  mysql_mutex_lock(&LOCK_log);
+  if (need_lock_log)
+    mysql_mutex_lock(&LOCK_log);
   int ret = raw_get_current_log(linfo);
-  mysql_mutex_unlock(&LOCK_log);
+  if (need_lock_log)
+    mysql_mutex_unlock(&LOCK_log);
   return ret;
 }
 
 int MYSQL_BIN_LOG::raw_get_current_log(LOG_INFO* linfo)
 {
   strmake(linfo->log_file_name, log_file_name, sizeof(linfo->log_file_name)-1);
-  linfo->pos = my_b_tell(&log_file);
+  linfo->pos = my_b_safe_tell(&log_file);
   return 0;
 }
 
@@ -4092,9 +4163,17 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
     rli->set_group_relay_log_name(rli->linfo.log_file_name);
     rli->notify_group_relay_log_name_update();
   }
-
-  /* Store where we are in the new file for the execution thread */
-  rli->flush_info(TRUE);
+  /*
+    Store where we are in the new file for the execution thread.
+    If we are in the middle of a group), then we should not store
+    the position in the repository, instead in that case set a flag
+    to true which indicates that a 'forced flush' is postponed due
+    to transaction split across the relaylogs.
+  */
+  if (!rli->is_in_group())
+    rli->flush_info(TRUE);
+  else
+    rli->force_flush_postponed_due_to_split_trans= true;
 
   DBUG_EXECUTE_IF("crash_before_purge_logs", DBUG_SUICIDE(););
 
@@ -4878,7 +4957,10 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock_log, Format_description_log_even
       written to the binary log.
    */
   while (get_prep_xids() > 0)
+  {
+    DEBUG_SYNC(current_thd, "before_rotate_binlog_file");
     mysql_cond_wait(&m_prep_xids_cond, &LOCK_xids);
+  }
   mysql_mutex_unlock(&LOCK_xids);
 
   mysql_mutex_lock(&LOCK_index);
@@ -4890,19 +4972,22 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock_log, Format_description_log_even
   mysql_mutex_assert_owner(&LOCK_log);
   mysql_mutex_assert_owner(&LOCK_index);
 
-  /* Reuse old name if not binlog and not update log */
-  new_name_ptr= name;
 
   /*
     If user hasn't specified an extension, generate a new log name
     We have to do this here and not in open as we want to store the
     new file name in the current binary log file.
   */
+  new_name_ptr= new_name;
   if ((error= generate_new_name(new_name, name)))
+  {
+    // Use the old name if generation of new name fails.
+    strcpy(new_name, name);
+    close_on_error= TRUE;
     goto end;
+  }
   else
   {
-    new_name_ptr=new_name;
     /*
       We log the whole file name for log file as the user may decide
       to change base names at some point.
@@ -4950,6 +5035,7 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock_log, Format_description_log_even
      Note that at this point, log_state != LOG_CLOSED (important for is_open()).
   */
 
+  DEBUG_SYNC(current_thd, "before_rotate_binlog_file");
   /*
      new_file() is only used for rotation (in FLUSH LOGS or because size >
      max_binlog_size or max_relay_log_size).
@@ -5003,18 +5089,9 @@ end:
     close(LOG_CLOSE_INDEX);
     if (binlog_error_action == ABORT_SERVER)
     {
-      THD *thd= current_thd;
-      /*
-        On fatal error when code enters here we should forcefully clear the
-        previous errors so that a new critical error message can be pushed
-        to the client side.
-       */
-      thd->clear_error();
-      my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), "Either disk is full or "
-               "file system is read only while rotating the binlog. Aborting "
-               "the server");
-      thd->protocol->end_statement();
-      _exit(EXIT_FAILURE);
+      exec_binlog_error_action_abort("Either disk is full or file system is"
+                                     " read only while rotating the binlog."
+                                     " Aborting the server.");
     }
     else
       sql_print_error("Could not open %s for logging (error %d). "
@@ -5065,11 +5142,19 @@ bool MYSQL_BIN_LOG::after_append_to_relay_log(Master_info *mi)
   bool error= false;
   if (flush_and_sync(0) == 0)
   {
+    DBUG_EXECUTE_IF ("set_max_size_zero",
+                     {max_size=0;});
     // If relay log is too big, rotate
     if ((uint) my_b_append_tell(&log_file) >
         DBUG_EVALUATE_IF("rotate_slave_debug_group", 500, max_size))
     {
       error= new_file_without_locking(mi->get_mi_description_event());
+      DBUG_EXECUTE_IF ("set_max_size_zero",
+                       {
+                       max_size=1073741824;
+                       DBUG_SET("-d,set_max_size_zero");
+                       DBUG_SET("-d,flush_after_reading_gtid_event");
+                       });
     }
   }
 
@@ -5190,7 +5275,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;
@@ -5252,10 +5341,17 @@ bool MYSQL_BIN_LOG::write_event(Log_event *event_info)
   /*
     We only end the statement if we are in a top-level statement.  If
     we are inside a stored function, we do not end the statement since
-    this will close all tables on the slave.
+    this will close all tables on the slave. But there can be a special case
+    where we are inside a stored function/trigger and a SAVEPOINT is being
+    set in side the stored function/trigger. This SAVEPOINT execution will
+    force the pending event to be flushed without an STMT_END_F flag. This
+    will result in a case where following DMLs will be considered as part of
+    same statement and result in data loss on slave. Hence in this case we
+    force the end_stmt to be true.
   */
-  bool const end_stmt=
-    thd->locked_tables_mode && thd->lex->requires_prelocking();
+  bool const end_stmt= (thd->in_sub_stmt && thd->lex->sql_command ==
+                        SQLCOM_SAVEPOINT)? true:
+    (thd->locked_tables_mode && thd->lex->requires_prelocking());
   if (thd->binlog_flush_pending_rows_event(end_stmt,
                                            event_info->is_using_trans_cache()))
     DBUG_RETURN(error);
@@ -5265,7 +5361,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 +5514,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);
@@ -5420,30 +5531,7 @@ int MYSQL_BIN_LOG::rotate(bool force_rotate, bool* check_purge)
 
   if (force_rotate || (my_b_tell(&log_file) >= (my_off_t) max_size))
   {
-    if ((error= new_file_without_locking(NULL)))
-      /** 
-        Be conservative... There are possible lost events (eg, 
-        failing to log the Execute_load_query_log_event
-        on a LOAD DATA while using a non-transactional
-        table)!
-
-        We give it a shot and try to write an incident event anyway
-        to the current log. 
-      */
-      if (!write_incident(current_thd, false/*need_lock_log=false*/,
-                          false/*do_flush_and_sync==false*/))
-      {
-        /*
-          Write an error to log. So that user might have a chance
-          to be alerted and explore incident details before its
-          slave servers would stop.
-        */
-        sql_print_error("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.");
-        flush_and_sync(0);
-      }
-
+    error= new_file_without_locking(NULL);
     *check_purge= true;
   }
   DBUG_RETURN(error);
@@ -5898,6 +5986,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();
@@ -5907,7 +5998,8 @@ bool MYSQL_BIN_LOG::write_cache(THD *thd, binlog_cache_data *cache_data)
                     if (rand() % 3 == 0)
                     {
                       write_error=1;
-                      goto err;
+                      thd->commit_error= THD::CE_FLUSH_ERROR;
+                      DBUG_RETURN(0);
                     }
                   };);
 
@@ -6353,7 +6445,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;
 
@@ -6649,24 +6747,27 @@ MYSQL_BIN_LOG::process_commit_stage_queue(THD *thd, THD *first)
 #ifndef DBUG_OFF
     stage_manager.clear_preempt_status(head);
 #endif
-    if (head->commit_error == THD::CE_NONE)
+    /*
+      Flush/Sync error should be ignored and continue
+      to commit phase. And thd->commit_error cannot be
+      COMMIT_ERROR at this moment.
+    */
+    DBUG_ASSERT(head->commit_error != THD::CE_COMMIT_ERROR);
+    excursion.try_to_attach_to(head);
+    bool all= head->transaction.flags.real_commit;
+    if (head->transaction.flags.commit_low)
     {
-      excursion.try_to_attach_to(head);
-      bool all= head->transaction.flags.real_commit;
-      if (head->transaction.flags.commit_low)
-      {
-        /* head is parked to have exited append() */
-        DBUG_ASSERT(head->transaction.flags.ready_preempt);
-        /*
-          storage engine commit
-        */
-        if (ha_commit_low(head, all, false))
-          head->commit_error= THD::CE_COMMIT_ERROR;
-      }
-      DBUG_PRINT("debug", ("commit_error: %d, flags.pending: %s",
-                           head->commit_error,
-                           YESNO(head->transaction.flags.pending)));
+      /* head is parked to have exited append() */
+      DBUG_ASSERT(head->transaction.flags.ready_preempt);
+      /*
+        storage engine commit
+      */
+      if (ha_commit_low(head, all, false))
+        head->commit_error= THD::CE_COMMIT_ERROR;
     }
+    DBUG_PRINT("debug", ("commit_error: %d, flags.pending: %s",
+                         head->commit_error,
+                         YESNO(head->transaction.flags.pending)));
     /*
       Decrement the prepared XID counter after storage engine commit.
       We also need decrement the prepared XID when encountering a
@@ -6692,7 +6793,7 @@ MYSQL_BIN_LOG::process_after_commit_stage_queue(THD *thd, THD *first)
   for (THD *head= first; head; head= head->next_to_commit)
   {
     if (head->transaction.flags.run_hooks &&
-        head->commit_error == THD::CE_NONE)
+        head->commit_error != THD::CE_COMMIT_ERROR)
     {
 
       /*
@@ -6789,7 +6890,11 @@ int
 MYSQL_BIN_LOG::flush_cache_to_file(my_off_t *end_pos_var)
 {
   if (flush_io_cache(&log_file))
+  {
+    THD *thd= current_thd;
+    thd->commit_error= THD::CE_FLUSH_ERROR;
     return ER_ERROR_ON_WRITE;
+  }
   *end_pos_var= my_b_tell(&log_file);
   return 0;
 }
@@ -6806,8 +6911,29 @@ MYSQL_BIN_LOG::sync_binlog_file(bool force)
   if (force || (sync_period && ++sync_counter >= sync_period))
   {
     sync_counter= 0;
-    if (mysql_file_sync(log_file.file, MYF(MY_WME)))
+
+    /**
+      On *pure non-transactional* workloads there is a small window
+      in time where a concurrent rotate might be able to close
+      the file before the sync is actually done. In that case,
+      ignore the bad file descriptor errors.
+
+      Transactional workloads (InnoDB) are not affected since the
+      the rotation will not happen until all transactions have
+      committed to the storage engine, thence decreased the XID
+      counters.
+
+      TODO: fix this properly even for non-transactional storage
+            engines.
+     */
+    if (DBUG_EVALUATE_IF("simulate_error_during_sync_binlog_file", 1,
+                         mysql_file_sync(log_file.file,
+                                         MYF(MY_WME | MY_IGNORE_BADFD))))
+    {
+      THD *thd= current_thd;
+      thd->commit_error= THD::CE_SYNC_ERROR;
       return std::make_pair(true, synced);
+    }
     synced= true;
   }
   return std::make_pair(false, synced);
@@ -6837,14 +6963,25 @@ MYSQL_BIN_LOG::sync_binlog_file(bool force)
 int
 MYSQL_BIN_LOG::finish_commit(THD *thd)
 {
+  /*
+    In some unlikely situations, it can happen that binary
+    log is closed before the thread flushes it's cache.
+    In that case, clear the caches before doing commit.
+  */
+  if (unlikely(!is_open()))
+  {
+    binlog_cache_mngr *cache_mngr= thd_get_cache_mngr(thd);
+    if (cache_mngr)
+      cache_mngr->reset();
+  }
   if (thd->transaction.flags.commit_low)
   {
     const bool all= thd->transaction.flags.real_commit;
     /*
       storage engine commit
     */
-    if (thd->commit_error == THD::CE_NONE &&
-        ha_commit_low(thd, all, false))
+    DBUG_ASSERT(thd->commit_error != THD::CE_COMMIT_ERROR);
+    if (ha_commit_low(thd, all, false))
       thd->commit_error= THD::CE_COMMIT_ERROR;
     /*
       Decrement the prepared XID counter after storage engine commit
@@ -6858,7 +6995,7 @@ MYSQL_BIN_LOG::finish_commit(THD *thd)
             if and be the only after_commit invocation left in the
             code.
     */
-    if ((thd->commit_error == THD::CE_NONE) && thd->transaction.flags.run_hooks)
+    if ((thd->commit_error != THD::CE_COMMIT_ERROR ) && thd->transaction.flags.run_hooks)
     {
       (void) RUN_HOOK(transaction, after_commit, (thd, all));
       thd->transaction.flags.run_hooks= false;
@@ -6879,10 +7016,72 @@ MYSQL_BIN_LOG::finish_commit(THD *thd)
   DBUG_ASSERT(!thd_get_cache_mngr(thd)->dbug_any_finalized());
   DBUG_PRINT("return", ("Thread ID: %lu, commit_error: %d",
                         thd->thread_id, thd->commit_error));
-  return thd->commit_error;
+  /*
+    flush or sync errors are handled by the leader of the group
+    (using binlog_error_action). Hence treat only COMMIT_ERRORs as errors.
+  */
+  return (thd->commit_error == THD::CE_COMMIT_ERROR);
 }
 
-
+/**
+  Helper function to handle flush or sync stage errors.
+  If binlog_error_action= ABORT_SERVER, server will be aborted
+  after reporting the error to the client.
+  If binlog_error_action= IGNORE_ERROR, binlog will be closed
+  for the life time of the server. close() call is protected
+  with LOCK_log to avoid any parallel operations on binary log.
+
+  @param thd Thread object that faced flush/sync error
+  @param need_lock_log
+                       > Indicates true if LOCk_log is needed before closing
+                         binlog (happens when we are handling sync error)
+                       > Indicates false if LOCK_log is already acquired
+                         by the thread (happens when we are handling flush
+                         error)
+
+  @return void
+*/
+void MYSQL_BIN_LOG::handle_binlog_flush_or_sync_error(THD *thd,
+                                                      bool need_lock_log)
+{
+  char errmsg[MYSQL_ERRMSG_SIZE];
+  sprintf(errmsg, "An error occurred during %s stage of the commit. "
+          "'binlog_error_action' is set to '%s'.",
+          thd->commit_error== THD::CE_FLUSH_ERROR ? "flush" : "sync",
+          binlog_error_action == ABORT_SERVER ? "ABORT_SERVER" : "IGNORE_ERROR");
+  if (binlog_error_action == ABORT_SERVER)
+  {
+    char err_buff[MYSQL_ERRMSG_SIZE];
+    sprintf(err_buff, "%s Hence aborting the server.", errmsg);
+    exec_binlog_error_action_abort(err_buff);
+  }
+  else
+  {
+    DEBUG_SYNC(thd, "before_binlog_closed_due_to_error");
+    if (need_lock_log)
+      mysql_mutex_lock(&LOCK_log);
+    else
+      mysql_mutex_assert_owner(&LOCK_log);
+    /*
+      It can happen that other group leader encountered
+      error and already closed the binary log. So print
+      error only if it is in open state. But we should
+      call close() always just in case if the previous
+      close did not close index file.
+    */
+    if (is_open())
+    {
+      sql_print_error("%s 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.",
+                      errmsg);
+    }
+    close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT);
+    if (need_lock_log)
+      mysql_mutex_unlock(&LOCK_log);
+    DEBUG_SYNC(thd, "after_binlog_closed_due_to_error");
+  }
+}
 /**
   Flush and commit the transaction.
 
@@ -6935,10 +7134,32 @@ MYSQL_BIN_LOG::finish_commit(THD *thd)
 int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
 {
   DBUG_ENTER("MYSQL_BIN_LOG::ordered_commit");
-  int flush_error= 0;
+  int flush_error= 0, sync_error= 0;
   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", 
+                  WSREP_QUERY(thd));
+      cache_mngr->stmt_cache.reset();
+    }
+    DBUG_RETURN(rcode);
+  }
+#endif /* WITH_WSREP */
+
   /*
     These values are used while flushing a transaction, so clear
     everything.
@@ -6984,6 +7205,7 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
     anything more since it is possible that a thread entered and
     appointed itself leader for the flush phase.
   */
+  DEBUG_SYNC(thd, "waiting_to_enter_flush_stage");
   if (change_stage(thd, Stage_manager::FLUSH_STAGE, thd, NULL, &LOCK_log))
   {
     DBUG_PRINT("return", ("Thread ID: %lu, commit_error: %d",
@@ -6991,10 +7213,26 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
     DBUG_RETURN(finish_commit(thd));
   }
 
-  THD *wait_queue= NULL;
-  flush_error= process_flush_stage_queue(&total_bytes, &do_rotate, &wait_queue);
-
+  THD *wait_queue= NULL, *final_queue= NULL;
+  mysql_mutex_t *leave_mutex_before_commit_stage= NULL;
   my_off_t flush_end_pos= 0;
+  bool need_LOCK_log;
+  if (unlikely(!is_open()))
+  {
+    final_queue= stage_manager.fetch_queue_for(Stage_manager::FLUSH_STAGE);
+    leave_mutex_before_commit_stage= &LOCK_log;
+    /*
+      binary log is closed, flush stage and sync stage should be
+      ignored. Binlog cache should be cleared, but instead of doing
+      it here, do that work in 'finish_commit' function so that
+      leader and followers thread caches will be cleared.
+    */
+    goto commit_stage;
+  }
+  DEBUG_SYNC(thd, "waiting_in_the_middle_of_flush_stage");
+  flush_error= process_flush_stage_queue(&total_bytes, &do_rotate,
+                                                 &wait_queue);
+
   if (flush_error == 0 && total_bytes > 0)
     flush_error= flush_cache_to_file(&flush_end_pos);
 
@@ -7019,10 +7257,18 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
     DBUG_EXECUTE_IF("crash_commit_after_log", DBUG_SUICIDE(););
   }
 
+  if (flush_error)
+  {
+    /*
+      Handle flush error (if any) after leader finishes it's flush stage.
+    */
+    handle_binlog_flush_or_sync_error(thd, false /* need_lock_log */);
+  }
+
   /*
     Stage #2: Syncing binary log file to disk
   */
-  bool need_LOCK_log= (get_sync_period() == 1);
+  need_LOCK_log= (get_sync_period() == 1);
 
   /*
     LOCK_log is not released when sync_binlog is 1. It guarantees that the
@@ -7035,17 +7281,17 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
                           thd->thread_id, thd->commit_error));
     DBUG_RETURN(finish_commit(thd));
   }
-  THD *final_queue= stage_manager.fetch_queue_for(Stage_manager::SYNC_STAGE);
+  final_queue= stage_manager.fetch_queue_for(Stage_manager::SYNC_STAGE);
   if (flush_error == 0 && total_bytes > 0)
   {
     DEBUG_SYNC(thd, "before_sync_binlog_file");
     std::pair<bool, bool> result= sync_binlog_file(false);
-    flush_error= result.first;
+    sync_error= result.first;
   }
 
   if (need_LOCK_log)
     mysql_mutex_unlock(&LOCK_log);
-
+  leave_mutex_before_commit_stage= &LOCK_sync;
   /*
     Stage #3: Commit all transactions in order.
 
@@ -7055,10 +7301,18 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
     Howver, since we are keeping the lock from the previous stage, we
     need to unlock it if we skip the stage.
    */
-  if (opt_binlog_order_commits)
+commit_stage:
+  /*
+    We are delaying the handling of sync error until
+    all locks are released but we should not enter into
+    commit stage if binlog_error_action is ABORT_SERVER.
+  */
+  if (opt_binlog_order_commits &&
+      (sync_error == 0 || binlog_error_action != ABORT_SERVER))
   {
     if (change_stage(thd, Stage_manager::COMMIT_STAGE,
-                     final_queue, &LOCK_sync, &LOCK_commit))
+                     final_queue, leave_mutex_before_commit_stage,
+                     &LOCK_commit))
     {
       DBUG_PRINT("return", ("Thread ID: %lu, commit_error: %d",
                             thd->thread_id, thd->commit_error));
@@ -7076,8 +7330,14 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
     process_after_commit_stage_queue(thd, commit_queue);
     final_queue= commit_queue;
   }
-  else
-    mysql_mutex_unlock(&LOCK_sync);
+  else if (leave_mutex_before_commit_stage)
+    mysql_mutex_unlock(leave_mutex_before_commit_stage);
+
+  /*
+    Handle sync error after we release all locks in order to avoid deadlocks
+  */
+  if (sync_error)
+    handle_binlog_flush_or_sync_error(thd, true /* need_lock_log */);
 
   /* Commit done so signal all waiting threads */
   stage_manager.signal_done(final_queue);
@@ -7106,6 +7366,10 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
     DEBUG_SYNC(thd, "ready_to_do_rotation");
     bool check_purge= false;
     mysql_mutex_lock(&LOCK_log);
+    /*
+      If rotate fails then depends on binlog_error_action variable
+      appropriate action will be taken inside rotate call.
+    */
     int error= rotate(false, &check_purge);
     mysql_mutex_unlock(&LOCK_log);
 
@@ -7114,7 +7378,11 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
     else if (check_purge)
       purge();
   }
-  DBUG_RETURN(thd->commit_error);
+  /*
+    flush or sync errors are handled above (using binlog_error_action).
+    Hence treat only COMMIT_ERRORs as errors.
+  */
+  DBUG_RETURN(thd->commit_error == THD::CE_COMMIT_ERROR);
 }
 
 
@@ -7143,6 +7411,23 @@ 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.
+  */
+  wsrep_uuid_t uuid;
+  wsrep_seqno_t seqno;
+  wsrep_get_SE_checkpoint(uuid, seqno);
+  char uuid_str[40];
+  wsrep_uuid_print(&uuid, uuid_str, sizeof(uuid_str));
+  WSREP_INFO("Binlog recovery, found wsrep position %s:%lld", uuid_str,
+             (long long)seqno);
+  const wsrep_seqno_t last_xid_seqno= seqno;
+  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 +7436,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 +7462,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 +7509,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 +7538,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 +7733,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
@@ -7606,6 +7911,94 @@ THD::add_to_binlog_accessed_dbs(const char *db_param)
     binlog_accessed_db_names->push_back(after_db, db_mem_root);
 }
 
+/*
+  Tells if two (or more) tables have auto_increment columns and we want to
+  lock those tables with a write lock.
+
+  SYNOPSIS
+    has_two_write_locked_tables_with_auto_increment
+      tables        Table list
+
+  NOTES:
+    Call this function only when you have established the list of all tables
+    which you'll want to update (including stored functions, triggers, views
+    inside your statement).
+*/
+
+static bool
+has_write_table_with_auto_increment(TABLE_LIST *tables)
+{
+  for (TABLE_LIST *table= tables; table; table= table->next_global)
+  {
+    /* we must do preliminary checks as table->table may be NULL */
+    if (!table->placeholder() &&
+        table->table->found_next_number_field &&
+        (table->lock_type >= TL_WRITE_ALLOW_WRITE))
+      return 1;
+  }
+
+  return 0;
+}
+
+/*
+   checks if we have select tables in the table list and write tables
+   with auto-increment column.
+
+  SYNOPSIS
+   has_two_write_locked_tables_with_auto_increment_and_select
+      tables        Table list
+
+  RETURN VALUES
+
+   -true if the table list has atleast one table with auto-increment column
+
+
+         and atleast one table to select from.
+   -false otherwise
+*/
+
+static bool
+has_write_table_with_auto_increment_and_select(TABLE_LIST *tables)
+{
+  bool has_select= false;
+  bool has_auto_increment_tables = has_write_table_with_auto_increment(tables);
+  for(TABLE_LIST *table= tables; table; table= table->next_global)
+  {
+     if (!table->placeholder() &&
+        (table->lock_type <= TL_READ_NO_INSERT))
+      {
+        has_select= true;
+        break;
+      }
+  }
+  return(has_select && has_auto_increment_tables);
+}
+
+/*
+  Tells if there is a table whose auto_increment column is a part
+  of a compound primary key while is not the first column in
+  the table definition.
+
+  @param tables Table list
+
+  @return true if the table exists, fais if does not.
+*/
+
+static bool
+has_write_table_auto_increment_not_first_in_pk(TABLE_LIST *tables)
+{
+  for (TABLE_LIST *table= tables; table; table= table->next_global)
+  {
+    /* we must do preliminary checks as table->table may be NULL */
+    if (!table->placeholder() &&
+        table->table->found_next_number_field &&
+        (table->lock_type >= TL_WRITE_ALLOW_WRITE)
+        && table->table->s->next_number_keypart != 0)
+      return 1;
+  }
+
+  return 0;
+}
 
 /**
   Decide on logging format to use for the statement and issue errors
@@ -7721,9 +8114,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
@@ -7805,6 +8205,31 @@ int THD::decide_logging_format(TABLE_LIST *tables)
     }
 #endif
 
+    if (variables.binlog_format != BINLOG_FORMAT_ROW && tables)
+    {
+      /*
+        DML statements that modify a table with an auto_increment column based on
+        rows selected from a table are unsafe as the order in which the rows are
+        fetched fron the select tables cannot be determined and may differ on
+        master and slave.
+       */
+      if (has_write_table_with_auto_increment_and_select(tables))
+        lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT);
+
+      if (has_write_table_auto_increment_not_first_in_pk(tables))
+        lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST);
+
+      /*
+        A query that modifies autoinc column in sub-statement can make the
+        master and slave inconsistent.
+        We can solve these problems in mixed mode by switching to binlogging
+        if at least one updated table is used by sub-statement
+       */
+      if (lex->requires_prelocking() &&
+          has_write_table_with_auto_increment(lex->first_not_own_table()))
+        lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS);
+    }
+
     /*
       Get the capabilities vector for all involved storage engines and
       mask out the flags for the binary log.
@@ -7882,6 +8307,27 @@ int THD::decide_logging_format(TABLE_LIST *tables)
         is_write= TRUE;
 
         prev_write_table= table->table;
+
+        /*
+          INSERT...ON DUPLICATE KEY UPDATE on a table with more than one unique keys
+          can be unsafe. Check for it if the flag is already not marked for the
+          given statement.
+        */
+        if (!lex->is_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS) &&
+            lex->sql_command == SQLCOM_INSERT &&
+            /* Duplicate key update is not supported by INSERT DELAYED */
+            get_command() != COM_DELAYED_INSERT && lex->duplicates == DUP_UPDATE)
+        {
+          uint keys= table->table->s->keys, i= 0, unique_keys= 0;
+          for (KEY* keyinfo= table->table->s->key_info;
+               i < keys && unique_keys <= 1; i++, keyinfo++)
+          {
+            if (keyinfo->flags & HA_NOSAME)
+              unique_keys++;
+          }
+          if (unique_keys > 1 )
+            lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS);
+        }
       }
       flags_access_some_set |= flags;
 
@@ -7967,8 +8413,8 @@ 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 &&
-               sqlcom_can_generate_row_events(this))
+      else if (WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_ROW &&
+               sqlcom_can_generate_row_events(this->lex->sql_command))
       {
         /*
           2. Error: Cannot modify table that uses a storage engine
@@ -7996,8 +8442,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())
         {
           /*
@@ -8007,13 +8453,20 @@ int THD::decide_logging_format(TABLE_LIST *tables)
           my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_MODE), MYF(0));
         }
         else if ((flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0 &&
-                 sqlcom_can_generate_row_events(this))
+                 sqlcom_can_generate_row_events(this->lex->sql_command))
         {
           /*
             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 +8612,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
 
@@ -8199,8 +8652,9 @@ bool THD::is_ddl_gtid_compatible() const
       inside a transaction because the table will stay and the
       transaction will be written to the slave's binary log with the
       GTID even if the transaction is rolled back.
+      This includes the execution inside Functions and Triggers.
     */
-    if (in_multi_stmt_transaction_mode())
+    if (in_multi_stmt_transaction_mode() || in_sub_stmt)
     {
       my_error(ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION,
                MYF(0));
@@ -8469,7 +8923,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 +8958,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 +9030,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 +9154,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 +9427,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 +9545,73 @@ 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",
+                    WSREP_QUERY(thd));
+       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 };
index 38efe642f545ef66f9dae24f72e21b72c168b193..4ed6db27214b5a2d7d0f3db0873c781a100b1ef6 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef BINLOG_H_INCLUDED
-/* Copyright (c) 2010, 2014, 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
@@ -518,6 +518,7 @@ private:
   int process_flush_stage_queue(my_off_t *total_bytes_var, bool *rotate_var,
                                 THD **out_queue_var);
   int ordered_commit(THD *thd, bool all, bool skip_commit = false);
+  void handle_binlog_flush_or_sync_error(THD *thd, bool need_lock_log);
 public:
   int open_binlog(const char *opt_name);
   void close();
@@ -663,7 +664,7 @@ public:
   int find_log_pos(LOG_INFO* linfo, const char* log_name,
                    bool need_lock_index);
   int find_next_log(LOG_INFO* linfo, bool need_lock_index);
-  int get_current_log(LOG_INFO* linfo);
+  int get_current_log(LOG_INFO* linfo, bool need_lock_log= true);
   int raw_get_current_log(LOG_INFO* linfo);
   uint next_file_id();
   inline char* get_index_fname() { return index_file_name;}
index 13a769150a726eb51541bc634022b6fcce272acf..a7c545107e4b968e474ff07685e05fb0ee2d565c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+/* 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
@@ -1334,6 +1334,7 @@ Event_job_data::execute(THD *thd, bool drop)
 #endif
   List<Item> empty_item_list;
   bool ret= TRUE;
+  sql_digest_state *parent_digest= thd->m_digest;
   PSI_statement_locker *parent_locker= thd->m_statement_psi;
 
   DBUG_ENTER("Event_job_data::execute");
@@ -1409,6 +1410,7 @@ Event_job_data::execute(THD *thd, bool drop)
     if (parser_state.init(thd, thd->query(), thd->query_length()))
       goto end;
 
+    thd->m_digest= NULL;
     thd->m_statement_psi= NULL;
     if (parse_sql(thd, & parser_state, creation_ctx))
     {
@@ -1416,9 +1418,11 @@ Event_job_data::execute(THD *thd, bool drop)
                       "%serror during compilation of %s.%s",
                       thd->is_fatal_error ? "fatal " : "",
                       (const char *) dbname.str, (const char *) name.str);
+      thd->m_digest= parent_digest;
       thd->m_statement_psi= parent_locker;
       goto end;
     }
+    thd->m_digest= parent_digest;
     thd->m_statement_psi= parent_locker;
   }
 
@@ -1477,8 +1481,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;
     }
index 6a06a079bccb3a559d1ebf7829630c21860e4ea0..655c19ec4dc81f88d452ec94e17c298ebdec6ccf 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   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
index e16a2937d8d67d2986a68c0fa2cb5949c0712a77..a1ccc682d616ad49520c8b9dea460b3ddbf02523 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2014, 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
@@ -301,6 +301,10 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event)
   Event_job_data job_data;
   bool res;
 
+  DBUG_ASSERT(thd->m_digest == NULL);
+  DBUG_ASSERT(thd->m_statement_psi == NULL);
+
+
   thd->thread_stack= &my_stack;                // remember where our stack is
   res= post_init_event_thread(thd);
 
@@ -329,6 +333,9 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event)
                           job_data.definer.str,
                           job_data.dbname.str, job_data.name.str);
 end:
+  DBUG_ASSERT(thd->m_statement_psi == NULL);
+  DBUG_ASSERT(thd->m_digest == NULL);
+
   DBUG_PRINT("info", ("Done with Event %s.%s", event->dbname.str,
              event->name.str));
 
index ff87dd40aec585cf659e5e21f50f5a33fe7aa31e..66a0eadf7827b4c780986779fc20a89a950fede1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+   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
@@ -308,6 +308,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
 {
   bool ret;
   bool save_binlog_row_based, event_already_exists;
+  ulong save_binlog_format= thd->variables.binlog_format;
   DBUG_ENTER("Events::create_event");
 
   if (check_if_system_tables_error())
@@ -341,10 +342,15 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
   */
   if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
     thd->clear_current_stmt_binlog_format_row();
+  thd->variables.binlog_format= BINLOG_FORMAT_STMT;
+
 
   if (lock_object_name(thd, MDL_key::EVENT,
                        parse_data->dbname.str, parse_data->name.str))
-    DBUG_RETURN(TRUE);
+  {
+    ret= true;
+    goto err;
+  }
 
   /* On error conditions my_error() is called so no need to handle here */
   if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists,
@@ -399,10 +405,12 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
       }
     }
   }
+err:
   /* 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();
+  thd->variables.binlog_format= save_binlog_format;
 
   DBUG_RETURN(ret);
 }
@@ -433,6 +441,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
 {
   int ret;
   bool save_binlog_row_based;
+  ulong save_binlog_format= thd->variables.binlog_format;
   Event_queue_element *new_element;
 
   DBUG_ENTER("Events::update_event");
@@ -481,10 +490,14 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
   */
   if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
     thd->clear_current_stmt_binlog_format_row();
+  thd->variables.binlog_format= BINLOG_FORMAT_STMT;
 
   if (lock_object_name(thd, MDL_key::EVENT,
                        parse_data->dbname.str, parse_data->name.str))
-    DBUG_RETURN(TRUE);
+  {
+    ret= true;
+    goto err;
+  }
 
   /* On error conditions my_error() is called so no need to handle here */
   if (!(ret= db_repository->update_event(thd, parse_data,
@@ -519,10 +532,12 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
       ret= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
     }
   }
+err:
   /* 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();
+  thd->variables.binlog_format= save_binlog_format;
 
   DBUG_RETURN(ret);
 }
@@ -1139,7 +1154,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 +1211,48 @@ 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: schema: %s, query: %s",
+               (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+    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: schema: %s, query: %s",
+               (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+    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)
 */
index e0e6bb5334d98a9c565fbf7638c186d29a2071c7..ff3b49f5188db23947dd1f552a696f2e99402914 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef FIELD_INCLUDED
 #define FIELD_INCLUDED
 
-/* 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
@@ -1236,6 +1236,17 @@ public:
 
   /* Hash value */
   virtual void hash(ulong *nr, ulong *nr2);
+
+/**
+  Checks whether a string field is part of write_set.
+
+  @return
+    FALSE  - If field is not char/varchar/....
+           - If field is char/varchar/.. and is not part of write set.
+    TRUE   - If field is char/varchar/.. and is part of write set.
+*/
+  virtual bool is_updatable() const { return FALSE; }
+
   friend int cre_myisam(char * name, register TABLE *form, uint options,
                        ulonglong auto_increment_value);
   friend class Copy_field;
@@ -1523,6 +1534,11 @@ public:
 
   type_conversion_status store_decimal(const my_decimal *d);
   uint32 max_data_length() const;
+  bool is_updatable() const
+  {
+    DBUG_ASSERT(table && table->write_set);
+    return bitmap_is_set(table->write_set, field_index);
+  }
 };
 
 /* base class for float and double and decimal (old one) */
index 07c869e6c52e824b82dc6f8c80e4e52dddeb08d1..1e44aefc424906ca8e4e99b9148e4cf6e0df89ba 100644 (file)
@@ -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
@@ -826,15 +826,15 @@ type_conversion_status field_conv(Field *to,Field *from)
   {                                            // Be sure the value is stored
     Field_blob *blob=(Field_blob*) to;
     from->val_str(&blob->value);
+
     /*
-      Copy value if copy_blobs is set, or source is not a string and
-      we have a pointer to its internal string conversion buffer.
+      Copy value if copy_blobs is set, or source is part of the table's
+      writeset.
     */
     if (to->table->copy_blobs ||
-        (!blob->value.is_alloced() &&
-         from->real_type() != MYSQL_TYPE_STRING &&
-         from->real_type() != MYSQL_TYPE_VARCHAR))
+        (!blob->value.is_alloced() && from->is_updatable()))
       blob->value.copy();
+
     return blob->store(blob->value.ptr(),blob->value.length(),from->charset());
   }
   if (from->real_type() == MYSQL_TYPE_ENUM &&
index 3290288ce420a4e0d6c9b861358caba9b1714dd9..3d5ba0ccd18d0e96896305197b0c86d91e63b665 100644 (file)
@@ -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
@@ -299,6 +300,13 @@ ha_rows filesort(THD *thd, TABLE *table, Filesort *filesort,
     const ulong min_sort_memory=
       max<ulong>(MIN_SORT_MEMORY,
                  ALIGN_SIZE(MERGEBUFF2 * (param.rec_length + sizeof(uchar*))));
+    /*
+      Cannot depend on num_rows. For external sort, space for upto MERGEBUFF2
+      rows is required.
+    */
+    if (num_rows < MERGEBUFF2)
+      num_rows= MERGEBUFF2;
+
     while (memory_available >= min_sort_memory)
     {
       ha_rows keys= memory_available / (param.rec_length + sizeof(char*));
@@ -357,9 +365,6 @@ ha_rows filesort(THD *thd, TABLE *table, Filesort *filesort,
   }
   else
   {
-    /* filesort cannot handle zero-length records during merge. */
-    DBUG_ASSERT(param.sort_length != 0);
-
     if (table_sort.buffpek && table_sort.buffpek_len < maxbuffer)
     {
       my_free(table_sort.buffpek);
@@ -528,18 +533,33 @@ uint Filesort::make_sortorder()
 
   for (ord= order; ord; ord= ord->next, pos++)
   {
-    Item *item= ord->item[0]->real_item();
+    Item *const item= ord->item[0], *const real_item= item->real_item();
     pos->field= 0; pos->item= 0;
-    if (item->type() == Item::FIELD_ITEM)
-      pos->field= ((Item_field*) item)->field;
-    else if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item())
-      pos->field= ((Item_sum*) item)->get_tmp_table_field();
-    else if (item->type() == Item::COPY_STR_ITEM)
+    if (real_item->type() == Item::FIELD_ITEM)
+    {
+      // Could be a field, or Item_direct_view_ref wrapping a field
+      DBUG_ASSERT(item->type() == Item::FIELD_ITEM ||
+                  (item->type() == Item::REF_ITEM &&
+                   static_cast<Item_ref*>(item)->ref_type() ==
+                   Item_ref::VIEW_REF));
+      pos->field= static_cast<Item_field*>(real_item)->field;
+    }
+    else if (real_item->type() == Item::SUM_FUNC_ITEM &&
+             !real_item->const_item())
+    {
+      // Aggregate, or Item_aggregate_ref
+      DBUG_ASSERT(item->type() == Item::SUM_FUNC_ITEM ||
+                  (item->type() == Item::REF_ITEM &&
+                   static_cast<Item_ref*>(item)->ref_type() ==
+                   Item_ref::AGGREGATE_REF));
+      pos->field= item->get_tmp_table_field();
+    }
+    else if (real_item->type() == Item::COPY_STR_ITEM)
     {                                          // Blob patch
-      pos->item= ((Item_copy*) item)->get_item();
+      pos->item= static_cast<Item_copy*>(real_item)->get_item();
     }
     else
-      pos->item= *ord->item;
+      pos->item= item;
     pos->reverse= (ord->direction == ORDER::ORDER_DESC);
     DBUG_ASSERT(pos->field != NULL || pos->item != NULL);
   }
@@ -1020,7 +1040,7 @@ void make_sortkey(Sort_param *param, uchar *to, uchar *ref_pos)
         if (sort_field->need_strxnfrm)
         {
           char *from=(char*) res->ptr();
-          uint tmp_length;
+          uint tmp_length __attribute__((unused));
           if ((uchar*) from == to)
           {
             DBUG_ASSERT(sort_field->length >= length);
index 4fd371d556bd224fcc0fbda6ed9b354c520f05ca..a1adbb246e01926879201cf699c75689c8a10a83 100644 (file)
@@ -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
@@ -222,7 +222,7 @@ int Gcalc_function::count_internal()
         result= result & !next_res;
         break;
       case op_backdifference:
-        result= !result & next_res;
+        result= (!result) & next_res;
         break;
       default:
         DBUG_ASSERT(FALSE);
diff --git a/mysql-wsrep-5.6/sql/gen_lex_token.cc b/mysql-wsrep-5.6/sql/gen_lex_token.cc
new file mode 100644 (file)
index 0000000..3b2d37c
--- /dev/null
@@ -0,0 +1,359 @@
+/*
+   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
+   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,
+   51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#include <my_global.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/* We only need the tokens here */
+#define YYSTYPE_IS_DECLARED
+#include <sql_yacc.h>
+#include <lex.h>
+
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+
+/*
+  This is a tool used during build only,
+  so MY_MAX_TOKEN does not need to be exact,
+  only big enough to hold:
+  - 256 character terminal tokens
+  - YYNTOKENS named terminal tokens
+  from bison.
+  See also YYMAXUTOK.
+*/
+#define MY_MAX_TOKEN 1000
+/** Generated token. */
+struct gen_lex_token_string
+{
+  const char *m_token_string;
+  int m_token_length;
+  bool m_append_space;
+  bool m_start_expr;
+};
+
+gen_lex_token_string compiled_token_array[MY_MAX_TOKEN];
+int max_token_seen= 0;
+
+char char_tokens[256];
+
+int tok_generic_value= 0;
+int tok_generic_value_list= 0;
+int tok_row_single_value= 0;
+int tok_row_single_value_list= 0;
+int tok_row_multiple_value= 0;
+int tok_row_multiple_value_list= 0;
+int tok_ident= 0;
+int tok_unused= 0;
+
+void set_token(int tok, const char *str)
+{
+  if (tok <= 0)
+  {
+    fprintf(stderr, "Bad token found\n");
+    exit(1);
+  }
+
+  if (tok > max_token_seen)
+  {
+    max_token_seen= tok;
+  }
+
+  if (max_token_seen >= MY_MAX_TOKEN)
+  {
+    fprintf(stderr, "Added that many new keywords ? Increase MY_MAX_TOKEN\n");
+    exit(1);
+  }
+
+  compiled_token_array[tok].m_token_string= str;
+  compiled_token_array[tok].m_token_length= strlen(str);
+  compiled_token_array[tok].m_append_space= true;
+  compiled_token_array[tok].m_start_expr= false;
+}
+
+void set_start_expr_token(int tok)
+{
+  compiled_token_array[tok].m_start_expr= true;
+}
+
+void compute_tokens()
+{
+  int tok;
+  unsigned int i;
+  char *str;
+
+  /*
+    Default value.
+  */
+  for (tok= 0; tok < MY_MAX_TOKEN; tok++)
+  {
+    compiled_token_array[tok].m_token_string= "(unknown)";
+    compiled_token_array[tok].m_token_length= 9;
+    compiled_token_array[tok].m_append_space= true;
+    compiled_token_array[tok].m_start_expr= false;
+  }
+
+  /*
+    Tokens made of just one terminal character
+  */
+  for (tok=0; tok < 256; tok++)
+  {
+    str= & char_tokens[tok];
+    str[0]= (char) tok;
+    compiled_token_array[tok].m_token_string= str;
+    compiled_token_array[tok].m_token_length= 1;
+    compiled_token_array[tok].m_append_space= true;
+  }
+
+  max_token_seen= 255;
+
+  /*
+    String terminal tokens, used in sql_yacc.yy
+  */
+  set_token(NEG, "~");
+  set_token(TABLE_REF_PRIORITY, "TABLE_REF_PRIORITY");
+
+  /*
+    Tokens hard coded in sql_lex.cc
+  */
+
+  set_token(WITH_CUBE_SYM, "WITH CUBE");
+  set_token(WITH_ROLLUP_SYM, "WITH ROLLUP");
+  set_token(NOT2_SYM, "!");
+  set_token(OR2_SYM, "|");
+  set_token(PARAM_MARKER, "?");
+  set_token(SET_VAR, ":=");
+  set_token(UNDERSCORE_CHARSET, "(_charset)");
+  set_token(END_OF_INPUT, "");
+
+  /*
+    Values.
+    These tokens are all normalized later,
+    so this strings will never be displayed.
+  */
+  set_token(BIN_NUM, "(bin)");
+  set_token(DECIMAL_NUM, "(decimal)");
+  set_token(FLOAT_NUM, "(float)");
+  set_token(HEX_NUM, "(hex)");
+  set_token(LEX_HOSTNAME, "(hostname)");
+  set_token(LONG_NUM, "(long)");
+  set_token(NUM, "(num)");
+  set_token(TEXT_STRING, "(text)");
+  set_token(NCHAR_STRING, "(nchar)");
+  set_token(ULONGLONG_NUM, "(ulonglong)");
+
+  /*
+    Identifiers.
+  */
+  set_token(IDENT, "(id)");
+  set_token(IDENT_QUOTED, "(id_quoted)");
+
+  /*
+    Unused tokens
+  */
+  set_token(LOCATOR_SYM, "LOCATOR");
+  set_token(SERVER_OPTIONS, "SERVER_OPTIONS");
+  set_token(UDF_RETURNS_SYM, "UDF_RETURNS");
+
+  /*
+    See symbols[] in sql/lex.h
+  */
+  for (i= 0; i< sizeof(symbols)/sizeof(symbols[0]); i++)
+  {
+    set_token(symbols[i].tok, symbols[i].name);
+  }
+
+  /*
+    See sql_functions[] in sql/lex.h
+  */
+  for (i= 0; i< sizeof(sql_functions)/sizeof(sql_functions[0]); i++)
+  {
+    set_token(sql_functions[i].tok, sql_functions[i].name);
+  }
+
+  /*
+    Additional FAKE tokens,
+    used internally to normalize a digest text.
+  */
+
+  max_token_seen++;
+  tok_generic_value= max_token_seen;
+  set_token(tok_generic_value, "?");
+
+  max_token_seen++;
+  tok_generic_value_list= max_token_seen;
+  set_token(tok_generic_value_list, "?, ...");
+
+  max_token_seen++;
+  tok_row_single_value= max_token_seen;
+  set_token(tok_row_single_value, "(?)");
+
+  max_token_seen++;
+  tok_row_single_value_list= max_token_seen;
+  set_token(tok_row_single_value_list, "(?) /* , ... */");
+
+  max_token_seen++;
+  tok_row_multiple_value= max_token_seen;
+  set_token(tok_row_multiple_value, "(...)");
+
+  max_token_seen++;
+  tok_row_multiple_value_list= max_token_seen;
+  set_token(tok_row_multiple_value_list, "(...) /* , ... */");
+
+  max_token_seen++;
+  tok_ident= max_token_seen;
+  set_token(tok_ident, "(tok_id)");
+
+  max_token_seen++;
+  tok_unused= max_token_seen;
+  set_token(tok_unused, "UNUSED");
+
+  /*
+    Fix whitespace for some special tokens.
+  */
+
+  /*
+    The lexer parses "@@variable" as '@', '@', 'variable',
+    returning a token for '@' alone.
+
+    This is incorrect, '@' is not really a token,
+    because the syntax "@ @ variable" (with spaces) is not accepted:
+    The lexer keeps some internal state after the '@' fake token.
+
+    To work around this, digest text are printed as "@@variable".
+  */
+  compiled_token_array[(int) '@'].m_append_space= false;
+
+  /*
+    Define additional properties for tokens.
+
+    List all the token that are followed by an expression.
+    This is needed to differentiate unary from binary
+    '+' and '-' operators, because we want to:
+    - reduce <unary +> <NUM> to <?>,
+    - preserve <...> <binary +> <NUM> as is.
+  */
+  set_start_expr_token('(');
+  set_start_expr_token(',');
+  set_start_expr_token(EVERY_SYM);
+  set_start_expr_token(AT_SYM);
+  set_start_expr_token(STARTS_SYM);
+  set_start_expr_token(ENDS_SYM);
+  set_start_expr_token(DEFAULT);
+  set_start_expr_token(RETURN_SYM);
+  set_start_expr_token(IF);
+  set_start_expr_token(ELSEIF_SYM);
+  set_start_expr_token(CASE_SYM);
+  set_start_expr_token(WHEN_SYM);
+  set_start_expr_token(WHILE_SYM);
+  set_start_expr_token(UNTIL_SYM);
+  set_start_expr_token(SELECT_SYM);
+
+  set_start_expr_token(OR_SYM);
+  set_start_expr_token(OR2_SYM);
+  set_start_expr_token(XOR);
+  set_start_expr_token(AND_SYM);
+  set_start_expr_token(AND_AND_SYM);
+  set_start_expr_token(NOT_SYM);
+  set_start_expr_token(BETWEEN_SYM);
+  set_start_expr_token(LIKE);
+  set_start_expr_token(REGEXP);
+
+  set_start_expr_token('|');
+  set_start_expr_token('&');
+  set_start_expr_token(SHIFT_LEFT);
+  set_start_expr_token(SHIFT_RIGHT);
+  set_start_expr_token('+');
+  set_start_expr_token('-');
+  set_start_expr_token(INTERVAL_SYM);
+  set_start_expr_token('*');
+  set_start_expr_token('/');
+  set_start_expr_token('%');
+  set_start_expr_token(DIV_SYM);
+  set_start_expr_token(MOD_SYM);
+  set_start_expr_token('^');
+}
+
+void print_tokens()
+{
+  int tok;
+
+  printf("#ifdef LEX_TOKEN_WITH_DEFINITION\n");
+  printf("lex_token_string lex_token_array[]=\n");
+  printf("{\n");
+  printf("/* PART 1: character tokens. */\n");
+
+  for (tok= 0; tok<256; tok++)
+  {
+    printf("/* %03d */  { \"\\x%02x\", 1, %s, %s},\n",
+           tok,
+           tok,
+           compiled_token_array[tok].m_append_space ? "true" : "false",
+           compiled_token_array[tok].m_start_expr ? "true" : "false");
+  }
+
+  printf("/* PART 2: named tokens. */\n");
+
+  for (tok= 256; tok<= max_token_seen; tok++)
+  {
+    printf("/* %03d */  { \"%s\", %d, %s, %s},\n",
+           tok,
+           compiled_token_array[tok].m_token_string,
+           compiled_token_array[tok].m_token_length,
+           compiled_token_array[tok].m_append_space ? "true" : "false",
+           compiled_token_array[tok].m_start_expr ? "true" : "false");
+  }
+
+  printf("/* DUMMY */ { \"\", 0, false, false}\n");
+  printf("};\n");
+  printf("#endif /* LEX_TOKEN_WITH_DEFINITION */\n");
+
+  printf("/* DIGEST specific tokens. */\n");
+  printf("#define TOK_GENERIC_VALUE %d\n", tok_generic_value);
+  printf("#define TOK_GENERIC_VALUE_LIST %d\n", tok_generic_value_list);
+  printf("#define TOK_ROW_SINGLE_VALUE %d\n", tok_row_single_value);
+  printf("#define TOK_ROW_SINGLE_VALUE_LIST %d\n", tok_row_single_value_list);
+  printf("#define TOK_ROW_MULTIPLE_VALUE %d\n", tok_row_multiple_value);
+  printf("#define TOK_ROW_MULTIPLE_VALUE_LIST %d\n", tok_row_multiple_value_list);
+  printf("#define TOK_IDENT %d\n", tok_ident);
+  printf("#define TOK_UNUSED %d\n", tok_unused);
+}
+
+int main(int argc,char **argv)
+{
+  puts("/*");
+  puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2011"));
+  puts("*/");
+
+  printf("/*\n");
+  printf("  This file is generated, do not edit.\n");
+  printf("  See file sql/gen_lex_token.cc.\n");
+  printf("*/\n");
+  printf("struct lex_token_string\n");
+  printf("{\n");
+  printf("  const char *m_token_string;\n");
+  printf("  int m_token_length;\n");
+  printf("  bool m_append_space;\n");
+  printf("  bool m_start_expr;\n");
+  printf("};\n");
+  printf("typedef struct lex_token_string lex_token_string;\n");
+
+  compute_tokens();
+  print_tokens();
+
+  return 0;
+}
+
index d0fcbe7893681a0d8015af577d8f1f575d8a6677..18194f93e496dacd91210743ea3ee28db6c2d08f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2013, 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
@@ -8154,7 +8154,7 @@ static int ndbcluster_rollback(handlerton *hton, THD *thd, bool all)
       of the transaction
     */
     DBUG_PRINT("info", ("Rollback before start or end-of-statement only"));
-    mark_transaction_to_rollback(thd, 1);
+    thd->mark_transaction_to_rollback(1);
     my_error(ER_WARN_ENGINE_TRANSACTION_ROLLBACK, MYF(0), "NDB");
     DBUG_RETURN(0);
   }
index 57a76e8f9c043c5c5c7783ed5dbc6d741f6819e0..21f20b556d7d185c28991735e1513e14acad5f59 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  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
@@ -4833,7 +4833,8 @@ ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname)
   char path[FN_REFLEN + 1];
 
   build_table_filename(path, sizeof(path) - 1, dbname, "", "", 0);
-  if (find_files(thd, &files, dbname, path, NullS, 0) != FIND_FILES_OK)
+  if (find_files(thd, &files, dbname, path, NullS, 0, NULL) !=
+      FIND_FILES_OK)
   {
     thd->clear_error();
     DBUG_PRINT("info", ("Failed to find files"));
index 26172ca0e76a897437d514e6d44a1ba2e4418c66..1626305611d24a336504485b013e8e9d944fef6d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+   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
@@ -234,7 +234,7 @@ static bool check_partition_column_order(List<Create_field> *create_list,
 
   Field **f_ptr;
   List_iterator_fast<Create_field> new_field_it;
-  Create_field *new_field;
+  Create_field *new_field= NULL;
   new_field_it.init(*create_list);
 
   for (f_ptr= field_arary ; *f_ptr; f_ptr++)
@@ -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
@@ -8180,6 +8186,7 @@ bool ha_partition::prepare_inplace_alter_table(TABLE *altered_table,
   for (index= 0; index < m_tot_parts && !error; index++)
   {
     ha_alter_info->handler_ctx= part_inplace_ctx->handler_ctx_array[index];
+    m_file[index]->update_create_info(ha_alter_info->create_info);
     if (m_file[index]->ha_prepare_inplace_alter_table(altered_table,
                                                       ha_alter_info))
       error= true;
index 6b20de0ec553446f8df7b7124eab767842e0bff7..acdfeb9a56dbed3a3f0a74d2277fef2f08f07fb7 100644 (file)
@@ -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 */
index f91c04c000b1593d8dc1f266b1e4a847ac021165..a891766af71406a2ff1165c0a52904c3840392e4 100644 (file)
@@ -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
@@ -60,7 +60,10 @@ inline double log2(double x)
   return (log(x) / M_LN2);
 }
 #endif
-
+#ifdef WITH_WSREP
+#include "wsrep_mysqld.h"
+#include "wsrep_xid.h"
+#endif
 /*
   While we have legacy_db_type, we have this array to
   check for dups and to find handlerton from legacy_db_type.
@@ -337,7 +340,7 @@ redo:
   if ((plugin= my_plugin_lock_by_name(thd, name, MYSQL_STORAGE_ENGINE_PLUGIN)))
   {
     handlerton *hton= plugin_data(plugin, handlerton *);
-    if (!(hton->flags & HTON_NOT_USER_SELECTABLE))
+    if (hton && !(hton->flags & HTON_NOT_USER_SELECTABLE))
       return plugin;
       
     /*
@@ -1219,10 +1222,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 +1253,6 @@ int ha_prepare(THD *thd)
       }
     }
   }
-
   DBUG_RETURN(error);
 }
 
@@ -1408,7 +1427,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 +1506,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 +1549,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 +1837,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 +1912,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 +2150,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);
     }
@@ -2385,7 +2459,8 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
 #ifdef HAVE_PSI_TABLE_INTERFACE
   if (likely(error == 0))
   {
-    my_bool temp_table= (my_bool)is_prefix(alias, tmp_file_prefix);
+    /* Table share not available, so check path for temp table prefix. */
+    bool temp_table = (strstr(path, tmp_file_prefix) != NULL);
     PSI_TABLE_CALL(drop_table_share)
       (temp_table, db, strlen(db), alias, strlen(alias));
   }
@@ -3336,7 +3411,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 +4701,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))
   {
     /*
@@ -4733,12 +4815,12 @@ int ha_create_table(THD *thd, const char *path,
   const char *name;
   TABLE_SHARE share;
   bool saved_abort_on_warning;
-  DBUG_ENTER("ha_create_table");
 #ifdef HAVE_PSI_TABLE_INTERFACE
-  my_bool temp_table= (my_bool)is_temp_table ||
-               (my_bool)is_prefix(table_name, tmp_file_prefix) ||
-               (create_info->options & HA_LEX_CREATE_TMP_TABLE ? TRUE : FALSE);
+  bool temp_table = is_temp_table ||
+    (create_info->options & HA_LEX_CREATE_TMP_TABLE) ||
+    (strstr(path, tmp_file_prefix) != NULL);
 #endif
+  DBUG_ENTER("ha_create_table");
   
   init_tmp_table_share(thd, &share, db, 0, table_name, path);
   if (open_table_def(thd, &share, 0))
@@ -4750,7 +4832,13 @@ int ha_create_table(THD *thd, const char *path,
 
   if (open_table_from_share(thd, &share, "", 0, (uint) READ_ALL, 0, &table,
                             TRUE))
+  {
+#ifdef HAVE_PSI_TABLE_INTERFACE
+    PSI_TABLE_CALL(drop_table_share)
+      (temp_table, db, strlen(db), table_name, strlen(table_name));
+#endif
     goto err;
+  }
 
   if (update_create_info)
     update_create_info_from_table(create_info, &table);
@@ -6271,7 +6359,7 @@ end:
 ha_rows DsMrr_impl::dsmrr_info(uint keyno, uint n_ranges, uint rows,
                                uint *bufsz, uint *flags, Cost_estimate *cost)
 {  
-  ha_rows res;
+  ha_rows res __attribute__((unused));
   uint def_flags= *flags;
   uint def_bufsz= *bufsz;
 
@@ -6635,13 +6723,30 @@ void get_sweep_read_cost(TABLE *table, ha_rows nrows, bool interrupted,
 
     DBUG_PRINT("info",("sweep: nblocks=%g, busy_blocks=%g", n_blocks,
                        busy_blocks));
-    if (interrupted)
-      cost->add_io(busy_blocks * Cost_estimate::IO_BLOCK_READ_COST());
-    else
+    /*
+      The random access cost for reading the data pages will be the
+      upper limit for the sweep_cost.
+    */
+    cost->add_io(busy_blocks * Cost_estimate::IO_BLOCK_READ_COST());
+
+    if (!interrupted)
+    {
       /* Assume reading is done in one 'sweep' */
-      cost->add_io(busy_blocks * 
+      Cost_estimate sweep_cost;
+      sweep_cost.add_io(busy_blocks *
                    (DISK_SEEK_BASE_COST +
                     DISK_SEEK_PROP_COST * n_blocks / busy_blocks));
+      /*
+        For some cases, ex: when only few blocks need to be read
+        and the seek distance becomes very large, the sweep cost
+        model can produce a cost estimate that is larger than the
+        cost of random access.  To handle this case, we use the
+        sweep cost only when it is less than the random access
+        cost.
+      */
+      if (sweep_cost.get_io_cost() < cost->get_io_cost())
+        *cost= sweep_cost;
+    }
   }
   DBUG_PRINT("info",("returning cost=%g", cost->total_cost()));
   DBUG_VOID_RETURN;
@@ -7017,7 +7122,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 +7229,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 +7560,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) &&  
+      !(bf_thd->variables.wsrep_OSU_method == 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
@@ -7606,3 +7786,28 @@ fl_create_iterator(enum handler_iterator_type type,
   }
 }
 #endif /*TRANS_LOG_MGM_EXAMPLE_CODE*/
+
+
+/**
+   Report a warning for FK constraint violation.
+
+   @param  thd     Thread handle.
+   @param  table   table on which the operation is performed.
+   @param  error   handler error number.
+*/
+void warn_fk_constraint_violation(THD *thd,TABLE *table, int error)
+{
+  String str;
+  switch(error) {
+  case HA_ERR_ROW_IS_REFERENCED:
+    table->file->get_error_message(error, &str);
+    push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
+                 ER_ROW_IS_REFERENCED_2, str.c_ptr_safe());
+    break;
+  case HA_ERR_NO_REFERENCED_ROW:
+    table->file->get_error_message(error, &str);
+    push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
+                 ER_NO_REFERENCED_ROW_2, str.c_ptr_safe());
+    break;
+  }
+}
index 3d7d4fa8ea2e9ce466346904de4ec219f83eedfd..b0ed7a55e45529024fdfbf0e729508d98e836943 100644 (file)
@@ -2,7 +2,7 @@
 #define HANDLER_INCLUDED
 
 /*
-   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
@@ -369,6 +369,7 @@ static const uint MYSQL_START_TRANS_OPT_READ_WRITE         = 4;
 /* Flags for method is_fatal_error */
 #define HA_CHECK_DUP_KEY 1
 #define HA_CHECK_DUP_UNIQUE 2
+#define HA_CHECK_FK_ERROR 4
 #define HA_CHECK_DUP (HA_CHECK_DUP_KEY + HA_CHECK_DUP_UNIQUE)
 
 enum legacy_db_type
@@ -392,6 +393,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 +926,11 @@ struct handlerton
                      const char *wild, bool dir, List<LEX_STRING> *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);
 
@@ -2147,7 +2154,10 @@ public:
     if (!error ||
         ((flags & HA_CHECK_DUP_KEY) &&
          (error == HA_ERR_FOUND_DUPP_KEY ||
-          error == HA_ERR_FOUND_DUPP_UNIQUE)))
+          error == HA_ERR_FOUND_DUPP_UNIQUE)) ||
+        ((flags & HA_CHECK_FK_ERROR) &&
+         (error == HA_ERR_ROW_IS_REFERENCED ||
+          error == HA_ERR_NO_REFERENCED_ROW)))
       return FALSE;
     return TRUE;
   }
@@ -3332,6 +3342,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 +3453,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 +3488,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);
@@ -3488,5 +3511,6 @@ inline const char *table_case_name(HA_CREATE_INFO *info, const char *name)
 
 void print_keydup_error(TABLE *table, KEY *key, const char *msg, myf errflag);
 void print_keydup_error(TABLE *table, KEY *key, myf errflag);
+void warn_fk_constraint_violation(THD *thd, TABLE *table, int error);
 
 #endif /* HANDLER_INCLUDED */
index 3d9e2f6de97cc0728ea87dfdd5b4cbef6885950e..d3944ba847c2886746ff0c293f7b456346d6bd62 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -413,7 +413,7 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
 {
   const struct sockaddr *ip= (const sockaddr *) ip_storage;
   int err_code;
-  bool err_status;
+  bool err_status __attribute__((unused));
   Host_errors errors;
 
   DBUG_ENTER("ip_to_hostname");
index 72aed8d541771789cec994f47cf3b840d71b16ec..e2635c198d60f95497d8897ebb45cb90b0c2ec12 100644 (file)
@@ -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
@@ -362,9 +362,13 @@ my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value)
   MYSQL_TIME ltime;
   if (get_date(&ltime, TIME_FUZZY_DATE))
   {
+    /*
+      The conversion may fail in strict mode. Do not return a NULL pointer,
+      as the result may be used in subsequent arithmetic operations.
+    */
     my_decimal_set_zero(decimal_value);
     null_value= 1;                               // set NULL, stop processing
-    return 0;
+    return decimal_value;;
   }
   return date2my_decimal(&ltime, decimal_value);
 }
@@ -1175,14 +1179,31 @@ Item *Item_param::safe_charset_converter(const CHARSET_INFO *tocs)
 {
   if (const_item())
   {
-    uint cnv_errors;
-    String *ostr= val_str(&cnvstr);
-    cnvitem->str_value.copy(ostr->ptr(), ostr->length(),
-                            ostr->charset(), tocs, &cnv_errors);
-    if (cnv_errors)
-       return NULL;
-    cnvitem->str_value.mark_as_const();
-    cnvitem->max_length= cnvitem->str_value.numchars() * tocs->mbmaxlen;
+    Item *cnvitem;
+    String tmp, cstr, *ostr= val_str(&tmp);
+
+    if (null_value)
+    {
+      cnvitem= new Item_null();
+      if (cnvitem == NULL)
+        return NULL;
+
+      cnvitem->collation.set(tocs);
+    }
+    else
+    {
+      uint conv_errors;
+      cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs,
+                &conv_errors);
+
+      if (conv_errors || !(cnvitem= new Item_string(cstr.ptr(), cstr.length(),
+                                                    cstr.charset(),
+                                                    collation.derivation)))
+        return NULL;
+
+      cnvitem->str_value.copy();
+      cnvitem->str_value.mark_as_const();
+    }
     return cnvitem;
   }
   return Item::safe_charset_converter(tocs);
@@ -2623,36 +2644,39 @@ const char *Item_ident::full_name() const
   return tmp;
 }
 
-void Item_ident::print(String *str, enum_query_type query_type)
+
+void Item_ident::print(String *str, enum_query_type query_type,
+                       const char *db_name_arg,
+                       const char *table_name_arg) const
 {
   THD *thd= current_thd;
   char d_name_buff[MAX_ALIAS_NAME], t_name_buff[MAX_ALIAS_NAME];
-  const char *d_name= db_name, *t_name= table_name;
+  const char *d_name= db_name_arg, *t_name= table_name_arg;
   if (lower_case_table_names== 1 ||
       (lower_case_table_names == 2 && !alias_name_used))
   {
-    if (table_name && table_name[0])
+    if (table_name_arg && table_name_arg[0])
     {
-      strmov(t_name_buff, table_name);
+      strmov(t_name_buff, table_name_arg);
       my_casedn_str(files_charset_info, t_name_buff);
       t_name= t_name_buff;
     }
-    if (db_name && db_name[0])
+    if (db_name_arg && db_name_arg[0])
     {
-      strmov(d_name_buff, db_name);
+      strmov(d_name_buff, db_name_arg);
       my_casedn_str(files_charset_info, d_name_buff);
       d_name= d_name_buff;
     }
   }
 
-  if (!table_name || !field_name || !field_name[0])
+  if (!table_name_arg || !field_name || !field_name[0])
   {
     const char *nm= (field_name && field_name[0]) ?
                       field_name : item_name.is_set() ? item_name.ptr() : "tmp_field";
     append_identifier(thd, str, nm, (uint) strlen(nm));
     return;
   }
-  if (db_name && db_name[0] && !alias_name_used)
+  if (db_name_arg && db_name_arg[0] && !alias_name_used)
   {
     if (!(cached_table && cached_table->belong_to_view &&
           cached_table->belong_to_view->compact_view_format))
@@ -2671,7 +2695,7 @@ void Item_ident::print(String *str, enum_query_type query_type)
   }
   else
   {
-    if (table_name[0])
+    if (table_name_arg[0])
     {
       append_identifier(thd, str, t_name, (uint) strlen(t_name));
       str->append('.');
@@ -3413,8 +3437,6 @@ Item_param::Item_param(uint pos_in_query_arg) :
     value is set.
   */
   maybe_null= 1;
-  cnvitem= new Item_string("", 0, &my_charset_bin, DERIVATION_COERCIBLE);
-  cnvstr.set(cnvbuf, sizeof(cnvbuf), &my_charset_bin);
 }
 
 
@@ -4075,7 +4097,7 @@ Item_param::eq(const Item *arg, bool binary_cmp) const
 
 void Item_param::print(String *str, enum_query_type query_type)
 {
-  if (state == NO_VALUE)
+  if (state == NO_VALUE || query_type & QT_NO_DATA_EXPANSION)
   {
     str->append('?');
   }
@@ -5900,44 +5922,54 @@ enum_field_types Item::field_type() const
 /**
   Verifies that the input string is well-formed according to its character set.
   @param send_error   If true, call my_error if string is not well-formed.
-
-  Will truncate input string if it is not well-formed.
+  @param truncate     If true, set to null/truncate if not well-formed.
 
   @return
   If well-formed: input string.
   If not well-formed:
-    if strict mode: NULL pointer and we set this Item's value to NULL
-    if not strict mode: input string truncated up to last good character
+    if truncate is true and strict mode:     NULL pointer and we set this
+                                             Item's value to NULL.
+    if truncate is true and not strict mode: input string truncated up to
+                                             last good character.
+    if truncate is false:                    input string is returned.
  */
-String *Item::check_well_formed_result(String *str, bool send_error)
+String *Item::check_well_formed_result(String *str,
+                                       bool send_error,
+                                       bool truncate)
 {
   /* Check whether we got a well-formed string */
   const CHARSET_INFO *cs= str->charset();
-  int well_formed_error;
-  uint wlen= cs->cset->well_formed_len(cs,
-                                       str->ptr(), str->ptr() + str->length(),
-                                       str->length(), &well_formed_error);
-  if (wlen < str->length())
+
+  size_t valid_length;
+  bool length_error;
+
+  if (validate_string(cs, str->ptr(), str->length(),
+                      &valid_length, &length_error))
   {
+    const char *str_end= str->ptr() + str->length();
+    const char *print_byte= str->ptr() + valid_length;
     THD *thd= current_thd;
     char hexbuf[7];
-    uint diff= str->length() - wlen;
+    uint diff= str_end - print_byte;
     set_if_smaller(diff, 3);
-    octet2hex(hexbuf, str->ptr() + wlen, diff);
-    if (send_error)
+    octet2hex(hexbuf, print_byte, diff);
+    if (send_error && length_error)
     {
       my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
                cs->csname,  hexbuf);
       return 0;
     }
-    if (thd->is_strict_mode())
-    {
-      null_value= 1;
-      str= 0;
-    }
-    else
+    if (truncate && length_error)
     {
-      str->length(wlen);
+      if (thd->is_strict_mode())
+      {
+        null_value= 1;
+        str= 0;
+      }
+      else
+      {
+        str->length(valid_length);
+      }
     }
     push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_INVALID_CHARACTER_STRING,
                         ER(ER_INVALID_CHARACTER_STRING), cs->csname, hexbuf);
@@ -7098,7 +7130,8 @@ Item *Item_field::update_value_transformer(uchar *select_arg)
 
 void Item_field::print(String *str, enum_query_type query_type)
 {
-  if (field && field->table->const_table)
+  if (field && field->table->const_table &&
+      !(query_type & QT_NO_DATA_EXPANSION))
   {
     char buff[MAX_FIELD_WIDTH];
     String tmp(buff,sizeof(buff),str->charset());
@@ -7113,7 +7146,11 @@ void Item_field::print(String *str, enum_query_type query_type)
     }
     return;
   }
-  Item_ident::print(str, query_type);
+  if ((table_name == NULL || table_name[0] == 0) && field && field->orig_table)
+    Item_ident::print(str, query_type, field->orig_table->s->db.str,
+                      field->orig_table->alias);
+  else
+    Item_ident::print(str, query_type);
 }
 
 
index 3471af4c3b89f6154bb940f5d118ca66bd3cdbc3..e0d90ae921db3f36a5651709b3836095740b4a73 100644 (file)
@@ -1,8 +1,7 @@
 #ifndef ITEM_INCLUDED
 #define ITEM_INCLUDED
 
-/* 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
@@ -1654,7 +1653,9 @@ public:
   }
   virtual Field::geometry_type get_geometry_type() const
     { return Field::GEOM_GEOMETRY; };
-  String *check_well_formed_result(String *str, bool send_error= 0);
+  String *check_well_formed_result(String *str,
+                                   bool send_error,
+                                   bool truncate);
   bool eq_by_collation(Item *item, bool binary_cmp, const CHARSET_INFO *cs); 
 
   /*
@@ -2111,7 +2112,37 @@ public:
                                  st_select_lex *removed_select);
   void cleanup();
   bool remove_dependence_processor(uchar * arg);
-  virtual void print(String *str, enum_query_type query_type);
+  virtual void print(String *str, enum_query_type query_type)
+  {
+    print(str, query_type, db_name, table_name);
+  }
+protected:
+  /**
+    Function to print column name for a table
+
+    To print a column for a permanent table (picks up database and table from
+    Item_ident object):
+
+       item->print(str, qt)
+
+    To print a column for a temporary table:
+
+       item->print(str, qt, specific_db, specific_table)
+
+    Items of temporary table fields have empty/NULL values of table_name and
+    db_name. To print column names in a 3D form (`database`.`table`.`column`),
+    this function prints db_name_arg and table_name_arg parameters instead of
+    this->db_name and this->table_name respectively.
+
+    @param [out] str            Output string buffer.
+    @param       query_type     Bitmap to control printing details.
+    @param       db_name_arg    String to output as a column database name.
+    @param       table_name_arg String to output as a column table name.
+  */
+  void print(String *str, enum_query_type query_type,
+             const char *db_name_arg,
+             const char *table_name_arg) const;
+public:
   virtual bool change_context_processor(uchar *cntx)
     { context= (Name_resolution_context *)cntx; return FALSE; }
   friend bool insert_fields(THD *thd, Name_resolution_context *context,
@@ -2399,10 +2430,6 @@ public:
 class Item_param :public Item,
                   private Settable_routine_parameter
 {
-  char cnvbuf[MAX_FIELD_WIDTH];
-  String cnvstr;
-  Item *cnvitem;
-
 public:
   enum enum_item_param_state
   {
@@ -2842,6 +2869,11 @@ public:
     decimals=NOT_FIXED_DEC;
     // it is constant => can be used without fix_fields (and frequently used)
     fixed= 1;
+    /*
+      Check if the string has any character that can't be
+      interpreted using the relevant charset.
+    */
+    check_well_formed_result(&str_value, false, false);
   }
   /* Just create an item and do not fill string representation */
   Item_string(const CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
@@ -4173,7 +4205,11 @@ public:
     collation.set(item->collation);
     unsigned_flag= item->unsigned_flag;
     if (item->type() == FIELD_ITEM)
+    {
       cached_field= ((Item_field *)item)->field;
+      if (cached_field->table)
+        used_table_map= cached_field->table->map;
+    }
     return 0;
   };
   enum Type type() const { return CACHE_ITEM; }
index a97e6c736e16276bb549699c73e7a25a2140cbc4..b854729fcfe446bcecd001b1bdb532fc52475b5c 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -4164,29 +4164,39 @@ cmp_item_row::~cmp_item_row()
 }
 
 
-void cmp_item_row::alloc_comparators()
+void cmp_item_row::alloc_comparators(Item *item)
 {
+  n= item->cols();
+  DBUG_ASSERT(comparators == NULL);
   if (!comparators)
     comparators= (cmp_item **) current_thd->calloc(sizeof(cmp_item *)*n);
+  if (comparators)
+  {
+    for (uint i= 0; i < n; i++)
+    {
+      DBUG_ASSERT(comparators[i] == NULL);
+      Item *item_i= item->element_index(i);
+      if (!(comparators[i]=
+            cmp_item::get_comparator(item_i->result_type(),
+                                     item_i->collation.collation)))
+        break;                                  // new failed
+      if (item_i->result_type() == ROW_RESULT)
+        static_cast<cmp_item_row*>(comparators[i])->alloc_comparators(item_i);
+    }
+  }
 }
 
 
 void cmp_item_row::store_value(Item *item)
 {
   DBUG_ENTER("cmp_item_row::store_value");
-  n= item->cols();
-  alloc_comparators();
+  DBUG_ASSERT(comparators);
   if (comparators)
   {
     item->bring_value();
     item->null_value= 0;
-    for (uint i=0; i < n; i++)
+    for (uint i= 0; i < n; i++)
     {
-      if (!comparators[i])
-        if (!(comparators[i]=
-              cmp_item::get_comparator(item->element_index(i)->result_type(),
-                                       item->element_index(i)->collation.collation)))
-         break;                                        // new failed
       comparators[i]->store_value(item->element_index(i));
       item->null_value|= item->element_index(i)->null_value;
     }
@@ -4464,7 +4474,7 @@ void Item_func_in::fix_length_and_dec()
         cmp_items[ROW_RESULT]= cmp;
       }
       cmp->n= args[0]->cols();
-      cmp->alloc_comparators();
+      cmp->alloc_comparators(args[0]);
     }
     /* All DATE/DATETIME fields/functions has the STRING result type. */
     if (cmp_type == STRING_RESULT || cmp_type == ROW_RESULT)
@@ -4583,11 +4593,8 @@ void Item_func_in::fix_length_and_dec()
         break;
       case ROW_RESULT:
         /*
-          The row comparator was created at the beginning but only DATETIME
-          items comparators were initialized. Call store_value() to setup
-          others.
+          The row comparator was created at the beginning.
         */
-        ((in_row*)array)->tmp.store_value(args[0]);
         break;
       case DECIMAL_RESULT:
         array= new in_decimal(arg_count - 1);
index ef7252bb26d43b6245b04a10c60b09da92c91ab7..3311a83148b1dd06916b4d9c278cdc29a96ba89e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ITEM_CMPFUNC_INCLUDED
 #define ITEM_CMPFUNC_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
@@ -1450,7 +1450,7 @@ public:
   cmp_item_row(): comparators(0), n(0) {}
   ~cmp_item_row();
   void store_value(Item *item);
-  inline void alloc_comparators();
+  inline void alloc_comparators(Item *item);
   int cmp(Item *arg);
   int compare(cmp_item *arg);
   cmp_item *make_same();
index e5ff0b820f27e5bdd7413107f7a7c528c52cf347..a42976443de25ac99f25c801286a1b3881049410 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -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));
 }
@@ -4729,7 +4741,7 @@ bool user_var_entry::realloc(uint length)
   @retval  true    on allocation error
 
 */
-bool user_var_entry::store(void *from, uint length, Item_result type)
+bool user_var_entry::store(const void *from, uint length, Item_result type)
 {
   // Store strings with end \0
   if (realloc(length + MY_TEST(type == STRING_RESULT)))
@@ -4763,7 +4775,7 @@ bool user_var_entry::store(void *from, uint length, Item_result type)
     true    failure
 */
 
-bool user_var_entry::store(void *ptr, uint length, Item_result type,
+bool user_var_entry::store(const void *ptr, uint length, Item_result type,
                            const CHARSET_INFO *cs, Derivation dv,
                            bool unsigned_arg)
 {
@@ -4776,7 +4788,7 @@ bool user_var_entry::store(void *ptr, uint length, Item_result type,
 
 
 bool
-Item_func_set_user_var::update_hash(void *ptr, uint length,
+Item_func_set_user_var::update_hash(const void *ptr, uint length,
                                     Item_result res_type,
                                     const CHARSET_INFO *cs, Derivation dv,
                                     bool unsigned_arg)
@@ -4790,8 +4802,16 @@ Item_func_set_user_var::update_hash(void *ptr, uint length,
     null_value= ((Item_field*)args[0])->field->is_null();
   else
     null_value= args[0]->null_value;
+
+  if (ptr == NULL)
+  {
+    DBUG_ASSERT(length == 0);
+    null_value= true;
+  }
+
   if (null_value && null_item)
     res_type= entry->type();                    // Don't change type of item
+
   if (null_value)
     entry->set_null_value(res_type);
   else if (entry->store(ptr, length, res_type, cs, dv, unsigned_arg))
@@ -5046,13 +5066,13 @@ Item_func_set_user_var::update()
   switch (cached_result_type) {
   case REAL_RESULT:
   {
-    res= update_hash((void*) &save_result.vreal,sizeof(save_result.vreal),
+    res= update_hash(&save_result.vreal,sizeof(save_result.vreal),
                     REAL_RESULT, default_charset(), DERIVATION_IMPLICIT, 0);
     break;
   }
   case INT_RESULT:
   {
-    res= update_hash((void*) &save_result.vint, sizeof(save_result.vint),
+    res= update_hash(&save_result.vint, sizeof(save_result.vint),
                      INT_RESULT, default_charset(), DERIVATION_IMPLICIT,
                      unsigned_flag);
     break;
@@ -5060,10 +5080,10 @@ Item_func_set_user_var::update()
   case STRING_RESULT:
   {
     if (!save_result.vstr)                                     // Null value
-      res= update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin,
+      res= update_hash(NULL, 0, STRING_RESULT, &my_charset_bin,
                       DERIVATION_IMPLICIT, 0);
     else
-      res= update_hash((void*) save_result.vstr->ptr(),
+      res= update_hash(save_result.vstr->ptr(),
                       save_result.vstr->length(), STRING_RESULT,
                       save_result.vstr->charset(),
                       DERIVATION_IMPLICIT, 0);
@@ -5072,10 +5092,10 @@ Item_func_set_user_var::update()
   case DECIMAL_RESULT:
   {
     if (!save_result.vdec)                                     // Null value
-      res= update_hash((void*) 0, 0, DECIMAL_RESULT, &my_charset_bin,
+      res= update_hash(NULL, 0, DECIMAL_RESULT, &my_charset_bin,
                        DERIVATION_IMPLICIT, 0);
     else
-      res= update_hash((void*) save_result.vdec,
+      res= update_hash(save_result.vdec,
                        sizeof(my_decimal), DECIMAL_RESULT,
                        default_charset(), DERIVATION_IMPLICIT, 0);
     break;
@@ -6201,6 +6221,18 @@ void Item_func_match::init_search(bool no_order)
   DBUG_VOID_RETURN;
 }
 
+/**
+   Add field into table read set.
+
+   @param field field to be added to the table read set.
+*/
+static void update_table_read_set(Field *field)
+{
+  TABLE *table= field->table;
+
+  if (!bitmap_fast_test_and_set(table->read_set, field->field_index))
+    table->covering_keys.intersect(field->part_of_key);
+}
 
 bool Item_func_match::fix_fields(THD *thd, Item **ref)
 {
@@ -6227,12 +6259,12 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref)
   const_item_cache=0;
   for (uint i=1 ; i < arg_count ; i++)
   {
-    item=args[i];
-    if (item->type() == Item::REF_ITEM)
-      args[i]= item= *((Item_ref *)item)->ref;
-    if (item->type() != Item::FIELD_ITEM)
+    item= args[i]= args[i]->real_item();
+    if (item->type() != Item::FIELD_ITEM ||
+        /* Cannot use FTS index with outer table field */
+        (item->used_tables() & OUTER_REF_TABLE_BIT))
     {
-      my_error(ER_WRONG_ARGUMENTS, MYF(0), "AGAINST");
+      my_error(ER_WRONG_ARGUMENTS, MYF(0), "MATCH");
       return TRUE;
     }
     allows_multi_table_search &= 
@@ -6252,12 +6284,46 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref)
     my_error(ER_WRONG_ARGUMENTS,MYF(0),"MATCH");
     return TRUE;
   }
-  table=((Item_field *)item)->field->table;
+
+  /*
+    Here we make an assumption that if the engine supports
+    fulltext extension(HA_CAN_FULLTEXT_EXT flag) then table
+    can have FTS_DOC_ID column. Atm this is the only way
+    to distinguish MyISAM and InnoDB engines.
+  */
+  table= ((Item_field *)item)->field->table;
+
   if (!(table->file->ha_table_flags() & HA_CAN_FULLTEXT))
   {
     my_error(ER_TABLE_CANT_HANDLE_FT, MYF(0));
     return 1;
   }
+  if ((table->file->ha_table_flags() & HA_CAN_FULLTEXT_EXT))
+  {
+    Field *doc_id_field= table->fts_doc_id_field;
+    /*
+      Update read set with FTS_DOC_ID column so that indexes that have
+      FTS_DOC_ID part can be considered as a covering index.
+    */
+    if (doc_id_field)
+      update_table_read_set(doc_id_field);
+    /*
+      Prevent index only accces by non-FTS index if table does not have
+      FTS_DOC_ID column, find_relevance does not work properly without
+      FTS_DOC_ID value.
+    */
+    else
+      table->no_keyread= true;
+  }
+  else
+  {
+    /*
+      Since read_set is not updated for MATCH arguments
+      it's necessary to update it here for MyISAM.
+    */
+    for (uint i= 1; i < arg_count; i++)
+      update_table_read_set(((Item_field*)args[i])->field);
+  }
   table->fulltext_searched=1;
   return agg_item_collations_for_comparison(cmp_collation, func_name(),
                                             args+1, arg_count-1, 0);
index 7a5b654fac66486eb8e892dad28ac884d834e417..079daa03a521245a87d56cdb738d83e736060a9a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ITEM_FUNC_INCLUDED
 #define ITEM_FUNC_INCLUDED
 
-/* 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
@@ -238,7 +238,7 @@ public:
     char buf[256];
     String str(buf, sizeof(buf), system_charset_info);
     str.length(0);
-    print(&str, QT_ORDINARY);
+    print(&str, QT_NO_DATA_EXPANSION);
     my_error(ER_DATA_OUT_OF_RANGE, MYF(0), type_name, str.c_ptr_safe());
   }
   inline double raise_float_overflow()
@@ -1700,7 +1700,7 @@ public:
   String *str_result(String *str);
   my_decimal *val_decimal_result(my_decimal *);
   bool is_null_result();
-  bool update_hash(void *ptr, uint length, enum Item_result type,
+  bool update_hash(const void *ptr, uint length, enum Item_result type,
                   const CHARSET_INFO *cs, Derivation dv, bool unsigned_arg);
   bool send(Protocol *protocol, String *str_arg);
   void make_field(Send_field *tmp_field);
index 3f8bc9fbbbb041c790ed9679dd81e8ba0ae1bf5c..95306db81acaa186ab86e7d262fe3e9dd52a3c4a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ITEM_GEOFUNC_INCLUDED
 #define ITEM_GEOFUNC_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
@@ -186,7 +186,7 @@ public:
       if (args[i]->fixed && args[i]->field_type() != MYSQL_TYPE_GEOMETRY)
       {
         String str;
-        args[i]->print(&str, QT_ORDINARY);
+        args[i]->print(&str, QT_NO_DATA_EXPANSION);
         str.append('\0');
         my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "non geometric",
                  str.ptr());
index 919b083c9e2d713f30dc73763816cc399ac013cc..1f2499667fbb33e2dfd2970ce053d6da211db06e 100644 (file)
@@ -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
@@ -609,7 +609,7 @@ void Item_func_to_base64::fix_length_and_dec()
   }
   else
   {
-    int length= base64_needed_encoded_length((int) args[0]->max_length);
+    uint64 length= base64_needed_encoded_length((uint64) args[0]->max_length);
     DBUG_ASSERT(length > 0);
     fix_char_length_ulonglong((ulonglong) length - 1);
   }
@@ -620,11 +620,11 @@ String *Item_func_to_base64::val_str_ascii(String *str)
 {
   String *res= args[0]->val_str(str);
   bool too_long= false;
-  int length;
+  uint64 length;
   if (!res ||
       res->length() > (uint) base64_encode_max_arg_length() ||
       (too_long=
-       ((uint) (length= base64_needed_encoded_length((int) res->length())) >
+       ((uint64) (length= base64_needed_encoded_length((uint64) res->length())) >
         current_thd->variables.max_allowed_packet)) ||
       tmp_value.alloc((uint) length))
   {
@@ -654,7 +654,7 @@ void Item_func_from_base64::fix_length_and_dec()
   }
   else
   {
-    int length= base64_needed_decoded_length((int) args[0]->max_length);
+    uint64 length= base64_needed_decoded_length((uint64) args[0]->max_length);
     fix_char_length_ulonglong((ulonglong) length);
   }
   maybe_null= 1; // Can be NULL, e.g. in case of badly formed input string
@@ -665,16 +665,16 @@ String *Item_func_from_base64::val_str(String *str)
 {
   String *res= args[0]->val_str_ascii(str);
   bool too_long= false;
-  int length;
+  int64 length;
   const char *end_ptr;
 
   if (!res ||
       res->length() > (uint) base64_decode_max_arg_length() ||
       (too_long=
-       ((uint) (length= base64_needed_decoded_length((int) res->length())) >
+       ((uint64) (length= base64_needed_decoded_length((uint64) res->length())) >
         current_thd->variables.max_allowed_packet)) ||
       tmp_value.alloc((uint) length) ||
-      (length= base64_decode(res->ptr(), (int) res->length(),
+      (length= base64_decode(res->ptr(), (uint64) res->length(),
                              (char *) tmp_value.ptr(), &end_ptr, 0)) < 0 ||
       end_ptr < res->ptr() + res->length())
   {
@@ -751,8 +751,17 @@ String *Item_func_concat::val_str(String *str)
          str->replace(0,0,*res);
        else
        {
-         str->copy(*res);
-         str->append(*res2);
+          // If res2 is a substring of str, then clone it first.
+          char buff[STRING_BUFFER_USUAL_SIZE];
+          String res2_clone(buff, sizeof(buff), system_charset_info);
+          if (res2->uses_buffer_owned_by(str))
+          {
+            if (res2_clone.copy(*res2))
+              goto null;
+            res2= &res2_clone;
+          }
+          str->copy(*res);
+          str->append(*res2);
        }
         res= str;
         use_as_buff= &tmp_value;
@@ -1097,9 +1106,18 @@ String *Item_func_concat_ws::val_str(String *str)
       }
       else
       {
-       str->copy(*res);
-       str->append(*sep_str);
-       str->append(*res2);
+        // If res2 is a substring of str, then clone it first.
+        char buff[STRING_BUFFER_USUAL_SIZE];
+        String res2_clone(buff, sizeof(buff), system_charset_info);
+        if (res2->uses_buffer_owned_by(str))
+        {
+          if (res2_clone.copy(*res2))
+            goto null;
+          res2= &res2_clone;
+        }
+        str->copy(*res);
+        str->append(*sep_str);
+        str->append(*res2);
       }
       res=str;
       use_as_buff= &tmp_value;
@@ -1345,7 +1363,15 @@ redo:
           if (!alloced)
           {
             alloced=1;
-            res=copy_if_not_alloced(str,res,res->length()+to_length);
+            if (res->uses_buffer_owned_by(str))
+            {
+              if (tmp_value_res.alloc(res->length() + to_length) ||
+                  tmp_value_res.copy(*res))
+                goto null;
+              res= &tmp_value_res;
+            }
+            else
+              res= copy_if_not_alloced(str, res, res->length() + to_length);
           }
           res->replace((uint) offset,from_length,*res3);
          offset+=(int) to_length;
@@ -1372,7 +1398,15 @@ skip:
       if (!alloced)
       {
         alloced=1;
-        res=copy_if_not_alloced(str,res,res->length()+to_length);
+        if (res->uses_buffer_owned_by(str))
+        {
+          if (tmp_value_res.alloc(res->length() + to_length) ||
+              tmp_value_res.copy(*res))
+            goto null;
+          res= &tmp_value_res;
+        }
+        else
+          res= copy_if_not_alloced(str, res, res->length() + to_length);
       }
       res->replace((uint) offset,from_length,*res3);
       offset+=(int) to_length;
@@ -1406,22 +1440,27 @@ String *Item_func_insert::val_str(String *str)
 {
   DBUG_ASSERT(fixed == 1);
   String *res,*res2;
-  longlong start, length;  /* must be longlong to avoid truncation */
+  longlong start, length, orig_len;  /* must be longlong to avoid truncation */
 
   null_value=0;
   res=args[0]->val_str(str);
   res2=args[3]->val_str(&tmp_value);
-  start= args[1]->val_int() - 1;
+  start= args[1]->val_int();
   length= args[2]->val_int();
 
   if (args[0]->null_value || args[1]->null_value || args[2]->null_value ||
       args[3]->null_value)
     goto null; /* purecov: inspected */
 
-  if ((start < 0) || (start > res->length()))
+  orig_len= static_cast<longlong>(res->length());
+
+  if ((start < 1) || (start > orig_len))
     return res;                                 // Wrong param; skip insert
-  if ((length < 0) || (length > res->length()))
-    length= res->length();
+
+  --start;    // Internal start from '0'
+
+  if ((length < 0) || (length > orig_len))
+    length= orig_len;
 
   /*
     There is one exception not handled (intentionaly) by the character set
@@ -1442,12 +1481,12 @@ String *Item_func_insert::val_str(String *str)
    length= res->charpos((int) length, (uint32) start);
 
   /* Re-testing with corrected params */
-  if (start > res->length())
+  if (start > orig_len)
     return res; /* purecov: inspected */        // Wrong param; skip insert
-  if (length > res->length() - start)
-    length= res->length() - start;
+  if (length > orig_len - start)
+    length= orig_len - start;
 
-  if ((ulonglong) (res->length() - length + res2->length()) >
+  if ((ulonglong) (orig_len - length + res2->length()) >
       (ulonglong) current_thd->variables.max_allowed_packet)
   {
     push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
@@ -1456,7 +1495,16 @@ String *Item_func_insert::val_str(String *str)
                        func_name(), current_thd->variables.max_allowed_packet);
     goto null;
   }
-  res=copy_if_not_alloced(str,res,res->length());
+  if (res->uses_buffer_owned_by(str))
+  {
+    if (tmp_value_res.alloc(orig_len) ||
+        tmp_value_res.copy(*res))
+      goto null;
+    res= &tmp_value_res;
+  }
+  else
+    res= copy_if_not_alloced(str, res, orig_len);
+
   res->replace((uint32) start,(uint32) length,*res2);
   return res;
 null:
@@ -1491,7 +1539,15 @@ String *Item_str_conv::val_str(String *str)
   if (multiply == 1)
   {
     uint len;
-    res= copy_if_not_alloced(str,res,res->length());
+    if (res->uses_buffer_owned_by(str))
+    {
+       if (tmp_value.copy(*res))
+         goto null;
+       res= &tmp_value;
+    }
+    else
+      res= copy_if_not_alloced(str, res, res->length());
+
     len= converter(collation.collation, (char*) res->ptr(), res->length(),
                                         (char*) res->ptr(), res->length());
     DBUG_ASSERT(len <= res->length());
@@ -1508,6 +1564,9 @@ String *Item_str_conv::val_str(String *str)
     res= &tmp_value;
   }
   return res;
+null:
+  null_value= maybe_null;
+  return 0;
 }
 
 
@@ -2363,11 +2422,22 @@ String *Item_func_encode::val_str(String *str)
   }
 
   null_value= 0;
-  res= copy_if_not_alloced(str, res, res->length());
+  if (res->uses_buffer_owned_by(str))
+  {
+    if (tmp_value_res.copy(*res))
+      goto null;
+    res= &tmp_value_res;
+  }
+  else
+    res= copy_if_not_alloced(str, res, res->length());
+
   crypto_transform(res);
   sql_crypt.reinit();
 
   return res;
+null:
+  null_value= maybe_null;
+  return 0;
 }
 
 void Item_func_encode::crypto_transform(String *res)
@@ -3017,7 +3087,9 @@ String *Item_func_char::val_str(String *str)
     }
   }
   str->realloc(str->length());                 // Add end 0 (for Purify)
-  return check_well_formed_result(str);
+  return check_well_formed_result(str,
+                                  false,  // send warning
+                                  true);  // truncate
 }
 
 
@@ -3257,7 +3329,9 @@ String *Item_func_rpad::val_str(String *str)
   if (use_mb(rpad->charset()))
   {
     // This will chop off any trailing illegal characters from rpad.
-    String *well_formed_pad= args[2]->check_well_formed_result(rpad, false);
+    String *well_formed_pad= args[2]->check_well_formed_result(rpad,
+                                                               false, //send warning
+                                                               true); //truncate
     if (!well_formed_pad)
       goto err;
   }
@@ -3372,7 +3446,9 @@ String *Item_func_lpad::val_str(String *str)
   if (use_mb(pad->charset()))
   {
     // This will chop off any trailing illegal characters from pad.
-    String *well_formed_pad= args[2]->check_well_formed_result(pad, false);
+    String *well_formed_pad= args[2]->check_well_formed_result(pad,
+                                                               false, // send warning
+                                                               true); // truncate
     if (!well_formed_pad)
       goto err;
   }
@@ -3488,7 +3564,9 @@ String *Item_func_conv_charset::val_str(String *str)
   }
   null_value= tmp_value.copy(arg->ptr(), arg->length(), arg->charset(),
                              conv_charset, &dummy_errors);
-  return null_value ? 0 : check_well_formed_result(&tmp_value);
+  return null_value ? 0 : check_well_formed_result(&tmp_value,
+                                                   false, // send warning
+                                                   true); // truncate
 }
 
 void Item_func_conv_charset::fix_length_and_dec()
@@ -4599,6 +4677,9 @@ String *Item_func_uuid::val_str(String *str)
   tohex(s+9, time_mid, 4);
   tohex(s+14, time_hi_and_version, 4);
   strmov(s+18, clock_seq_and_node_str);
+  DBUG_EXECUTE_IF("force_fake_uuid",
+                  strmov(s, "a2d00942-b69c-11e4-a696-0020ff6fcbe6");
+                  );
   return str;
 }
 
index d8976e44641a1385108bb49ba1eaa3c77ecc43b8..64a547294afeebcbe32cc9ca5dbd7e5d2f49f995 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ITEM_STRFUNC_INCLUDED
 #define ITEM_STRFUNC_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
@@ -209,6 +209,8 @@ public:
 class Item_func_replace :public Item_str_func
 {
   String tmp_value,tmp_value2;
+  /** Holds result in case we need to allocate our own result buffer.*/
+  String tmp_value_res;
 public:
   Item_func_replace(Item *org,Item *find,Item *replace)
     :Item_str_func(org,find,replace) {}
@@ -221,6 +223,8 @@ public:
 class Item_func_insert :public Item_str_func
 {
   String tmp_value;
+  /** Holds result in case we need to allocate our own result buffer.*/
+  String tmp_value_res;
 public:
   Item_func_insert(Item *org,Item *start,Item *length,Item *new_str)
     :Item_str_func(org,start,length,new_str) {}
@@ -456,6 +460,8 @@ class Item_func_encode :public Item_str_func
 private:
   /** Whether the PRNG has already been seeded. */
   bool seeded;
+  /** Holds result in case we need to allocate our own result buffer.*/
+  String tmp_value_res;
 protected:
   SQL_CRYPT sql_crypt;
 public:
index 34f74fbb1562f7c76ac5e47b15c42d65b12bc3bd..a1998e96d06f4e366e7ff59ed9ab8aba52fb13d3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights
    reserved.
 
    This program is free software; you can redistribute it and/or modify
@@ -295,6 +295,7 @@ bool Item_in_subselect::finalize_materialization_transform(JOIN *join)
       For some reason we cannot use materialization for this IN predicate.
       Delete all materialization-related objects, and return error.
     */
+    new_engine->cleanup();
     delete new_engine;
     return true;
   }
@@ -1609,6 +1610,27 @@ Item_in_subselect::single_value_transformer(JOIN *join,
       because these items would be deleted at the end
       of the statement. Thus one of 'substitution' arguments
       can be broken in case of PS.
+
+      @todo
+      Why do we use real_item()/substitutional_item() instead of the plain
+      left_expr?
+      Because left_expr might be a rollbackable item, and we fail to properly
+      rollback all copies of left_expr at end of execution, so we want to
+      avoid creating copies of left_expr as much as possible, so we use
+      real_item() instead.
+      Doing a proper rollback is difficult: the change was registered for the
+      original item which was the left argument of IN. Then this item was
+      copied to left_expr, which is copied below to substitution->args[0]. To
+      do a proper rollback, we would have to restore the content
+      of both copies as well as the original item. There might be more copies,
+      if AND items have been constructed.
+      The same applies to the right expression.
+      However, using real_item()/substitutional_item() brings its own
+      problems: for example, we lose information that the item is an outer
+      reference; the item can thus wrongly be considered for a Keyuse (causing
+      bug#17766653).
+      When WL#6570 removes the "rolling back" system, all
+      real_item()/substitutional_item() in this file should be removed.
     */
     substitution= func->create(left_expr->substitutional_item(), subs);
     DBUG_RETURN(RES_OK);
@@ -1769,6 +1791,9 @@ Item_in_subselect::single_value_in_to_exists_transformer(JOIN * join, Comp_creat
   }
   else
   {
+    /*
+      Grep for "WL#6570" to see the relevant comment about real_item.
+    */
     Item *orig_item= select_lex->item_list.head()->real_item();
 
     if (select_lex->table_list.elements)
@@ -2747,7 +2772,7 @@ bool subselect_single_select_engine::exec()
     if (join->optimize())
     {
       optimize_error= true;
-      rc= join->error ? join->error : 1;
+      rc= 1;
       goto exit;
     }
     if (item->engine_changed)
@@ -3560,21 +3585,20 @@ bool subselect_hash_sj_engine::setup(List<Item> *tmp_columns)
     - here we initialize only those members that are used by
       subselect_indexsubquery_engine, so these objects are incomplete.
   */ 
-  JOIN_TAB * const tmp_tab= new (thd->mem_root) JOIN_TAB;
-  if (tmp_tab == NULL)
+  if (!(tab= new (thd->mem_root) JOIN_TAB))
     DBUG_RETURN(TRUE);
-  tmp_tab->table= tmp_table;
-  tmp_tab->ref.key= 0; /* The only temp table index. */
-  tmp_tab->ref.key_length= tmp_key->key_length;
-  if (!(tmp_tab->ref.key_buff=
+  tab->table= tmp_table;
+  tab->ref.key= 0; /* The only temp table index. */
+  tab->ref.key_length= tmp_key->key_length;
+  if (!(tab->ref.key_buff=
         (uchar*) thd->calloc(ALIGN_SIZE(tmp_key->key_length) * 2)) ||
-      !(tmp_tab->ref.key_copy=
+      !(tab->ref.key_copy=
         (store_key**) thd->alloc((sizeof(store_key*) * tmp_key_parts))) ||
-      !(tmp_tab->ref.items=
+      !(tab->ref.items=
         (Item**) thd->alloc(sizeof(Item*) * tmp_key_parts)))
     DBUG_RETURN(TRUE);
 
-  uchar *cur_ref_buff= tmp_tab->ref.key_buff;
+  uchar *cur_ref_buff= tab->ref.key_buff;
 
   /*
     Like semijoin-materialization-lookup (see create_subquery_equalities()),
@@ -3618,11 +3642,11 @@ bool subselect_hash_sj_engine::setup(List<Item> *tmp_columns)
     /* Item for the corresponding field from the materialized temp table. */
     Item_field *right_col_item;
     const bool nullable= key_parts[part_no].field->real_maybe_null();
-    tmp_tab->ref.items[part_no]= item_in->left_expr->element_index(part_no);
+    tab->ref.items[part_no]= item_in->left_expr->element_index(part_no);
 
     if (!(right_col_item= new Item_field(thd, context, 
                                          key_parts[part_no].field)) ||
-        !(eq_cond= new Item_func_eq(tmp_tab->ref.items[part_no],
+        !(eq_cond= new Item_func_eq(tab->ref.items[part_no],
                                     right_col_item)) ||
         ((Item_cond_and*)cond)->add(eq_cond))
     {
@@ -3631,7 +3655,7 @@ bool subselect_hash_sj_engine::setup(List<Item> *tmp_columns)
       DBUG_RETURN(TRUE);
     }
 
-    tmp_tab->ref.key_copy[part_no]= 
+    tab->ref.key_copy[part_no]=
       new store_key_item(thd, key_parts[part_no].field,
                          /* TODO:
                             the NULL byte is taken into account in
@@ -3642,7 +3666,7 @@ bool subselect_hash_sj_engine::setup(List<Item> *tmp_columns)
                          cur_ref_buff + (nullable ? 1 : 0),
                          nullable ? cur_ref_buff : 0,
                          key_parts[part_no].length,
-                         tmp_tab->ref.items[part_no]);
+                         tab->ref.items[part_no]);
     if (nullable &&          // nullable column in tmp table,
         // and UNKNOWN should not be interpreted as FALSE
         !item_in->is_top_level_item())
@@ -3650,26 +3674,23 @@ bool subselect_hash_sj_engine::setup(List<Item> *tmp_columns)
       // It must be the single column, or we wouldn't be here
       DBUG_ASSERT(tmp_key_parts == 1);
       // Be ready to search for NULL into inner column:
-      tmp_tab->ref.null_ref_key= cur_ref_buff;
+      tab->ref.null_ref_key= cur_ref_buff;
       mat_table_has_nulls= NEX_UNKNOWN;
     }
     else
     {
-      tmp_tab->ref.null_ref_key= NULL;
+      tab->ref.null_ref_key= NULL;
       mat_table_has_nulls= NEX_IRRELEVANT_OR_FALSE;
     }
 
     cur_ref_buff+= key_parts[part_no].store_length;
   }
-  tmp_tab->ref.key_err= 1;
-  tmp_tab->ref.key_parts= tmp_key_parts;
+  tab->ref.key_err= 1;
+  tab->ref.key_parts= tmp_key_parts;
 
   if (cond->fix_fields(thd, &cond))
     DBUG_RETURN(TRUE);
 
-  // Set 'tab' only when function cannot fail, because of assert in destructor
-  tab= tmp_tab;
-
   /*
     Create and optimize the JOIN that will be used to materialize
     the subquery if not yet created.
index b2e85cf2566610b66ef4d2ae1c0a631d34778189..58bac62684917de80e291d134ee5288bee1d1628 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    rights reserved.
 
    This program is free software; you can redistribute it and/or modify
@@ -385,10 +385,6 @@ Item_sum::Item_sum(List<Item> &list) :next(NULL), arg_count(list.elements),
       args[i++]= item;
     }
   }
-  if (!(orig_args= (Item **) sql_alloc(sizeof(Item *) * arg_count)))
-  {
-    args= NULL;
-  }
   mark_as_sum_func();
   init_aggregator();
   list.empty();                                        // Fields are used
@@ -405,24 +401,15 @@ Item_sum::Item_sum(THD *thd, Item_sum *item):
   aggr_sel(item->aggr_sel),
   nest_level(item->nest_level), aggr_level(item->aggr_level),
   quick_group(item->quick_group),
-  arg_count(item->arg_count), orig_args(NULL),
+  arg_count(item->arg_count),
   used_tables_cache(item->used_tables_cache),
   forced_const(item->forced_const) 
 {
   if (arg_count <= 2)
-  {
-    args=tmp_args;
-    orig_args=tmp_orig_args;
-  }
-  else
-  {
-    if (!(args= (Item**) thd->alloc(sizeof(Item*)*arg_count)))
-      return;
-    if (!(orig_args= (Item**) thd->alloc(sizeof(Item*)*arg_count)))
-      return;
-  }
+    args= tmp_args;
+  else if (!(args= (Item**) thd->alloc(sizeof(Item*)*arg_count)))
+    return;
   memcpy(args, item->args, sizeof(Item*)*arg_count);
-  memcpy(orig_args, item->orig_args, sizeof(Item*)*arg_count);
   init_aggregator();
   with_distinct= item->with_distinct;
   if (item->aggr)
@@ -441,14 +428,12 @@ void Item_sum::mark_as_sum_func()
 
 void Item_sum::print(String *str, enum_query_type query_type)
 {
-  /* orig_args is not filled with valid values until fix_fields() */
-  Item **pargs= fixed ? orig_args : args;
   str->append(func_name());
   for (uint i=0 ; i < arg_count ; i++)
   {
     if (i)
       str->append(',');
-    pargs[i]->print(str, query_type);
+    args[i]->print(str, query_type);
   }
   str->append(')');
 }
@@ -1215,7 +1200,6 @@ Item_sum_num::fix_fields(THD *thd, Item **ref)
   if (check_sum_func(thd, ref))
     return TRUE;
 
-  memcpy (orig_args, args, sizeof (Item *) * arg_count);
   fixed= 1;
   return FALSE;
 }
@@ -1266,7 +1250,6 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
   if (check_sum_func(thd, ref))
     return TRUE;
 
-  orig_args[0]= args[0];
   fixed= 1;
   return FALSE;
 }
@@ -3212,12 +3195,6 @@ Item_func_group_concat(Name_resolution_context *context_arg,
                                  sizeof(ORDER*)*arg_count_order)))
     return;
 
-  if (!(orig_args= (Item **) sql_alloc(sizeof(Item *) * arg_count)))
-  {
-    args= NULL;
-    return;
-  }
-
   order= (ORDER**)(args + arg_count);
 
   /* fill args items of show and sort */
@@ -3238,7 +3215,6 @@ Item_func_group_concat(Name_resolution_context *context_arg,
       order_item->item= arg_ptr++;
     }
   }
-  memcpy(orig_args, args, sizeof(Item*) * arg_count);
 }
 
 
@@ -3324,6 +3300,21 @@ void Item_func_group_concat::cleanup()
     }
     DBUG_ASSERT(tree == 0);
   }
+  /*
+    As the ORDER structures pointed to by the elements of the
+    'order' array may be modified in find_order_in_list() called
+    from Item_func_group_concat::setup() to point to runtime
+    created objects, we need to reset them back to the original
+    arguments of the function.
+  */
+  ORDER **order_ptr= order;
+  for (uint i= 0; i < arg_count_order; i++)
+  {
+
+    if ((*order_ptr)->counter_used)
+      args[arg_count_field + i]= (*order_ptr)->item_ptr;
+    order_ptr++;
+  }
   DBUG_VOID_RETURN;
 }
 
@@ -3659,7 +3650,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type)
   {
     if (i)
       str->append(',');
-    orig_args[i]->print(str, query_type);
+    args[i]->print(str, query_type);
   }
   if (arg_count_order)
   {
@@ -3668,7 +3659,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type)
     {
       if (i)
         str->append(',');
-      orig_args[i + arg_count_field]->print(str, query_type);
+      args[i + arg_count_field]->print(str, query_type);
       if (order[i]->direction == ORDER::ORDER_ASC)
         str->append(STRING_WITH_LEN(" ASC"));
       else
index f36353a652c9c5e9a603f7a775319f0dfedcdae1..7862fb0d7cf16914f62da17e816b4753be2826a3 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ITEM_SUM_INCLUDED
 #define ITEM_SUM_INCLUDED
 
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. reserved.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. reserved.
    reserved.
 
    This program is free software; you can redistribute it and/or modify
@@ -361,12 +361,6 @@ public:
 protected:  
   uint arg_count;
   Item **args, *tmp_args[2];
-  /* 
-    Copy of the arguments list to hold the original set of arguments.
-    Used in EXPLAIN EXTENDED instead of the current argument list because 
-    the current argument list can be altered by usage of temporary tables.
-  */
-  Item **orig_args, *tmp_orig_args[2];
   table_map used_tables_cache;
   bool forced_const;
   static ulonglong ram_limitation(THD *thd);
@@ -380,14 +374,14 @@ public:
     init_aggregator();
   }
   Item_sum(Item *a) :next(NULL), quick_group(1), arg_count(1), args(tmp_args),
-    orig_args(tmp_orig_args), forced_const(FALSE)
+   forced_const(FALSE)
   {
     args[0]=a;
     mark_as_sum_func();
     init_aggregator();
   }
   Item_sum( Item *a, Item *b ) :next(NULL), quick_group(1), arg_count(2), args(tmp_args),
-    orig_args(tmp_orig_args), forced_const(FALSE)
+    forced_const(FALSE)
   {
     args[0]=a; args[1]=b;
     mark_as_sum_func();
@@ -1196,7 +1190,6 @@ public:
     if (udf.fix_fields(thd, this, this->arg_count, this->args))
       return TRUE;
 
-    memcpy (orig_args, args, sizeof (Item *) * arg_count);
     return check_sum_func(thd, ref);
   }
   enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
index f946335c2692da95d26fbfe0f6a177cf3010e069..7583e87838deeca4d295ad47cc2b3875c26d51a1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2013, 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
@@ -2851,6 +2851,7 @@ String *Item_func_xml_extractvalue::val_str(String *str)
   null_value= 0;
   if (!nodeset_func)
     parse_xpath(args[1]);
+  tmp_value.set("", 0, pxml.charset());
   if (!nodeset_func ||
       !(res= args[0]->val_str(str)) || 
       !parse_xml(res, &pxml) ||
index 43f27733ff3b40d97a88fc0a1bd90393ff13bf98..00ee0effb89b550df1717c795091ac5b1c9cf443 100644 (file)
@@ -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
 #include "sql_acl.h"                       // SUPER_ACL
 #include <hash.h>
 #include <assert.h>
-
+#include "my_atomic.h"
+#ifdef WITH_WSREP
+#include "wsrep_mysqld.h"
+#endif /* WITH_WSREP */
 /**
   @defgroup Locking Locking
   @{
@@ -314,6 +317,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,
@@ -895,6 +902,7 @@ static void print_lock_error(int error, const char *table)
   DBUG_VOID_RETURN;
 }
 
+volatile int32 Global_read_lock::m_active_requests;
 
 /****************************************************************************
   Handling of global read locks
@@ -975,9 +983,15 @@ bool Global_read_lock::lock_global_read_lock(THD *thd)
                                                  MDL_SHARED));
     mdl_request.init(MDL_key::GLOBAL, "", "", MDL_SHARED, MDL_EXPLICIT);
 
+    /* Increment static variable first to signal innodb memcached server
+       to release mdl locks held by it */
+    my_atomic_add32(&Global_read_lock::m_active_requests, 1);
     if (thd->mdl_context.acquire_lock(&mdl_request,
                                       thd->variables.lock_wait_timeout))
+    {
+      my_atomic_add32(&Global_read_lock::m_active_requests, -1);
       DBUG_RETURN(1);
+    }
 
     m_mdl_global_shared_lock= mdl_request.ticket;
     m_state= GRL_ACQUIRED;
@@ -1014,11 +1028,29 @@ 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
+    if (WSREP(thd) || wsrep_node_is_donor())
+    {
+      wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED;
+      wsrep->resume(wsrep);
+      /* resync here only if we did implicit desync earlier */
+      if (!wsrep_desync && wsrep_node_is_synced())
+      {
+        int ret = wsrep->resync(wsrep);
+        if (ret != WSREP_OK)
+        {
+          WSREP_WARN("resync failed %d for FTWRL: db: %s, query: %s", ret,
+                     (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+          DBUG_VOID_RETURN;
+        }
+      }
+    }
+#endif /* WITH_WSREP */
   }
   thd->mdl_context.release_lock(m_mdl_global_shared_lock);
+  my_atomic_add32(&Global_read_lock::m_active_requests, -1);
   m_mdl_global_shared_lock= NULL;
   m_state= GRL_NONE;
-
   DBUG_VOID_RETURN;
 }
 
@@ -1046,6 +1078,16 @@ 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 (WSREP(thd) && m_mdl_blocks_commits_lock)
+  {
+    WSREP_DEBUG("GRL was in block commit mode when entering "
+               "make_global_read_lock_block_commit");
+    DBUG_RETURN(FALSE);
+  }
+#endif /* WITH_WSREP */
+
   if (m_state != GRL_ACQUIRED)
     DBUG_RETURN(0);
 
@@ -1058,6 +1100,53 @@ 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
+  /* Native threads should bail out before wsrep oprations to follow.
+     Donor servicing thread is an exception, it should pause provider but not desync,
+     as it is already desynced in donor state
+  */
+  if (!WSREP(thd) && !wsrep_node_is_donor())
+  {
+    DBUG_RETURN(FALSE);
+  }
+
+  /* if already desynced or donor, avoid double desyncing 
+     if not in PC and synced, desyncing is not possible either
+  */
+  if (wsrep_desync || !wsrep_node_is_synced())
+  {
+    WSREP_DEBUG("desync set upfont, skipping implicit desync for FTWRL: %d",
+                wsrep_desync);
+  }
+  else
+  {
+    int rcode;
+    WSREP_DEBUG("running implicit desync for node");
+    rcode = wsrep->desync(wsrep);
+    if (rcode != WSREP_OK)
+    {
+      WSREP_WARN("FTWRL desync failed %d for schema: %s, query: %s",
+                 rcode, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+      my_message(ER_LOCK_DEADLOCK, "wsrep desync failed for FTWRL", MYF(0));
+      DBUG_RETURN(TRUE);
+    }
+  }
+
+  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);
 }
 
index 808c17639d82a3aa51cdfeb73cd3bb63e8873ba2..d6c8ba96c31e36a643d446136f0b1c3734637bef 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -39,6 +39,9 @@
 #include <my_dir.h>
 #include <stdarg.h>
 #include <m_ctype.h>                           // For test_if_number
+#ifdef WITH_WSREP
+#include "wsrep_mysqld.h"
+#endif /* WITH_WSREP */
 
 #ifdef _WIN32
 #include "message.h"
@@ -47,7 +50,7 @@
 using std::min;
 using std::max;
 
-/* max size of the log message */
+/* max size of log messages (error log, plugins' logging, general log) */
 #define MAX_LOG_BUFFER_SIZE 1024
 #define MAX_TIME_SIZE 32
 
@@ -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)
@@ -1054,7 +1056,7 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length)
 
     /* fill in user_host value: the format is "%s[%s] @ %s [%s]" */
     user_host_len= (strxnmov(user_host_buff, MAX_USER_HOST_SIZE,
-                             sctx->priv_user ? sctx->priv_user : "", "[",
+                             sctx->priv_user, "[",
                              sctx->user ? sctx->user : "", "] @ ",
                              sctx->get_host()->length() ?
                              sctx->get_host()->ptr() : "", " [",
@@ -1114,12 +1116,6 @@ bool LOGGER::general_log_write(THD *thd, enum enum_server_command command,
 
   current_time= my_time(0);
 
-  mysql_audit_general_log(thd, current_time,
-                          user_host_buff, user_host_len,
-                          command_name[(uint) command].str,
-                          command_name[(uint) command].length,
-                          query, query_length);
-                        
   while (*current_handler)
     error|= (*current_handler++)->
       log_general(thd, current_time, user_host_buff,
@@ -1416,7 +1412,7 @@ static int find_uniq_filename(char *name)
   file_info= dir_info->dir_entry;
   for (i= dir_info->number_off_files ; i-- ; file_info++)
   {
-    if (memcmp(file_info->name, start, length) == 0 &&
+    if (strncmp(file_info->name, start, length) == 0 &&
        test_if_number(file_info->name+length, &number,0))
     {
       set_if_bigger(max_found,(ulong) number);
@@ -1613,18 +1609,9 @@ bool MYSQL_LOG::open(
 err:
   if (log_type == LOG_BIN && binlog_error_action == ABORT_SERVER)
   {
-    THD *thd= current_thd;
-    /*
-      On fatal error when code enters here we should forcefully clear the
-      previous errors so that a new critical error message can be pushed
-      to the client side.
-     */
-    thd->clear_error();
-    my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), "Either disk is full or "
-             "file system is read only while opening the binlog. Aborting the "
-             "server");
-    thd->protocol->end_statement();
-    _exit(EXIT_FAILURE);
+    exec_binlog_error_action_abort("Either disk is full or file system is read "
+                                   "only while opening the binlog. Aborting the"
+                                   " server.");
   }
   else
     sql_print_error("Could not open %s for logging (error %d). "
@@ -2089,7 +2076,8 @@ bool slow_log_print(THD *thd, const char *query, uint query_length)
 }
 
 
-bool LOGGER::log_command(THD *thd, enum enum_server_command command)
+bool LOGGER::log_command(THD *thd, enum enum_server_command command,
+                         const char *query_str, size_t query_length)
 {
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
   Security_context *sctx= thd->security_ctx;
@@ -2098,6 +2086,12 @@ bool LOGGER::log_command(THD *thd, enum enum_server_command command)
     Log command if we have at least one log event handler enabled and want
     to log this king of commands
   */
+
+  /* Audit notification when no general log handler present */
+  mysql_audit_general_log(thd, command_name[(uint) command].str,
+                          command_name[(uint) command].length,
+                          query_str, query_length);
+
   if (*general_log_handler_list && (what_to_log & (1L << (uint) command)))
   {
     if ((thd->variables.option_bits & OPTION_LOG_OFF)
@@ -2124,7 +2118,7 @@ bool general_log_print(THD *thd, enum enum_server_command command,
   uint error= 0;
 
   /* Print the message to the buffer if we want to log this king of commands */
-  if (! logger.log_command(thd, command))
+  if (! logger.log_command(thd, command, "", 0))
     return FALSE;
 
   va_start(args, format);
@@ -2138,7 +2132,7 @@ bool general_log_write(THD *thd, enum enum_server_command command,
                        const char *query, uint query_length)
 {
   /* Write the message to the log if we want to log this king of commands */
-  if (logger.log_command(thd, command))
+  if (logger.log_command(thd, command, query, query_length))
     return logger.general_log_write(thd, command, query, query_length);
 
   return FALSE;
@@ -2349,7 +2343,7 @@ static void print_buffer_to_file(enum loglevel level, const char *buffer,
 */
 int vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
 {
-  char   buff[1024];
+  char   buff[MAX_LOG_BUFFER_SIZE];
   size_t length;
   DBUG_ENTER("vprint_msg_to_log");
 
@@ -2408,7 +2402,7 @@ extern "C"
 int my_plugin_log_message(MYSQL_PLUGIN *plugin_ptr, plugin_log_level level,
                           const char *format, ...)
 {
-  char format2[MYSQL_ERRMSG_SIZE];
+  char format2[MAX_LOG_BUFFER_SIZE];
   int ret;
   loglevel lvl;
   struct st_plugin_int *plugin = static_cast<st_plugin_int *> (*plugin_ptr);
@@ -2435,6 +2429,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 +2545,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);
@@ -2955,3 +2956,48 @@ int TC_LOG::using_heuristic_recover()
   sql_print_information("Please restart mysqld without --tc-heuristic-recover");
   return 1;
 }
+
+/**
+  When a fatal error occurs due to which binary logging becomes impossible and
+  the user specified binlog_error_action= ABORT_SERVER the following function is
+  invoked. This function pushes the appropriate error message to client and logs
+  the same to server error log and then aborts the server.
+
+  @param err_string          Error string which specifies the exact error
+                             message from the caller.
+
+  @retval
+    none
+*/
+void exec_binlog_error_action_abort(const char* err_string)
+{
+  THD *thd= current_thd;
+  /*
+    When the code enters here it means that there was an error at higher layer
+    and my_error function could have been invoked to let the client know what
+    went wrong during the execution.
+
+    But these errors will not let the client know that the server is going to
+    abort. Even if we add an additional my_error function call at this point
+    client will be able to see only the first error message that was set
+    during the very first invocation of my_error function call.
+
+    The advantage of having multiple my_error function calls are visible when
+    the server is up and running and user issues SHOW WARNINGS or SHOW ERROR
+    calls. In this special scenario server will be immediately aborted and
+    user will not be able execute the above SHOW commands.
+
+    Hence we clear the previous errors and push one critical error message to
+    clients.
+   */
+  thd->clear_error();
+  /*
+    Adding ME_NOREFRESH flag will ensure that the error is sent to both
+    client and to the server error log as well.
+   */
+  my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(ME_NOREFRESH + ME_FATALERROR),
+           err_string);
+  thd->protocol->end_statement();
+  abort();
+}
+
index 6536c9efeeb1e75f987d605b542f434e309769f1..8c0d91eb344bd4a6af05827937c3ad592fdce44b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+/* 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
@@ -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);
@@ -484,7 +500,8 @@ public:
   void lock_exclusive() { mysql_rwlock_wrlock(&LOCK_logger); }
   void unlock() { mysql_rwlock_unlock(&LOCK_logger); }
   bool is_log_table_enabled(uint log_table_type);
-  bool log_command(THD *thd, enum enum_server_command command);
+  bool log_command(THD *thd, enum enum_server_command command,
+                   const char *query_str, size_t query_length);
 
   /*
     We want to initialize all log mutexes as soon as possible,
@@ -542,12 +559,29 @@ 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 */
+void exec_binlog_error_action_abort(const char* err_string);
 int query_error_code(THD *thd, bool not_killed);
 uint purge_log_get_error_code(int res);
 
index cbca5d7638d75f06256eff10b4e731a04e8a72e9..e7878a35b8775bc31fb0770960aa19a44c554dcb 100644 (file)
@@ -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
@@ -45,6 +45,9 @@
 #include "rpl_rli_pdb.h"
 #include "sql_show.h"    // append_identifier
 #include <mysql/psi/mysql_statement.h>
+#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,
@@ -58,6 +61,8 @@ slave_ignored_err_throttle(window_size,
 #include <my_bitmap.h>
 #include "rpl_utility.h"
 
+#include "sql_digest.h"
+
 using std::min;
 using std::max;
 
@@ -1860,17 +1865,16 @@ void Log_event::print_header(IO_CACHE* file,
   @param[in] file              IO cache
   @param[in] prt               Pointer to string
   @param[in] length            String length
-  @param[in] esc_all        Whether to escape all characters
 */
 
 static void
-my_b_write_quoted(IO_CACHE *file, const uchar *ptr, uint length, bool esc_all)
+my_b_write_quoted(IO_CACHE *file, const uchar *ptr, uint length)
 {
   const uchar *s;
   my_b_printf(file, "'");
   for (s= ptr; length > 0 ; s++, length--)
   {
-    if (*s > 0x1F && !esc_all)
+    if (*s > 0x1F && *s != '\'' && *s != '\\')
       my_b_write(file, s, 1);
     else
     {
@@ -1882,14 +1886,6 @@ my_b_write_quoted(IO_CACHE *file, const uchar *ptr, uint length, bool esc_all)
   my_b_printf(file, "'");
 }
 
-
-static void
-my_b_write_quoted(IO_CACHE *file, const uchar *ptr, uint length)
-{
-  my_b_write_quoted(file, ptr, length, false);
-}
-
-
 /**
   Prints a bit string to io cache in format  b'1010'.
   
@@ -2501,7 +2497,7 @@ void Log_event::print_base64(IO_CACHE* file,
   uint32 size= uint4korr(ptr + EVENT_LEN_OFFSET);
   DBUG_ENTER("Log_event::print_base64");
 
-  size_t const tmp_str_sz= base64_needed_encoded_length((int) size);
+  uint64 const tmp_str_sz= base64_needed_encoded_length((uint64) size);
   char *const tmp_str= (char *) my_malloc(tmp_str_sz, MYF(MY_WME));
   if (!tmp_str) {
     fprintf(stderr, "\nError: Out of memory. "
@@ -2731,7 +2727,7 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli)
   {
     if (!rli->curr_group_seen_gtid && !rli->curr_group_seen_begin)
     {
-      ulong gaq_idx;
+      ulong gaq_idx __attribute__((unused));
       rli->mts_groups_assigned++;
 
       rli->curr_group_isolated= FALSE;
@@ -3409,7 +3405,7 @@ bool Query_log_event::write(IO_CACHE* file)
       user= thd->get_invoker_user();
       host= thd->get_invoker_host();
     }
-    else if (thd->security_ctx->priv_user)
+    else
     {
       Security_context *ctx= thd->security_ctx;
 
@@ -3422,26 +3418,23 @@ bool Query_log_event::write(IO_CACHE* file)
       }
     }
 
-    if (user.length > 0)
-    {
-      *start++= Q_INVOKER;
+    *start++= Q_INVOKER;
 
-      /*
-        Store user length and user. The max length of use is 16, so 1 byte is
-        enough to store the user's length.
-       */
-      *start++= (uchar)user.length;
-      memcpy(start, user.str, user.length);
-      start+= user.length;
+    /*
+      Store user length and user. The max length of use is 16, so 1 byte is
+      enough to store the user's length.
+     */
+    *start++= (uchar)user.length;
+    memcpy(start, user.str, user.length);
+    start+= user.length;
 
-      /*
-        Store host length and host. The max length of host is 60, so 1 byte is
-        enough to store the host's length.
-       */
-      *start++= (uchar)host.length;
-      memcpy(start, host.str, host.length);
-      start+= host.length;
-    }
+    /*
+      Store host length and host. The max length of host is 60, so 1 byte is
+      enough to store the host's length.
+     */
+    *start++= (uchar)host.length;
+    memcpy(start, host.str, host.length);
+    start+= host.length;
   }
 
   if (thd && thd->get_binlog_accessed_db_names() != NULL)
@@ -3583,6 +3576,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));
 
@@ -3762,7 +3763,8 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
         cmd_can_generate_row_events= cmd_must_go_to_trx_cache= TRUE;
         break;
       default:
-        cmd_can_generate_row_events= sqlcom_can_generate_row_events(thd);
+        cmd_can_generate_row_events=
+          sqlcom_can_generate_row_events(thd->lex->sql_command);
         break;
     }
   }
@@ -3943,7 +3945,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
   
   slave_proxy_id= thread_id = uint4korr(buf + Q_THREAD_ID_OFFSET);
   exec_time = uint4korr(buf + Q_EXEC_TIME_OFFSET);
-  db_len = (uint)buf[Q_DB_LEN_OFFSET]; // TODO: add a check of all *_len vars
+  db_len = (uchar)buf[Q_DB_LEN_OFFSET]; // TODO: add a check of all *_len vars
   error_code = uint2korr(buf + Q_ERR_CODE_OFFSET);
 
   /*
@@ -4093,12 +4095,16 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
       user.length= *pos++;
       CHECK_SPACE(pos, end, user.length);
       user.str= (char *)pos;
+      if (user.length == 0)
+        user.str= (char *)"";
       pos+= user.length;
 
       CHECK_SPACE(pos, end, 1);
       host.length= *pos++;
       CHECK_SPACE(pos, end, host.length);
       host.str= (char *)pos;
+      if (host.length == 0)
+        host.str= (char *)"";
       pos+= host.length;
       break;
     }
@@ -4816,12 +4822,17 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
       Parser_state parser_state;
       if (!parser_state.init(thd, thd->query(), thd->query_length()))
       {
+        DBUG_ASSERT(thd->m_digest == NULL);
+        thd->m_digest= & thd->m_digest_state;
+        DBUG_ASSERT(thd->m_statement_psi == NULL);
         thd->m_statement_psi= MYSQL_START_STATEMENT(&thd->m_statement_state,
                                                     stmt_info_rpl.m_key,
                                                     thd->db, thd->db_length,
                                                     thd->charset());
         THD_STAGE_INFO(thd, stage_init);
         MYSQL_SET_STATEMENT_TEXT(thd->m_statement_psi, thd->query(), thd->query_length());
+        if (thd->m_digest != NULL)
+          thd->m_digest->reset(thd->m_token_array, max_digest_length);
 
         mysql_parse(thd, thd->query(), thd->query_length(), &parser_state);
         /* Finalize server status flags after executing a statement. */
@@ -4857,12 +4868,23 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
       else
       {
         rli->report(ERROR_LEVEL, expected_error, 
+#ifdef WITH_WSREP
+                          "\
+Query partially completed on the master (error on master: %d) \
+and was aborted. There is a chance that your master is inconsistent at this \
+point. If you are sure that your master is ok, run this query manually on the \
+slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; \
+START SLAVE; . Query: '%s'", expected_error,
+        (!opt_log_raw) && thd->rewritten_query.length()
+          ? thd->rewritten_query.c_ptr_safe() : thd->query());
+#else
                           "\
 Query partially completed on the master (error on master: %d) \
 and was aborted. There is a chance that your master is inconsistent at this \
 point. If you are sure that your master is ok, run this query manually on the \
 slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; \
 START SLAVE; . Query: '%s'", expected_error, thd->query());
+#endif /* WITH_WSREP */
         thd->is_slave_error= 1;
       }
       goto end;
@@ -4905,7 +4927,13 @@ compare_errors:
     DBUG_PRINT("info",("expected_error: %d  sql_errno: %d",
                        expected_error, actual_error));
 
-    if ((expected_error && expected_error != actual_error &&
+    /*
+      If a statement with expected error is received on slave and if the
+      statement is not filtered on the slave, only then compare the expected
+      error with the actual error that happened on slave.
+    */
+    if ((expected_error && rpl_filter->db_ok(thd->db) &&
+         expected_error != actual_error &&
          !concurrency_error_code(expected_error)) &&
         !ignored_error_code(actual_error) &&
         !ignored_error_code(expected_error))
@@ -4920,7 +4948,13 @@ Default database: '%s'. Query: '%s'",
                       expected_error,
                       actual_error ? thd->get_stmt_da()->message() : "no error",
                       actual_error,
+#ifdef WITH_WSREP
+                      print_slave_db_safe(db),
+                  (!opt_log_raw) && thd->rewritten_query.length()
+                  ? thd->rewritten_query.c_ptr_safe() : query_arg);
+#else
                       print_slave_db_safe(db), query_arg);
+#endif /* WITH_WSREP */
       thd->is_slave_error= 1;
     }
     /*
@@ -4963,7 +4997,13 @@ Default database: '%s'. Query: '%s'",
                     "Error '%s' on query. Default database: '%s'. Query: '%s'",
                     (actual_error ? thd->get_stmt_da()->message() :
                      "unexpected success or fatal error"),
+#ifdef WITH_WSREP
+                      print_slave_db_safe(thd->db),
+                  (!opt_log_raw) && thd->rewritten_query.length()
+                  ? thd->rewritten_query.c_ptr_safe() : query_arg);
+#else
                     print_slave_db_safe(thd->db), query_arg);
+#endif /* WITH_WSREP */
       }
       thd->is_slave_error= 1;
     }
@@ -5033,6 +5073,7 @@ end:
   /* Mark the statement completed. */
   MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
   thd->m_statement_psi= NULL;
+  thd->m_digest= NULL;
 
   /*
     As a disk space optimization, future masters will not log an event for
@@ -10723,7 +10764,7 @@ end:
   {
     /* we need to unpack the AI so that positions get updated */
     m_curr_row= m_curr_row_end;
-    unpack_current_row(rli, &m_cols);
+    unpack_current_row(rli, &m_cols_ai);
   }
   m_table->default_column_bitmaps();
   DBUG_RETURN(error);
@@ -11160,6 +11201,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)
       {
         /*
@@ -11249,7 +11302,18 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
       const_cast<Relay_log_info*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
 
 #ifdef HAVE_QUERY_CACHE
-    query_cache.invalidate_locked_for_write(rli->tables_to_lock);
+#ifdef WITH_WSREP
+    /*
+      Moved invalidation right before the call to rows_event_stmt_cleanup(),
+      to avoid query cache being polluted with stale entries,
+    */
+    if (! (WSREP(thd) && (thd->wsrep_exec_mode == REPL_RECV)))
+    {
+#endif /* WITH_WSREP */
+      query_cache.invalidate_locked_for_write(rli->tables_to_lock);
+#ifdef WITH_WSREP
+    }
+#endif /* WITH_WSREP */
 #endif
   }
 
@@ -11490,6 +11554,14 @@ AFTER_MAIN_EXEC_ROW_LOOP:
 
   if (get_flags(STMT_END_F))
   {
+
+#if defined(WITH_WSREP) && defined(HAVE_QUERY_CACHE)
+    if (WSREP(thd) && thd->wsrep_exec_mode == REPL_RECV)
+    {
+      query_cache.invalidate_locked_for_write(rli->tables_to_lock);
+    }
+#endif /* WITH_WSREP && HAVE_QUERY_CACHE */
+
    if((error= rows_event_stmt_cleanup(rli, thd)))
     slave_rows_error_report(ERROR_LEVEL,
                             thd->is_error() ? 0 : error,
@@ -12132,7 +12204,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 +12942,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);
@@ -13551,8 +13643,28 @@ int Gtid_log_event::do_apply_event(Relay_log_info const *rli)
   DBUG_ENTER("Gtid_log_event::do_apply_event");
   DBUG_ASSERT(rli->info_thd == thd);
 
-  // Gtid_log_events should be filtered out at earlier stages if gtid_mode == 0
-  DBUG_ASSERT(gtid_mode > 0);
+  if (get_type_code() == ANONYMOUS_GTID_LOG_EVENT)
+  {
+    if (gtid_mode == GTID_MODE_ON)
+    {
+      my_error(ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON, MYF(0));
+      DBUG_RETURN(1);
+    }
+    thd->variables.gtid_next.set_anonymous();
+    /*
+      We do not need to write the anonymous gtid log event into binary log,
+      since we should not add new fields to include logical timestamps used
+      for applying transactions in parallel in the GA version.
+    */
+    DBUG_RETURN(0);
+  }
+
+  /* Applying Gtid_log_event should report an error when GTID_MODE is OFF */
+  if (gtid_mode == GTID_MODE_OFF)
+  {
+    my_error(ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF, MYF(0));
+    DBUG_RETURN(1);
+  }
 
   rpl_sidno sidno= get_sidno(true);
   if (sidno < 0)
@@ -13752,7 +13864,7 @@ st_print_event_info::st_print_event_info()
    auto_increment_increment(0),auto_increment_offset(0), charset_inited(0),
    lc_time_names_number(~0),
    charset_database_number(ILLEGAL_CHARSET_INFO_NUMBER),
-   thread_id(0), thread_id_printed(false),
+   thread_id(0), thread_id_printed(false),server_id_from_fd_event(0),
    base64_output_mode(BASE64_OUTPUT_UNSPEC), printed_fd_event(FALSE),
    have_unflushed_events(false), skipped_event_in_transaction(false),
    is_gtid_next_set(false), is_gtid_next_valid(true)
index 1f1b0ba7de79dff88193be8ee902589eab945b0b..86059035a278060e3b1abdb14f327d198f2f6e86 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -788,6 +788,7 @@ typedef struct st_print_event_info
   uint charset_database_number;
   uint thread_id;
   bool thread_id_printed;
+  uint32 server_id_from_fd_event;
 
   st_print_event_info();
 
index 944d286282126e7b881468dd1195d6c899dd4df4..d2be228b2acb4f50d6da0949c11cc198e0eee87a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2013, 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
@@ -1688,7 +1688,7 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
        rli->report(ERROR_LEVEL, thd->net.last_errno,
                     "Error in %s event: row application failed. %s",
                     get_type_str(),
-                    thd->net.last_error ? thd->net.last_error : "");
+                    thd->net.last_error);
        thd->is_slave_error= 1;
        break;
       }
@@ -1728,7 +1728,7 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
                 "on table %s.%s. %s",
                 get_type_str(), table->s->db.str,
                 table->s->table_name.str,
-                thd->net.last_error ? thd->net.last_error : "");
+                thd->net.last_error);
 
     /*
       If one day we honour --skip-slave-errors in row-based replication, and
index 70a33ab06b5e65b0789c833ace02fcefb9fbb757..6f3d730e56eb996f2309b90bd8234419a2677e46 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2013, 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
 #include <mysql/psi/mysql_stage.h>
 #include <my_murmur3.h>
 
+#ifdef WITH_WSREP
+#include "debug_sync.h"
+#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,
+                          const MDL_key *key);
+#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;
@@ -1323,6 +1336,22 @@ MDL_wait::timed_wait(MDL_context_owner *owner, struct timespec *abs_timeout,
   while (!m_wait_status && !owner->is_killed() &&
          wait_result != ETIMEDOUT && wait_result != ETIME)
   {
+#ifdef WITH_WSREP
+    // Allow tests to block the applier thread using the DBUG facilities
+    DBUG_EXECUTE_IF("sync.wsrep_before_mdl_wait",
+                 {
+                   const char act[]=
+                     "now "
+                     "wait_for signal.wsrep_before_mdl_wait";
+                   DBUG_ASSERT(!debug_sync_set_action((owner->get_thd()),
+                                                      STRING_WITH_LEN(act)));
+                 };);
+    if (wsrep_thd_is_BF(owner->get_thd(), false))
+    {
+      wait_result= mysql_cond_wait(&m_COND_wait_status, &m_LOCK_wait_status);
+    }
+    else
+#endif /* WITH_WSREP */
     wait_result= mysql_cond_timedwait(&m_COND_wait_status, &m_LOCK_wait_status,
                                       abs_timeout);
   }
@@ -1389,11 +1418,55 @@ 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,
+                                       &ticket->get_lock()->key))
+        {
+          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 +1782,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 +1806,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 +1831,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, &key))
+          {
+            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;
 }
 
@@ -1930,7 +2052,7 @@ MDL_context::find_ticket(MDL_request *mdl_request,
 bool
 MDL_context::try_acquire_lock(MDL_request *mdl_request)
 {
-  MDL_ticket *ticket;
+  MDL_ticket *ticket= NULL;
 
   if (try_acquire_lock_impl(mdl_request, &ticket))
     return TRUE;
@@ -2184,7 +2306,7 @@ bool
 MDL_context::acquire_lock(MDL_request *mdl_request, ulong lock_wait_timeout)
 {
   MDL_lock *lock;
-  MDL_ticket *ticket;
+  MDL_ticket *ticket= NULL;
   struct timespec abs_timeout;
   MDL_wait::enum_wait_status wait_status;
   /* Do some work outside the critical section. */
@@ -2780,6 +2902,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 +3196,46 @@ 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());
+    }
+}
+bool MDL_context::wsrep_has_explicit_locks()
+{
+  MDL_ticket *ticket = NULL;
+
+  Ticket_iterator it(m_tickets[MDL_EXPLICIT]);
+
+  while ((ticket = it++))
+  {
+    return true;
+  }
+
+  return false;
+}
+
+#endif /* WITH_WSREP */
index ddbd55ac467ee829db50484f6ee7f041747e0e44..254df2f62b4e6fae5df77619cc3e4c85ae0a6304 100644 (file)
@@ -438,6 +438,7 @@ public:
   MDL_key key;
 
 public:
+
   static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
   { return alloc_root(mem_root, size); }
   static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
@@ -577,6 +578,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 +767,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 +786,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 +922,10 @@ private:
                              MDL_ticket **out_ticket);
 
 public:
+#ifdef WITH_WSREP
+  THD *wsrep_get_thd() const { return get_thd(); }
+  bool wsrep_has_explicit_locks();
+#endif /* WITH_WSREP */
   void find_deadlock();
 
   bool visit_subgraph(MDL_wait_for_graph_visitor *dvisitor);
index 6641453a965e38eeab5025efcfe1cf7744a976bf..8ef0032e423322d0dbc29be64d50484c4639ff53 100644 (file)
@@ -1,77 +1,77 @@
-#ifndef MESSAGE_INCLUDED
-#define MESSAGE_INCLUDED
-/* Copyright (c) 2008, 2009 Sun Microsystems, Inc.
-   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 St, Fifth Floor, Boston, MA 02110-1301  USA */
-
-/*
-  To change or add messages mysqld writes to the Windows error log, run
-   mc.exe message.mc
-  and checkin generated messages.h, messages.rc and msg000001.bin under the 
-  source control.
-  mc.exe can be installed with Windows SDK, some Visual Studio distributions 
-  do not include it.
-*/
-
-
-//
-//  Values are 32 bit values layed out as follows:
-//
-//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
-//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
-//  +---+-+-+-----------------------+-------------------------------+
-//  |Sev|C|R|     Facility          |               Code            |
-//  +---+-+-+-----------------------+-------------------------------+
-//
-//  where
-//
-//      Sev - is the severity code
-//
-//          00 - Success
-//          01 - Informational
-//          10 - Warning
-//          11 - Error
-//
-//      C - is the Customer code flag
-//
-//      R - is a reserved bit
-//
-//      Facility - is the facility code
-//
-//      Code - is the facility's status code
-//
-//
-// Define the facility codes
-//
-
-
-//
-// Define the severity codes
-//
-
-
-//
-// MessageId: MSG_DEFAULT
-//
-// MessageText:
-//
-//  %1For more information, see Help and Support Center at http://www.mysql.com.
+#ifndef MESSAGE_INCLUDED\r
+#define MESSAGE_INCLUDED\r
+/* Copyright (c) 2008, 2009 Sun Microsystems, Inc.\r
+   Use is subject to license terms.\r
+\r
+   This program is free software; you can redistribute it and/or modify\r
+   it under the terms of the GNU General Public License as published by\r
+   the Free Software Foundation; version 2 of the License.\r
+\r
+   This program is distributed in the hope that it will be useful,\r
+   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+   GNU General Public License for more details.\r
+\r
+   You should have received a copy of the GNU General Public License\r
+   along with this program; if not, write to the Free Software\r
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */\r
+\r
+/*\r
+  To change or add messages mysqld writes to the Windows error log, run\r
+   mc.exe message.mc\r
+  and checkin generated messages.h, messages.rc and msg000001.bin under the \r
+  source control.\r
+  mc.exe can be installed with Windows SDK, some Visual Studio distributions \r
+  do not include it.\r
+*/\r
+\r
+\r
+//\r
+//  Values are 32 bit values layed out as follows:\r
+//\r
+//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1\r
+//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0\r
+//  +---+-+-+-----------------------+-------------------------------+\r
+//  |Sev|C|R|     Facility          |               Code            |\r
+//  +---+-+-+-----------------------+-------------------------------+\r
+//\r
+//  where\r
+//\r
+//      Sev - is the severity code\r
+//\r
+//          00 - Success\r
+//          01 - Informational\r
+//          10 - Warning\r
+//          11 - Error\r
+//\r
+//      C - is the Customer code flag\r
+//\r
+//      R - is a reserved bit\r
+//\r
+//      Facility - is the facility code\r
+//\r
+//      Code - is the facility's status code\r
+//\r
+//\r
+// Define the facility codes\r
+//\r
+\r
+\r
+//\r
+// Define the severity codes\r
+//\r
+\r
+\r
+//\r
+// MessageId: MSG_DEFAULT\r
+//\r
+// MessageText:\r
+//\r
+//  %1For more information, see Help and Support Center at http://www.mysql.com.\r
 //  
 //  
-//
-#define MSG_DEFAULT                      0xC0000064L
-
-#endif /* MESSAGE_INCLUDED */
-
+//\r
+#define MSG_DEFAULT                      0xC0000064L\r
+\r
+#endif /* MESSAGE_INCLUDED */\r
+\r
index 0885a897e6f8c8941aa9a6ce627e4f9caa1e9196..116522b7d48e2d0ed111d29fa3ef23494ec0de18 100644 (file)
@@ -1,2 +1,2 @@
-LANGUAGE 0x9,0x1
-1 11 MSG00001.bin
+LANGUAGE 0x9,0x1\r
+1 11 MSG00001.bin\r
index fa68613264889c09cffb551c6570f547e515dce2..aaa60ad9249733d15d542510e7ce2e4138dc8acc 100644 (file)
 #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;
@@ -582,6 +592,11 @@ ulong expire_logs_days = 0;
   in the sp_cache for one connection.
 */
 ulong stored_program_cache_size= 0;
+/**
+  Compatibility option to prevent auto upgrade of old temporals
+  during certain ALTER TABLE operations.
+*/
+my_bool avoid_temporal_upgrade;
 
 const double log_10[] = {
   1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009,
@@ -747,6 +762,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 +1241,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;
@@ -1260,6 +1294,7 @@ struct st_VioSSLFd *ssl_acceptor_fd;
   LOCK_connection_count.
 */
 uint connection_count= 0;
+mysql_cond_t COND_connection_count;
 
 /* Function declarations */
 
@@ -1421,6 +1456,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 +1563,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);
@@ -1539,6 +1606,17 @@ static void close_connections(void)
   }
   mysql_mutex_unlock(&LOCK_thread_count);
 
+  /*
+    Connection threads might take a little while to go down after removing from
+    global thread list. Give it some time.
+  */
+  mysql_mutex_lock(&LOCK_connection_count);
+  while (connection_count > 0)
+  {
+    mysql_cond_wait(&COND_connection_count, &LOCK_connection_count);
+  }
+  mysql_mutex_unlock(&LOCK_connection_count);
+
   close_active_mi();
   DBUG_PRINT("quit",("close_connections thread"));
   DBUG_VOID_RETURN;
@@ -1672,8 +1750,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 +1852,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 +2116,21 @@ 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
+  mysql_cond_destroy(&COND_connection_count);
 }
 #endif /*EMBEDDED_LIBRARY*/
 
@@ -2383,7 +2499,7 @@ static void network_init(void)
       returned by getaddrinfo();
     */
 
-    struct addrinfo *a;
+    struct addrinfo *a = NULL;
     ip_sock= create_socket(ai, AF_INET, &a);
 
     if (mysql_socket_getfd(ip_sock) == INVALID_SOCKET)
@@ -2463,6 +2579,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 +2678,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 +2700,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");
 
@@ -2637,6 +2763,8 @@ void dec_connection_count()
 {
   mysql_mutex_lock(&LOCK_connection_count);
   --connection_count;
+  if (connection_count == 0)
+    mysql_cond_signal(&COND_connection_count);
   mysql_mutex_unlock(&LOCK_connection_count);
 }
 
@@ -2744,14 +2872,21 @@ bool one_thread_per_connection_end(THD *thd, bool block_pthread)
   DBUG_PRINT("info", ("thd %p block_pthread %d", thd, (int) block_pthread));
 
   thd->release_resources();
-  dec_connection_count();
   remove_global_thread(thd);
+  dec_connection_count();
   if (kill_blocked_pthreads_flag)
   {
     // Do not block if we are about to shut down
     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 +3927,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,11 +3993,18 @@ 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();
 
+  sql_print_information("%s (mysqld %s) starting as process %lu ...",
+                        my_progname, server_version, (ulong) getpid());
+
 #ifndef EMBEDDED_LIBRARY
   if (opt_help && !opt_verbose)
     unireg_abort(0);
@@ -4082,17 +4231,11 @@ int init_common_variables()
                       "--slow-query-log-file option, log tables are used. "
                       "To enable logging to files use the --log-output=file option.");
 
-#define FIX_LOG_VAR(VAR, ALT)                                   \
-  if (!VAR || !*VAR)                                            \
-  {                                                             \
-    my_free(VAR); /* it could be an allocated empty string "" */ \
-    VAR= ALT;                                                    \
-  }
+  if (!opt_logname || !*opt_logname)
+    opt_logname= make_default_log_name(logname_path, ".log");
 
-  FIX_LOG_VAR(opt_logname,
-              make_default_log_name(logname_path, ".log"));
-  FIX_LOG_VAR(opt_slow_logname,
-              make_default_log_name(slow_logname_path, "-slow.log"));
+  if (!opt_slow_logname || !*opt_slow_logname)
+    opt_slow_logname= make_default_log_name(slow_logname_path, "-slow.log");
 
 #if defined(ENABLED_DEBUG_SYNC)
   /* Initialize the debug sync facility. See debug_sync.cc. */
@@ -4121,13 +4264,14 @@ int init_common_variables()
   {
     if (lower_case_table_names_used)
     {
-      if (log_warnings)
-  sql_print_warning("\
-You have forced lower_case_table_names to 0 through a command-line \
-option, even though your file system '%s' is case insensitive.  This means \
-that you can corrupt a MyISAM table by accessing it with different cases. \
-You should consider changing lower_case_table_names to 1 or 2",
-      mysql_real_data_home);
+      sql_print_error("The server option 'lower_case_table_names' is "
+                      "configured to use case sensitive table names but the "
+                      "data directory is on a case-insensitive file system "
+                      "which is an unsupported combination. Please consider "
+                      "either using a case sensitive file system for your data "
+                      "directory or switching to a case-insensitive table name "
+                      "mode.");
+      return 1;
     }
     else
     {
@@ -4238,6 +4382,7 @@ static int init_thread_environment()
   mysql_rwlock_init(key_rwlock_LOCK_sys_init_slave, &LOCK_sys_init_slave);
   mysql_rwlock_init(key_rwlock_LOCK_grant, &LOCK_grant);
   mysql_cond_init(key_COND_thread_count, &COND_thread_count, NULL);
+  mysql_cond_init(key_COND_connection_count, &COND_connection_count, NULL);
   mysql_cond_init(key_COND_thread_cache, &COND_thread_cache, NULL);
   mysql_cond_init(key_COND_flush_thread_cache, &COND_flush_thread_cache, NULL);
   mysql_cond_init(key_COND_manager, &COND_manager, NULL);
@@ -4260,6 +4405,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 +4768,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 +4865,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 +4952,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 +5070,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 +5079,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 +5174,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 +5292,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 +5313,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 +5862,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 +6198,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 +6284,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
@@ -5662,6 +6356,8 @@ int mysqld_main(int argc, char **argv)
   }
 #endif
 
+  MYSQL_SET_STAGE(0 ,__FILE__, __LINE__);
+
 #if defined(_WIN32) || defined(HAVE_SMEM)
   handle_connections_methods();
 #else
@@ -5675,6 +6371,9 @@ int mysqld_main(int argc, char **argv)
 #ifndef __WIN__
 #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"));
@@ -5941,6 +6640,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;
@@ -6072,6 +6774,8 @@ void create_thread_to_handle_connection(THD *thd)
 
       mysql_mutex_lock(&LOCK_connection_count);
       --connection_count;
+      if (connection_count == 0)
+        mysql_cond_signal(&COND_connection_count);
       mysql_mutex_unlock(&LOCK_connection_count);
 
       statistic_increment(aborted_connects,&LOCK_status);
@@ -6080,7 +6784,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 +6840,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 +7064,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 +7246,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 +7445,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;
     }
@@ -6935,7 +7658,7 @@ void adjust_table_cache_size(ulong requested_open_files)
     char msg[1024];
 
     snprintf(msg, sizeof(msg),
-             "Changed limits: table_cache: %lu (requested %lu)",
+             "Changed limits: table_open_cache: %lu (requested %lu)",
              limit, table_cache_size);
     buffered_logs.buffer(WARNING_LEVEL, msg);
 
@@ -8028,6 +8751,20 @@ SHOW_VAR status_vars[]= {
   {"Uptime",                   (char*) &show_starttime,         SHOW_FUNC},
 #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}
 };
@@ -8355,6 +9092,10 @@ static int mysql_init_variables(void)
   if (!(tmpenv = getenv("MY_BASEDIR_VERSION")))
     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 +9308,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:
     /*
@@ -8754,6 +9503,12 @@ pfs_error:
   case OPT_TABLE_DEFINITION_CACHE:
     table_definition_cache_specified= true;
     break;
+  case OPT_AVOID_TEMPORAL_UPGRADE:
+    WARN_DEPRECATED_NO_REPLACEMENT(NULL, "avoid_temporal_upgrade");
+    break;
+  case OPT_SHOW_OLD_TEMPORALS:
+    WARN_DEPRECATED_NO_REPLACEMENT(NULL, "show_old_temporals");
+    break;
   }
   return 0;
 }
@@ -8926,6 +9681,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-causal-reads is deprecated");
+      if (!(global_system_variables.wsrep_sync_wait &
+            WSREP_SYNC_WAIT_BEFORE_READ)) {
+          WSREP_WARN("--wsrep-causal-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;
@@ -9124,6 +9904,40 @@ bool is_secure_file_path(char *path)
 }
 
 
+/**
+  Test a file path whether it is same as mysql data directory path.
+
+  @param path null terminated character string
+
+  @return
+    @retval TRUE The path is different from mysql data directory.
+    @retval FALSE The path is same as mysql data directory.
+*/
+bool is_mysql_datadir_path(const char *path)
+{
+  if (path == NULL)
+    return false;
+
+  char mysql_data_dir[FN_REFLEN], path_dir[FN_REFLEN];
+  convert_dirname(path_dir, path, NullS);
+  convert_dirname(mysql_data_dir, mysql_unpacked_real_data_home, NullS);
+  size_t mysql_data_home_len= dirname_length(mysql_data_dir);
+  size_t path_len = dirname_length(path_dir);
+
+  if (path_len < mysql_data_home_len)
+    return true;
+
+  if (!lower_case_file_system)
+    return(memcmp(mysql_data_dir, path_dir, mysql_data_home_len));
+
+  return(files_charset_info->coll->strnncoll(files_charset_info,
+                                            (uchar *) path_dir, path_len,
+                                            (uchar *) mysql_data_dir,
+                                            mysql_data_home_len,
+                                            TRUE));
+
+}
+
 static int fix_paths(void)
 {
   char buff[FN_REFLEN],*pos;
@@ -9320,6 +10134,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);
@@ -9379,10 +10196,17 @@ PSI_mutex_key
   key_relay_log_info_sleep_lock,
   key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
   key_mutex_slave_parallel_pend_jobs, key_mutex_mts_temp_tables_lock,
+  key_mutex_slave_parallel_worker_count,
   key_mutex_slave_parallel_worker,
   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;
@@ -9461,6 +10285,7 @@ static PSI_mutex_info all_server_mutexes[]=
   { &key_relay_log_info_log_space_lock, "Relay_log_info::log_space_lock", 0},
   { &key_relay_log_info_run_lock, "Relay_log_info::run_lock", 0},
   { &key_mutex_slave_parallel_pend_jobs, "Relay_log_info::pending_jobs_lock", 0},
+  { &key_mutex_slave_parallel_worker_count, "Relay_log_info::exit_count_lock", 0},
   { &key_mutex_mts_temp_tables_lock, "Relay_log_info::temp_tables_lock", 0},
   { &key_mutex_slave_parallel_worker, "Worker_info::jobs_lock", 0},
   { &key_structure_guard_mutex, "Query_cache::structure_guard_mutex", 0},
@@ -9468,6 +10293,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},
@@ -9522,7 +10359,14 @@ PSI_cond_key key_BINLOG_update_cond,
   key_relay_log_info_sleep_cond, key_cond_slave_parallel_pend_jobs,
   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;
+  key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache,
+  key_COND_connection_count;
+#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,8 +10411,18 @@ 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}
+  { &key_gtid_ensure_index_cond, "Gtid_state", PSI_FLAG_GLOBAL},
+  { &key_COND_connection_count, "COND_connection_count", PSI_FLAG_GLOBAL}
 };
 
 PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert,
index 2844275f951f9f566a47a8fc9f32d585dd53cdea..88daae7d539b7b6a233fa00f233b235f01173577 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 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
@@ -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);
@@ -73,6 +77,7 @@ bool one_thread_per_connection_end(THD *thd, bool block_pthread);
 void kill_blocked_pthreads();
 void refresh_status(THD *thd);
 bool is_secure_file_path(char *path);
+bool is_mysql_datadir_path(const char *path);
 void dec_connection_count();
 
 // These are needed for unit testing.
@@ -191,6 +196,7 @@ extern ulong slow_launch_threads, slow_launch_time;
 extern ulong table_cache_size, table_def_size;
 extern ulong table_cache_size_per_instance, table_cache_instances;
 extern MYSQL_PLUGIN_IMPORT ulong max_connections;
+extern ulong max_digest_length;
 extern ulong max_connect_errors, connect_timeout;
 extern my_bool opt_slave_allow_batching;
 extern my_bool allow_slave_start;
@@ -282,6 +288,7 @@ extern "C" MYSQL_PLUGIN_IMPORT char **orig_argv;
 extern pthread_attr_t connection_attrib;
 extern MYSQL_FILE *bootstrap_file;
 extern my_bool old_mode;
+extern my_bool avoid_temporal_upgrade;
 extern LEX_STRING opt_init_connect, opt_init_slave;
 extern int bootstrap_error;
 extern char err_shared_dir[];
@@ -309,6 +316,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;
@@ -342,6 +353,7 @@ extern PSI_mutex_key
   key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
   key_mutex_slave_parallel_pend_jobs, key_mutex_mts_temp_tables_lock,
   key_mutex_slave_parallel_worker,
+  key_mutex_slave_parallel_worker_count,
   key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
   key_LOCK_error_messages, key_LOCK_thread_count, key_LOCK_thd_remove,
   key_LOCK_log_throttle_qni;
@@ -379,7 +391,8 @@ extern PSI_cond_key key_BINLOG_update_cond,
   key_relay_log_info_sleep_cond, key_cond_slave_parallel_pend_jobs,
   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;
+  key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache,
+  key_COND_connection_count;
 extern PSI_cond_key key_BINLOG_COND_done;
 extern PSI_cond_key key_RELAYLOG_COND_done;
 extern PSI_cond_key key_RELAYLOG_update_cond;
@@ -586,6 +599,7 @@ extern mysql_mutex_t
        LOCK_prepared_stmt_count, LOCK_error_messages, LOCK_connection_count,
        LOCK_sql_slave_skip_counter, LOCK_slave_net_timeout;
 #ifdef HAVE_OPENSSL
+extern char* des_key_file;
 extern mysql_mutex_t LOCK_des_key_file;
 #endif
 extern mysql_mutex_t LOCK_server_started;
@@ -658,6 +672,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,
@@ -668,7 +690,9 @@ enum options_mysqld
   OPT_SECURE_AUTH,
   OPT_THREAD_CACHE_SIZE,
   OPT_HOST_CACHE_SIZE,
-  OPT_TABLE_DEFINITION_CACHE
+  OPT_TABLE_DEFINITION_CACHE,
+  OPT_AVOID_TEMPORAL_UPGRADE,
+  OPT_SHOW_OLD_TEMPORALS
 };
 
 
@@ -688,7 +712,13 @@ enum enum_query_type
   /// Don't print a database if it's equal to the connection's database
   QT_NO_DEFAULT_DB= (1 << 3),
   /// When printing a derived table, don't print its expression, only alias
-  QT_DERIVED_TABLE_ONLY_ALIAS= (1 << 4)
+  QT_DERIVED_TABLE_ONLY_ALIAS= (1 << 4),
+  /**
+    If an expression is constant, print the expression, not the value
+    it evaluates to. Should be used for error messages, so that they
+    don't reveal values.
+  */
+  QT_NO_DATA_EXPANSION= (1 << 9),
 };
 
 /* query_id */
@@ -766,4 +796,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 */
index 9616d7c0bc15f5fbe646a5b7f6303a459d6a5a0f..95dd5370d7a81e55b328f2666bc715fa07ee4add 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
  * reserved.
 
    This program is free software; you can redistribute it and/or modify
@@ -3875,10 +3875,19 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
                                          key_tree->min_flag |
                                            key_tree->max_flag,
                                          &subpart_iter);
-      DBUG_ASSERT(res); /* We can't get "no satisfying subpartitions" */
+      if (res == 0)
+      {
+        /*
+           The only case where we can get "no satisfying subpartitions"
+           returned from the above call is when an error has occurred.
+        */
+        DBUG_ASSERT(range_par->thd->is_error());
+        return 0;
+      }
+
       if (res == -1)
         goto pop_and_go_right; /* all subpartitions satisfy */
-        
+
       uint32 subpart_id;
       bitmap_clear_all(&ppar->subparts_bitmap);
       while ((subpart_id= subpart_iter.get_next(&subpart_iter)) !=
@@ -5225,7 +5234,7 @@ static bool ror_intersect_add(ROR_INTERSECT_INFO *info,
   {
     Cost_estimate sweep_cost;
     JOIN *join= info->param->thd->lex->select_lex.join;
-    const bool is_interrupted= join && join->tables == 1;
+    const bool is_interrupted= join && join->tables != 1;
     get_sweep_read_cost(info->param->table, double2rows(info->out_rows),
                         is_interrupted, &sweep_cost);
     info->total_cost += sweep_cost.total_cost();
@@ -7758,21 +7767,19 @@ get_range(SEL_ARG **e1,SEL_ARG **e2,SEL_ARG *root1)
 static SEL_ARG *
 key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2)
 {
-  if (!key1)
+  if (key1 == NULL || key1->type == SEL_ARG::ALWAYS)
   {
     if (key2)
     {
       key2->use_count--;
       key2->free_tree();
     }
-    return 0;
-  }
-  if (!key2)
-  {
-    key1->use_count--;
-    key1->free_tree();
-    return 0;
+    return key1;
   }
+  if (key2 == NULL || key2->type == SEL_ARG::ALWAYS)
+    // Case is symmetric to the one above, just flip parameters.
+    return key_or(param, key2, key1);
+
   key1->use_count--;
   key2->use_count--;
 
@@ -7804,7 +7811,7 @@ key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2)
     {
       swap_variables(SEL_ARG *,key1,key2);
     }
-    if (key1->use_count > 0 || !(key1=key1->clone_tree(param)))
+    if (key1->use_count > 0 && (key1= key1->clone_tree(param)) == NULL)
       return 0;                                 // OOM
   }
 
@@ -8774,7 +8781,6 @@ int test_rb_tree(SEL_ARG *element,SEL_ARG *parent)
   }
   return -1;                                   // Error, no more warnings
 }
-#endif
 
 
 /**
@@ -8836,7 +8842,6 @@ static ulong count_key_part_usage(SEL_ARG *root, SEL_ARG *key)
 }
 
 
-#ifndef DBUG_OFF
 /*
   Check if SEL_ARG::use_count value is correct
 
@@ -12868,7 +12873,12 @@ bool QUICK_GROUP_MIN_MAX_SELECT::add_range(SEL_ARG *sel_range)
     if (sel_range->maybe_null &&
         sel_range->min_value[0] && sel_range->max_value[0])
       range_flag|= NULL_RANGE; /* IS NULL condition */
-    else if (memcmp(sel_range->min_value, sel_range->max_value,
+    /*
+      Do not perform comparison if one of the argiment is NULL value.
+    */
+    else if (!sel_range->min_value[0] &&
+             !sel_range->max_value[0] &&
+             memcmp(sel_range->min_value, sel_range->max_value,
                     min_max_arg_len) == 0)
       range_flag|= EQ_RANGE;  /* equality condition */
   }
index 5ab2cd75f613c9cd9625dafaf37ab67529ce73a5..c3a970d7242a05b31155a22230acbb7202b6c055 100644 (file)
@@ -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
 #include "ha_partition.h"
 
 
-partition_info *partition_info::get_clone()
+partition_info *partition_info::get_clone(bool reset /* = false */)
 {
   DBUG_ENTER("partition_info::get_clone");
-  if (!this)
-    DBUG_RETURN(NULL);
   List_iterator<partition_element> part_it(partitions);
   partition_element *part;
   partition_info *clone= new partition_info();
@@ -49,6 +47,7 @@ partition_info *partition_info::get_clone()
   memset(&(clone->lock_partitions), 0, sizeof(clone->lock_partitions));
   clone->bitmaps_are_initialized= FALSE;
   clone->partitions.empty();
+  clone->temp_partitions.empty();
 
   while ((part= (part_it++)))
   {
@@ -61,6 +60,26 @@ partition_info *partition_info::get_clone()
       DBUG_RETURN(NULL);
     }
     memcpy(part_clone, part, sizeof(partition_element));
+
+    /*
+      Mark that RANGE and LIST values needs to be fixed so that we don't
+      use old values. fix_column_value_functions would evaluate the values
+      from Item expression.
+    */
+    if (reset)
+    {
+      clone->defined_max_value = false;
+      List_iterator<part_elem_value> list_it(part_clone->list_val_list);
+      while (part_elem_value *list_value= list_it++)
+      {
+        part_column_list_val *col_val= list_value->col_val_array;
+        for (uint i= 0; i < num_columns; col_val++, i++)
+        {
+          col_val->fixed= 0;
+        }
+      }
+    }
+
     part_clone->subpartitions.empty();
     while ((subpart= (subpart_it++)))
     {
@@ -78,6 +97,18 @@ partition_info *partition_info::get_clone()
   DBUG_RETURN(clone);
 }
 
+partition_info *partition_info::get_full_clone()
+{
+  partition_info *clone;
+  DBUG_ENTER("partition_info::get_full_clone");
+  clone= get_clone();
+  if (!clone)
+    DBUG_RETURN(NULL);
+  memcpy(&clone->read_partitions, &read_partitions, sizeof(read_partitions));
+  memcpy(&clone->lock_partitions, &lock_partitions, sizeof(lock_partitions));
+  clone->bitmaps_are_initialized= bitmaps_are_initialized;
+  DBUG_RETURN(clone);
+}
 
 /**
   Mark named [sub]partition to be used/locked.
@@ -1593,15 +1624,22 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
   {
     int err= 0;
 
+    /* Check for partition expression. */
     if (!list_of_part_fields)
     {
       DBUG_ASSERT(part_expr);
       err= part_expr->walk(&Item::check_partition_func_processor, 0,
                            NULL);
-      if (!err && is_sub_partitioned() && !list_of_subpart_fields)
-        err= subpart_expr->walk(&Item::check_partition_func_processor, 0,
-                                NULL);
     }
+
+    /* Check for sub partition expression. */
+    if (!err && is_sub_partitioned() && !list_of_subpart_fields)
+    {
+      DBUG_ASSERT(subpart_expr);
+      err= subpart_expr->walk(&Item::check_partition_func_processor, 0,
+                              NULL);
+    }
+
     if (err)
     {
       my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
index 7a875dcbda26731c7dd5a192c613ce7b930d9844..37f00eaf1cc7d9c5cc8ebe6ad94febeebb791fe9 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PARTITION_INFO_INCLUDED
 #define PARTITION_INFO_INCLUDED
 
-/* 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
@@ -286,7 +286,8 @@ public:
   }
   ~partition_info() {}
 
-  partition_info *get_clone();
+  partition_info *get_clone(bool reset = false);
+  partition_info *get_full_clone();
   bool set_named_partition_bitmap(const char *part_name, uint length);
   bool set_partition_bitmaps(TABLE_LIST *table_list);
   /* Answers the question if subpartitioning is used for a certain table */
index c03d78bde53fe338d13621ade2922e1a40c610cd..346f265d530b724c04cb959e2b7783f17248a7c6 100644 (file)
@@ -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
@@ -42,9 +42,6 @@ static bool write_eof_packet(THD *, NET *, uint, uint);
 
 #ifndef EMBEDDED_LIBRARY
 bool Protocol::net_store_data(const uchar *from, size_t length)
-#else
-bool Protocol_binary::net_store_data(const uchar *from, size_t length)
-#endif
 {
   ulong packet_length=packet->length();
   /* 
@@ -59,7 +56,7 @@ bool Protocol_binary::net_store_data(const uchar *from, size_t length)
   packet->length((uint) (to+length-(uchar*) packet->ptr()));
   return 0;
 }
-
+#endif
 
 
 
@@ -485,6 +482,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;
@@ -1244,12 +1249,14 @@ bool Protocol_binary::prepare_for_send(uint num_columns)
 }
 
 
+#ifndef EMBEDDED_LIBRARY
 void Protocol_binary::prepare_for_resend()
 {
   packet->length(bit_fields+1);
   memset(const_cast<char*>(packet->ptr()), 0, 1+bit_fields);
   field_pos=0;
 }
+#endif
 
 
 bool Protocol_binary::store(const char *from, size_t length,
index 1363c65da3ae940337806f926f2109aaf993e68f..a9504aec9658a4a8e946e2ff0dbbe038dcbc4854 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PROTOCOL_INCLUDED
 #define PROTOCOL_INCLUDED
 
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
@@ -45,8 +45,9 @@ protected:
   MYSQL_FIELD *next_mysql_field;
   MEM_ROOT *alloc;
 #endif
-  bool net_store_data(const uchar *from, size_t length,
-                      const CHARSET_INFO *fromcs, const CHARSET_INFO *tocs);
+  virtual bool net_store_data(const uchar *from, size_t length,
+                              const CHARSET_INFO *fromcs,
+                              const CHARSET_INFO *tocs);
   bool store_string_aux(const char *from, size_t length,
                         const CHARSET_INFO *fromcs, const CHARSET_INFO *tocs);
 
@@ -178,6 +179,9 @@ public:
 #ifdef EMBEDDED_LIBRARY
   virtual bool write();
   bool net_store_data(const uchar *from, size_t length);
+  bool net_store_data(const uchar *from, size_t length,
+                      const CHARSET_INFO *fromcs,
+                      const CHARSET_INFO *tocs);
 #endif
   virtual bool store_null();
   virtual bool store_tiny(longlong from);
index 81322eebd54814fa7496ea00932e931b23aabdbb..78b8378344264c959c891f8bc6104298e7277100 100644 (file)
@@ -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
@@ -259,7 +259,7 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
         info->ref_length <= MAX_REFLENGTH)
     {
       if (init_rr_cache(thd, info))
-        DBUG_RETURN(true);
+        goto skip_caching;
       DBUG_PRINT("info",("using rr_from_cache"));
       info->read_record=rr_from_cache;
     }
@@ -296,6 +296,8 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
       (void) table->file->extra_opt(HA_EXTRA_CACHE,
                                  thd->variables.read_buff_size);
   }
+
+skip_caching:
   /* 
     Do condition pushdown for UPDATE/DELETE.
     TODO: Remove this from here as it causes two condition pushdown calls 
@@ -590,11 +592,20 @@ static int rr_unpack_from_buffer(READ_RECORD *info)
 }
        /* cacheing of records from a database */
 
+/**
+  Initialize caching of records from temporary file.
+  
+  @retval
+    0 OK, use caching.
+    1 Buffer is too small, or cannot be allocated.
+      Skip caching, and read records directly from temporary file.
+ */
 static int init_rr_cache(THD *thd, READ_RECORD *info)
 {
   uint rec_cache_size;
   DBUG_ENTER("init_rr_cache");
 
+  READ_RECORD info_copy= *info;
   info->struct_length= 3+MAX_REFLENGTH;
   info->reclength= ALIGN_SIZE(info->table->s->reclength+1);
   if (info->reclength < info->struct_length)
@@ -611,8 +622,10 @@ static int init_rr_cache(THD *thd, READ_RECORD *info)
       !(info->cache=(uchar*) my_malloc_lock(rec_cache_size+info->cache_records*
                                           info->struct_length+1,
                                           MYF(0))))
+  {
+    *info= info_copy;
     DBUG_RETURN(1);
-
+  }
   DBUG_PRINT("info",("Allocated buffert for %d records",info->cache_records));
   info->read_positions=info->cache+rec_cache_size;
   info->cache_pos=info->cache_end=info->cache;
index caaef3f132ddd32d38ee05e0c765bfb71e85c01b..6f6f08cc66c66816636c21da94fe76d77f9a3612 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2014, 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
@@ -2424,6 +2424,9 @@ struct Gtid_specification
   { type= GTID_GROUP; gtid.sidno= sidno; gtid.gno= gno; }
   /// Set the type to GTID_GROUP and SID, GNO to the given Gtid.
   void set(const Gtid &gtid_param) { set(gtid_param.sidno, gtid_param.gno); }
+  /// Set the type to ANONYMOUS_GROUP and SID, GNO to 0, 0.
+  void set_anonymous()
+  { type= ANONYMOUS_GROUP; gtid.sidno= 0; gtid.gno= 0; }
   /// Set the type to AUTOMATIC_GROUP.
   void set_automatic()
   {
index 271a99dd864347beca4a339c672ca29abfc25c19..7e8a36849634d39a218ed5a5ca078b0a51f500c4 100644 (file)
@@ -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);
index c14cbe88401bf588dffe21eb5f4c7b93544d8cd2..704dd2f5fd47cbe91ee3452d221c4452df9ca500 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2014, 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
@@ -229,6 +229,7 @@ void Gtid_set::put_free_interval(Interval *iv)
 void Gtid_set::clear()
 {
   DBUG_ENTER("Gtid_set::clear");
+  cached_string_length= -1;
   rpl_sidno max_sidno= get_max_sidno();
   if (max_sidno == 0)
     DBUG_VOID_RETURN;
index 1ac3b7f85dbd45e001f0ab8f40c06a563bc73016..7724d69415a41cd56215697e452981e55e46c850 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, 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
@@ -344,6 +344,7 @@ err:
   if (error)
     sql_print_error("Could not delete from Slave Workers info repository.");
   rli->recovery_parallel_workers= 0;
+  rli->clear_mts_recovery_groups();
   if (rli->flush_info(true))
   {
     error= true;
@@ -406,9 +407,20 @@ Slave_worker *Rpl_info_factory::create_worker(uint rli_option, uint worker_id,
 
   if (decide_repository(worker, rli_option, &handler_src, &handler_dest, &msg))
     goto err;
-       
-  if (worker->rli_init_info(is_gaps_collecting_phase))
+
+  if (DBUG_EVALUATE_IF("mts_worker_thread_init_fails", 1, 0) ||
+      worker->rli_init_info(is_gaps_collecting_phase))
   {
+    DBUG_EXECUTE_IF("enable_mts_worker_failure_init",
+                    {
+                      DBUG_SET("-d,mts_worker_thread_init_fails");
+                      DBUG_SET("-d,enable_mts_worker_failure_init");
+                    });
+    DBUG_EXECUTE_IF("enable_mts_wokrer_failure_in_recovery_finalize",
+                    {
+                      DBUG_SET("-d,mts_worker_thread_init_fails");
+                      DBUG_SET("-d,enable_mts_wokrer_failure_in_recovery_finalize");
+                    });
     msg= "Failed to initialize the worker info structure";
     goto err;
   }
index 349793cdbfd580fb8d89f5bbd287aac328cdc29c..fa5abbf08a0043eb17a44fdeafe7e7661e81bf21 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2014, 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
@@ -860,7 +860,9 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
   IO_CACHE log;
   File file = -1;
   String* packet = &thd->packet;
-  int error;
+  time_t last_event_sent_ts= time(0);
+  bool time_for_hb_event= false;
+  int error= 0;
   const char *errmsg = "Unknown error";
   char error_text[MAX_SLAVE_ERRMSG]; // to be send to slave via my_message()
   NET* net = &thd->net;
@@ -886,6 +888,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
   Diagnostics_area temp_da;
   Diagnostics_area *saved_da= thd->get_stmt_da();
   thd->set_stmt_da(&temp_da);
+  bool was_killed_by_duplicate_slave_uuid= false;
 
   DBUG_ENTER("mysql_binlog_send");
   DBUG_PRINT("enter",("log_ident: '%s'  pos: %ld", log_ident, (long) pos));
@@ -1240,11 +1243,25 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
                                                          STRING_WITH_LEN(act)));
                     };);
     bool is_active_binlog= false;
-    while (!(error= Log_event::read_log_event(&log, packet, log_lock,
+    while (!thd->killed &&
+           !(error= Log_event::read_log_event(&log, packet, log_lock,
                                               current_checksum_alg,
                                               log_file_name,
                                               &is_active_binlog)))
     {
+      DBUG_EXECUTE_IF("simulate_dump_thread_kill",
+                      {
+                        thd->killed= THD::KILL_CONNECTION;
+                      });
+      DBUG_EXECUTE_IF("hold_dump_thread_inside_inner_loop",
+                    {
+                      const char act[]= "now "
+                                        "signal signal_inside_inner_loop "
+                                        "wait_for signal_continue";
+                      DBUG_ASSERT(!debug_sync_set_action(current_thd,
+                                                         STRING_WITH_LEN(act)));
+                      DBUG_ASSERT(thd->killed);
+                    };);
       time_t created;
       DBUG_PRINT("info", ("read_log_event returned 0 on line %d", __LINE__));
 #ifndef DBUG_OFF
@@ -1430,14 +1447,28 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
       {
         p_last_skip_coord->pos= p_coord->pos;
         strcpy(p_last_skip_coord->file_name, p_coord->file_name);
+        /*
+          If we have not send any event from past 'heartbeat_period' time
+          period, then it is time to send a packet before skipping this group.
+         */
+        DBUG_EXECUTE_IF("inject_2sec_sleep_when_skipping_an_event",
+                        {
+                          my_sleep(2000000);
+                        });
+        time_t now= time(0);
+        DBUG_ASSERT(now >= last_event_sent_ts);
+        time_for_hb_event= ((ulonglong)(now - last_event_sent_ts) >=
+                            (ulonglong)(heartbeat_period/1000000000UL));
       }
 
-      if (!skip_group && last_skip_group
-          && event_type != FORMAT_DESCRIPTION_EVENT)
+      if ((!skip_group && last_skip_group
+           && event_type != FORMAT_DESCRIPTION_EVENT) || time_for_hb_event)
       {
         /*
           Dump thread is ready to send it's first transaction after
-          one or more skipped transactions. Send a heart beat event
+          one or more skipped transactions or dump thread did not
+          send any event from past 'heartbeat_period' time frame
+          (busy skipping gtid groups). Send a heart beat event
           to update slave IO thread coordinates before that happens.
 
           Notice that for a new binary log file, FORMAT_DESCRIPTION_EVENT
@@ -1452,18 +1483,24 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
         {
           GOTO_ERR;
         }
+        last_event_sent_ts= time(0);
+        last_skip_group= time_for_hb_event= false;
       }
-
-      /* save this flag for next iteration */
-      last_skip_group= skip_group;
-
-      if (skip_group == false && my_net_write(net, (uchar*) packet->ptr(), packet->length()))
+      else
       {
-        errmsg = "Failed on my_net_write()";
-        my_errno= ER_UNKNOWN_ERROR;
-        GOTO_ERR;
+        last_skip_group= skip_group;
       }
 
+      if (skip_group == false)
+      {
+        if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
+        {
+          errmsg = "Failed on my_net_write()";
+          my_errno= ER_UNKNOWN_ERROR;
+          GOTO_ERR;
+        }
+        last_event_sent_ts= time(0);
+      }
 
       DBUG_EXECUTE_IF("dump_thread_wait_before_send_xid",
                       {
@@ -1499,6 +1536,10 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
         GOTO_ERR;
     }
 
+    /* If the above while is killed due to thd->killed flag and not
+      due to read_log_event error, then do nothing.*/
+    if (thd->killed)
+      goto end;
     DBUG_EXECUTE_IF("wait_after_binlog_EOF",
                     {
                       const char act[]= "now wait_for signal.rotate_finished no_clear_event";
@@ -1665,6 +1706,11 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
             */
             if (skip_group)
             {
+              /*
+                TODO: Number of HB events sent from here can be reduced
+               by checking whehter it is time to send a HB event or not.
+               (i.e., using the flag time_for_hb_event)
+              */
               if (send_last_skip_group_heartbeat(thd, net, packet,
                                                  p_coord, &ev_offset,
                                                  current_checksum_alg, &errmsg,
@@ -1821,6 +1867,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
              my_errno= ER_UNKNOWN_ERROR;
              GOTO_ERR;
             }
+            last_event_sent_ts= time(0);
 
             if (event_type == LOAD_EVENT)
             {
@@ -1907,6 +1954,21 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
   }
 
 end:
+  /*
+    If the dump thread was killed because of a duplicate slave UUID we
+    will fail throwing an error to the slave so it will not try to
+    reconnect anymore.
+  */
+  mysql_mutex_lock(&thd->LOCK_thd_data);
+  was_killed_by_duplicate_slave_uuid= thd->duplicate_slave_uuid;
+  mysql_mutex_unlock(&thd->LOCK_thd_data);
+  if (was_killed_by_duplicate_slave_uuid)
+  {
+    errmsg= "A slave with the same server_uuid as this slave "
+            "has connected to the master";
+    my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
+    goto err;
+  }
   thd->set_stmt_da(saved_da);
   end_io_cache(&log);
   mysql_file_close(file, MYF(MY_WME));
@@ -2048,7 +2110,8 @@ void kill_zombie_dump_threads(String *slave_uuid)
       sql_print_information("While initializing dump thread for slave with "
                             "UUID <%s>, found a zombie dump thread with "
                             "the same UUID. Master is killing the zombie dump "
-                            "thread.", slave_uuid->c_ptr());
+                            "thread(%lu).", slave_uuid->c_ptr(), tmp->thread_id);
+    tmp->duplicate_slave_uuid= true;
     tmp->awake(THD::KILL_QUERY);
     mysql_mutex_unlock(&tmp->LOCK_thd_data);
   }
index dc058f36ee095bb7a4fe7902739c5455b03baa0e..bf31ae45ff3431b08ac4a6c428d6870dab318939 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2014, 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
@@ -91,8 +91,10 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery
    tables_to_lock(0), tables_to_lock_count(0),
    rows_query_ev(NULL), last_event_start_time(0), deferred_events(NULL),
    slave_parallel_workers(0),
+   exit_counter(0),
+   max_updated_index(0),
    recovery_parallel_workers(0), checkpoint_seqno(0),
-   checkpoint_group(opt_mts_checkpoint_group), 
+   checkpoint_group(opt_mts_checkpoint_group),
    recovery_groups_inited(false), mts_recovery_group_cnt(0),
    mts_recovery_index(0), mts_recovery_group_seen_begin(0),
    mts_group_status(MTS_NOT_IN_GROUP), reported_unsafe_warning(false),
@@ -132,11 +134,14 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery
   mysql_mutex_init(key_mutex_slave_parallel_pend_jobs, &pending_jobs_lock,
                    MY_MUTEX_INIT_FAST);
   mysql_cond_init(key_cond_slave_parallel_pend_jobs, &pending_jobs_cond, NULL);
+  mysql_mutex_init(key_mutex_slave_parallel_worker_count, &exit_count_lock,
+                   MY_MUTEX_INIT_FAST);
   my_atomic_rwlock_init(&slave_open_temp_tables_lock);
 
   relay_log.init_pthread_objects();
   do_server_version_split(::server_version, slave_version_split);
   last_retrieved_gtid.clear();
+  force_flush_postponed_due_to_split_trans= false;
   DBUG_VOID_RETURN;
 }
 
@@ -173,6 +178,7 @@ Relay_log_info::~Relay_log_info()
   mysql_cond_destroy(&log_space_cond);
   mysql_mutex_destroy(&pending_jobs_lock);
   mysql_cond_destroy(&pending_jobs_cond);
+  mysql_mutex_destroy(&exit_count_lock);
   my_atomic_rwlock_destroy(&slave_open_temp_tables_lock);
   relay_log.cleanup();
   set_rli_description_event(NULL);
@@ -302,15 +308,33 @@ bool Relay_log_info::mts_finalize_recovery()
     even temporary holes. Therefore stale records are deleted
     from the tail.
   */
+  DBUG_EXECUTE_IF("enable_mts_wokrer_failure_in_recovery_finalize",
+                  {DBUG_SET("+d,mts_worker_thread_init_fails");});
+
   for (i= recovery_parallel_workers; i > workers.elements && !ret; i--)
   {
     Slave_worker *w=
       Rpl_info_factory::create_worker(repo_type, i - 1, this, true);
-    ret= w->remove_info();
-    delete w;
+    /*
+      If an error occurs during the above create_worker call, the newly created
+      worker object gets deleted within the above function call itself and only
+      NULL is returned. Hence the following check has been added to verify
+      that a valid worker object exists.
+    */
+    if (w)
+    {
+      ret= w->remove_info();
+      delete w;
+    }
+    else
+    {
+      ret= true;
+      goto err;
+    }
   }
   recovery_parallel_workers= slave_parallel_workers;
 
+err:
   DBUG_RETURN(ret);
 }
 
@@ -392,7 +416,7 @@ void Relay_log_info::clear_until_condition()
   acquired it.
   @param errmsg[out] On error, this function will store a pointer to
   an error message here
-  @param look_for_description_event[in] If true, this function will
+  @param keep_looking_for_fd[in] If true, this function will
   look for a Format_description_log_event.  We only need this when the
   SQL thread starts and opens an existing relay log and has to execute
   it (possibly from an offset >4); then we need to read the first
@@ -407,7 +431,7 @@ void Relay_log_info::clear_until_condition()
 int Relay_log_info::init_relay_log_pos(const char* log,
                                        ulonglong pos, bool need_data_lock,
                                        const char** errmsg,
-                                       bool look_for_description_event)
+                                       bool keep_looking_for_fd)
 {
   DBUG_ENTER("Relay_log_info::init_relay_log_pos");
   DBUG_PRINT("info", ("pos: %lu", (ulong) pos));
@@ -496,7 +520,7 @@ int Relay_log_info::init_relay_log_pos(const char* log,
   if (pos > BIN_LOG_HEADER_SIZE) /* If pos<=4, we stay at 4 */
   {
     Log_event* ev;
-    while (look_for_description_event)
+    while (keep_looking_for_fd)
     {
       /*
         Read the possible Format_description_log_event; if position
@@ -537,23 +561,27 @@ int Relay_log_info::init_relay_log_pos(const char* log,
           describes the whole relay log; indeed, one can have this sequence
           (starting from position 4):
           Format_desc (of slave)
+          Previous-GTIDs (of slave IO thread, if GTIDs are enabled)
           Rotate (of master)
           Format_desc (of master)
           So the Format_desc which really describes the rest of the relay log
-          is the 3rd event (it can't be further than that, because we rotate
+          can be the 3rd or the 4th event (depending on GTIDs being enabled or
+          not, it can't be further than that, because we rotate
           the relay log when we queue a Rotate event from the master).
           But what describes the Rotate is the first Format_desc.
           So what we do is:
           go on searching for Format_description events, until you exceed the
-          position (argument 'pos') or until you find another event than Rotate
-          or Format_desc.
+          position (argument 'pos') or until you find an event other than
+          Previous-GTIDs, Rotate or Format_desc.
         */
       }
       else
       {
         DBUG_PRINT("info",("found event of another type=%d",
                            ev->get_type_code()));
-        look_for_description_event= (ev->get_type_code() == ROTATE_EVENT);
+        keep_looking_for_fd=
+          (ev->get_type_code() == ROTATE_EVENT ||
+           ev->get_type_code() == PREVIOUS_GTIDS_LOG_EVENT);
         delete ev;
       }
     }
@@ -2024,9 +2052,10 @@ int Relay_log_info::flush_info(const bool force)
   if (write_info(handler))
     goto err;
 
-  if (handler->flush_info(force))
+  if (handler->flush_info(force || force_flush_postponed_due_to_split_trans))
     goto err;
 
+  force_flush_postponed_due_to_split_trans= false;
   DBUG_RETURN(0);
 
 err:
index cfaa69936c8d1a2b512143ee4cb8688fa9f18d05..f6fdcac77f575ef8a9514f2d3fcdbe7af26e5292 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -261,7 +261,7 @@ public:
   int init_relay_log_pos(const char* log,
                          ulonglong pos, bool need_data_lock,
                          const char** errmsg,
-                         bool look_for_description_event);
+                         bool keep_looking_for_fd);
 
   /*
     Handling of the relay_log_space_limit optional constraint.
@@ -490,6 +490,7 @@ public:
   volatile ulong pending_jobs;
   mysql_mutex_t pending_jobs_lock;
   mysql_cond_t pending_jobs_cond;
+  mysql_mutex_t exit_count_lock; // mutex of worker exit count
   ulong       mts_slave_worker_queue_len_max;
   ulonglong   mts_pending_jobs_size;      // actual mem usage by WQ:s
   ulonglong   mts_pending_jobs_size_max;  // max of WQ:s size forcing C to wait
@@ -525,9 +526,11 @@ public:
   ulong mts_coordinator_basic_nap; // C sleeps to avoid WQs overrun
   ulong opt_slave_parallel_workers; // cache for ::opt_slave_parallel_workers
   ulong slave_parallel_workers; // the one slave session time number of workers
+  ulong exit_counter; // Number of workers contributed to max updated group index
+  ulonglong max_updated_index;
   ulong recovery_parallel_workers; // number of workers while recovering
   uint checkpoint_seqno;  // counter of groups executed after the most recent CP
-  uint checkpoint_group;  // cache for ::opt_mts_checkpoint_group 
+  uint checkpoint_group;  // cache for ::opt_mts_checkpoint_group
   MY_BITMAP recovery_groups;  // bitmap used during recovery
   bool recovery_groups_inited;
   ulong mts_recovery_group_cnt; // number of groups to execute at recovery
@@ -562,10 +565,10 @@ public:
   } mts_group_status;
 
   /*
-    MTS statistics: 
+    MTS statistics:
   */
   ulonglong mts_events_assigned; // number of events (statements) scheduled
-  ulong mts_groups_assigned; // number of groups (transactions) scheduled
+  ulonglong mts_groups_assigned; // number of groups (transactions) scheduled
   volatile ulong mts_wq_overrun_cnt; // counter of all mts_wq_excess_cnt increments
   ulong wq_size_waits_cnt;    // number of times C slept due to WQ:s oversize
   /*
@@ -599,6 +602,16 @@ public:
     return mts_recovery_group_cnt != 0;
   }
 
+  inline void clear_mts_recovery_groups()
+  {
+    if (recovery_groups_inited)
+    {
+      bitmap_free(&recovery_groups);
+      mts_recovery_group_cnt= 0;
+      recovery_groups_inited= false;
+    }
+  }
+
   /**
      returns true if events are to be executed in parallel
   */
@@ -836,6 +849,11 @@ public:
   */
   bool reported_unsafe_warning;
 
+  /*
+    'sql_thread_kill_accepted is set to TRUE when killed status is recognized.
+  */
+  bool sql_thread_kill_accepted;
+
   time_t get_row_stmt_start_timestamp()
   {
     return row_stmt_start_timestamp;
@@ -889,6 +907,17 @@ public:
   */
   void adapt_to_master_version(Format_description_log_event *fdle);
   uchar slave_version_split[3]; // bytes of the slave server version
+  /*
+    relay log info repository should be updated on relay log
+    rotate. But when the transaction is split across two relay logs,
+    update the repository will cause unexpected results and should
+    be postponed till the 'commit' of the transaction is executed.
+
+    A flag that set to 'true' when this type of 'forced flush'(at the
+    time of rotate relay log) is postponed due to transaction split
+    across the relay logs.
+  */
+  bool force_flush_postponed_due_to_split_trans;
 
 protected:
   Format_description_log_event *rli_description_event;
index 6f5cab1685711c90e27d62db293a96624e0f893f..7b03f1baf6e1df0e015ee26461af7ed5edbfe578 100644 (file)
@@ -1,3 +1,18 @@
+/* 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
+   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 "my_global.h"                          /* NO_EMBEDDED_ACCESS_CHECKS */
 #include "sql_priv.h"
 #include "unireg.h"
 #define HASH_DYNAMIC_INCR 1
 
 using std::min;
+using std::max;
+
+/**
+   This function is called by both coordinator and workers.
+
+   Upon receiving the STOP command, the workers will identify a
+   maximum group index already executed (or under execution).
+
+   All groups whose index are below or equal to the maximum
+   group index will be applied by the workers before stopping.
+
+   The workers with groups above the maximum group index will
+   exit without applying these groups by setting their running
+   status to "STOP_ACCEPTED".
+
+   @param worker    a pointer to the waiting Worker struct
+   @param job_item  a pointer to struct carrying a reference to an event
+
+   @return true if STOP command gets accepted otherwise false is returned.
+*/
+bool handle_slave_worker_stop(Slave_worker *worker,
+                              Slave_job_item *job_item)
+{
+  ulonglong group_index= 0;
+  Relay_log_info *rli= worker->c_rli;
+  mysql_mutex_lock(&rli->exit_count_lock);
+  /*
+    First, W calculates a group-"at-hands" index which is
+    either the currently read ev group index, or the last executed
+    group's one when the  queue is empty.
+  */
+  group_index= (job_item->data)?
+    rli->gaq->get_job_group(((Log_event*)
+                             (job_item->data))->mts_group_idx)->total_seqno:
+    worker->last_groups_assigned_index;
+
+  /*
+    The max updated index is being updated as long as
+    exit_counter permits. That's stopped with the final W's
+    increment of it.
+  */
+  if (!worker->exit_incremented)
+  {
+    if (rli->exit_counter < rli->slave_parallel_workers)
+      rli->max_updated_index = max(rli->max_updated_index, group_index);
+
+    ++rli->exit_counter;
+    worker->exit_incremented= true;
+    DBUG_ASSERT(!is_mts_worker(current_thd));
+  }
+#ifndef DBUG_OFF
+  else
+    DBUG_ASSERT(is_mts_worker(current_thd));
+#endif
+
+  /*
+    Now let's decide about the deferred exit to consider
+    the empty queue and the counter value reached
+    slave_parallel_workers.
+  */
+  if (!job_item->data)
+  {
+    worker->running_status= Slave_worker::STOP_ACCEPTED;
+    mysql_cond_signal(&worker->jobs_cond);
+    mysql_mutex_unlock(&rli->exit_count_lock);
+    return(true);
+  }
+  else if (rli->exit_counter == rli->slave_parallel_workers)
+  {
+    //over steppers should exit with accepting STOP
+    if (group_index > rli->max_updated_index)
+    {
+      worker->running_status= Slave_worker::STOP_ACCEPTED;
+      mysql_cond_signal(&worker->jobs_cond);
+      mysql_mutex_unlock(&rli->exit_count_lock);
+      return(true);
+    }
+  }
+  mysql_mutex_unlock(&rli->exit_count_lock);
+  return(false);
+}
+
+/**
+   This function is called by both coordinator and workers.
+   Both coordinator and workers contribute to max_updated_index.
+
+   @param worker    a pointer to the waiting Worker struct
+   @param job_item  a pointer to struct carrying a reference to an event
+
+   @return true if STOP command gets accepted otherwise false is returned.
+*/
+bool set_max_updated_index_on_stop(Slave_worker *worker,
+                                   Slave_job_item *job_item)
+{
+  head_queue(&worker->jobs, job_item);
+  if (worker->running_status == Slave_worker::STOP)
+  {
+    if (handle_slave_worker_stop(worker, job_item))
+      return true;
+  }
+  return false;
+}
 
 /*
   Please every time you add a new field to the worker slave info, update
@@ -88,7 +205,7 @@ Slave_worker::Slave_worker(Relay_log_info *rli
                    , param_id + 1
                   ), c_rli(rli), id(param_id),
     checkpoint_relay_log_pos(0), checkpoint_master_log_pos(0),
-    checkpoint_seqno(0), running_status(NOT_RUNNING)
+    checkpoint_seqno(0), running_status(NOT_RUNNING), exit_incremented(false)
 {
   /*
     In the future, it would be great if we use only one identifier.
@@ -152,7 +269,7 @@ int Slave_worker::init_worker(Relay_log_info * rli, ulong i)
   usage_partition= 0;
   end_group_sets_max_dbs= false;
   gaq_index= last_group_done_index= c_rli->gaq->size; // out of range
-
+  last_groups_assigned_index=0;
   DBUG_ASSERT(!jobs.inited_queue);
   jobs.avail= 0;
   jobs.len= 0;
@@ -1075,20 +1192,24 @@ void Slave_worker::slave_worker_ends_group(Log_event* ev, int error)
     ptr_g->done= 1;    // GAQ index is available to C now
 
     last_group_done_index= gaq_index;
+    last_groups_assigned_index= ptr_g->total_seqno;
     reset_gaq_index();
     groups_done++;
   }
   else
   {
-    // tagging as exiting so Coordinator won't be able synchronize with it
-    mysql_mutex_lock(&jobs_lock);
-    running_status= ERROR_LEAVING;
-    mysql_mutex_unlock(&jobs_lock);
-
-    // Killing Coordinator to indicate eventual consistency error
-    mysql_mutex_lock(&c_rli->info_thd->LOCK_thd_data);
-    c_rli->info_thd->awake(THD::KILL_QUERY);
-    mysql_mutex_unlock(&c_rli->info_thd->LOCK_thd_data);
+    if (running_status != STOP_ACCEPTED)
+    {
+      // tagging as exiting so Coordinator won't be able synchronize with it
+      mysql_mutex_lock(&jobs_lock);
+      running_status= ERROR_LEAVING;
+      mysql_mutex_unlock(&jobs_lock);
+
+      // Killing Coordinator to indicate eventual consistency error
+      mysql_mutex_lock(&c_rli->info_thd->LOCK_thd_data);
+      c_rli->info_thd->awake(THD::KILL_QUERY);
+      mysql_mutex_unlock(&c_rli->info_thd->LOCK_thd_data);
+    }
   }
 
   /*
@@ -1369,7 +1490,7 @@ ulong Slave_committed_queue::move_queue_head(DYNAMIC_ARRAY *ws)
     Slave_worker *w_i;
     Slave_job_group *ptr_g, g;
     char grl_name[FN_REFLEN];
-    ulong ind;
+    ulong ind __attribute__((unused));
 
 #ifndef DBUG_OFF
     if (DBUG_EVALUATE_IF("check_slave_debug_group", 1, 0) &&
@@ -1646,7 +1767,7 @@ static int en_queue(Slave_jobs_queue *jobs, Slave_job_item *item)
 /**
    return the value of @c data member of the head of the queue.
 */
-static void * head_queue(Slave_jobs_queue *jobs, Slave_job_item *ret)
+void * head_queue(Slave_jobs_queue *jobs, Slave_job_item *ret)
 {
   if (jobs->entry == jobs->size)
   {
@@ -1834,18 +1955,19 @@ bool append_item_to_jobs(slave_job_item *job_item,
    @return NULL failure or
            a-pointer to an item.
 */
-struct slave_job_item* pop_jobs_item(Slave_worker *worker, Slave_job_item *job_item)
+struct slave_job_item* pop_jobs_item(Slave_worker *worker,
+                                     Slave_job_item *job_item)
 {
   THD *thd= worker->info_thd;
 
   mysql_mutex_lock(&worker->jobs_lock);
-
   while (!job_item->data && !thd->killed &&
-         worker->running_status == Slave_worker::RUNNING)
+         (worker->running_status == Slave_worker::RUNNING ||
+          worker->running_status == Slave_worker::STOP))
   {
     PSI_stage_info old_stage;
-
-    head_queue(&worker->jobs, job_item);
+    if (set_max_updated_index_on_stop(worker, job_item))
+      break;
     if (job_item->data == NULL)
     {
       worker->wq_empty_waits++;
@@ -1893,8 +2015,9 @@ int slave_worker_exec_job(Slave_worker *worker, Relay_log_info *rli)
   DBUG_ENTER("slave_worker_exec_job");
 
   job_item= pop_jobs_item(worker, job_item);
-  if (thd->killed || worker->running_status != Slave_worker::RUNNING)
+  if (thd->killed || worker->running_status == Slave_worker::STOP_ACCEPTED)
   {
+    DBUG_ASSERT(worker->running_status != Slave_worker::ERROR_LEAVING);
     // de-queueing and decrement counters is in the caller's exit branch
     error= -1;
     goto err;
index ef98c7d65d3e67b862b2f97aab3f0c4e8d46e36b..c85865a1f38ce91e75d3e9c664a6d07bba3bbc4b 100644 (file)
@@ -1,3 +1,18 @@
+/* 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
+   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 */
+
 #ifndef RPL_RLI_PDB_H
 
 #define RPL_RLI_PDB_H
@@ -314,6 +329,7 @@ public:
   */
   // the index in GAQ of the last processed group by this Worker
   volatile ulong last_group_done_index;
+  ulonglong last_groups_assigned_index; // index of previous group assigned to worker
   ulong wq_empty_waits;  // how many times got idle
   ulong events_done;     // how many events (statements) processed
   ulong groups_done;     // how many groups (transactions) processed
@@ -360,14 +376,21 @@ public:
   {
     NOT_RUNNING= 0,
     RUNNING= 1,
-    ERROR_LEAVING,         // is set by Worker
-    KILLED                 // is set by Coordinator
+    ERROR_LEAVING= 2,         // is set by Worker
+    STOP= 3,                  // is set by Coordinator upon receiving STOP
+    STOP_ACCEPTED= 4          // is set by worker upon completing job when STOP SLAVE is issued
   };
   /*
     The running status is guarded by jobs_lock mutex that a writer
     Coordinator or Worker itself needs to hold when write a new value.
   */
   en_running_state volatile running_status;
+  /*
+    exit_incremented indicates whether worker has contributed to max updated index.
+    By default it is set to false. When the worker contibutes for the first time this
+    variable is set to true.
+  */
+  bool exit_incremented;
 
   int init_worker(Relay_log_info*, ulong);
   int rli_init_info(bool);
@@ -428,6 +451,11 @@ private:
   Slave_worker(const Slave_worker& info);
 };
 
+void * head_queue(Slave_jobs_queue *jobs, Slave_job_item *ret);
+bool handle_slave_worker_stop(Slave_worker *worker, Slave_job_item *job_item);
+bool set_max_updated_index_on_stop(Slave_worker *worker,
+                                   Slave_job_item *job_item);
+
 TABLE* mts_move_temp_table_to_entry(TABLE*, THD*, db_worker_hash_entry*);
 TABLE* mts_move_temp_tables_to_thd(THD*, TABLE*);
 #endif // HAVE_REPLICATION
index 736d790e5d3b65b34a9a14115ea2465222578e32..2fc70b8cc3d04cca68c543a2625633c6bfe2d09b 100644 (file)
@@ -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
@@ -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"
@@ -201,6 +204,7 @@ static int process_io_create_file(Master_info* mi, Create_file_log_event* cev);
 static bool wait_for_relay_log_space(Relay_log_info* rli);
 static inline bool io_slave_killed(THD* thd,Master_info* mi);
 static inline bool sql_slave_killed(THD* thd,Relay_log_info* rli);
+static inline bool is_autocommit_off_and_infotables(THD* thd);
 static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type);
 static void print_slave_skip_errors(void);
 static int safe_connect(THD* thd, MYSQL* mysql, Master_info* mi);
@@ -658,12 +662,20 @@ int init_recovery(Master_info* mi, const char** errmsg)
     error= mts_recovery_groups(rli);
     if (rli->mts_recovery_group_cnt)
     {
-      error= 1;
-      sql_print_error("--relay-log-recovery cannot be executed when the slave "
+      if (gtid_mode == GTID_MODE_ON)
+      {
+        rli->recovery_parallel_workers= 0;
+        rli->clear_mts_recovery_groups();
+      }
+      else
+      {
+        error= 1;
+        sql_print_error("--relay-log-recovery cannot be executed when the slave "
                         "was stopped with an error or killed in MTS mode; "
                         "consider using RESET SLAVE or restart the server "
                         "with --relay-log-recovery = 0 followed by "
                         "START SLAVE UNTIL SQL_AFTER_MTS_GAPS");
+      }
     }
   }
 
@@ -689,8 +701,11 @@ int init_recovery(Master_info* mi, const char** errmsg)
                                                rli->get_group_master_log_pos()));
     mi->set_master_log_name(rli->get_group_master_log_name());
 
-    sql_print_warning("Recovery from master pos %ld and file %s.",
-                      (ulong) mi->get_master_log_pos(), mi->get_master_log_name());
+    sql_print_warning("Recovery from master pos %ld and file %s. "
+                      "Previous relay log pos and relay log file had "
+                      "been set to %lld, %s respectively.",
+                      (ulong) mi->get_master_log_pos(), mi->get_master_log_name(),
+                      rli->get_group_relay_log_pos(), rli->get_group_relay_log_name());
 
     rli->set_group_relay_log_name(rli->relay_log.get_log_fname());
     rli->set_event_relay_log_name(rli->relay_log.get_log_fname());
@@ -728,14 +743,14 @@ int global_init_info(Master_info* mi, bool ignore_if_no_info, int thread_mask)
     transaction start to avoid table access deadlocks when START SLAVE
     is executed after RESET SLAVE.
   */
-  if (thd && thd->in_multi_stmt_transaction_mode() &&
-      (opt_mi_repository_id == INFO_REPOSITORY_TABLE ||
-       opt_rli_repository_id == INFO_REPOSITORY_TABLE))
+  if (is_autocommit_off_and_infotables(thd))
+  {
     if (trans_begin(thd))
     {
       init_error= 1;
       goto end;
     }
+  }
 
   /*
     This takes care of the startup dependency between the master_info
@@ -764,15 +779,15 @@ int global_init_info(Master_info* mi, bool ignore_if_no_info, int thread_mask)
       init_error= 1;
   }
 
+  DBUG_EXECUTE_IF("enable_mts_worker_failure_init",
+                  {DBUG_SET("+d,mts_worker_thread_init_fails");});
 end:
   /*
     When info tables are used and autocommit= 0 we force transaction
     commit to avoid table access deadlocks when START SLAVE is executed
     after RESET SLAVE.
   */
-  if (thd && thd->in_multi_stmt_transaction_mode() &&
-      (opt_mi_repository_id == INFO_REPOSITORY_TABLE ||
-       opt_rli_repository_id == INFO_REPOSITORY_TABLE))
+  if (is_autocommit_off_and_infotables(thd))
     if (trans_commit(thd))
       init_error= 1;
 
@@ -1233,7 +1248,7 @@ terminate_slave_thread(THD *thd,
 
   while (*slave_running)                        // Should always be true
   {
-    int error;
+    int error __attribute__((unused));
     DBUG_PRINT("loop", ("killing slave thread"));
 
     mysql_mutex_lock(&thd->LOCK_thd_data);
@@ -1486,6 +1501,24 @@ void close_active_mi()
   mysql_mutex_unlock(&LOCK_active_mi);
 }
 
+/**
+   Check if multi-statement transaction mode and master and slave info
+   repositories are set to table.
+
+   @param THD    THD object
+
+   @retval true  Success
+   @retval false Failure
+*/
+static bool is_autocommit_off_and_infotables(THD* thd)
+{
+  DBUG_ENTER("is_autocommit_off_and_infotables");
+  DBUG_RETURN((thd && thd->in_multi_stmt_transaction_mode() &&
+               (opt_mi_repository_id == INFO_REPOSITORY_TABLE ||
+                opt_rli_repository_id == INFO_REPOSITORY_TABLE))?
+              true : false);
+}
+
 static bool io_slave_killed(THD* thd, Master_info* mi)
 {
   DBUG_ENTER("io_slave_killed");
@@ -1516,16 +1549,18 @@ static bool io_slave_killed(THD* thd, Master_info* mi)
 */
 static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
 {
-  bool ret= FALSE;
   bool is_parallel_warn= FALSE;
 
   DBUG_ENTER("sql_slave_killed");
 
   DBUG_ASSERT(rli->info_thd == thd);
   DBUG_ASSERT(rli->slave_running == 1);
+  if (rli->sql_thread_kill_accepted)
+    DBUG_RETURN(true);
   if (abort_loop || thd->killed || rli->abort_slave)
   {
-    is_parallel_warn= (rli->is_parallel_exec() && 
+    rli->sql_thread_kill_accepted= true;
+    is_parallel_warn= (rli->is_parallel_exec() &&
                        (rli->is_mts_in_group() || thd->killed));
     /*
       Slave can execute stop being in one of two MTS or Single-Threaded mode.
@@ -1553,7 +1588,6 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
         "In such cases you have to examine your data (see documentation for "
         "details).";
 
-      ret= TRUE;
       if (rli->abort_slave)
       {
         DBUG_PRINT("info", ("Request to stop slave SQL Thread received while "
@@ -1573,14 +1607,16 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
 
         if (rli->last_event_start_time == 0)
           rli->last_event_start_time= my_time(0);
-        ret= difftime(my_time(0), rli->last_event_start_time) <=
-          SLAVE_WAIT_GROUP_DONE ? FALSE : TRUE;
+        rli->sql_thread_kill_accepted= difftime(my_time(0),
+                                               rli->last_event_start_time) <=
+                                               SLAVE_WAIT_GROUP_DONE ?
+                                               FALSE : TRUE;
 
-        DBUG_EXECUTE_IF("stop_slave_middle_group", 
+        DBUG_EXECUTE_IF("stop_slave_middle_group",
                         DBUG_EXECUTE_IF("incomplete_group_in_relay_log",
-                                        ret= TRUE;);); // time is over
+                                        rli->sql_thread_kill_accepted= TRUE;);); // time is over
 
-        if (!ret && !rli->reported_unsafe_warning)
+        if (!rli->sql_thread_kill_accepted && !rli->reported_unsafe_warning)
         {
           rli->report(WARNING_LEVEL, 0,
                       !is_parallel_warn ?
@@ -1594,8 +1630,13 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
           rli->reported_unsafe_warning= true;
         }
       }
-      if (ret)
+      if (rli->sql_thread_kill_accepted)
       {
+        rli->last_event_start_time= 0;
+        if (rli->mts_group_status == Relay_log_info::MTS_IN_GROUP)
+        {
+          rli->mts_group_status= Relay_log_info::MTS_KILLED_GROUP;
+        }
         if (is_parallel_warn)
           rli->report(!rli->is_error() ? ERROR_LEVEL :
                       WARNING_LEVEL,    // an error was reported by Worker
@@ -1607,21 +1648,8 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
                       ER(ER_SLAVE_FATAL_ERROR), msg_stopped);
       }
     }
-    else
-    {
-      ret= TRUE;
-    }
-  }
-  if (ret)
-  {
-    rli->last_event_start_time= 0;
-    if (rli->mts_group_status == Relay_log_info::MTS_IN_GROUP)
-    {
-      rli->mts_group_status= Relay_log_info::MTS_KILLED_GROUP;
-    }
   }
-  
-  DBUG_RETURN(ret);
+  DBUG_RETURN(rli->sql_thread_kill_accepted);
 }
 
 
@@ -1904,6 +1932,25 @@ static int get_master_uuid(MYSQL *mysql, Master_info *mi)
   return ret;
 }
 
+
+/**
+  Determine, case-sensitively, if short_string is equal to
+  long_string, or a true prefix of long_string, or not a prefix.
+
+  @retval 0 short_string is not a prefix of long_string.
+  @retval 1 short_string is a true prefix of long_string (not equal).
+  @retval 2 short_string is equal to long_string.
+*/
+static int is_str_prefix_case(const char *short_string, const char *long_string)
+{
+  int i;
+  for (i= 0; short_string[i]; i++)
+    if (my_toupper(system_charset_info, short_string[i]) !=
+        my_toupper(system_charset_info, long_string[i]))
+      return 0;
+  return long_string[i] ? 1 : 2;
+}
+
 /*
   Note that we rely on the master's version (3.23, 4.0.14 etc) instead of
   relying on the binlog's version. This is not perfect: imagine an upgrade
@@ -2471,16 +2518,48 @@ when it try to get the value of TIME_ZONE global variable from master.";
       mi->master_gtid_mode= 0;
       break;
     case COMMAND_STATUS_OK:
-      int typelib_index= find_type(master_row[0], &gtid_mode_typelib, 1);
-      mysql_free_result(master_res);
-      if (typelib_index == 0)
+      const char *master_gtid_mode_string= master_row[0];
+      bool found_valid_mode= false;
+      DBUG_EXECUTE_IF("simulate_master_has_gtid_mode_on_permissive",
+                      { master_gtid_mode_string= "on_permissive"; });
+      DBUG_EXECUTE_IF("simulate_master_has_gtid_mode_off_permissive",
+                      { master_gtid_mode_string= "off_permissive"; });
+      DBUG_EXECUTE_IF("simulate_master_has_gtid_mode_on_something",
+                      { master_gtid_mode_string= "on_something"; });
+      DBUG_EXECUTE_IF("simulate_master_has_gtid_mode_off_something",
+                      { master_gtid_mode_string= "off_something"; });
+      DBUG_EXECUTE_IF("simulate_master_has_unknown_gtid_mode",
+                      { master_gtid_mode_string= "Krakel Spektakel"; });
+      for (int mode= 0; mode <= 3 && !found_valid_mode; mode+= 3)
+      {
+        switch (is_str_prefix_case(gtid_mode_typelib.type_names[mode],
+                                   master_gtid_mode_string))
+        {
+        case 0: // is not a prefix
+          break;
+        case 1: // is a true prefix, i.e. not equal
+          mi->report(WARNING_LEVEL, ER_UNKNOWN_ERROR,
+                     "The master uses an unknown GTID_MODE '%s'. "
+                     "Treating it as '%s'.",
+                     master_gtid_mode_string,
+                     gtid_mode_typelib.type_names[mode]);
+          // fall through
+        case 2: // is equal
+          found_valid_mode= true;
+          mi->master_gtid_mode= mode;
+          break;
+        }
+      }
+      if (!found_valid_mode)
       {
         mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
                    "The slave IO thread stops because the master has "
-                   "an unknown @@GLOBAL.GTID_MODE.");
+                   "an unknown @@GLOBAL.GTID_MODE '%s'.",
+                   master_gtid_mode_string);
+        mysql_free_result(master_res);
         DBUG_RETURN(1);
       }
-      mi->master_gtid_mode= typelib_index - 1;
+      mysql_free_result(master_res);
       break;
     }
     if (mi->master_gtid_mode > gtid_mode + 1 ||
@@ -3155,9 +3234,7 @@ void set_slave_thread_options(THD* thd)
     info tables updates which do not commit, like Rotate, Stop and
     skipped events handling.
   */
-  if ((thd->variables.option_bits & OPTION_NOT_AUTOCOMMIT) &&
-      (opt_mi_repository_id == INFO_REPOSITORY_TABLE ||
-       opt_rli_repository_id == INFO_REPOSITORY_TABLE))
+  if (is_autocommit_off_and_infotables(thd))
   {
     thd->variables.option_bits|= OPTION_AUTOCOMMIT;
     thd->variables.option_bits&= ~OPTION_NOT_AUTOCOMMIT;
@@ -3484,8 +3561,13 @@ static ulong read_event(MYSQL* mysql, Master_info *mi, bool* suppress_warnings)
       *suppress_warnings= TRUE;
     }
     else
-      sql_print_error("Error reading packet from server: %s ( server_errno=%d)",
-                      mysql_error(mysql), mysql_errno(mysql));
+    {
+      if (!mi->abort_slave)
+      {
+        sql_print_error("Error reading packet from server: %s (server_errno=%d)",
+                        mysql_error(mysql), mysql_errno(mysql));
+      }
+    }
     DBUG_RETURN(packet_error);
   }
 
@@ -3704,6 +3786,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;
@@ -3716,6 +3886,16 @@ apply_event_and_update_pos(Log_event** ptr_ev, THD* thd, Relay_log_info* rli)
       DBUG_RETURN(SLAVE_APPLY_EVENT_AND_UPDATE_POS_OK);
 
     exec_res= ev->apply_event(rli);
+#ifdef WITH_WSREP
+    if (exec_res && thd->wsrep_conflict_state != NO_CONFLICT)
+    {
+      WSREP_DEBUG("SQL apply failed, res %d conflict state: %d",
+                 exec_res, thd->wsrep_conflict_state);
+      rli->abort_slave = 1;
+      rli->report(ERROR_LEVEL, ER_UNKNOWN_COM_ERROR,
+                  "Node has dropped from cluster");
+    }
+#endif
 
     if (!exec_res && (ev->worker != rli))
     {
@@ -4223,6 +4403,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
         Hence deferred events wont be deleted here.
         They will be deleted in Deferred_log_events::rewind() funciton.
     */
+    WSREP_DEBUG("apply_event_and_update_pos result: %d", exec_res);
     if (*ptr_ev)
     {
       DBUG_ASSERT(*ptr_ev == ev); // event remains to belong to Coordinator
@@ -4266,6 +4447,12 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
       DBUG_RETURN(1);
     }
 
+#ifdef WITH_WSREP
+    mysql_mutex_lock(&thd->LOCK_wsrep_thd);
+    if (thd->wsrep_conflict_state == NO_CONFLICT)
+    {
+      mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+#endif /* WITH_WSREP */
     if (slave_trans_retries)
     {
       int UNINIT_VAR(temp_err);
@@ -4291,6 +4478,12 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
         */
         if (rli->trans_retries < slave_trans_retries)
         {
+          /*
+            The transactions has to be rolled back before global_init_info is
+            called. Because global_init_info will starts a new transaction if
+            master_info_repository is TABLE.
+          */
+          rli->cleanup_context(thd, 1);
           /*
              We need to figure out if there is a test case that covers
              this part. \Alfranio.
@@ -4306,7 +4499,6 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
           else
           {
             exec_res= SLAVE_APPLY_EVENT_AND_UPDATE_POS_OK;
-            rli->cleanup_context(thd, 1);
             /* chance for concurrent connection to get more locks */
             slave_sleep(thd, min<ulong>(rli->trans_retries, MAX_SLAVE_RETRY_PAUSE),
                         sql_slave_killed, rli);
@@ -4344,6 +4536,10 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
                             rli->trans_retries));
       }
     }
+#ifdef WITH_WSREP
+    } else mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+#endif /* WITH_WSREP */
+
     if (exec_res)
       delete ev;
     DBUG_RETURN(exec_res);
@@ -4409,6 +4605,10 @@ static int try_to_reconnect(THD *thd, MYSQL *mysql, Master_info *mi,
   thd->clear_active_vio();
 #endif
   end_server(mysql);
+  DBUG_EXECUTE_IF("simulate_no_master_reconnect",
+                   {
+                     return 1;
+                   });
   if ((*retry_count)++)
   {
     if (*retry_count > mi->retry_count)
@@ -4790,6 +4990,17 @@ ignore_log_space_limit=%d",
 log space");
           goto err;
         }
+      DBUG_EXECUTE_IF("flush_after_reading_user_var_event",
+                      {
+                      if (event_buf[EVENT_TYPE_OFFSET] == USER_VAR_EVENT)
+                      {
+                      const char act[]= "now signal Reached wait_for signal.flush_complete_continue";
+                      DBUG_ASSERT(opt_debug_sync_timeout > 0);
+                      DBUG_ASSERT(!debug_sync_set_action(current_thd,
+                                                         STRING_WITH_LEN(act)));
+
+                      }
+                      });
       DBUG_EXECUTE_IF("stop_io_after_reading_gtid_log_event",
         if (event_buf[EVENT_TYPE_OFFSET] == GTID_LOG_EVENT)
           thd->killed= THD::KILLED_NO_VALUE;
@@ -4814,6 +5025,14 @@ log space");
         if (event_buf[EVENT_TYPE_OFFSET] == WRITE_ROWS_EVENT)
           thd->killed= THD::KILLED_NO_VALUE;
       );
+      /*
+        After event is flushed to relay log file, memory used
+        by thread's mem_root is not required any more.
+        Hence adding free_root(thd->mem_root,...) to do the
+        cleanup, otherwise a long running IO thread can
+        cause OOM error.
+      */
+      free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC));
     }
   }
 
@@ -5101,6 +5320,7 @@ int mts_recovery_groups(Relay_log_info *rli)
   LOG_INFO linfo;
   my_off_t offset= 0;
   MY_BITMAP *groups= &rli->recovery_groups;
+  THD *thd= current_thd;
 
   DBUG_ENTER("mts_recovery_groups");
 
@@ -5136,6 +5356,20 @@ int mts_recovery_groups(Relay_log_info *rli)
                         rli->recovery_parallel_workers,
                         rli->recovery_parallel_workers);
 
+  /*
+    When info tables are used and autocommit= 0 we force a new
+    transaction start to avoid table access deadlocks when START SLAVE
+    is executed after STOP SLAVE with MTS enabled.
+  */
+  if (is_autocommit_off_and_infotables(thd))
+  {
+    if (trans_begin(thd))
+    {
+      error= TRUE;
+      goto err;
+    }
+  }
+
   for (uint id= 0; id < rli->recovery_parallel_workers; id++)
   {
     Slave_worker *worker=
@@ -5143,6 +5377,8 @@ int mts_recovery_groups(Relay_log_info *rli)
 
     if (!worker)
     {
+      if (is_autocommit_off_and_infotables(thd))
+        trans_rollback(thd);
       error= TRUE;
       goto err;
     }
@@ -5172,6 +5408,20 @@ int mts_recovery_groups(Relay_log_info *rli)
     }
   }
 
+  /*
+    When info tables are used and autocommit= 0 we force transaction
+    commit to avoid table access deadlocks when START SLAVE is executed
+    after STOP SLAVE with MTS enabled.
+  */
+  if (is_autocommit_off_and_infotables(thd))
+  {
+    if (trans_commit(thd))
+    {
+      error= TRUE;
+      goto err;
+    }
+  }
+
   /*
     In what follows, the group Recovery Bitmap is constructed.
 
@@ -5360,11 +5610,8 @@ err:
   }
 
   delete_dynamic(&above_lwm_jobs);
-  if (rli->recovery_groups_inited && rli->mts_recovery_group_cnt == 0)
-  {
-    bitmap_free(groups);
-    rli->recovery_groups_inited= false;
-  }
+  if (rli->mts_recovery_group_cnt == 0)
+    rli->clear_mts_recovery_groups();
 
   DBUG_RETURN(error ? ER_MTS_RECOVERY_FAILURE : 0);
 }
@@ -5691,55 +5938,36 @@ void slave_stop_workers(Relay_log_info *rli, bool *mts_inited)
 {
   int i;
   THD *thd= rli->info_thd;
-
-  if (!*mts_inited) 
+  if (!*mts_inited)
     return;
   else if (rli->slave_parallel_workers == 0)
     goto end;
 
   /*
-    In case of the "soft" graceful stop Coordinator
-    guaranteed Workers were assigned with full groups so waiting
-    will be resultful.
-    "Hard" stop with KILLing Coordinator or erroring out by a Worker
-    can't wait for Workers' completion because those may not receive
-    commit-events of last assigned groups.
+    If request for stop slave is received notify worker
+    to stop.
   */
-  if (rli->mts_group_status != Relay_log_info::MTS_KILLED_GROUP &&
-      thd->killed == THD::NOT_KILLED)
-  {
-    DBUG_ASSERT(rli->mts_group_status != Relay_log_info::MTS_IN_GROUP ||
-                thd->is_error());
+  // Initialize worker exit count and max_updated_index to 0 during each stop.
+  rli->exit_counter= 0;
+  rli->max_updated_index= (rli->until_condition !=
+                           Relay_log_info::UNTIL_NONE)?
+                           rli->mts_groups_assigned:0;
 
-#ifndef DBUG_OFF
-    if (DBUG_EVALUATE_IF("check_slave_debug_group", 1, 0))
-    {
-      sql_print_error("This is not supposed to happen at this point...");
-      DBUG_SUICIDE();
-    }
-#endif
-    // No need to know a possible error out of synchronization call.
-    (void) wait_for_workers_to_finish(rli);
-    /*
-      At this point the coordinator has been stopped and the checkpoint
-      routine is executed to eliminate possible gaps.
-    */
-    (void) mts_checkpoint_routine(rli, 0, false, true/*need_data_lock=true*/); // TODO: ALFRANIO ERROR
-  }
   for (i= rli->workers.elements - 1; i >= 0; i--)
   {
     Slave_worker *w;
+    struct slave_job_item item= {NULL}, *job_item= &item;
     get_dynamic((DYNAMIC_ARRAY*)&rli->workers, (uchar*) &w, i);
-    
     mysql_mutex_lock(&w->jobs_lock);
-    
+    //Inform all workers to stop
     if (w->running_status != Slave_worker::RUNNING)
     {
       mysql_mutex_unlock(&w->jobs_lock);
       continue;
     }
 
-    w->running_status= Slave_worker::KILLED;
+    w->running_status= Slave_worker::STOP;
+    (void) set_max_updated_index_on_stop(w, job_item);
     mysql_cond_signal(&w->jobs_cond);
 
     mysql_mutex_unlock(&w->jobs_lock);
@@ -5760,8 +5988,9 @@ void slave_stop_workers(Relay_log_info *rli, bool *mts_inited)
     while (w->running_status != Slave_worker::NOT_RUNNING)
     {
       PSI_stage_info old_stage;
-      DBUG_ASSERT(w->running_status == Slave_worker::KILLED ||
-                  w->running_status == Slave_worker::ERROR_LEAVING);
+      DBUG_ASSERT(w->running_status == Slave_worker::ERROR_LEAVING ||
+                  w->running_status == Slave_worker::STOP ||
+                  w->running_status == Slave_worker::STOP_ACCEPTED);
 
       thd->ENTER_COND(&w->jobs_cond, &w->jobs_lock,
                       &stage_slave_waiting_workers_to_exit, &old_stage);
@@ -5770,11 +5999,18 @@ void slave_stop_workers(Relay_log_info *rli, bool *mts_inited)
       mysql_mutex_lock(&w->jobs_lock);
     }
     mysql_mutex_unlock(&w->jobs_lock);
+  }
+
+  if (thd->killed == THD::NOT_KILLED)
+    (void) mts_checkpoint_routine(rli, 0, false, true/*need_data_lock=true*/); // TODO:consider to propagate an error out of the function
 
+  for (i= rli->workers.elements - 1; i >= 0; i--)
+  {
+    Slave_worker *w= NULL;
+    get_dynamic((DYNAMIC_ARRAY*)&rli->workers, (uchar*) &w, i);
     delete_dynamic_element(&rli->workers, i);
     delete w;
   }
-
   if (log_warnings > 1)
     sql_print_information("Total MTS session statistics: "
                           "events processed = %llu; "
@@ -5825,6 +6061,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 +6072,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);
@@ -5850,6 +6092,7 @@ pthread_handler_t handle_slave_sql(void *arg)
   rli->slave_run_id++;
   rli->slave_running = 1;
   rli->reported_unsafe_warning= false;
+  rli->sql_thread_kill_accepted= false;
 
   pthread_detach_this_thread();
   if (init_slave_thread(thd, SLAVE_THD_SQL))
@@ -5976,6 +6219,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)));
@@ -6050,6 +6305,13 @@ log '%s' at position %s, relay log '%s' position: %s", rli->get_rpl_log_name(),
     
     if (exec_relay_log_event(thd,rli))
     {
+#ifdef WITH_WSREP
+      if (thd->wsrep_conflict_state != NO_CONFLICT)
+      {
+        wsrep_node_dropped = 1;
+        rli->abort_slave   = 1;
+      }
+#endif /* WITH_WSREP */
       DBUG_PRINT("info", ("exec_relay_log_event() failed"));
       // do not scare the user if SQL thread was simply killed or stopped
       if (!sql_slave_killed(thd,rli))
@@ -6118,6 +6380,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;
     }
@@ -6132,13 +6400,18 @@ llstr(rli->get_group_master_log_pos(), llbuff));
  err:
 
   slave_stop_workers(rli, &mts_inited); // stopping worker pool
-  if (rli->recovery_groups_inited)
+  rli->clear_mts_recovery_groups();
+
+#ifdef WITH_WSREP
+  if (WSREP_ON)
   {
-    bitmap_free(&rli->recovery_groups);
-    rli->mts_recovery_group_cnt= 0;
-    rli->recovery_groups_inited= false;
+    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 +6464,30 @@ 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);
+      WSREP_DEBUG("wsrep_conflict_state now: %d", thd->wsrep_conflict_state);
+      WSREP_INFO("slave restart: %d", thd->wsrep_conflict_state);
+      thd->wsrep_conflict_state = NO_CONFLICT;
+      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
@@ -6623,6 +6920,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
   char *save_buf= NULL; // needed for checksumming the fake Rotate event
   char rot_buf[LOG_EVENT_HEADER_LEN + ROTATE_HEADER_LEN + FN_REFLEN];
   Gtid gtid= { 0, 0 };
+  Gtid old_retrieved_gtid= { 0, 0 };
   Log_event_type event_type= (Log_event_type)buf[EVENT_TYPE_OFFSET];
 
   DBUG_ASSERT(checksum_alg == BINLOG_CHECKSUM_ALG_OFF || 
@@ -7050,26 +7348,58 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
   }
   else
   {
+    DBUG_EXECUTE_IF("flush_after_reading_gtid_event",
+                    if (event_type == GTID_LOG_EVENT && gtid.gno == 4)
+                      DBUG_SET("+d,set_max_size_zero");
+                   );
+    DBUG_EXECUTE_IF("set_append_buffer_error",
+                    if (event_type == GTID_LOG_EVENT && gtid.gno == 4)
+                      DBUG_SET("+d,simulate_append_buffer_error");
+                   );
+    /*
+      Add the GTID to the retrieved set before actually appending it to relay
+      log. This will ensure that if a rotation happens at this point of time the
+      new GTID will be reflected as part of Previous_Gtid set and
+      Retrieved_Gtid_Set will not have any gaps.
+    */
+    if (event_type == GTID_LOG_EVENT)
+    {
+      global_sid_lock->rdlock();
+      old_retrieved_gtid= *(mi->rli->get_last_retrieved_gtid());
+      int ret= rli->add_logged_gtid(gtid.sidno, gtid.gno);
+      if (!ret)
+        rli->set_last_retrieved_gtid(gtid);
+      global_sid_lock->unlock();
+      if (ret != 0)
+      {
+        mysql_mutex_unlock(log_lock);
+        goto err;
+      }
+    }
     /* write the event to the relay log */
-    if (likely(rli->relay_log.append_buffer(buf, event_len, mi) == 0))
+    if (!DBUG_EVALUATE_IF("simulate_append_buffer_error", 1, 0) &&
+       likely(rli->relay_log.append_buffer(buf, event_len, mi) == 0))
     {
       mi->set_master_log_pos(mi->get_master_log_pos() + inc_pos);
       DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->get_master_log_pos()));
       rli->relay_log.harvest_bytes_written(&rli->log_space_total);
-
+    }
+    else
+    {
       if (event_type == GTID_LOG_EVENT)
       {
         global_sid_lock->rdlock();
-        int ret= rli->add_logged_gtid(gtid.sidno, gtid.gno);
-        if (!ret)
-          rli->set_last_retrieved_gtid(gtid);
-        global_sid_lock->unlock();
-        if (ret != 0)
+        Gtid_set * retrieved_set= (const_cast<Gtid_set *>(mi->rli->get_gtid_set()));
+        if (retrieved_set->_remove_gtid(gtid) != RETURN_STATUS_OK)
+        {
+          global_sid_lock->unlock();
+          mysql_mutex_unlock(log_lock);
           goto err;
+        }
+        if (!old_retrieved_gtid.empty())
+          rli->set_last_retrieved_gtid(old_retrieved_gtid);
+        global_sid_lock->unlock();
       }
-    }
-    else
-    {
       error= ER_SLAVE_RELAY_LOG_WRITE_FAILURE;
     }
     rli->ign_master_log_name_end[0]= 0; // last event is not ignored
@@ -7196,7 +7526,24 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
   }
 #endif
 
-  mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname);
+  /*
+    If server's default charset is not supported (like utf16, utf32) as client
+    charset, then set client charset to 'latin1' (default client charset).
+  */
+  if (is_supported_parser_charset(default_charset_info))
+    mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname);
+  else
+  {
+    sql_print_information("'%s' can not be used as client character set. "
+                          "'%s' will be used as default client character set "
+                          "while connecting to master.",
+                          default_charset_info->csname,
+                          default_client_charset_info->csname);
+    mysql_options(mysql, MYSQL_SET_CHARSET_NAME,
+                  default_client_charset_info->csname);
+  }
+
+
   /* This one is not strictly needed but we have it here for completeness */
   mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir);
 
index 8a06a851d10f37cb25daff59045f16df9d76ed83..248cebbdf4f5e15806aa51632300159beca96bb5 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2007, 2014, 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
@@ -33,8 +34,8 @@
 static bool no_threads_end(THD *thd, bool put_in_cache)
 {
   thd_release_resources(thd);
-  dec_connection_count();
   remove_global_thread(thd);
+  dec_connection_count();
   // THD is an incomplete type here, so use destroy_thd() to delete it.
   destroy_thd(thd);
 
index fbc7e167f08987f0bbb72ac192d974b273babf53..699561975c9f8a203cbbb23508e182abf9e20764 100644 (file)
@@ -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<set_var_base> *var_list);
+#endif
 int sys_var_init();
 int sys_var_add_options(std::vector<my_option> *long_options, int parse_flags);
 void sys_var_end(void);
index 88252ce2c1a63cf83ebbee700a0e7f8baf7ed3f7..b8ac6510f6a3768cfc594fe0b1144cab9c125c17 100644 (file)
@@ -6781,7 +6781,7 @@ ER_GTID_UNSAFE_CREATE_SELECT
   eng "CREATE TABLE ... SELECT is forbidden when @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1."
 
 ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION
- eng "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."
+ eng "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."
 
 ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME
   eng "The value of @@GLOBAL.GTID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGRADE_STEP_2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions." 
index 915a6af7364ef7badf059dfd554be8abfa76ffa9..2ed066954b07d9cdd6f5c119b641b3be1a006a80 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2002, 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
@@ -754,6 +754,7 @@ static sp_head *sp_compile(THD *thd, String *defstr, sql_mode_t sql_mode,
   sp_rcontext *sp_runtime_ctx_saved= thd->sp_runtime_ctx;
   Silence_deprecated_warning warning_handler;
   Parser_state parser_state;
+  sql_digest_state *parent_digest= thd->m_digest;
   PSI_statement_locker *parent_locker= thd->m_statement_psi;
 
   thd->variables.sql_mode= sql_mode;
@@ -770,6 +771,7 @@ static sp_head *sp_compile(THD *thd, String *defstr, sql_mode_t sql_mode,
   thd->push_internal_handler(&warning_handler);
   thd->sp_runtime_ctx= NULL;
 
+  thd->m_digest= NULL;
   thd->m_statement_psi= NULL;
   if (parse_sql(thd, & parser_state, creation_ctx) || thd->lex == NULL)
   {
@@ -781,6 +783,7 @@ static sp_head *sp_compile(THD *thd, String *defstr, sql_mode_t sql_mode,
   {
     sp= thd->lex->sphead;
   }
+  thd->m_digest= parent_digest;
   thd->m_statement_psi= parent_locker;
 
   thd->pop_internal_handler();
@@ -1512,6 +1515,14 @@ bool lock_db_routines(THD *thd, char *db)
     {
       char *sp_name= get_field(thd->mem_root,
                                table->field[MYSQL_PROC_FIELD_NAME]);
+      if (sp_name == NULL)
+      {
+        table->file->ha_index_end();
+        my_error(ER_SP_WRONG_NAME, MYF(0), "");
+        close_system_tables(thd, &open_tables_state_backup);
+        DBUG_RETURN(true);
+      }
+
       longlong sp_type= table->field[MYSQL_PROC_MYSQL_TYPE]->val_int();
       MDL_request *mdl_request= new (thd->mem_root) MDL_request;
       mdl_request->init(sp_type == SP_TYPE_FUNCTION ?
@@ -2734,3 +2745,38 @@ 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: schema: %s, query: %s",
+               (thd->db ? thd->db : "(null)"), thd->query());
+    return 1;
+  }
+  return wsrep_to_buf_helper(thd, log_query.ptr(), log_query.length(), buf, buf_len);
+}
+#endif /* WITH_WSREP */
index 376fb39ec0c2d94961d658d6e2f0b5d91b0c4586..b0dea7b90b752acdd851e1ff408c9fea797cff3d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2002, 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
@@ -642,8 +642,13 @@ bool sp_head::execute(THD *thd, bool merge_da_on_success)
     if (thd->locked_tables_mode <= LTM_LOCK_TABLES)
       thd->user_var_events_alloc= thd->mem_root;
 
+    sql_digest_state *parent_digest= thd->m_digest;
+    thd->m_digest= NULL;
+
     err_status= i->execute(thd, &ip);
 
+    thd->m_digest= parent_digest;
+
     if (i->free_list)
       cleanup_items(i->free_list);
 
index 232dc65e815a3afccb902bc1b808778c286a120c..eefb79394ddee4436f4cd74062b0ba06c5cc8630 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -45,7 +45,8 @@ static int cmp_splocal_locations(Item_splocal * const *a,
 /*
   StoredRoutinesBinlogging
   This paragraph applies only to statement-based binlogging. Row-based
-  binlogging does not need anything special like this.
+  binlogging does not need anything special like this except for a special
+  case that is mentioned below in section 2.1
 
   Top-down overview:
 
@@ -72,6 +73,14 @@ static int cmp_splocal_locations(Item_splocal * const *a,
     of SP local variables with NAME_CONST('spvar_name', <spvar-value>) calls.
     This substitution is done in subst_spvars().
 
+  2.1 Miscellaneous case: DDLs (Eg: ALTER EVENT) in StoredProcedure(SP) uses
+      its local variables
+
+  * Irrespective of binlog format, DDLs are always binlogged in statement mode.
+    Hence if there are any DDLs, in stored procedure, that uses SP local
+    variables,  those should be replaced with NAME_CONST('spvar_name', <spvar-value>)
+    even if binlog format is 'row'.
+
   3. FUNCTION calls
 
   In sp_head::execute_function(), we check
@@ -451,6 +460,7 @@ bool sp_lex_instr::reset_lex_and_exec_core(THD *thd,
 LEX *sp_lex_instr::parse_expr(THD *thd, sp_head *sp)
 {
   String sql_query;
+  sql_digest_state *parent_digest= thd->m_digest;
   PSI_statement_locker *parent_locker= thd->m_statement_psi;
   SQL_I_List<Item_trigger_field> *next_trig_list_bkp= NULL;
   sql_query.set_charset(system_charset_info);
@@ -483,7 +493,7 @@ LEX *sp_lex_instr::parse_expr(THD *thd, sp_head *sp)
     initiated. Also set the statement query arena to the lex mem_root.
   */
   MEM_ROOT *execution_mem_root= thd->mem_root;
-  Query_arena parse_arena(&m_lex_mem_root, thd->stmt_arena->state);
+  Query_arena parse_arena(&m_lex_mem_root, STMT_INITIALIZED_FOR_SP);
 
   thd->mem_root= &m_lex_mem_root;
   thd->stmt_arena->set_query_arena(&parse_arena);
@@ -515,8 +525,10 @@ LEX *sp_lex_instr::parse_expr(THD *thd, sp_head *sp)
 
   // Parse the just constructed SELECT-statement.
 
+  thd->m_digest= NULL;
   thd->m_statement_psi= NULL;
   bool parsing_failed= parse_sql(thd, &parser_state, NULL);
+  thd->m_digest= parent_digest;
   thd->m_statement_psi= parent_locker;
 
   if (!parsing_failed)
@@ -766,7 +778,13 @@ bool sp_instr_stmt::execute(THD *thd, uint *nextp)
 
     - general log is off
 
-    - binary logging is off, or not in statement mode
+    - binary logging is off
+
+    - if the query generates row events in binlog row format mode
+    (DDLs are always written in statement format irrespective of binlog_format
+    and they can have SP variables in it. For example, 'ALTER EVENT' is allowed
+    inside a procedure and can contain SP variables in it. Those too need to be
+    substituted with NAME_CONST(...))
 
     We don't have to substitute on behalf of the query cache as
     queries with SP vars are not cached, anyway.
@@ -783,10 +801,11 @@ bool sp_instr_stmt::execute(THD *thd, uint *nextp)
     substitution immediately before writing to the log.
   */
 
-  need_subst= ((thd->variables.option_bits & OPTION_LOG_OFF) &&
+  need_subst= !((thd->variables.option_bits & OPTION_LOG_OFF) &&
                (!(thd->variables.option_bits & OPTION_BIN_LOG) ||
                 !mysql_bin_log.is_open() ||
-                thd->is_current_stmt_binlog_format_row())) ? FALSE : TRUE;
+                (thd->is_current_stmt_binlog_format_row() &&
+                 sqlcom_can_generate_row_events(m_lex->sql_command))));
 
   /*
     If we need to do a substitution but can't (OOM), give up.
index 52ac1adbad3020caa121f53db645914380adef13..fb82ad268c334e501d9c01c32ca4159e37147b66 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -350,6 +350,8 @@ protected:
   */
   virtual void cleanup_before_parsing(THD *thd);
 
+  /// LEX-object.
+  LEX *m_lex;
 private:
   /** 
     Mem-root for storing the LEX-tree during reparse. This
@@ -358,8 +360,6 @@ private:
   */
   MEM_ROOT m_lex_mem_root;
 
-  /// LEX-object.
-  LEX *m_lex;
 
   /**
     Indicates whether this sp_lex_instr instance is responsible for
index dc059b0c27887cd2ae480a842200a06f3dda48f9..5a6e3ca911d42e9753339ff517e851b24cff9cdf 100644 (file)
@@ -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
@@ -53,6 +53,7 @@
 #include <mysql/plugin_validate_password.h>
 #include "password.h"
 #include "crypt_genhash_impl.h"
+#include "debug_sync.h"
 
 #if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL)
 #include <openssl/rsa.h>
@@ -183,221 +184,9 @@ TABLE_FIELD_TYPE mysql_db_table_fields[MYSQL_DB_FIELD_COUNT] = {
   }
 };
 
-static const
-TABLE_FIELD_TYPE mysql_user_table_fields[MYSQL_USER_FIELD_COUNT] = {
-  {
-    { C_STRING_WITH_LEN("Host") },            
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0 }
-  },
-  {
-    { C_STRING_WITH_LEN("User") },            
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0 }
-  },
-  {
-    { C_STRING_WITH_LEN("Password") },            
-    { C_STRING_WITH_LEN("char(41)") },
-    { C_STRING_WITH_LEN("latin1") }
-  }, 
-  {
-    { C_STRING_WITH_LEN("Select_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  {
-    { C_STRING_WITH_LEN("Insert_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  {
-    { C_STRING_WITH_LEN("Update_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  {
-    { C_STRING_WITH_LEN("Delete_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  {
-    { C_STRING_WITH_LEN("Create_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  {
-    { C_STRING_WITH_LEN("Drop_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  {
-    { C_STRING_WITH_LEN("Reload_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  {
-    { C_STRING_WITH_LEN("Shutdown_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Process_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("File_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Grant_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("References_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Index_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Alter_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Show_db_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Super_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Create_tmp_table_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Lock_tables_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Execute_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Repl_slave_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Repl_client_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Create_view_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Show_view_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Create_routine_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Alter_routine_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Create_user_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Event_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Trigger_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("Create_tablespace_priv") },
-    { C_STRING_WITH_LEN("enum('N','Y')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("ssl_type") },
-    { C_STRING_WITH_LEN("enum('','ANY','X509','SPECIFIED')") },
-    { C_STRING_WITH_LEN("utf8") }
-  },
-  { 
-    { C_STRING_WITH_LEN("ssl_cipher") },
-    { C_STRING_WITH_LEN("blob") },
-    { NULL, 0 }
-  },
-  { 
-    { C_STRING_WITH_LEN("x509_issuer") },
-    { C_STRING_WITH_LEN("blob") },
-    { NULL, 0 }
-  },
-  { 
-    { C_STRING_WITH_LEN("x509_subject") },
-    { C_STRING_WITH_LEN("blob") },
-    { NULL, 0 }
-  },
-  { 
-    { C_STRING_WITH_LEN("max_questions") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0 }
-  },
-  { 
-    { C_STRING_WITH_LEN("max_updates") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0 }
-  },
-  { 
-    { C_STRING_WITH_LEN("max_connections") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0 }
-  },
-  { 
-    { C_STRING_WITH_LEN("plugin") },
-    { C_STRING_WITH_LEN("char(64)") },
-    { NULL, 0 }
-  },
-  { 
-    { C_STRING_WITH_LEN("authentication_string") },
-    { C_STRING_WITH_LEN("text") },
-    { NULL, 0 }
-  } 
-};
-
 const TABLE_FIELD_DEF
   mysql_db_table_def= {MYSQL_DB_FIELD_COUNT, mysql_db_table_fields};
 
-const TABLE_FIELD_DEF
-  mysql_user_table_def= {MYSQL_USER_FIELD_COUNT, mysql_user_table_fields};
-
 static LEX_STRING native_password_plugin_name= {
   C_STRING_WITH_LEN("mysql_native_password")
 };
@@ -1053,7 +842,6 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
                        NULL, 1, 1, FALSE))
     goto end;
   table->use_all_columns();
-  (void) my_init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100);
   
   allow_all_hosts=0;
   while (!(read_record_info.read_record(&read_record_info)))
@@ -1353,7 +1141,6 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
                        NULL, 1, 1, FALSE))
     goto end;
   table->use_all_columns();
-  (void) my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB),50,100);
   while (!(read_record_info.read_record(&read_record_info)))
   {
     /* Reading record in mysql.db */
@@ -1414,8 +1201,6 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
   freeze_size(&acl_dbs);
 
   /* Prepare to read records from the mysql.proxies_priv table */
-  (void) my_init_dynamic_array(&acl_proxy_users, sizeof(ACL_PROXY_USER), 
-                               50, 100);
   if (tables[2].table)
   {
     if (init_read_record(&read_record_info, thd, table= tables[2].table,
@@ -1468,12 +1253,12 @@ void acl_free(bool end)
   delete_dynamic(&acl_wild_hosts);
   delete_dynamic(&acl_proxy_users);
   my_hash_free(&acl_check_hosts);
-  plugin_unlock(0, native_password_plugin);
-  plugin_unlock(0, old_password_plugin);
   if (!end)
     acl_cache->clear(1); /* purecov: inspected */
   else
   {
+    plugin_unlock(0, native_password_plugin);
+    plugin_unlock(0, old_password_plugin);
     delete acl_cache;
     acl_cache=0;
   }
@@ -1643,6 +1428,9 @@ my_bool acl_reload(THD *thd)
   old_acl_users= acl_users;
   old_acl_proxy_users= acl_proxy_users;
   old_acl_dbs= acl_dbs;
+  my_init_dynamic_array(&acl_users, sizeof(ACL_USER), 50, 100);
+  my_init_dynamic_array(&acl_dbs, sizeof(ACL_DB), 50, 100);
+  my_init_dynamic_array(&acl_proxy_users, sizeof(ACL_PROXY_USER), 50, 100);
   old_mem= global_acl_memory;
   delete_dynamic(&acl_wild_hosts);
   my_hash_free(&acl_check_hosts);
@@ -1668,6 +1456,8 @@ my_bool acl_reload(THD *thd)
     mysql_mutex_unlock(&acl_cache->lock);
 end:
   close_acl_tables(thd);
+
+  DEBUG_SYNC(thd, "after_acl_reload");
   DBUG_RETURN(return_val);
 }
 
@@ -1716,7 +1506,8 @@ static ulong get_access(TABLE *form, uint fieldnr, uint *next_field)
 /*
   Return a number which, if sorted 'desc', puts strings in this order:
     no wildcards
-    wildcards
+    strings containg wildcards and non-wildcard characters
+    single muilt-wildcard character('%')
     empty string
 */
 
@@ -1733,7 +1524,16 @@ static ulong get_sort(uint count,...)
   {
     char *start, *str= va_arg(args,char*);
     uint chars= 0;
-    uint wild_pos= 0;           /* first wildcard position */
+    uint wild_pos= 0;
+
+    /*
+      wild_pos
+        0                            if string is empty
+        1                            if string is a single muilt-wildcard
+                                     character('%')
+        first wildcard position + 1  if string containg wildcards and
+                                     non-wildcard characters
+    */
 
     if ((start= str))
     {
@@ -1744,6 +1544,8 @@ static ulong get_sort(uint count,...)
         else if (*str == wild_many || *str == wild_one)
         {
           wild_pos= (uint) (str - start) + 1;
+          if (!(wild_pos == 1 && *str == wild_many && *(++str) == '\0'))
+            wild_pos++;
           break;
         }
         chars= 128;                             // Marker that chars existed
@@ -2304,6 +2106,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 +2116,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 +2202,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 +2210,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 +2220,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 +2502,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 */
 }
 
 
@@ -2898,8 +2736,14 @@ update_user_table(THD *thd, TABLE *table,
   */
   if (!password_expired)
   {
-    table->field[(int) password_field]->store(new_password, new_password_len,
-                                              system_charset_info);
+    if (table->s->fields >= (uint) password_field)
+      table->field[(uint) password_field]->store(new_password, new_password_len,
+                                                 system_charset_info);
+    else
+    {
+      my_error(ER_BAD_FIELD_ERROR, MYF(0), "authentication string", "mysql.user");
+      DBUG_RETURN(1);
+    }
     if (new_password_len == SCRAMBLED_PASSWORD_CHAR_LENGTH_323 &&
         password_field == MYSQL_USER_FIELD_PASSWORD)
     {
@@ -3103,17 +2947,24 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
       /* Use the authentication_string field */
       combo->auth.str= password;
       combo->auth.length= password_len;
-      if (password_len > 0)
+      if (table->s->fields >= MYSQL_USER_FIELD_AUTHENTICATION_STRING)
+      {
+        if (password_len > 0)
+          table->
+            field[MYSQL_USER_FIELD_AUTHENTICATION_STRING]->
+              store(password, password_len, &my_charset_utf8_bin);
+        /* Assert that the proper plugin is set */
         table->
-          field[MYSQL_USER_FIELD_AUTHENTICATION_STRING]->
-            store(password, password_len, &my_charset_utf8_bin);
-      /* Assert that the proper plugin is set */
-      table->
-        field[MYSQL_USER_FIELD_PLUGIN]->
-          store(sha256_password_plugin_name.str,
-                sha256_password_plugin_name.length,
-                system_charset_info);
-
+          field[MYSQL_USER_FIELD_PLUGIN]->
+            store(sha256_password_plugin_name.str,
+                  sha256_password_plugin_name.length,
+                  system_charset_info);
+      }
+      else
+      {
+        my_error(ER_BAD_FIELD_ERROR, MYF(0), "plugin", "mysql.user");
+        goto end;
+      }
     }
     else
 #endif
@@ -3121,8 +2972,9 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
       /* Use the legacy Password field */
       table->field[MYSQL_USER_FIELD_PASSWORD]->store(password, password_len,
                                                      system_charset_info);
-      table->field[MYSQL_USER_FIELD_AUTHENTICATION_STRING]->store("\0", 0,
-                                                     &my_charset_utf8_bin);
+      if (table->s->fields >= MYSQL_USER_FIELD_AUTHENTICATION_STRING)
+        table->field[MYSQL_USER_FIELD_AUTHENTICATION_STRING]->store("\0", 0,
+                                                       &my_charset_utf8_bin);
     }
   }
   else // if (table->file->ha_index_read_idx_map [..]
@@ -3191,7 +3043,8 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
        }
       }
     }
-    old_plugin.length= 0;
+    else
+      old_plugin.length= 0;
     combo->plugin= old_plugin;
 
     /*
@@ -3275,7 +3128,6 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
       else
         combo->auth.length= 0;
     }
-    
     /* 2. Digest password if needed (plugin must have been resolved */
     if (combo->uses_identified_by_clause)
     {
@@ -5607,6 +5459,7 @@ end_index_init:
     exists.
 
   @param thd A pointer to the thread handler object.
+  @param table A pointer to the table list.
 
   @see grant_reload
 
@@ -5615,31 +5468,22 @@ end_index_init:
     @retval TRUE An error has occurred.
 */
 
-static my_bool grant_reload_procs_priv(THD *thd)
+static my_bool grant_reload_procs_priv(THD *thd, TABLE_LIST *table)
 {
   HASH old_proc_priv_hash, old_func_priv_hash;
-  TABLE_LIST table;
   my_bool return_val= FALSE;
   DBUG_ENTER("grant_reload_procs_priv");
 
-  table.init_one_table("mysql", 5, "procs_priv",
-                       strlen("procs_priv"), "procs_priv",
-                       TL_READ);
-  table.open_type= OT_BASE_ONLY;
-
-  if (open_and_lock_tables(thd, &table, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT))
-    DBUG_RETURN(TRUE);
-
-  mysql_rwlock_wrlock(&LOCK_grant);
   /* Save a copy of the current hash if we need to undo the grant load */
   old_proc_priv_hash= proc_priv_hash;
   old_func_priv_hash= func_priv_hash;
 
-  if ((return_val= grant_load_procs_priv(table.table)))
+  if ((return_val= grant_load_procs_priv(table->table)))
   {
     /* Error; Reverting to old hash */
     DBUG_PRINT("error",("Reverting to old privileges"));
-    grant_free();
+    my_hash_free(&proc_priv_hash);
+    my_hash_free(&func_priv_hash);
     proc_priv_hash= old_proc_priv_hash;
     func_priv_hash= old_func_priv_hash;
   }
@@ -5648,7 +5492,6 @@ static my_bool grant_reload_procs_priv(THD *thd)
     my_hash_free(&old_proc_priv_hash);
     my_hash_free(&old_func_priv_hash);
   }
-  mysql_rwlock_unlock(&LOCK_grant);
 
   DBUG_RETURN(return_val);
 }
@@ -5671,7 +5514,7 @@ static my_bool grant_reload_procs_priv(THD *thd)
 
 my_bool grant_reload(THD *thd)
 {
-  TABLE_LIST tables[2];
+  TABLE_LIST tables[3];
   HASH old_column_priv_hash;
   MEM_ROOT old_mem;
   my_bool return_val= 1;
@@ -5687,15 +5530,57 @@ my_bool grant_reload(THD *thd)
   tables[1].init_one_table(C_STRING_WITH_LEN("mysql"),
                            C_STRING_WITH_LEN("columns_priv"),
                            "columns_priv", TL_READ);
+  tables[2].init_one_table(C_STRING_WITH_LEN("mysql"),
+                           C_STRING_WITH_LEN("procs_priv"),
+                           "procs_priv", TL_READ);
+
   tables[0].next_local= tables[0].next_global= tables+1;
-  tables[0].open_type= tables[1].open_type= OT_BASE_ONLY;
+  tables[1].next_local= tables[1].next_global= tables+2;
+  tables[0].open_type= tables[1].open_type= tables[2].open_type= OT_BASE_ONLY;
+
+  /*
+    Reload will work in the following manner:-
+
+                             proc_priv_hash structure
+                              /                     \
+                    not initialized                 initialized
+                   /               \                     |
+    mysql.procs_priv table        Server Startup         |
+        is missing                      \                |
+             |                         open_and_lock_tables()
+    Assume we are working on           /success             \failure
+    pre 4.1 system tables.        Normal Scenario.          An error is thrown.
+    A warning is printed          Reload column privilege.  Retain the old hash.
+    and continue with             Reload function and
+    reloading the column          procedure privileges,
+    privileges.                   if available.
+  */
+
+  if (!(my_hash_inited(&proc_priv_hash)))
+    tables[2].open_strategy= TABLE_LIST::OPEN_IF_EXISTS;
 
   /*
     To avoid deadlocks we should obtain table locks before
     obtaining LOCK_grant rwlock.
   */
   if (open_and_lock_tables(thd, tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT))
+  {
+    if (thd->get_stmt_da()->is_error())
+    {
+      sql_print_error("Fatal error: Can't open and lock privilege tables: %s",
+                      thd->get_stmt_da()->message());
+    }
     goto end;
+  }
+
+  if (tables[2].table == NULL)
+  {
+    sql_print_warning("Table 'mysql.procs_priv' does not exist. "
+                      "Please run mysql_upgrade.");
+    push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_NO_SUCH_TABLE,
+                        ER(ER_NO_SUCH_TABLE), tables[2].db,
+                        tables[2].table_name);
+  }
 
   mysql_rwlock_wrlock(&LOCK_grant);
   old_column_priv_hash= column_priv_hash;
@@ -5706,11 +5591,18 @@ my_bool grant_reload(THD *thd)
   */
   old_mem= memex;
   init_sql_alloc(&memex, ACL_ALLOC_BLOCK_SIZE, 0);
-
-  if ((return_val= grant_load(thd, tables)))
+  /*
+    tables[2].table i.e. procs_priv can be null if we are working with
+    pre 4.1 privilage tables
+  */
+  if ((return_val= (grant_load(thd, tables) ||
+                    (tables[2].table != NULL &&
+                     grant_reload_procs_priv(thd, &tables[2])))
+     ))
   {                                            // Error. Revert to old hash
     DBUG_PRINT("error",("Reverting to old privileges"));
-    grant_free();                              /* purecov: deadcode */
+    my_hash_free(&column_priv_hash);
+    free_root(&memex,MYF(0));
     column_priv_hash= old_column_priv_hash;    /* purecov: deadcode */
     memex= old_mem;                            /* purecov: deadcode */
   }
@@ -5718,20 +5610,9 @@ my_bool grant_reload(THD *thd)
   {
     my_hash_free(&old_column_priv_hash);
     free_root(&old_mem,MYF(0));
+    grant_version++;
   }
   mysql_rwlock_unlock(&LOCK_grant);
-  close_acl_tables(thd);
-
-  /*
-    It is OK failing to load procs_priv table because we may be
-    working with 4.1 privilege tables.
-  */
-  if (grant_reload_procs_priv(thd))
-    return_val= 1;
-
-  mysql_rwlock_wrlock(&LOCK_grant);
-  grant_version++;
-  mysql_rwlock_unlock(&LOCK_grant);
 
 end:
   close_acl_tables(thd);
@@ -5815,24 +5696,27 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
        tl && number-- && tl != first_not_own_table;
        tl= tl->next_global)
   {
-    sctx = MY_TEST(tl->security_ctx) ? tl->security_ctx : thd->security_ctx;
+    TABLE_LIST *const t_ref=
+      tl->correspondent_table ? tl->correspondent_table : tl;
+    sctx = MY_TEST(t_ref->security_ctx) ? t_ref->security_ctx :
+                                          thd->security_ctx;
 
     const ACL_internal_table_access *access=
-      get_cached_table_access(&tl->grant.m_internal,
-                              tl->get_db_name(),
-                              tl->get_table_name());
+      get_cached_table_access(&t_ref->grant.m_internal,
+                              t_ref->get_db_name(),
+                              t_ref->get_table_name());
 
     if (access)
     {
-      switch(access->check(orig_want_access, &tl->grant.privilege))
+      switch(access->check(orig_want_access, &t_ref->grant.privilege))
       {
       case ACL_INTERNAL_ACCESS_GRANTED:
         /*
            Grant all access to the table to skip column checks.
            Depend on the controls in the P_S table itself.
         */
-        tl->grant.privilege|= TMP_TABLE_ACLS;
-        tl->grant.want_privilege= 0;
+        t_ref->grant.privilege|= TMP_TABLE_ACLS;
+        t_ref->grant.want_privilege= 0;
         continue;
       case ACL_INTERNAL_ACCESS_DENIED:
         goto err;
@@ -5846,26 +5730,26 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
     if (!want_access)
       continue;                                 // ok
 
-    if (!(~tl->grant.privilege & want_access) ||
-        tl->is_anonymous_derived_table() || tl->schema_table)
+    if (!(~t_ref->grant.privilege & want_access) ||
+        t_ref->is_anonymous_derived_table() || t_ref->schema_table)
     {
       /*
-        It is subquery in the FROM clause. VIEW set tl->derived after
+        It is subquery in the FROM clause. VIEW set t_ref->derived after
         table opening, but this function always called before table opening.
       */
-      if (!tl->referencing_view)
+      if (!t_ref->referencing_view)
       {
         /*
           If it's a temporary table created for a subquery in the FROM
           clause, or an INFORMATION_SCHEMA table, drop the request for
           a privilege.
         */
-        tl->grant.want_privilege= 0;
+        t_ref->grant.want_privilege= 0;
       }
       continue;
     }
 
-    if (is_temporary_table(tl))
+    if (is_temporary_table(t_ref))
     {
       /*
         If this table list element corresponds to a pre-opened temporary
@@ -5873,21 +5757,21 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
         Note that during creation of temporary table we still need to check
         if user has CREATE_TMP_ACL.
       */
-      tl->grant.privilege|= TMP_TABLE_ACLS;
-      tl->grant.want_privilege= 0;
+      t_ref->grant.privilege|= TMP_TABLE_ACLS;
+      t_ref->grant.want_privilege= 0;
       continue;
     }
 
     GRANT_TABLE *grant_table= table_hash_search(sctx->get_host()->ptr(),
                                                 sctx->get_ip()->ptr(),
-                                                tl->get_db_name(),
+                                                t_ref->get_db_name(),
                                                 sctx->priv_user,
-                                                tl->get_table_name(),
+                                                t_ref->get_table_name(),
                                                 FALSE);
 
     if (!grant_table)
     {
-      want_access &= ~tl->grant.privilege;
+      want_access &= ~t_ref->grant.privilege;
       goto err;                                        // No grants
     }
 
@@ -5898,17 +5782,17 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
     if (any_combination_will_do)
       continue;
 
-    tl->grant.grant_table= grant_table; // Remember for column test
-    tl->grant.version= grant_version;
-    tl->grant.privilege|= grant_table->privs;
-    tl->grant.want_privilege= ((want_access & COL_ACLS) & ~tl->grant.privilege);
+    t_ref->grant.grant_table= grant_table; // Remember for column test
+    t_ref->grant.version= grant_version;
+    t_ref->grant.privilege|= grant_table->privs;
+    t_ref->grant.want_privilege= ((want_access & COL_ACLS) & ~t_ref->grant.privilege);
 
-    if (!(~tl->grant.privilege & want_access))
+    if (!(~t_ref->grant.privilege & want_access))
       continue;
 
-    if (want_access & ~(grant_table->cols | tl->grant.privilege))
+    if (want_access & ~(grant_table->cols | t_ref->grant.privilege))
     {
-      want_access &= ~(grant_table->cols | tl->grant.privilege);
+      want_access &= ~(grant_table->cols | t_ref->grant.privilege);
       goto err;                                        // impossible
     }
   }
@@ -6203,7 +6087,7 @@ bool check_grant_db(THD *thd,const char *db)
   bool error= TRUE;
   size_t copy_length;
 
-  copy_length= (size_t) (strlen(sctx->priv_user ? sctx->priv_user : "") +
+  copy_length= (size_t) (strlen(sctx->priv_user) +
                  strlen(db ? db : "")) + 1; /* Added 1 at the end to avoid  
                                                buffer overflow at strmov()*/
 
@@ -6552,24 +6436,36 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
                  system_charset_info);
     global.append ('\'');
 #if defined(HAVE_OPENSSL)
-    if (acl_user->plugin.str == sha256_password_plugin_name.str)
+    if (acl_user->plugin.str == sha256_password_plugin_name.str &&
+        acl_user->auth_string.length > 0)
     {
-      global.append(STRING_WITH_LEN(" IDENTIFIED BY PASSWORD '"));
-      global.append((const char *) &acl_user->auth_string.str[0]);
-      global.append('\'');
+      global.append(STRING_WITH_LEN(" IDENTIFIED BY PASSWORD"));
+      if ((thd->security_ctx->master_access & SUPER_ACL) == SUPER_ACL)
+      {
+        global.append(" \'");
+        global.append((const char *) &acl_user->auth_string.str[0]);
+        global.append('\'');
+      }
     }
     else
 #endif
     if (acl_user->salt_len)
     {
-      char passwd_buff[SCRAMBLED_PASSWORD_CHAR_LENGTH+1];
-      if (acl_user->salt_len == SCRAMBLE_LENGTH)
-        make_password_from_salt(passwd_buff, acl_user->salt);
+      global.append(STRING_WITH_LEN(" IDENTIFIED BY PASSWORD"));
+      if ((thd->security_ctx->master_access & SUPER_ACL) == SUPER_ACL)
+      {
+        char passwd_buff[SCRAMBLED_PASSWORD_CHAR_LENGTH+1];
+        if (acl_user->salt_len == SCRAMBLE_LENGTH)
+          make_password_from_salt(passwd_buff, acl_user->salt);
+        else
+          make_password_from_salt_323(passwd_buff, (ulong *) acl_user->salt);
+
+        global.append(" \'");
+        global.append(passwd_buff);
+        global.append('\'');
+      }
       else
-        make_password_from_salt_323(passwd_buff, (ulong *) acl_user->salt);
-      global.append(STRING_WITH_LEN(" IDENTIFIED BY PASSWORD '"));
-      global.append(passwd_buff);
-      global.append('\'');
+        global.append(" <secret>");
     }
     /* "show grants" SSL related stuff */
     if (acl_user->ssl_type == SSL_TYPE_ANY)
@@ -8827,11 +8723,14 @@ acl_check_proxy_grant_access(THD *thd, const char *host, const char *user,
     DBUG_RETURN(FALSE);
   }
 
+  mysql_mutex_lock(&acl_cache->lock);
+
   /* check for matching WITH PROXY rights */
   for (uint i=0; i < acl_proxy_users.elements; i++)
   {
     ACL_PROXY_USER *proxy= dynamic_element(&acl_proxy_users, i, 
                                            ACL_PROXY_USER *);
+    DEBUG_SYNC(thd, "before_proxy_matches");
     if (proxy->matches(thd->security_ctx->get_host()->ptr(),
                        thd->security_ctx->user,
                        thd->security_ctx->get_ip()->ptr(),
@@ -8839,10 +8738,12 @@ acl_check_proxy_grant_access(THD *thd, const char *host, const char *user,
         proxy->get_with_grant())
     {
       DBUG_PRINT("info", ("found"));
+      mysql_mutex_unlock(&acl_cache->lock);
       DBUG_RETURN(FALSE);
     }
   }
 
+  mysql_mutex_unlock(&acl_cache->lock);
   my_error(ER_ACCESS_DENIED_NO_PASSWORD_ERROR, MYF(0),
            thd->security_ctx->user,
            thd->security_ctx->host_or_ip);
@@ -9289,7 +9190,7 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
   DBUG_PRINT("enter", ("Host: '%s', Ip: '%s', User: '%s', table: `%s`.`%s`",
                        sctx->priv_host, (sctx->get_ip()->length() ?
                        sctx->get_ip()->ptr() : "(NULL)"),
-                       (sctx->priv_user ? sctx->priv_user : "(NULL)"),
+                       sctx->priv_user,
                        db, table));
   /* --skip-grants */
   if (!initialized)
@@ -9303,12 +9204,6 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
   /* global privileges */
   grant->privilege= sctx->master_access;
 
-  if (!sctx->priv_user)
-  {
-    DBUG_PRINT("info", ("privilege 0x%lx", grant->privilege));
-    DBUG_VOID_RETURN;                         // it is slave
-  }
-
   /* db privileges */
   grant->privilege|= acl_get(sctx->get_host()->ptr(), sctx->get_ip()->ptr(),
                              sctx->priv_user, db, 0);
@@ -10114,6 +10009,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,
@@ -10339,12 +10240,17 @@ char *get_56_lenc_string(char **buffer,
 
   *string_length= (size_t)net_field_length_ll((uchar **)buffer);
 
+  DBUG_EXECUTE_IF("sha256_password_scramble_too_long",
+                  *string_length= SIZE_T_MAX;
+  );
+
   size_t len_len= (size_t)(*buffer - begin);
   
-  if (*string_length + len_len > *max_bytes_available)
+  if (*string_length > *max_bytes_available - len_len)
     return NULL;
 
-  *max_bytes_available -= *string_length + len_len;
+  *max_bytes_available -= *string_length;
+  *max_bytes_available -= len_len;
   *buffer += *string_length;
   return (char *)(begin + len_len);
 }
@@ -10442,8 +10348,6 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
     mpvio->client_capabilities= uint4korr(end);
     mpvio->max_client_packet_length= 0xfffff;
     charset_code= global_system_variables.character_set_client->number;
-    if (mpvio->charset_adapter->init_client_charset(charset_code))
-      return packet_error;
     goto skip_to_ssl;
   }
   
@@ -10481,10 +10385,6 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
     charset_code= global_system_variables.character_set_client->number;
   }
 
-  DBUG_PRINT("info", ("client_character_set: %u", charset_code));
-  if (mpvio->charset_adapter->init_client_charset(charset_code))
-    return packet_error;
-
 skip_to_ssl:
 #if defined(HAVE_OPENSSL)
   DBUG_PRINT("info", ("client capabilities: %lu", mpvio->client_capabilities));
@@ -10497,6 +10397,9 @@ skip_to_ssl:
   if (mpvio->client_capabilities & CLIENT_SSL)
   {
     unsigned long errptr;
+#if !defined(DBUG_OFF)
+    uint ssl_charset_code= 0;
+#endif
 
     /* Do the SSL layering. */
     if (!ssl_acceptor_fd)
@@ -10534,6 +10437,10 @@ skip_to_ssl:
     {
       packet_has_required_size= bytes_remaining_in_packet >= 
         AUTH_PACKET_HEADER_SIZE_PROTO_41;
+#if !defined(DBUG_OFF)
+      ssl_charset_code= (uint)(uchar)*((char *)net->read_pos + 8);
+      DBUG_PRINT("info", ("client_character_set: %u", ssl_charset_code));
+#endif
       end= (char *)net->read_pos + AUTH_PACKET_HEADER_SIZE_PROTO_41;
       bytes_remaining_in_packet -= AUTH_PACKET_HEADER_SIZE_PROTO_41;
     }
@@ -10543,13 +10450,24 @@ skip_to_ssl:
         AUTH_PACKET_HEADER_SIZE_PROTO_40;
       end= (char *)net->read_pos + AUTH_PACKET_HEADER_SIZE_PROTO_40;
       bytes_remaining_in_packet -= AUTH_PACKET_HEADER_SIZE_PROTO_40;
+#if !defined(DBUG_OFF)
+      /**
+        Old clients didn't have their own charset. Instead the assumption
+        was that they used what ever the server used.
+      */
+      ssl_charset_code= global_system_variables.character_set_client->number;
+#endif
     }
-    
+    DBUG_ASSERT(charset_code == ssl_charset_code);
     if (!packet_has_required_size)
       return packet_error;
   }
 #endif /* HAVE_OPENSSL */
 
+  DBUG_PRINT("info", ("client_character_set: %u", charset_code));
+  if (mpvio->charset_adapter->init_client_charset(charset_code))
+    return packet_error;
+
   if ((mpvio->client_capabilities & CLIENT_TRANSACTIONS) &&
       opt_using_transactions)
     net->return_status= mpvio->server_status;
@@ -11282,8 +11200,7 @@ acl_authenticate(THD *thd, uint com_change_user_pkt_len)
     {
       general_log_print(thd, command, "%s@%s as %s on %s",
                         mpvio.auth_info.user_name, mpvio.auth_info.host_or_ip,
-                        mpvio.auth_info.authenticated_as ? 
-                          mpvio.auth_info.authenticated_as : "anonymous",
+                        mpvio.auth_info.authenticated_as,
                         mpvio.db.str ? mpvio.db.str : (char*) "");
     }
     else
index 52b7ff490d183b48dab697436fb4af44900ee6b0..07fae56f434cac104e6e65fe23809ece7c0b0ce3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2014, 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
@@ -247,7 +247,8 @@ static inline bool table_not_corrupt_error(uint sql_errno)
           sql_errno == ER_LOCK_WAIT_TIMEOUT ||
           sql_errno == ER_LOCK_DEADLOCK ||
           sql_errno == ER_CANT_LOCK_LOG_TABLE ||
-          sql_errno == ER_OPEN_AS_READONLY);
+          sql_errno == ER_OPEN_AS_READONLY ||
+          sql_errno == ER_WRONG_OBJECT);
 }
 
 
@@ -351,7 +352,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
       lex->query_tables_last= &table->next_global;
       lex->query_tables_own_last= 0;
 
-      if (view_operator_func == NULL)
+      /*
+        CHECK TABLE command is allowed for views as well. Check on alter flags
+        to differentiate from ALTER TABLE...CHECK PARTITION on which view is not
+        allowed.
+      */
+      if (lex->alter_info.flags & Alter_info::ALTER_ADMIN_PARTITION ||
+          view_operator_func == NULL)
         table->required_type=FRMTYPE_TABLE;
 
       if (!thd->locked_tables_mode && repair_table_use_frm)
@@ -429,28 +436,15 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
           if (!table->table->part_info)
           {
             my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
-            if (gtid_rollback_must_be_skipped)
-              thd->skip_gtid_rollback= false;
-            DBUG_RETURN(TRUE);
+            result_code= HA_ADMIN_FAILED;
+            goto send_result;
           }
 
           if (set_part_state(alter_info, table->table->part_info, PART_ADMIN))
           {
-            char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
-            size_t length;
-            DBUG_PRINT("admin", ("sending non existent partition error"));
-            protocol->prepare_for_resend();
-            protocol->store(table_name, system_charset_info);
-            protocol->store(operator_name, system_charset_info);
-            protocol->store(STRING_WITH_LEN("error"), system_charset_info);
-            length= my_snprintf(buff, sizeof(buff),
-                                ER(ER_DROP_PARTITION_NON_EXISTENT),
-                                table_name);
-            protocol->store(buff, length, system_charset_info);
-            if(protocol->write())
-              goto err;
-            my_eof(thd);
-            goto err;
+            my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), table_name);
+            result_code= HA_ADMIN_FAILED;
+            goto send_result;
           }
         }
       }
@@ -1071,6 +1065,7 @@ bool Sql_cmd_analyze_table::execute(THD *thd)
   if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
                          FALSE, UINT_MAX, FALSE))
     goto error;
+  WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
   thd->enable_slow_log= opt_log_slow_admin_statements;
   res= mysql_admin_table(thd, first_table, &thd->lex->check_opt,
                          "analyze", lock_type, 1, 0, 0, 0,
@@ -1124,6 +1119,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_WRTCHK(NULL, NULL, first_table);
   thd->enable_slow_log= opt_log_slow_admin_statements;
   res= (specialflag & SPECIAL_NO_NEW_FUNC) ?
     mysql_recreate_table(thd, first_table, true) :
@@ -1156,6 +1152,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_WRTCHK(NULL, NULL, first_table);
   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),
index 3cf1c9393be866c79be5c81bfa13390a590d3e14..167daff7b6b39805b3ce4cba6f4bcaf9a3b74ffa 100644 (file)
@@ -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 */
 }
 
 
index 5b2954806160bff71711da7e52d4f8269a7ef358..c3fe8a24212ed8fc7638f1df2231582ed47b38dc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights
    reserved.
 
    This program is free software; you can redistribute it and/or modify
@@ -71,59 +71,56 @@ public:
   // Set for DISABLE KEYS | ENABLE KEYS
   static const uint ALTER_KEYS_ONOFF            = 1L <<  9;
 
-  // Set for CONVERT TO CHARACTER SET
-  static const uint ALTER_CONVERT               = 1L << 10;
-
   // Set for FORCE
   // Set for ENGINE(same engine)
   // Set by mysql_recreate_table()
-  static const uint ALTER_RECREATE              = 1L << 11;
+  static const uint ALTER_RECREATE              = 1L << 10;
 
   // Set for ADD PARTITION
-  static const uint ALTER_ADD_PARTITION         = 1L << 12;
+  static const uint ALTER_ADD_PARTITION         = 1L << 11;
 
   // Set for DROP PARTITION
-  static const uint ALTER_DROP_PARTITION        = 1L << 13;
+  static const uint ALTER_DROP_PARTITION        = 1L << 12;
 
   // Set for COALESCE PARTITION
-  static const uint ALTER_COALESCE_PARTITION    = 1L << 14;
+  static const uint ALTER_COALESCE_PARTITION    = 1L << 13;
 
   // Set for REORGANIZE PARTITION ... INTO
-  static const uint ALTER_REORGANIZE_PARTITION  = 1L << 15;
+  static const uint ALTER_REORGANIZE_PARTITION  = 1L << 14;
 
   // Set for partition_options
-  static const uint ALTER_PARTITION             = 1L << 16;
+  static const uint ALTER_PARTITION             = 1L << 15;
 
   // Set for LOAD INDEX INTO CACHE ... PARTITION
   // Set for CACHE INDEX ... PARTITION
-  static const uint ALTER_ADMIN_PARTITION       = 1L << 17;
+  static const uint ALTER_ADMIN_PARTITION       = 1L << 16;
 
   // Set for REORGANIZE PARTITION
-  static const uint ALTER_TABLE_REORG           = 1L << 18;
+  static const uint ALTER_TABLE_REORG           = 1L << 17;
 
   // Set for REBUILD PARTITION
-  static const uint ALTER_REBUILD_PARTITION     = 1L << 19;
+  static const uint ALTER_REBUILD_PARTITION     = 1L << 18;
 
   // Set for partitioning operations specifying ALL keyword
-  static const uint ALTER_ALL_PARTITION         = 1L << 20;
+  static const uint ALTER_ALL_PARTITION         = 1L << 19;
 
   // Set for REMOVE PARTITIONING
-  static const uint ALTER_REMOVE_PARTITIONING   = 1L << 21;
+  static const uint ALTER_REMOVE_PARTITIONING   = 1L << 20;
 
   // Set for ADD FOREIGN KEY
-  static const uint ADD_FOREIGN_KEY             = 1L << 22;
+  static const uint ADD_FOREIGN_KEY             = 1L << 21;
 
   // Set for DROP FOREIGN KEY
-  static const uint DROP_FOREIGN_KEY            = 1L << 23;
+  static const uint DROP_FOREIGN_KEY            = 1L << 22;
 
   // Set for EXCHANGE PARITION
-  static const uint ALTER_EXCHANGE_PARTITION    = 1L << 24;
+  static const uint ALTER_EXCHANGE_PARTITION    = 1L << 23;
 
   // Set by Sql_cmd_alter_table_truncate_partition::execute()
-  static const uint ALTER_TRUNCATE_PARTITION    = 1L << 25;
+  static const uint ALTER_TRUNCATE_PARTITION    = 1L << 24;
 
   // Set for ADD [COLUMN] FIRST | AFTER
-  static const uint ALTER_COLUMN_ORDER          = 1L << 26;
+  static const uint ALTER_COLUMN_ORDER          = 1L << 25;
 
 
   enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
index 37dca6839e729142b60ffb95e2e0a01f117693f2..ef14fefae3d668532cf54f37a3231c68e86d6a66 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2013, 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
@@ -120,8 +120,10 @@ static audit_handler_t audit_handlers[] =
   general_class_handler, connection_class_handler
 };
 
+#ifndef DBUG_OFF
 static const uint audit_handlers_count=
   (sizeof(audit_handlers) / sizeof(audit_handler_t));
+#endif /* DBUG_OFF */
 
 
 /**
@@ -342,8 +344,7 @@ int initialize_audit_plugin(st_plugin_int *plugin)
 {
   st_mysql_audit *data= (st_mysql_audit*) plugin->plugin->info;
   
-  if (!data->class_mask || !data->event_notify ||
-      !data->class_mask[0])
+  if (!data->event_notify || !data->class_mask[0])
   {
     sql_print_error("Plugin '%s' has invalid data.",
                     plugin->name.str);
@@ -492,6 +493,12 @@ static void event_class_dispatch(THD *thd, unsigned int event_class,
 }
 
 
+/**  There's at least one active audit plugin tracking the general events */
+bool is_any_audit_plugin_active(THD *thd __attribute__((unused)))
+{
+  return (mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK);
+}
+
 #else /* EMBEDDED_LIBRARY */
 
 
index 30b868997833555caa04c5eb85091715cc5898e6..993068ca90ed17cceea64ed60c56800b9c37adc4 100644 (file)
@@ -1,7 +1,4 @@
-#ifndef SQL_AUDIT_INCLUDED
-#define SQL_AUDIT_INCLUDED
-
-/* Copyright (c) 2007, 2013, 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
@@ -16,6 +13,8 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
 
+#ifndef SQL_AUDIT_INCLUDED
+#define SQL_AUDIT_INCLUDED
 
 #include <my_global.h>
 
@@ -38,6 +37,7 @@ extern void mysql_audit_acquire_plugins(THD *thd, uint event_class);
 #ifndef EMBEDDED_LIBRARY
 extern void mysql_audit_notify(THD *thd, uint event_class,
                                uint event_subtype, ...);
+bool is_any_audit_plugin_active(THD *thd __attribute__((unused)));
 #else
 #define mysql_audit_notify(...)
 #endif
@@ -59,29 +59,47 @@ static inline uint make_user_name(THD *thd, char *buf)
   Call audit plugins of GENERAL audit class, MYSQL_AUDIT_GENERAL_LOG subtype.
   
   @param[in] thd
-  @param[in] time             time that event occurred
-  @param[in] user             User name
-  @param[in] userlen          User name length
   @param[in] cmd              Command name
   @param[in] cmdlen           Command name length
-  @param[in] query            Query string
-  @param[in] querylen         Query string length
-*/
+  @param[in] query_str        query text. Leave empty to fetch it from THD
+  @param[in] query_len        query text length. 0 to fetch it from THD
+  */
  
 static inline
-void mysql_audit_general_log(THD *thd, time_t time,
-                             const char *user, uint userlen,
-                             const char *cmd, uint cmdlen,
-                             const char *query, uint querylen)
+void mysql_audit_general_log(THD *thd, const char *cmd, uint cmdlen,
+                             const char *query_str, size_t query_len)
 {
 #ifndef EMBEDDED_LIBRARY
   if (mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK)
   {
     MYSQL_LEX_STRING sql_command, ip, host, external_user;
+    MYSQL_LEX_STRING query={ (char *)query_str, query_len };
     static MYSQL_LEX_STRING empty= { C_STRING_WITH_LEN("") };
+    ha_rows rows= 0;
+    int error_code= 0; 
+    char user_buff[MAX_USER_HOST_SIZE + 1];
+    const char *user= user_buff;
+    uint userlen= make_user_name(thd, user_buff);
+    time_t time= (time_t) thd->start_time.tv_sec;
 
     if (thd)
     {
+      if (!query_len)
+      {
+        /* no query specified, fetch from THD */
+        if (!thd->rewritten_query.length())
+          mysql_rewrite_query(thd);
+        if (thd->rewritten_query.length())
+        {
+          query.str= (char *) thd->rewritten_query.ptr();
+          query.length= thd->rewritten_query.length();
+        }
+        else
+        {
+          query.str= thd->query();
+          query.length= thd->query_length();
+        }
+      }
       ip.str= (char *) thd->security_ctx->get_ip()->ptr();
       ip.length= thd->security_ctx->get_ip()->length();
       host.str= (char *) thd->security_ctx->get_host()->ptr();
@@ -102,8 +120,9 @@ void mysql_audit_general_log(THD *thd, time_t time,
       : global_system_variables.character_set_client;
 
     mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, MYSQL_AUDIT_GENERAL_LOG,
-                       0, time, user, userlen, cmd, cmdlen, query, querylen,
-                       clientcs, 0, sql_command, host, external_user, ip);
+                       error_code, time, user, userlen, cmd, cmdlen, query.str,
+                       query.length, clientcs, rows, sql_command, host,
+                       external_user, ip);
   }
 #endif
 }
@@ -197,7 +216,18 @@ void mysql_audit_general(THD *thd, uint event_subtype,
 #define MYSQL_AUDIT_NOTIFY_CONNECTION_DISCONNECT(thd, errcode)\
   mysql_audit_notify(\
   (thd), MYSQL_AUDIT_CONNECTION_CLASS, MYSQL_AUDIT_CONNECTION_DISCONNECT,\
-  (errcode), (thd)->thread_id, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0)
+  (errcode), (thd)->thread_id,\
+  (thd)->security_ctx->user,\
+  (thd)->security_ctx->user ? strlen((thd)->security_ctx->user) : 0,\
+  (thd)->security_ctx->priv_user, strlen((thd)->security_ctx->priv_user),\
+  (thd)->security_ctx->get_external_user()->ptr(),\
+  (thd)->security_ctx->get_external_user()->length(),\
+  (thd)->security_ctx->proxy_user, strlen((thd)->security_ctx->proxy_user),\
+  (thd)->security_ctx->get_host()->ptr(),\
+  (thd)->security_ctx->get_host()->length(),\
+  (thd)->security_ctx->get_ip()->ptr(),\
+  (thd)->security_ctx->get_ip()->length(),\
+  (thd)->db, (thd)->db ? strlen((thd)->db) : 0)
 
 #define MYSQL_AUDIT_NOTIFY_CONNECTION_CHANGE_USER(thd) mysql_audit_notify(\
   (thd), MYSQL_AUDIT_CONNECTION_CLASS, MYSQL_AUDIT_CONNECTION_CHANGE_USER,\
index ef5e7dc34bbfdad16604e63e614478c4b7682756..93d45168465001657e17266b6242bf852c4299e3 100644 (file)
@@ -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
@@ -57,6 +57,9 @@
 #include <io.h>
 #endif
 #include "table_cache.h" // Table_cache_manager, Table_cache
+#ifdef WITH_WSREP
+#include "wsrep_mysqld.h"
+#endif /* WITH_WSREP */
 
 
 bool
@@ -237,11 +240,6 @@ static bool check_and_update_table_version(THD *thd, TABLE_LIST *tables,
                                            TABLE_SHARE *table_share);
 static bool open_table_entry_fini(THD *thd, TABLE_SHARE *share, TABLE *entry);
 static bool auto_repair_table(THD *thd, TABLE_LIST *table_list);
-static bool
-has_write_table_with_auto_increment(TABLE_LIST *tables);
-static bool
-has_write_table_with_auto_increment_and_select(TABLE_LIST *tables);
-static bool has_write_table_auto_increment_not_first_in_pk(TABLE_LIST *tables);
 
 
 /**
@@ -503,7 +501,7 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list,
   if (my_hash_insert(&table_def_cache, (uchar*) share))
   {
     free_table_share(share);
-    DBUG_RETURN(0);                            // return error
+    DBUG_RETURN(0);       // return error
   }
   if (open_table_def(thd, share, db_flags))
   {
@@ -511,10 +509,11 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list,
     (void) my_hash_delete(&table_def_cache, (uchar*) share);
     DBUG_RETURN(0);
   }
-  share->ref_count++;                          // Mark in use
+  share->ref_count++;        // Mark in use
 
 #ifdef HAVE_PSI_TABLE_INTERFACE
-  share->m_psi= PSI_TABLE_CALL(get_table_share)(false, share);
+  share->m_psi=
+     PSI_TABLE_CALL(get_table_share)((share->tmp_table != NO_TMP_TABLE), share);
 #else
   share->m_psi= NULL;
 #endif
@@ -995,6 +994,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables,
 
   while (found && ! thd->killed)
   {
+    WSREP_DEBUG("close_cached_tables, wait loop");
     TABLE_SHARE *share;
     found= FALSE;
     /*
@@ -1561,13 +1561,20 @@ bool close_temporary_tables(THD *thd)
   DBUG_ASSERT(!thd->slave_thread ||
               thd->system_thread != SYSTEM_THREAD_SLAVE_WORKER);
 
+  /*
+    Ensure we don't have open HANDLERs for tables we are about to close.
+    This is necessary when close_temporary_tables() is called as part
+    of execution of BINLOG statement (e.g. for format description event).
+  */
+  mysql_ha_rm_temporary_tables(thd);
   if (!mysql_bin_log.is_open())
   {
     TABLE *tmp_next;
-    for (table= thd->temporary_tables; table; table= tmp_next)
+    for (TABLE *t= thd->temporary_tables; t; t= tmp_next)
     {
-      tmp_next= table->next;
-      close_temporary(table, 1, 1);
+      tmp_next= t->next;
+      mysql_lock_remove(thd, thd->lock, t);
+      close_temporary(t, 1, 1);
     }
     thd->temporary_tables= 0;
     if (thd->slave_thread)
@@ -1696,6 +1703,7 @@ bool close_temporary_tables(THD *thd)
         }
 
         next= table->next;
+        mysql_lock_remove(thd, thd->lock, table);
         close_temporary(table, 1, 1);
       }
       thd->clear_error();
@@ -2789,6 +2797,16 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx)
       */
       if (dd_frm_type(thd, path, &not_used) == FRMTYPE_VIEW)
       {
+        /*
+          If parent_l of the table_list is non null then a merge table
+          has this view as child table, which is not supported.
+        */
+        if (table_list->parent_l)
+        {
+          my_error(ER_WRONG_MRG_TABLE, MYF(0));
+          DBUG_RETURN(true);
+        }
+
         if (!tdc_open_view(thd, table_list, alias, key, key_length,
                            CHECK_METADATA_VERSION))
         {
@@ -4071,10 +4089,11 @@ request_backoff_action(enum_open_table_action action_arg,
     * We met a broken table that needs repair, or a table that
       is not present on this MySQL server and needs re-discovery.
       To perform the action, we need an exclusive metadata lock on
-      the table. Acquiring an X lock while holding other shared
-      locks is very deadlock-prone. If this is a multi- statement
-      transaction that holds metadata locks for completed
-      statements, we don't do it, and report an error instead.
+      the table. Acquiring X lock while holding other shared
+      locks can easily lead to deadlocks. We rely on MDL deadlock
+      detector to discover them. If this is a multi-statement
+      transaction that holds metadata locks for completed statements,
+      we should keep these locks after discovery/repair.
       The action type in this case is OT_DISCOVER or OT_REPAIR.
     * Our attempt to acquire an MDL lock lead to a deadlock,
       detected by the MDL deadlock detector. The current
@@ -4115,10 +4134,10 @@ request_backoff_action(enum_open_table_action action_arg,
       keep tables open between statements and a livelock
       is not possible.
   */
-  if (action_arg != OT_REOPEN_TABLES && m_has_locks)
+  if (action_arg == OT_BACKOFF_AND_RETRY && m_has_locks)
   {
     my_error(ER_LOCK_DEADLOCK, MYF(0));
-    mark_transaction_to_rollback(m_thd, true);
+    m_thd->mark_transaction_to_rollback(true);
     return TRUE;
   }
   /*
@@ -4142,6 +4161,32 @@ request_backoff_action(enum_open_table_action action_arg,
 }
 
 
+/**
+  An error handler to mark transaction to rollback on DEADLOCK error
+  during DISCOVER / REPAIR.
+*/
+class MDL_deadlock_discovery_repair_handler : public Internal_error_handler
+{
+public:
+  virtual bool handle_condition(THD *thd,
+                                uint sql_errno,
+                                const char* sqlstate,
+                                Sql_condition::enum_warning_level level,
+                                const char* msg,
+                                Sql_condition ** cond_hdl)
+  {
+    if (sql_errno == ER_LOCK_DEADLOCK)
+    {
+      thd->mark_transaction_to_rollback(true);
+    }
+    /*
+      We have marked this transaction to rollback. Return false to allow
+      error to be reported or handled by other handlers.
+    */
+    return false;
+  }
+};
+
 /**
    Recover from failed attempt of open table by performing requested action.
 
@@ -4156,7 +4201,33 @@ bool
 Open_table_context::
 recover_from_failed_open()
 {
+  if (m_action == OT_REPAIR)
+  {
+    DEBUG_SYNC(m_thd, "recover_ot_repair");
+  }
+
+  /*
+    Skip repair and discovery in IS-queries as they require X lock
+    which could lead to delays or deadlock. Instead set
+    ER_WARN_I_S_SKIPPED_TABLE which will be converted to a warning
+    later.
+   */
+  if ((m_action == OT_REPAIR || m_action == OT_DISCOVER)
+      && (m_flags & MYSQL_OPEN_FAIL_ON_MDL_CONFLICT))
+  {
+    my_error(ER_WARN_I_S_SKIPPED_TABLE, MYF(0),
+             m_failed_table->mdl_request.key.db_name(),
+             m_failed_table->mdl_request.key.name());
+    return true;
+  }
+
   bool result= FALSE;
+  MDL_deadlock_discovery_repair_handler handler;
+  /*
+    Install error handler to mark transaction to rollback on DEADLOCK error.
+  */
+  m_thd->push_internal_handler(&handler);
+
   /* Execute the action. */
   switch (m_action)
   {
@@ -4177,7 +4248,12 @@ recover_from_failed_open()
 
         m_thd->get_stmt_da()->clear_warning_info(m_thd->query_id);
         m_thd->clear_error();                 // Clear error message
-        m_thd->mdl_context.release_transactional_locks();
+        /*
+          Rollback to start of the current statement to release exclusive lock
+          on table which was discovered but preserve locks from previous statements
+          in current transaction.
+        */
+        m_thd->mdl_context.rollback_to_savepoint(start_of_statement_svp());
         break;
       }
     case OT_REPAIR:
@@ -4190,12 +4266,18 @@ recover_from_failed_open()
                          m_failed_table->table_name, FALSE);
 
         result= auto_repair_table(m_thd, m_failed_table);
-        m_thd->mdl_context.release_transactional_locks();
+        /*
+          Rollback to start of the current statement to release exclusive lock
+          on table which was discovered but preserve locks from previous statements
+          in current transaction.
+        */
+        m_thd->mdl_context.rollback_to_savepoint(start_of_statement_svp());
         break;
       }
     default:
       DBUG_ASSERT(0);
   }
+  m_thd->pop_internal_handler();
   /*
     Reset the pointers to conflicting MDL request and the
     TABLE_LIST element, set when we need auto-discovery or repair,
@@ -4504,10 +4586,16 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables,
       obtain proper metadata locks and do other necessary steps like
       stored routine processing.
     */
-    tables->db= tables->view_db.str;
-    tables->db_length= tables->view_db.length;
-    tables->table_name= tables->view_name.str;
-    tables->table_name_length= tables->view_name.length;
+    if (tables->db != tables->view_db.str)
+    {
+      tables->db= tables->view_db.str;
+      tables->db_length= tables->view_db.length;
+    }
+    if (tables->table_name != tables->view_name.str)
+    {
+      tables->table_name= tables->view_name.str;
+      tables->table_name_length= tables->view_name.length;
+    }
   }
   /*
     If this TABLE_LIST object is a placeholder for an information_schema
@@ -5229,6 +5317,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 && 
@@ -5907,64 +6011,6 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count,
        *(ptr++)= table->table;
     }
 
-    /*
-    DML statements that modify a table with an auto_increment column based on
-    rows selected from a table are unsafe as the order in which the rows are
-    fetched fron the select tables cannot be determined and may differ on
-    master and slave.
-    */
-    if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables &&
-        has_write_table_with_auto_increment_and_select(tables))
-      thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT);
-    /* Todo: merge all has_write_table_auto_inc with decide_logging_format */
-    if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables)
-    {
-      if (has_write_table_auto_increment_not_first_in_pk(tables))
-        thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST);
-    }
-
-    /* 
-     INSERT...ON DUPLICATE KEY UPDATE on a table with more than one unique keys
-     can be unsafe.
-     */
-    uint unique_keys= 0;
-    for (TABLE_LIST *query_table= tables; query_table && unique_keys <= 1;
-         query_table= query_table->next_global)
-      if(query_table->table)
-      {
-        uint keys= query_table->table->s->keys, i= 0;
-        unique_keys= 0;
-        for (KEY* keyinfo= query_table->table->s->key_info;
-             i < keys && unique_keys <= 1; i++, keyinfo++)
-        {
-          if (keyinfo->flags & HA_NOSAME)
-            unique_keys++;
-        }
-        if (!query_table->placeholder() &&
-            query_table->lock_type >= TL_WRITE_ALLOW_WRITE &&
-            unique_keys > 1 && thd->lex->sql_command == SQLCOM_INSERT &&
-            /* Duplicate key update is not supported by INSERT DELAYED */
-            thd->get_command() != COM_DELAYED_INSERT &&
-            thd->lex->duplicates == DUP_UPDATE)
-          thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS);
-      }
-    /* We have to emulate LOCK TABLES if we are statement needs prelocking. */
-    if (thd->lex->requires_prelocking())
-    {
-
-      /*
-        A query that modifies autoinc column in sub-statement can make the 
-        master and slave inconsistent.
-        We can solve these problems in mixed mode by switching to binlogging 
-        if at least one updated table is used by sub-statement
-      */
-      if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables && 
-          has_write_table_with_auto_increment(thd->lex->first_not_own_table()))
-        thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS);
-    }
-
     DEBUG_SYNC(thd, "before_lock_tables_takes_lock");
 
     if (! (thd->lock= mysql_lock_tables(thd, start, (uint) (ptr - start),
@@ -6539,10 +6585,7 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
           Use own arena for Prepared Statements or data will be freed after
           PREPARE.
         */
-        Prepared_stmt_arena_holder ps_arena_holder(
-          thd,
-          register_tree_change &&
-            thd->stmt_arena->is_stmt_prepare_or_first_stmt_execute());
+        Prepared_stmt_arena_holder ps_arena_holder(thd, register_tree_change);
 
         /*
           create_item() may, or may not create a new Item, depending on
@@ -9365,98 +9408,6 @@ bool is_equal(const LEX_STRING *a, const LEX_STRING *b)
   return a->length == b->length && !strncmp(a->str, b->str, a->length);
 }
 
-
-/*
-  Tells if two (or more) tables have auto_increment columns and we want to
-  lock those tables with a write lock.
-
-  SYNOPSIS
-    has_two_write_locked_tables_with_auto_increment
-      tables        Table list
-
-  NOTES:
-    Call this function only when you have established the list of all tables
-    which you'll want to update (including stored functions, triggers, views
-    inside your statement).
-*/
-
-static bool
-has_write_table_with_auto_increment(TABLE_LIST *tables)
-{
-  for (TABLE_LIST *table= tables; table; table= table->next_global)
-  {
-    /* we must do preliminary checks as table->table may be NULL */
-    if (!table->placeholder() &&
-        table->table->found_next_number_field &&
-        (table->lock_type >= TL_WRITE_ALLOW_WRITE))
-      return 1;
-  }
-
-  return 0;
-}
-
-/*
-   checks if we have select tables in the table list and write tables
-   with auto-increment column.
-
-  SYNOPSIS
-   has_two_write_locked_tables_with_auto_increment_and_select
-      tables        Table list
-
-  RETURN VALUES
-
-   -true if the table list has atleast one table with auto-increment column
-
-
-         and atleast one table to select from.
-   -false otherwise
-*/
-
-static bool
-has_write_table_with_auto_increment_and_select(TABLE_LIST *tables)
-{
-  bool has_select= false;
-  bool has_auto_increment_tables = has_write_table_with_auto_increment(tables);
-  for(TABLE_LIST *table= tables; table; table= table->next_global)
-  {
-     if (!table->placeholder() &&
-        (table->lock_type <= TL_READ_NO_INSERT))
-      {
-        has_select= true;
-        break;
-      }
-  }
-  return(has_select && has_auto_increment_tables);
-}
-
-/*
-  Tells if there is a table whose auto_increment column is a part
-  of a compound primary key while is not the first column in
-  the table definition.
-
-  @param tables Table list
-
-  @return true if the table exists, fais if does not.
-*/
-
-static bool
-has_write_table_auto_increment_not_first_in_pk(TABLE_LIST *tables)
-{
-  for (TABLE_LIST *table= tables; table; table= table->next_global)
-  {
-    /* we must do preliminary checks as table->table may be NULL */
-    if (!table->placeholder() &&
-        table->table->found_next_number_field &&
-        (table->lock_type >= TL_WRITE_ALLOW_WRITE)
-        && table->table->s->next_number_keypart != 0)
-      return 1;
-  }
-
-  return 0;
-}
-
-
-
 /*
   Open and lock system tables for read.
 
index 33983885e14c41cbd2c3bec69a55fe9daf060111..9ea57964fd7b3b1c8e0829b9f6f96d95ff6b6b28 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+   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
@@ -188,7 +188,7 @@ void mysql_client_binlog_statement(THD* thd)
        strptr < thd->lex->comment.str + thd->lex->comment.length ; )
   {
     char const *endptr= 0;
-    int bytes_decoded= base64_decode(strptr, coded_len, buf, &endptr,
+    int64 bytes_decoded= base64_decode(strptr, coded_len, buf, &endptr,
                                      MY_BASE64_DECODE_ALLOW_MULTIPLE_CHUNKS);
 
 #ifndef HAVE_purify
@@ -197,7 +197,7 @@ void mysql_client_binlog_statement(THD* thd)
         since it will read from unassigned memory.
       */
     DBUG_PRINT("info",
-               ("bytes_decoded: %d  strptr: 0x%lx  endptr: 0x%lx ('%c':%d)",
+               ("bytes_decoded: %lld  strptr: 0x%lx  endptr: 0x%lx ('%c':%d)",
                 bytes_decoded, (long) strptr, (long) endptr, *endptr,
                 *endptr));
 #endif
@@ -226,7 +226,7 @@ void mysql_client_binlog_statement(THD* thd)
       order to be able to read exactly what is necessary.
     */
 
-    DBUG_PRINT("info",("binlog base64 decoded_len: %lu  bytes_decoded: %d",
+    DBUG_PRINT("info",("binlog base64 decoded_len: %lu  bytes_decoded: %lld",
                        (ulong) decoded_len, bytes_decoded));
 
     /*
@@ -246,7 +246,7 @@ void mysql_client_binlog_statement(THD* thd)
         my_error(ER_SYNTAX_ERROR, MYF(0));
         goto end;
       }
-      DBUG_PRINT("info", ("event_len=%lu, bytes_decoded=%d",
+      DBUG_PRINT("info", ("event_len=%lu, bytes_decoded=%lld",
                           event_len, bytes_decoded));
 
       if (check_event_type(bufptr[EVENT_TYPE_OFFSET], rli))
index cf7006fc7ce2984e5aacdd322858c4f229af7015..a89bd06ecc236eee9cad1ea5beb3980a75cb3d17 100644 (file)
@@ -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
 };
index 115251432179392134360d58e44b1a1de7e3a718..31c83e75678bef2cfa4512cfb13299ea6a1d317e 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2013, 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
@@ -404,6 +405,9 @@ using std::max;
 #define QC_DEBUG_SYNC(name)
 #endif
 
+// Max aligned size for ulong type query_cache_min_res_unit.
+static const ulong max_aligned_min_res_unit_size= ((ULONG_MAX) &
+                                                   (~(sizeof(double) - 1)));
 
 /**
   Thread state to be used when the query cache lock needs to be acquired.
@@ -1168,6 +1172,9 @@ ulong Query_cache::set_min_res_unit(ulong size)
 {
   if (size < min_allocation_unit)
     size= min_allocation_unit;
+  else if (size > max_aligned_min_res_unit_size)
+    size= max_aligned_min_res_unit_size;
+
   return (min_result_data_size= ALIGN_SIZE(size));
 }
 
@@ -1642,6 +1649,13 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
                           (int)flags.autocommit));
   memcpy((uchar *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)),
         (uchar*) &flags, QUERY_CACHE_FLAGS_SIZE);
+
+#ifdef WITH_WSREP
+  bool once_more;
+  once_more= true;
+lookup:
+#endif /* WITH_WSREP */
+
   query_block = (Query_cache_block *)  my_hash_search(&queries, (uchar*) sql,
                                                       tot_length);
   /* Quick abort on unlocked data */
@@ -1654,6 +1668,19 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
   }
   DBUG_PRINT("qcache", ("Query in query hash 0x%lx", (ulong)query_block));
 
+#ifdef WITH_WSREP
+  if (once_more && WSREP_CLIENT(thd) && wsrep_must_sync_wait(thd))
+  {
+    unlock();
+    if (wsrep_sync_wait(thd))
+      goto err;
+    if (try_lock(TRUE))
+      goto err;
+    once_more= false;
+    goto lookup;
+  }
+#endif /* WITH_WSREP */
+
   /* Now lock and test that nothing changed while blocks was unlocked */
   BLOCK_LOCK_RD(query_block);
 
@@ -4048,13 +4075,13 @@ my_bool Query_cache::move_by_type(uchar **border,
   case Query_cache_block::RES_CONT:
   case Query_cache_block::RESULT:
   {
-    DBUG_PRINT("qcache", ("block 0x%lx RES* (%d)", (ulong) block,
-               (int) block->type));
-    if (*border == 0)
-      break;
-    Query_cache_block *query_block= block->result()->parent();
-    BLOCK_LOCK_WR(query_block);
-    Query_cache_block *next= block->next, *prev= block->prev;
+    DBUG_PRINT("qcache", ("block 0x%lx RES* (%d)", (ulong) block,\r
+               (int) block->type));\r
+    if (*border == 0)\r
+      break;\r
+    Query_cache_block *query_block= block->result()->parent();\r
+    BLOCK_LOCK_WR(query_block);\r
+    Query_cache_block *next= block->next, *prev= block->prev;\r
     Query_cache_block::block_type type= block->type;
     ulong len = block->length, used = block->used;
     Query_cache_block *pprev = block->pprev,
index 79d56addb2eb81aa9baf4482b03d9a8bf1aa1366..3208e0412b19aff118d2cf9c1a65e9b88f49d0dc 100644 (file)
@@ -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
 #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"
@@ -521,14 +525,13 @@ ulong get_max_connections(void)
   return max_connections;
 }
 
-/*
-  The following functions form part of the C plugin API
-*/
-
-extern "C" int mysql_tmpfile(const char *prefix)
+int mysql_tmpfile_path(const char *path, const char *prefix)
 {
+  DBUG_ASSERT(path != NULL);
+  DBUG_ASSERT((strlen(path) + strlen(prefix)) <= FN_REFLEN);
+
   char filename[FN_REFLEN];
-  File fd = create_temp_file(filename, mysql_tmpdir, prefix,
+  File fd = create_temp_file(filename, path, prefix,
 #ifdef __WIN__
                              O_BINARY | O_TRUNC | O_SEQUENTIAL |
                              O_SHORT_LIVED |
@@ -549,6 +552,14 @@ extern "C" int mysql_tmpfile(const char *prefix)
   return fd;
 }
 
+/*
+  The following functions form part of the C plugin API
+*/
+
+extern "C" int mysql_tmpfile(const char *prefix)
+{
+  return mysql_tmpfile_path(mysql_tmpdir, prefix);
+}
 
 extern "C"
 int thd_in_lock_tables(const THD *thd)
@@ -816,6 +827,178 @@ 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) ? ((!opt_log_raw) && thd->rewritten_query.length() ?
+                  thd->rewritten_query.c_ptr_safe() : 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 +1026,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,12 +1060,17 @@ 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),
    in_sub_stmt(0),
    fill_status_recursion_level(0),
+   fill_variables_recursion_level(0),
    binlog_row_event_extra_data(NULL),
    binlog_unsafe_warning_flags(0),
    binlog_table_maps(0),
@@ -898,19 +1085,30 @@ THD::THD(bool enable_plugins)
    first_successful_insert_id_in_cur_stmt(0),
    stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE),
    m_examined_row_count(0),
+   m_digest(NULL),
    m_statement_psi(NULL),
    m_idle_psi(NULL),
    m_server_idle(false),
    next_to_commit(NULL),
    is_fatal_error(0),
    transaction_rollback_request(0),
-   is_fatal_sub_stmt_error(0),
+   is_fatal_sub_stmt_error(false),
    rand_used(0),
    time_zone_used(0),
    in_lock_tables(0),
    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),
@@ -918,7 +1116,8 @@ THD::THD(bool enable_plugins)
    m_enable_plugins(enable_plugins),
    owned_gtid_set(global_sid_map),
    main_da(0, false),
-   m_stmt_da(&main_da)
+   m_stmt_da(&main_da),
+   duplicate_slave_uuid(false)
 {
   ulong tmp;
 
@@ -1001,6 +1200,23 @@ 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;
+  wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+#endif
   /* Call to init() below requires fully initialized Open_tables_state. */
   reset_open_tables_state();
 
@@ -1033,6 +1249,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;
@@ -1044,6 +1267,13 @@ THD::THD(bool enable_plugins)
 #ifndef DBUG_OFF
   gis_debug= 0;
 #endif
+
+  m_token_array= NULL;
+  if (max_digest_length > 0)
+  {
+    m_token_array= (unsigned char*) my_malloc(max_digest_length,
+                                              MYF(MY_WME));
+  }
 }
 
 
@@ -1379,6 +1609,23 @@ 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;
+  wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+#endif
   binlog_row_event_extra_data= 0;
 
   if (variables.sql_log_bin)
@@ -1444,6 +1691,7 @@ void THD::change_user(void)
 {
   mysql_mutex_lock(&LOCK_status);
   add_to_status(&global_status_var, &status_var);
+  memset(&status_var, 0, sizeof(status_var));
   mysql_mutex_unlock(&LOCK_status);
 
   cleanup();
@@ -1467,6 +1715,7 @@ void THD::cleanup(void)
 {
   DBUG_ENTER("THD::cleanup");
   DBUG_ASSERT(cleanup_done == 0);
+  DEBUG_SYNC(this, "thd_cleanup_start");
 
   killed= KILL_CONNECTION;
 #ifdef ENABLE_WHEN_BINLOG_WILL_BE_ABLE_TO_PREPARE
@@ -1546,6 +1795,7 @@ void THD::release_resources()
 
   mysql_mutex_lock(&LOCK_status);
   add_to_status(&global_status_var, &status_var);
+  memset(&status_var, 0, sizeof(status_var));
   mysql_mutex_unlock(&LOCK_status);
 
   /* Ensure that no one is using THD */
@@ -1573,6 +1823,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;
+  wsrep_free_status(this);
+#endif
 }
 
 
@@ -1626,6 +1883,11 @@ THD::~THD()
 #endif
 
   free_root(&main_mem_root, MYF(0));
+
+  if (m_token_array != NULL)
+  {
+    my_free(m_token_array);
+  }
   DBUG_VOID_RETURN;
 }
 
@@ -1873,7 +2135,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);
   }
@@ -1961,6 +2235,7 @@ bool THD::restore_globals()
 
 void THD::cleanup_after_query()
 {
+
   /*
     Reset rand_used so that detection of calls to rand() will save random 
     seeds if needed by the slave.
@@ -1978,7 +2253,6 @@ void THD::cleanup_after_query()
     auto_inc_intervals_in_cur_stmt_for_binlog.empty();
     rand_used= 0;
     binlog_accessed_db_names= NULL;
-    m_trans_fixed_log_file= NULL;
 
     if (gtid_mode > 0)
       gtid_post_statement_checks(this);
@@ -1996,6 +2270,14 @@ void THD::cleanup_after_query()
       auto_inc_intervals_forced.empty();
 #endif
   }
+
+  /*
+    In case of stored procedures, stored functions, triggers and events
+    m_trans_fixed_log_file will not be set to NULL. The memory will be reused.
+  */
+  if (!sp_runtime_ctx)
+    m_trans_fixed_log_file= NULL;
+
   /*
     Forget the binlog stmt filter for the next query.
     There are some code paths that:
@@ -2029,6 +2311,10 @@ void THD::cleanup_after_query()
   if (rli_slave)
     rli_slave->cleanup_after_query();
 #endif
+
+#ifdef WITH_WSREP
+  wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+#endif /* WITH_WSREP */
 }
 
 
@@ -2068,21 +2354,17 @@ LEX_STRING *THD::make_lex_string(LEX_STRING *lex_str,
 /*
   Convert a string to another character set
 
-  SYNOPSIS
-    convert_string()
-    to                         Store new allocated string here
-    to_cs                      New character set for allocated string
-    from                       String to convert
-    from_length                        Length of string to convert
-    from_cs                    Original character set
+  @param to             Store new allocated string here
+  @param to_cs          New character set for allocated string
+  @param from           String to convert
+  @param from_length    Length of string to convert
+  @param from_cs        Original character set
 
-  NOTES
-    to will be 0-terminated to make it easy to pass to system funcs
+  @note to will be 0-terminated to make it easy to pass to system funcs
 
-  RETURN
-    0  ok
-    1  End of memory.
-        In this case to->str will point to 0 and to->length will be 0.
+  @retval false ok
+  @retval true  End of memory.
+                In this case to->str will point to 0 and to->length will be 0.
 */
 
 bool THD::convert_string(LEX_STRING *to, const CHARSET_INFO *to_cs,
@@ -2091,15 +2373,26 @@ bool THD::convert_string(LEX_STRING *to, const CHARSET_INFO *to_cs,
 {
   DBUG_ENTER("convert_string");
   size_t new_length= to_cs->mbmaxlen * from_length;
-  uint dummy_errors;
+  uint errors= 0;
   if (!(to->str= (char*) alloc(new_length+1)))
   {
     to->length= 0;                             // Safety fix
     DBUG_RETURN(1);                            // EOM
   }
   to->length= copy_and_convert((char*) to->str, new_length, to_cs,
-                              from, from_length, from_cs, &dummy_errors);
+                              from, from_length, from_cs, &errors);
   to->str[to->length]=0;                       // Safety
+  if (errors != 0)
+  {
+    char printable_buff[32];
+    convert_to_printable(printable_buff, sizeof(printable_buff),
+                         from, from_length, from_cs, 6);
+    push_warning_printf(this, Sql_condition::WARN_LEVEL_WARN,
+                        ER_INVALID_CHARACTER_STRING,
+                        ER_THD(this, ER_INVALID_CHARACTER_STRING),
+                        from_cs->csname, printable_buff);
+  }
+
   DBUG_RETURN(0);
 }
 
@@ -2438,6 +2731,13 @@ bool sql_exchange::escaped_given(void)
 bool select_send::send_result_set_metadata(List<Item> &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;
@@ -4056,6 +4356,8 @@ bool Slow_log_throttle::log(THD *thd, bool eligible)
 bool Error_log_throttle::log(THD *thd)
 {
   ulonglong end_utime_of_query= thd->current_utime();
+  DBUG_EXECUTE_IF("simulate_error_throttle_expiry",
+                  end_utime_of_query+=Log_throttle::LOG_THROTTLE_WINDOW_SIZE;);
 
   /*
     If the window has expired, we'll try to write a summary line.
@@ -4206,15 +4508,21 @@ 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;
 }
 
 extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all)
 {
-  mark_transaction_to_rollback(thd, all);
+  DBUG_ASSERT(thd);
+  thd->mark_transaction_to_rollback(all);
 }
 
 extern "C" bool thd_binlog_filter_ok(const MYSQL_THD thd)
@@ -4224,7 +4532,7 @@ extern "C" bool thd_binlog_filter_ok(const MYSQL_THD thd)
 
 extern "C" bool thd_sqlcom_can_generate_row_events(const MYSQL_THD thd)
 {
-  return sqlcom_can_generate_row_events(thd);
+  return sqlcom_can_generate_row_events(thd->lex->sql_command);
 }
 
 extern "C" enum durability_properties thd_get_durability_property(const MYSQL_THD thd)
@@ -4444,9 +4752,12 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
     If we've left sub-statement mode, reset the fatal error flag.
     Otherwise keep the current value, to propagate it up the sub-statement
     stack.
+
+    NOTE: is_fatal_sub_stmt_error can be set only if we've been in the
+    sub-statement mode.
   */
   if (!in_sub_stmt)
-    is_fatal_sub_stmt_error= FALSE;
+    is_fatal_sub_stmt_error= false;
 
   if ((variables.option_bits & OPTION_BIN_LOG) && is_update_query(lex->sql_command) &&
        !is_current_stmt_binlog_format_row())
@@ -4699,27 +5010,29 @@ void THD::get_definer(LEX_USER *definer)
 /**
   Mark transaction to rollback and mark error as fatal to a sub-statement.
 
-  @param  thd   Thread handle
   @param  all   TRUE <=> rollback main transaction.
 */
 
-void mark_transaction_to_rollback(THD *thd, bool all)
+void THD::mark_transaction_to_rollback(bool all)
 {
-  if (thd)
-  {
-    thd->is_fatal_sub_stmt_error= TRUE;
-    thd->transaction_rollback_request= all;
-    /*
-      Aborted transactions can not be IGNOREd.
-      Switch off the IGNORE flag for the current
-      SELECT_LEX. This should allow my_error()
-      to report the error and abort the execution
-      flow, even in presence
-      of IGNORE clause.
-    */
-    if (thd->lex->current_select)
-      thd->lex->current_select->no_error= FALSE;
-  }
+  /*
+    There is no point in setting is_fatal_sub_stmt_error unless
+    we are actually in_sub_stmt.
+  */
+  if (in_sub_stmt)
+    is_fatal_sub_stmt_error= true;
+
+  transaction_rollback_request= all;
+  /*
+    Aborted transactions can not be IGNOREd.
+    Switch off the IGNORE flag for the current
+    SELECT_LEX. This should allow my_error()
+    to report the error and abort the execution
+    flow, even in presence
+    of IGNORE clause.
+  */
+  if (lex->current_select)
+    lex->current_select->no_error= false;
 }
 /***************************************************************************
   Handling of XA id cacheing
@@ -4948,3 +5261,15 @@ void THD::time_out_user_resource_limits()
 
   DBUG_VOID_RETURN;
 }
+/**
+  Determine if binlogging is disabled for this session
+  @retval 0 if the current statement binlogging is disabled
+  (could be because of binlog closed/binlog option
+  is set to false).
+  @retval 1 if the current statement will be binlogged
+*/
+bool THD::is_current_stmt_binlog_disabled() const
+{
+  return (!(variables.option_bits & OPTION_BIN_LOG) ||
+          !mysql_bin_log.is_open());
+}
index 17f0055c405cfaf92b080e86065940b929ce2534..4b7b11eb410ffcc385d59b7dcc974e73c2c325cf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
    reserved.
 
    This program is free software; you can redistribute it and/or modify
 #include "opt_trace_context.h"    /* Opt_trace_context */
 #include "rpl_gtid.h"
 
+#include "sql_digest_stream.h"            // sql_digest_state
+
 #include <mysql/psi/mysql_stage.h>
 #include <mysql/psi/mysql_statement.h>
 #include <mysql/psi/mysql_idle.h>
 #include <mysql_com_server.h>
 #include "sql_data_change.h"
+#include "my_atomic.h"
 
 #define FLAGSTR(V,F) ((V)&(F)?#F" ":"")
 
@@ -70,6 +73,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,12 +562,27 @@ 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;
+  ulong wsrep_OSU_method;
+  my_bool wsrep_dirty_reads;
+  ulong wsrep_auto_increment_control;
+#endif
   double long_query_time_double;
 
   my_bool pseudo_slave_mode;
 
   Gtid_specification gtid_next;
   Gtid_set_or_null gtid_next_list;
+  /**
+    Compatibility option to mark the pre MySQL-5.6.4 temporals columns using
+    the old format using comments for SHOW CREATE TABLE and in I_S.COLUMNS
+    'COLUMN_TYPE' field.
+  */
+  my_bool show_old_temporals;
 } SV;
 
 
@@ -641,8 +671,6 @@ typedef struct system_status_var
 
 #define last_system_status_var questions
 
-void mark_transaction_to_rollback(THD *thd, bool all);
-
 
 /**
   Get collation by name, send error to client on failure.
@@ -848,7 +876,7 @@ public:
   String      rewritten_query;
 
   inline char *query() const { return query_string.str(); }
-  inline uint32 query_length() const { return query_string.length(); }
+  inline uint32 query_length() const { return (uint32)query_string.length(); }
   const CHARSET_INFO *query_charset() const { return query_string.charset(); }
   void set_query_inner(const CSET_STRING &string_arg)
   {
@@ -2006,6 +2034,16 @@ public:
 
   bool lock_global_read_lock(THD *thd);
   void unlock_global_read_lock(THD *thd);
+
+  /**
+    Used by innodb memcached server to check if any connections
+    have global read lock
+  */
+  static bool global_read_lock_active()
+  {
+    return my_atomic_load32(&m_active_requests) ? true : false;
+  }
+
   /**
     Check if this connection can acquire protection against GRL and
     emit error if otherwise.
@@ -2023,6 +2061,7 @@ public:
   bool is_acquired() const { return m_state != GRL_NONE; }
   void set_explicit_lock_duration(THD *thd);
 private:
+  volatile static int32 m_active_requests;
   enum_grl_state m_state;
   /**
     In order to acquire the global read lock, the connection must
@@ -2250,6 +2289,7 @@ public:
     decremented each time before it returns from the function.
   */
   uint fill_status_recursion_level;
+  uint fill_variables_recursion_level;
 
   /* container for handler's private per-connection data */
   Ha_data ha_data[MAX_HA];
@@ -2321,8 +2361,12 @@ 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);
   }
+
+  bool is_current_stmt_binlog_disabled() const;
+
   /** Tells whether the given optimizer_switch flag is on */
   inline bool optimizer_switch_flag(ulonglong flag) const
   {
@@ -2830,6 +2874,13 @@ public:
   PROFILING  profiling;
 #endif
 
+  /** Current statement digest. */
+  sql_digest_state *m_digest;
+  /** Current statement digest token array. */
+  unsigned char *m_token_array;
+  /** Top level statement digest. */
+  sql_digest_state m_digest_state;
+
   /** Current statement instrumentation. */
   PSI_statement_locker *m_statement_psi;
 #ifdef HAVE_PSI_STATEMENT_INTERFACE
@@ -2975,6 +3026,7 @@ public:
   {
     CE_NONE= 0,
     CE_FLUSH_ERROR,
+    CE_SYNC_ERROR,
     CE_COMMIT_ERROR,
     CE_ERROR_COUNT
   } commit_error;
@@ -3114,6 +3166,46 @@ 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 */
+  wsrep_gtid_t              wsrep_sync_wait_gtid;
+#endif /* WITH_WSREP */
   /**
     Internal parser state.
     Note that since the parser is not re-entrant, we keep only one parser
@@ -3149,7 +3241,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 +3753,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 +3795,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();
@@ -4061,7 +4157,9 @@ public:
   }
   LEX_STRING get_invoker_user() { return invoker_user; }
   LEX_STRING get_invoker_host() { return invoker_host; }
-  bool has_invoker() { return invoker_user.length > 0; }
+  bool has_invoker() { return invoker_user.str != NULL; }
+
+  void mark_transaction_to_rollback(bool all);
 
 #ifndef DBUG_OFF
 private:
@@ -4113,6 +4211,14 @@ private:
    */
   LEX_STRING invoker_user;
   LEX_STRING invoker_host;
+public:
+  /**
+    This is only used by master dump threads.
+    When the master receives a new connection from a slave with a UUID that
+    is already connected, it will set this flag TRUE before killing the old
+    slave connection.
+  */
+  bool duplicate_slave_uuid;
 };
 
 
@@ -4902,7 +5008,7 @@ class user_var_entry
     @retval        false on success
     @retval        true on memory allocation error
   */
-  bool store(void *from, uint length, Item_result type);
+  bool store(const void *from, uint length, Item_result type);
 
 public:
   user_var_entry() {}                         /* Remove gcc warning */
@@ -4925,7 +5031,7 @@ public:
     @retval        false on success
     @retval        true on memory allocation error
   */
-  bool store(void *from, uint length, Item_result type,
+  bool store(const void *from, uint length, Item_result type,
              const CHARSET_INFO *cs, Derivation dv, bool unsigned_arg);
   /**
     Set type of to the given value.
@@ -4954,7 +5060,7 @@ public:
   static user_var_entry *create(const Name_string &name)
   {
     user_var_entry *entry;
-    uint size= ALIGN_SIZE(sizeof(user_var_entry)) +
+    size_t size= ALIGN_SIZE(sizeof(user_var_entry)) +
                (name.length() + 1) + extra_size;
     if (!(entry= (user_var_entry*) my_malloc(size, MYF(MY_WME |
                                                        ME_FATALERROR))))
@@ -5293,12 +5399,19 @@ public:
   sent by the user (ie: stored procedure).
 */
 #define CF_SKIP_QUESTIONS       (1U << 1)
+#ifdef WITH_WSREP
+/**
+  Do not check that wsrep snapshot is ready before allowing this command
+*/
+#define CF_SKIP_WSREP_CHECK     (1U << 2)
+#else
+#define CF_SKIP_WSREP_CHECK     0
+#endif /* WITH_WSREP */
 
 void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var);
 
 void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
                         STATUS_VAR *dec_var);
-void mark_transaction_to_rollback(THD *thd, bool all);
 
 /* Inline functions */
 
@@ -5329,4 +5442,20 @@ inline bool add_group_to_list(THD *thd, Item *item, bool asc)
 
 #endif /* MYSQL_SERVER */
 
+/**
+  Create a temporary file.
+
+  @details
+  The temporary file is created in a location specified by the parameter
+  path. if path is null, then it will be created on the location given
+  by the mysql server configuration (--tmpdir option).  The caller
+  does not need to delete the file, it will be deleted automatically.
+
+  @param path  location for creating temporary file
+  @param prefix        prefix for temporary file name
+  @retval -1   error
+  @retval >= 0 a file handle that can be passed to dup or my_close
+*/
+int mysql_tmpfile_path(const char* path, const char* prefix);
+
 #endif /* SQL_CLASS_INCLUDED */
index 67b671bdaa3107ae86b16773b7b2b6375995ba95..9034a6e41d3b4982d76557c9060b260eb3f05e63 100644 (file)
@@ -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
 
index c99d05dd60cb01c2c158228e52869ec29cf5c88f..0c6b7e70d3788e10144b927277e4d2cc4ce8b09b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+/* 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
@@ -95,6 +95,7 @@ public:
 bool mysql_open_cursor(THD *thd, select_result *result,
                        Server_side_cursor **pcursor)
 {
+  sql_digest_state *parent_digest;
   PSI_statement_locker *parent_locker;
   select_result *save_result;
   Select_materialize *result_materialize;
@@ -113,9 +114,12 @@ bool mysql_open_cursor(THD *thd, select_result *result,
                          &thd->security_ctx->priv_user[0],
                          (char *) thd->security_ctx->host_or_ip,
                          2);
+  parent_digest= thd->m_digest;
   parent_locker= thd->m_statement_psi;
+  thd->m_digest= NULL;
   thd->m_statement_psi= NULL;
   bool rc= mysql_execute_command(thd);
+  thd->m_digest= parent_digest;
   DEBUG_SYNC(thd, "after_table_close");
   thd->m_statement_psi= parent_locker;
   MYSQL_QUERY_EXEC_DONE(rc);
index f3e887641925a77ae9bba0b95b30a915e9e3186b..1b9ef9b87cd5c8bf1f18e5d754c4c8dfe551ee5b 100644 (file)
@@ -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/mysql-wsrep-5.6/sql/sql_digest.cc b/mysql-wsrep-5.6/sql/sql_digest.cc
new file mode 100644 (file)
index 0000000..630e5b0
--- /dev/null
@@ -0,0 +1,697 @@
+/* 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
+  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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+/*
+  This code needs extra visibility in the lexer structures
+*/
+
+#include "my_global.h"
+#include "my_md5.h"
+#include "mysqld_error.h"
+#include "sql_data_change.h"
+
+#include "sql_string.h"
+#include "sql_class.h"
+#include "sql_lex.h"
+#include "sql_digest.h"
+#include "sql_digest_stream.h"
+
+#include "sql_get_diagnostics.h"
+
+#ifdef NEVER
+#include "my_sys.h"
+#include "sql_signal.h"
+#endif
+
+/* Generated code */
+#include "sql_yacc.h"
+#define LEX_TOKEN_WITH_DEFINITION
+#include "lex_token.h"
+
+/* Name pollution from sql/sql_lex.h */
+#ifdef LEX_YYSTYPE
+#undef LEX_YYSTYPE
+#endif
+
+#define LEX_YYSTYPE YYSTYPE*
+
+#define SIZE_OF_A_TOKEN 2
+
+ulong max_digest_length= 0;
+ulong get_max_digest_length()
+{
+  return max_digest_length;
+}
+
+/**
+  Read a single token from token array.
+*/
+inline uint read_token(const sql_digest_storage *digest_storage,
+                       uint index, uint *tok)
+{
+  uint safe_byte_count= (uint)digest_storage->m_byte_count;
+
+  if (index + SIZE_OF_A_TOKEN <= safe_byte_count &&
+      safe_byte_count <= digest_storage->m_token_array_length)
+  {
+    const unsigned char *src= & digest_storage->m_token_array[index];
+    *tok= src[0] | (src[1] << 8);
+    return index + SIZE_OF_A_TOKEN;
+  }
+
+  /* The input byte stream is exhausted. */
+  *tok= 0;
+  return MAX_DIGEST_STORAGE_SIZE + 1;
+}
+
+/**
+  Store a single token in token array.
+*/
+inline void store_token(sql_digest_storage* digest_storage, uint token)
+{
+  DBUG_ASSERT(digest_storage->m_byte_count <= digest_storage->m_token_array_length);
+
+  if (digest_storage->m_byte_count + SIZE_OF_A_TOKEN <= digest_storage->m_token_array_length)
+  {
+    unsigned char* dest= & digest_storage->m_token_array[digest_storage->m_byte_count];
+    dest[0]= token & 0xff;
+    dest[1]= (token >> 8) & 0xff;
+    digest_storage->m_byte_count+= SIZE_OF_A_TOKEN;
+  }
+  else
+  {
+    digest_storage->m_full= true;
+  }
+}
+
+/**
+  Read an identifier from token array.
+*/
+inline uint read_identifier(const sql_digest_storage* digest_storage,
+                            uint index, char ** id_string, int *id_length)
+{
+  uint new_index;
+  uint safe_byte_count= (uint)digest_storage->m_byte_count;
+
+  DBUG_ASSERT(index <= safe_byte_count);
+  DBUG_ASSERT(safe_byte_count <= digest_storage->m_token_array_length);
+
+  /*
+    token + length + string are written in an atomic way,
+    so we do always expect a length + string here
+  */
+
+  uint bytes_needed= SIZE_OF_A_TOKEN;
+  /* If we can read token and identifier length */
+  if ((index + bytes_needed) <= safe_byte_count)
+  {
+    const unsigned char *src= & digest_storage->m_token_array[index];
+    /* Read the length of identifier */
+    uint length= src[0] | (src[1] << 8);
+    bytes_needed+= length;
+    /* If we can read entire identifier from token array */
+    if ((index + bytes_needed) <= safe_byte_count)
+    {
+      *id_string= (char *) (src + 2);
+      *id_length= length;
+
+      new_index= index + bytes_needed;
+      DBUG_ASSERT(new_index <= safe_byte_count);
+      return new_index;
+    }
+  }
+
+  /* The input byte stream is exhausted. */
+  return MAX_DIGEST_STORAGE_SIZE + 1;
+}
+
+/**
+  Store an identifier in token array.
+*/
+inline void store_token_identifier(sql_digest_storage* digest_storage,
+                                   uint token,
+                                   size_t id_length, const char *id_name)
+{
+  DBUG_ASSERT(digest_storage->m_byte_count <= digest_storage->m_token_array_length);
+
+  size_t bytes_needed= 2 * SIZE_OF_A_TOKEN + id_length;
+  if (digest_storage->m_byte_count + bytes_needed <= (unsigned int)digest_storage->m_token_array_length)
+  {
+    unsigned char* dest= & digest_storage->m_token_array[digest_storage->m_byte_count];
+    /* Write the token */
+    dest[0]= token & 0xff;
+    dest[1]= (token >> 8) & 0xff;
+    /* Write the string length */
+    dest[2]= id_length & 0xff;
+    dest[3]= (id_length >> 8) & 0xff;
+    /* Write the string data */
+    if (id_length > 0)
+      memcpy((char *)(dest + 4), id_name, id_length);
+    digest_storage->m_byte_count+= bytes_needed;
+  }
+  else
+  {
+    digest_storage->m_full= true;
+  }
+}
+
+void compute_digest_md5(const sql_digest_storage *digest_storage, unsigned char *md5)
+{
+  compute_md5_hash((char *) md5,
+                   (const char *) digest_storage->m_token_array,
+                   (int)digest_storage->m_byte_count);
+}
+
+/*
+  Iterate token array and updates digest_text.
+*/
+void compute_digest_text(const sql_digest_storage* digest_storage,
+                         String *digest_text)
+{
+  DBUG_ASSERT(digest_storage != NULL);
+  uint byte_count= (uint)digest_storage->m_byte_count;
+  String *digest_output= digest_text;
+  uint tok= 0;
+  uint current_byte= 0;
+  lex_token_string *tok_data;
+
+  /* Reset existing data */
+  digest_output->length(0);
+
+  if (byte_count > digest_storage->m_token_array_length)
+  {
+    digest_output->append("\0", 1);
+    return;
+  }
+
+  /* Convert text to utf8 */
+  const CHARSET_INFO *from_cs= get_charset(digest_storage->m_charset_number, MYF(0));
+  const CHARSET_INFO *to_cs= &my_charset_utf8_bin;
+
+  if (from_cs == NULL)
+  {
+    /*
+      Can happen, as we do dirty reads on digest_storage,
+      which can be written to in another thread.
+    */
+    digest_output->append("\0", 1);
+    return;
+  }
+
+  char id_buffer[NAME_LEN + 1]= {'\0'};
+  char *id_string;
+  size_t id_length;
+  bool convert_text= !my_charset_same(from_cs, to_cs);
+
+  while (current_byte < byte_count)
+  {
+    current_byte= read_token(digest_storage, current_byte, &tok);
+
+    if (tok <= 0 || tok >= array_elements(lex_token_array)
+        || current_byte > max_digest_length)
+      return;
+
+    tok_data= &lex_token_array[tok];
+
+    switch (tok)
+    {
+    /* All identifiers are printed with their name. */
+    case IDENT:
+    case IDENT_QUOTED:
+    case TOK_IDENT:
+      {
+        char *id_ptr= NULL;
+        int id_len= 0;
+        uint err_cs= 0;
+
+        /* Get the next identifier from the storage buffer. */
+        current_byte= read_identifier(digest_storage, current_byte,
+                                      &id_ptr, &id_len);
+        if (current_byte > max_digest_length)
+          return;
+
+        if (convert_text)
+        {
+          /* Verify that the converted text will fit. */
+          if (to_cs->mbmaxlen*id_len > NAME_LEN)
+          {
+            digest_output->append("...", 3);
+            break;
+          }
+          /* Convert identifier string into the storage character set. */
+          id_length= my_convert(id_buffer, NAME_LEN, to_cs,
+                                id_ptr, id_len, from_cs, &err_cs);
+          id_string= id_buffer;
+        }
+        else
+        {
+          id_string= id_ptr;
+          id_length= id_len;
+        }
+
+        if (id_length == 0 || err_cs != 0)
+        {
+          break;
+        }
+        /* Copy the converted identifier into the digest string. */
+        digest_output->append("`", 1);
+        if (id_length > 0)
+          digest_output->append(id_string, (uint)id_length);
+        digest_output->append("` ", 2);
+      }
+      break;
+
+    /* Everything else is printed as is. */
+    default:
+      /*
+        Make sure not to overflow digest_text buffer.
+        +1 is to make sure extra space for ' '.
+      */
+      int tok_length= tok_data->m_token_length;
+
+      digest_output->append(tok_data->m_token_string, tok_length);
+      if (tok_data->m_append_space)
+        digest_output->append(" ", 1);
+      break;
+    }
+  }
+}
+
+static inline uint peek_token(const sql_digest_storage *digest, uint index)
+{
+  uint token;
+  DBUG_ASSERT(index + SIZE_OF_A_TOKEN <= digest->m_byte_count);
+  DBUG_ASSERT(digest->m_byte_count <=  digest->m_token_array_length);
+
+  token= ((digest->m_token_array[index + 1])<<8) | digest->m_token_array[index];
+  return token;
+}
+
+/**
+  Function to read last two tokens from token array. If an identifier
+  is found, do not look for token before that.
+*/
+static inline void peek_last_two_tokens(const sql_digest_storage* digest_storage,
+                                        uint last_id_index, uint *t1, uint *t2)
+{
+  uint byte_count= (uint)digest_storage->m_byte_count;
+  uint peek_index= byte_count;
+
+  if (last_id_index + SIZE_OF_A_TOKEN <= peek_index)
+  {
+    /* Take last token. */
+    peek_index-= SIZE_OF_A_TOKEN;
+    *t1= peek_token(digest_storage, peek_index);
+
+    if (last_id_index + SIZE_OF_A_TOKEN <= peek_index)
+    {
+      /* Take 2nd token from last. */
+      peek_index-= SIZE_OF_A_TOKEN;
+      *t2= peek_token(digest_storage, peek_index);
+    }
+    else
+    {
+      *t2= TOK_UNUSED;
+    }
+  }
+  else
+  {
+    *t1= TOK_UNUSED;
+    *t2= TOK_UNUSED;
+  }
+}
+
+/**
+  Function to read last three tokens from token array. If an identifier
+  is found, do not look for token before that.
+*/
+static inline void peek_last_three_tokens(const sql_digest_storage* digest_storage,
+                                          uint last_id_index, uint *t1, uint *t2, uint *t3)
+{
+  uint byte_count= (uint)digest_storage->m_byte_count;
+  uint peek_index= byte_count;
+
+  if (last_id_index + SIZE_OF_A_TOKEN <= peek_index)
+  {
+    /* Take last token. */
+    peek_index-= SIZE_OF_A_TOKEN;
+    *t1= peek_token(digest_storage, peek_index);
+
+    if (last_id_index + SIZE_OF_A_TOKEN <= peek_index)
+    {
+      /* Take 2nd token from last. */
+      peek_index-= SIZE_OF_A_TOKEN;
+      *t2= peek_token(digest_storage, peek_index);
+
+      if (last_id_index + SIZE_OF_A_TOKEN <= peek_index)
+      {
+        /* Take 3rd token from last. */
+        peek_index-= SIZE_OF_A_TOKEN;
+        *t3= peek_token(digest_storage, peek_index);
+      }
+      else
+      {
+        *t3= TOK_UNUSED;
+      }
+    }
+    else
+    {
+      *t2= TOK_UNUSED;
+      *t3= TOK_UNUSED;
+    }
+  }
+  else
+  {
+    *t1= TOK_UNUSED;
+    *t2= TOK_UNUSED;
+    *t3= TOK_UNUSED;
+  }
+}
+
+sql_digest_state* digest_add_token(sql_digest_state *state,
+                                   uint token,
+                                   LEX_YYSTYPE yylval)
+{
+  sql_digest_storage *digest_storage= NULL;
+
+  digest_storage= &state->m_digest_storage;
+
+  /*
+    Stop collecting further tokens if digest storage is full or
+    if END token is received.
+  */
+  if (digest_storage->m_full || token == END_OF_INPUT)
+    return NULL;
+
+  /*
+    Take last_token 2 tokens collected till now. These tokens will be used
+    in reduce for normalisation. Make sure not to consider ID tokens in reduce.
+  */
+  uint last_token;
+  uint last_token2;
+
+  switch (token)
+  {
+    case NUM:
+    case LONG_NUM:
+    case ULONGLONG_NUM:
+    case DECIMAL_NUM:
+    case FLOAT_NUM:
+    case BIN_NUM:
+    case HEX_NUM:
+    {
+      bool found_unary;
+      do
+      {
+        found_unary= false;
+        peek_last_two_tokens(digest_storage, state->m_last_id_index,
+                             &last_token, &last_token2);
+
+        if ((last_token == '-') || (last_token == '+'))
+        {
+          /*
+            We need to differentiate:
+            - a <unary minus> operator
+            - a <unary plus> operator
+            from
+            - a <binary minus> operator
+            - a <binary plus> operator
+            to only reduce "a = -1" to "a = ?", and not change "b - 1" to "b ?"
+
+            Binary operators are found inside an expression,
+            while unary operators are found at the beginning of an expression, or after operators.
+
+            To achieve this, every token that is followed by an <expr> expression
+            in the SQL grammar is flagged.
+            See sql/sql_yacc.yy
+            See sql/gen_lex_token.cc
+
+            For example,
+            "(-1)" is parsed as "(", "-", NUM, ")", and lex_token_array["("].m_start_expr is true,
+            so reduction of the "-" NUM is done, the result is "(?)".
+            "(a-1)" is parsed as "(", ID, "-", NUM, ")", and lex_token_array[ID].m_start_expr is false,
+            so the operator is binary, no reduction is done, and the result is "(a-?)".
+          */
+          if (lex_token_array[last_token2].m_start_expr)
+          {
+            /*
+              REDUCE:
+              TOK_GENERIC_VALUE := (UNARY_PLUS | UNARY_MINUS) (NUM | LOG_NUM | ... | FLOAT_NUM)
+
+              REDUCE:
+              TOK_GENERIC_VALUE := (UNARY_PLUS | UNARY_MINUS) TOK_GENERIC_VALUE
+            */
+            token= TOK_GENERIC_VALUE;
+            digest_storage->m_byte_count-= SIZE_OF_A_TOKEN;
+            found_unary= true;
+          }
+        }
+      } while (found_unary);
+    }
+    /* fall through, for case NULL_SYM below */
+    case LEX_HOSTNAME:
+    case TEXT_STRING:
+    case NCHAR_STRING:
+    case PARAM_MARKER:
+    {
+      /*
+        REDUCE:
+        TOK_GENERIC_VALUE := BIN_NUM | DECIMAL_NUM | ... | ULONGLONG_NUM
+      */
+      token= TOK_GENERIC_VALUE;
+
+      peek_last_two_tokens(digest_storage, state->m_last_id_index,
+                           &last_token, &last_token2);
+
+      if ((last_token2 == TOK_GENERIC_VALUE ||
+           last_token2 == TOK_GENERIC_VALUE_LIST) &&
+          (last_token == ','))
+      {
+        /*
+          REDUCE:
+          TOK_GENERIC_VALUE_LIST :=
+            TOK_GENERIC_VALUE ',' TOK_GENERIC_VALUE
+
+          REDUCE:
+          TOK_GENERIC_VALUE_LIST :=
+            TOK_GENERIC_VALUE_LIST ',' TOK_GENERIC_VALUE
+        */
+        digest_storage->m_byte_count-= 2*SIZE_OF_A_TOKEN;
+        token= TOK_GENERIC_VALUE_LIST;
+      }
+      /*
+        Add this token or the resulting reduce to digest storage.
+      */
+      store_token(digest_storage, token);
+      break;
+    }
+    case ')':
+    {
+      peek_last_two_tokens(digest_storage, state->m_last_id_index,
+                           &last_token, &last_token2);
+
+      if (last_token == TOK_GENERIC_VALUE &&
+          last_token2 == '(')
+      {
+        /*
+          REDUCE:
+          TOK_ROW_SINGLE_VALUE :=
+            '(' TOK_GENERIC_VALUE ')'
+        */
+        digest_storage->m_byte_count-= 2*SIZE_OF_A_TOKEN;
+        token= TOK_ROW_SINGLE_VALUE;
+
+        /* Read last two tokens again */
+        peek_last_two_tokens(digest_storage, state->m_last_id_index,
+                             &last_token, &last_token2);
+
+        if ((last_token2 == TOK_ROW_SINGLE_VALUE ||
+             last_token2 == TOK_ROW_SINGLE_VALUE_LIST) &&
+            (last_token == ','))
+        {
+          /*
+            REDUCE:
+            TOK_ROW_SINGLE_VALUE_LIST :=
+              TOK_ROW_SINGLE_VALUE ',' TOK_ROW_SINGLE_VALUE
+
+            REDUCE:
+            TOK_ROW_SINGLE_VALUE_LIST :=
+              TOK_ROW_SINGLE_VALUE_LIST ',' TOK_ROW_SINGLE_VALUE
+          */
+          digest_storage->m_byte_count-= 2*SIZE_OF_A_TOKEN;
+          token= TOK_ROW_SINGLE_VALUE_LIST;
+        }
+      }
+      else if (last_token == TOK_GENERIC_VALUE_LIST &&
+               last_token2 == '(')
+      {
+        /*
+          REDUCE:
+          TOK_ROW_MULTIPLE_VALUE :=
+            '(' TOK_GENERIC_VALUE_LIST ')'
+        */
+        digest_storage->m_byte_count-= 2*SIZE_OF_A_TOKEN;
+        token= TOK_ROW_MULTIPLE_VALUE;
+
+        /* Read last two tokens again */
+        peek_last_two_tokens(digest_storage, state->m_last_id_index,
+                             &last_token, &last_token2);
+
+        if ((last_token2 == TOK_ROW_MULTIPLE_VALUE ||
+             last_token2 == TOK_ROW_MULTIPLE_VALUE_LIST) &&
+            (last_token == ','))
+        {
+          /*
+            REDUCE:
+            TOK_ROW_MULTIPLE_VALUE_LIST :=
+              TOK_ROW_MULTIPLE_VALUE ',' TOK_ROW_MULTIPLE_VALUE
+
+            REDUCE:
+            TOK_ROW_MULTIPLE_VALUE_LIST :=
+              TOK_ROW_MULTIPLE_VALUE_LIST ',' TOK_ROW_MULTIPLE_VALUE
+          */
+          digest_storage->m_byte_count-= 2*SIZE_OF_A_TOKEN;
+          token= TOK_ROW_MULTIPLE_VALUE_LIST;
+        }
+      }
+      /*
+        Add this token or the resulting reduce to digest storage.
+      */
+      store_token(digest_storage, token);
+      break;
+    }
+    case IDENT:
+    case IDENT_QUOTED:
+    {
+      YYSTYPE *lex_token= yylval;
+      char *yytext= lex_token->lex_str.str;
+      size_t yylen= lex_token->lex_str.length;
+
+      /*
+        REDUCE:
+          TOK_IDENT := IDENT | IDENT_QUOTED
+        The parser gives IDENT or IDENT_TOKEN for the same text,
+        depending on the character set used.
+        We unify both to always print the same digest text,
+        and always have the same digest hash.
+      */
+      token= TOK_IDENT;
+      /* Add this token and identifier string to digest storage. */
+      store_token_identifier(digest_storage, token, yylen, yytext);
+
+      /* Update the index of last identifier found. */
+      state->m_last_id_index= (int)digest_storage->m_byte_count;
+      break;
+    }
+    default:
+    {
+      /* Add this token to digest storage. */
+      store_token(digest_storage, token);
+      break;
+    }
+  }
+
+  return state;
+}
+
+sql_digest_state* digest_reduce_token(sql_digest_state *state,
+                                      uint token_left, uint token_right)
+{
+  sql_digest_storage *digest_storage= NULL;
+
+  digest_storage= &state->m_digest_storage;
+
+  /*
+    Stop collecting further tokens if digest storage is full.
+  */
+  if (digest_storage->m_full)
+    return NULL;
+
+  uint last_token;
+  uint last_token2;
+  uint last_token3;
+  uint token_to_push= TOK_UNUSED;
+
+  peek_last_two_tokens(digest_storage, state->m_last_id_index,
+                       &last_token, &last_token2);
+
+  /*
+    There is only one caller of digest_reduce_token(),
+    see sql/sql_yacc.yy, rule literal := NULL_SYM.
+    REDUCE:
+      token_left := token_right
+    Used for:
+      TOK_GENERIC_VALUE := NULL_SYM
+  */
+
+  if (last_token == token_right)
+  {
+    /*
+      Current stream is like:
+        TOKEN_X TOKEN_RIGHT .
+      REDUCE to
+        TOKEN_X TOKEN_LEFT .
+    */
+    digest_storage->m_byte_count-= SIZE_OF_A_TOKEN;
+    store_token(digest_storage, token_left);
+  }
+  else
+  {
+    /*
+      Current stream is like:
+        TOKEN_X TOKEN_RIGHT TOKEN_Y .
+      Pop TOKEN_Y
+        TOKEN_X TOKEN_RIGHT . TOKEN_Y
+      REDUCE to
+        TOKEN_X TOKEN_LEFT . TOKEN_Y
+    */
+    DBUG_ASSERT(last_token2 == token_right);
+    digest_storage->m_byte_count-= 2 * SIZE_OF_A_TOKEN;
+    store_token(digest_storage, token_left);
+    token_to_push= last_token;
+  }
+
+  peek_last_three_tokens(digest_storage, state->m_last_id_index,
+                         &last_token, &last_token2, &last_token3);
+
+  if ((last_token3 == TOK_GENERIC_VALUE ||
+       last_token3 == TOK_GENERIC_VALUE_LIST) &&
+      (last_token2 == ',') &&
+      (last_token == TOK_GENERIC_VALUE))
+  {
+    /*
+      REDUCE:
+      TOK_GENERIC_VALUE_LIST :=
+        TOK_GENERIC_VALUE ',' TOK_GENERIC_VALUE
+
+      REDUCE:
+      TOK_GENERIC_VALUE_LIST :=
+        TOK_GENERIC_VALUE_LIST ',' TOK_GENERIC_VALUE
+    */
+    digest_storage->m_byte_count-= 3*SIZE_OF_A_TOKEN;
+    store_token(digest_storage, TOK_GENERIC_VALUE_LIST);
+  }
+
+  if (token_to_push != TOK_UNUSED)
+  {
+    /*
+      Push TOKEN_Y
+    */
+    store_token(digest_storage, token_to_push);
+  }
+
+  return state;
+}
+
diff --git a/mysql-wsrep-5.6/sql/sql_digest.h b/mysql-wsrep-5.6/sql/sql_digest.h
new file mode 100644 (file)
index 0000000..774f02c
--- /dev/null
@@ -0,0 +1,131 @@
+/* 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
+  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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#ifndef SQL_DIGEST_H
+#define SQL_DIGEST_H
+
+#include <string.h>
+class String;
+#include "my_md5.h"
+
+#define MAX_DIGEST_STORAGE_SIZE (1024*1024)
+
+ulong get_max_digest_length();
+
+/**
+  Structure to store token count/array for a statement
+  on which digest is to be calculated.
+*/
+struct sql_digest_storage
+{
+  bool m_full;
+  size_t m_byte_count;
+  unsigned char m_md5[MD5_HASH_SIZE];
+  /** Character set number. */
+  uint m_charset_number;
+  /**
+    Token array.
+    Token array is an array of bytes to store tokens received during parsing.
+    Following is the way token array is formed.
+    ... &lt;non-id-token&gt; &lt;non-id-token&gt; &lt;id-token&gt; &lt;id_len&gt; &lt;id_text&gt; ...
+    For Example:
+    SELECT * FROM T1;
+    &lt;SELECT_TOKEN&gt; &lt;*&gt; &lt;FROM_TOKEN&gt; &lt;ID_TOKEN&gt; &lt;2&gt; &lt;T1&gt;
+
+    @note Only the first @c m_byte_count bytes are initialized,
+      out of @c m_token_array_length.
+  */
+  unsigned char *m_token_array;
+  /* Length of the token array to be considered for DIGEST_TEXT calculation. */
+  uint m_token_array_length;
+
+  sql_digest_storage()
+  {
+    reset(NULL, 0);
+  }
+
+  inline void reset(unsigned char *token_array, uint length)
+  {
+    m_token_array= token_array;
+    m_token_array_length= length;
+    reset();
+  }
+
+  inline void reset()
+  {
+    m_full= false;
+    m_byte_count= 0;
+    m_charset_number= 0;
+    memset(m_md5, 0, MD5_HASH_SIZE);
+  }
+
+  inline bool is_empty()
+  {
+    return (m_byte_count == 0);
+  }
+
+  inline void copy(const sql_digest_storage *from)
+  {
+    /*
+      Keep in mind this is a dirty copy of something that may change,
+      as the thread producing the digest is executing concurrently,
+      without any lock enforced.
+    */
+    size_t byte_count_copy= m_token_array_length < from->m_byte_count ?
+                            m_token_array_length : from->m_byte_count;
+
+    if (byte_count_copy > 0)
+    {
+      m_full= from->m_full;
+      m_byte_count= byte_count_copy;
+      m_charset_number= from->m_charset_number;
+      memcpy(m_token_array, from->m_token_array, m_byte_count);
+      memcpy(m_md5, from->m_md5, MD5_HASH_SIZE);
+    }
+    else
+    {
+      m_full= false;
+      m_byte_count= 0;
+      m_charset_number= 0;
+    }
+  }
+};
+typedef struct sql_digest_storage sql_digest_storage;
+
+/**
+  Compute a digest hash.
+  @param digest_storage The digest
+  @param [out] md5 The computed digest hash. This parameter is a buffer of size @c MD5_HASH_SIZE.
+*/
+void compute_digest_md5(const sql_digest_storage *digest_storage, unsigned char *md5);
+
+/**
+  Compute a digest text.
+  A 'digest text' is a textual representation of a query,
+  where:
+  - comments are removed,
+  - non significant spaces are removed,
+  - literal values are replaced with a special '?' marker,
+  - lists of values are collapsed using a shorter notation
+  @param digest_storage The digest
+  @param [out] digest_text
+  @param digest_text_length Size of @c digest_text.
+  @param [out] truncated true if the text representation was truncated
+*/
+void compute_digest_text(const sql_digest_storage *digest_storage,
+                         String *digest_text);
+
+#endif
+
diff --git a/mysql-wsrep-5.6/sql/sql_digest_stream.h b/mysql-wsrep-5.6/sql/sql_digest_stream.h
new file mode 100644 (file)
index 0000000..55f7e22
--- /dev/null
@@ -0,0 +1,51 @@
+/* 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
+  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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#ifndef SQL_DIGEST_STREAM_H
+#define SQL_DIGEST_STREAM_H
+
+#include "sql_digest.h"
+
+/**
+  State data storage for @c digest_start, @c digest_add_token.
+  This structure extends the @c sql_digest_storage structure
+  with temporary state used only during parsing.
+*/
+struct sql_digest_state
+{
+  /**
+    Index, in the digest token array, of the last identifier seen.
+    Reduce rules used in the digest computation can not
+    apply to tokens seen before an identifier.
+    @sa digest_add_token
+  */
+  int m_last_id_index;
+  sql_digest_storage m_digest_storage;
+
+  inline void reset(unsigned char *token_array, uint length)
+  {
+    m_last_id_index= 0;
+    m_digest_storage.reset(token_array, length);
+  }
+
+  inline bool is_empty()
+  {
+    return m_digest_storage.is_empty();
+  }
+};
+typedef struct sql_digest_state sql_digest_state;
+
+#endif
+
index bfa28aa2856e9a6956f99a741051a85b45e56490..448ab526b4034bd24b27d50ce3e635cc55fca2a0 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -299,7 +299,10 @@ JOIN::create_intermediate_table(JOIN_TAB *tab, List<Item> *tmp_table_fields,
 
 err:
   if (table != NULL)
+  {
     free_tmp_table(thd, table);
+    tab->table= NULL;
+  }
   DBUG_RETURN(true);
 }
 
@@ -1603,6 +1606,10 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab)
       if (rc != NESTED_LOOP_OK)
         DBUG_RETURN(rc);
 
+      /* check for errors evaluating the condition */
+      if (join->thd->is_error())
+        DBUG_RETURN(NESTED_LOOP_ERROR);
+
       if (join_tab->do_loosescan() && join_tab->match_tab->found_match)
       {
         /* 
index ed53f2690f2755464fd58475c0c43e417d4ce923..707495be4233621c4c195dbab1a6df7e9a9f2b7c 100644 (file)
@@ -989,6 +989,53 @@ void mysql_ha_flush(THD *thd)
 }
 
 
+/**
+  Remove temporary tables from the HANDLER's hash table. The reason
+  for having a separate function, rather than calling
+  mysql_ha_rm_tables() is that it is not always feasible (e.g. in
+  close_temporary_tables) to obtain a TABLE_LIST containing the
+  temporary tables.
+
+  @See close_temporary_tables
+  @param thd Thread identifier.
+*/
+void mysql_ha_rm_temporary_tables(THD *thd)
+{
+  DBUG_ENTER("mysql_ha_rm_temporary_tables");
+
+  TABLE_LIST *tmp_handler_tables= NULL;
+  for (uint i= 0; i < thd->handler_tables_hash.records; i++)
+  {
+    TABLE_LIST *handler_table= reinterpret_cast<TABLE_LIST*>
+      (my_hash_element(&thd->handler_tables_hash, i));
+
+    if (handler_table->table && handler_table->table->s->tmp_table)
+    {
+      handler_table->next_local= tmp_handler_tables;
+      tmp_handler_tables= handler_table;
+    }
+  }
+
+  while (tmp_handler_tables)
+  {
+    TABLE_LIST *nl= tmp_handler_tables->next_local;
+    mysql_ha_close_table(thd, tmp_handler_tables);
+    my_hash_delete(&thd->handler_tables_hash, (uchar*) tmp_handler_tables);
+    tmp_handler_tables= nl;
+  }
+
+  /*
+    Mark MDL_context as no longer breaking protocol if we have
+    closed last HANDLER.
+  */
+  if (thd->handler_tables_hash.records == 0)
+  {
+    thd->mdl_context.set_needs_thr_lock_abort(FALSE);
+  }
+  DBUG_VOID_RETURN;
+}
+
+
 /**
   Close all HANDLER's tables.
 
index bd56c81348ca48c309ebf4bca745370d2ab9bd5b..0afa4e9ce1294daf0921c7052abd3e6036ef38ca 100644 (file)
@@ -123,6 +123,7 @@ public:
 void mysql_ha_flush(THD *thd);
 void mysql_ha_flush_tables(THD *thd, TABLE_LIST *all_tables);
 void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables);
+void mysql_ha_rm_temporary_tables(THD *thd);
 void mysql_ha_cleanup(THD *thd);
 void mysql_ha_set_explicit_lock_duration(THD *thd);
 
index 114beaadd25ea88dae995e8cf4ce2d32c2655a5d..2ad22038bfb14bd7c0e9d67ce92d584f56aef612 100644 (file)
@@ -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
@@ -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)
@@ -1676,7 +1680,7 @@ int write_record(THD *thd, TABLE *table, COPY_INFO *info, COPY_INFO *update)
       else
         table->file->insert_id_for_cur_row= insert_id_for_cur_row;
       bool is_duplicate_key_error;
-      if (table->file->is_fatal_error(error, HA_CHECK_DUP))
+      if (table->file->is_fatal_error(error, HA_CHECK_DUP | HA_CHECK_FK_ERROR))
        goto err;
       is_duplicate_key_error= table->file->is_fatal_error(error, 0);
       if (!is_duplicate_key_error)
@@ -1814,7 +1818,8 @@ int write_record(THD *thd, TABLE *table, COPY_INFO *info, COPY_INFO *update)
               error != HA_ERR_RECORD_IS_THE_SAME)
           {
             if (ignore_errors &&
-                !table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
+                !table->file->is_fatal_error(error, HA_CHECK_DUP_KEY |
+                                                    HA_CHECK_FK_ERROR))
             {
               goto ok_or_after_trg_err;
             }
@@ -1922,7 +1927,7 @@ int write_record(THD *thd, TABLE *table, COPY_INFO *info, COPY_INFO *update)
   {
     DEBUG_SYNC(thd, "write_row_noreplace");
     if (!ignore_errors ||
-        table->file->is_fatal_error(error, HA_CHECK_DUP))
+        table->file->is_fatal_error(error, HA_CHECK_DUP | HA_CHECK_FK_ERROR))
       goto err;
     table->file->restore_auto_increment(prev_insert_id);
     goto ok_or_after_trg_err;
@@ -1940,6 +1945,9 @@ ok_or_after_trg_err:
     my_safe_afree(key,table->s->max_unique_length,MAX_KEY_LENGTH);
   if (!table->file->has_transactions())
     thd->transaction.stmt.mark_modified_non_trans_table();
+  if (ignore_errors &&
+      !table->file->is_fatal_error(error, HA_CHECK_FK_ERROR))
+    warn_fk_constraint_violation(thd, table, error);
   DBUG_RETURN(trg_error);
 
 err:
@@ -2195,7 +2203,7 @@ public:
   MDL_request grl_protection;
 
   /** Creates a new delayed insert handler. */
-  Delayed_insert()
+  Delayed_insert(SELECT_LEX *current_select)
     :locks_in_memory(0), table(0),tables_in_use(0),stacked_inserts(0),
      status(0), handler_thread_initialized(FALSE), group_count(0)
   {
@@ -2206,7 +2214,7 @@ public:
             USERNAME_LENGTH);
     thd.current_tablenr=0;
     thd.set_command(COM_DELAYED_INSERT);
-    thd.lex->current_select= 0;                // for my_message_sql
+    thd.lex->current_select= current_select;
     thd.lex->sql_command= SQLCOM_INSERT;        // For innodb::store_lock()
 
     /*
@@ -2388,7 +2396,7 @@ bool delayed_get_table(THD *thd, MDL_request *grl_protection_request,
     */
     if (! (di= find_handler(thd, table_list)))
     {
-      if (!(di= new Delayed_insert()))
+      if (!(di= new Delayed_insert(thd->lex->current_select)))
         goto end_create;
       di->table_list= *table_list;                     // Needed to open table
       /* Replace volatile strings with local copies */
@@ -2938,6 +2946,16 @@ pthread_handler_t handle_delayed_insert(void *arg)
     if (di->open_and_lock_table())
       goto err;
 
+    /*
+      INSERT DELAYED generally expects thd->lex->current_select to be NULL,
+      since this is not an attribute of the current thread. This can lead to
+      problems if the thread that spawned the current one disconnects.
+      current_select will then point to freed memory. But current_select is
+      required to resolve the partition function. So, after fulfilling that
+      requirement, we set the current_select to 0.
+    */
+    thd->lex->current_select= NULL;
+
     /* Tell client that the thread is initialized */
     mysql_cond_signal(&di->cond_client);
 
@@ -3773,7 +3791,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 +3824,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 +3915,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 */
@@ -3971,7 +4004,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
   /* Add selected items to field list */
   List_iterator_fast<Item> it(*items);
   Item *item;
-  Field *tmp_field;
+
   DBUG_ENTER("create_table_from_items");
 
   tmp_table.alias= 0;
@@ -3989,21 +4022,48 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
 
   while ((item=it++))
   {
-    Create_field *cr_field;
-    Field *field, *def_field;
+    Field *tmp_table_field;
     if (item->type() == Item::FUNC_ITEM)
+    {
       if (item->result_type() != STRING_RESULT)
-        field= item->tmp_table_field(&tmp_table);
+        tmp_table_field= item->tmp_table_field(&tmp_table);
       else
-        field= item->tmp_table_field_from_field_type(&tmp_table, 0);
+        tmp_table_field= item->tmp_table_field_from_field_type(&tmp_table, false);
+    }
     else
-      field= create_tmp_field(thd, &tmp_table, item, item->type(),
-                              (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0);
-    if (!field ||
-       !(cr_field=new Create_field(field,(item->type() == Item::FIELD_ITEM ?
-                                          ((Item_field *)item)->field :
-                                          (Field*) 0))))
-      DBUG_RETURN(0);
+    {
+      Field *from_field, *default_field;
+      tmp_table_field= create_tmp_field(thd, &tmp_table, item, item->type(),
+                                        (Item ***) NULL,
+                                        &from_field, &default_field,
+                                        false, false, false, false);
+    }
+
+    if (!tmp_table_field)
+      DBUG_RETURN(NULL);
+
+    Field *table_field;
+
+    switch (item->type())
+    {
+    /*
+      We have to take into account both the real table's fields and
+      pseudo-fields used in trigger's body. These fields are used
+      to copy defaults values later inside constructor of
+      the class Create_field.
+    */
+    case Item::FIELD_ITEM:
+    case Item::TRIGGER_FIELD_ITEM:
+      table_field= ((Item_field *) item)->field;
+      break;
+    default:
+      table_field= NULL;
+    }
+
+    Create_field *cr_field= new Create_field(tmp_table_field, table_field);
+
+    if (!cr_field)
+      DBUG_RETURN(NULL);
 
     if (item->maybe_null)
       cr_field->flags &= ~NOT_NULL_FLAG;
@@ -4070,7 +4130,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
       }
     }
     if (!table)                                   // open failed
-      DBUG_RETURN(0);
+      DBUG_RETURN(NULL);
   }
   DBUG_RETURN(table);
 }
@@ -4293,7 +4353,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 +4367,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 +4435,19 @@ 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,
+                    WSREP_QUERY(thd));
+        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);
index c7ec347a4e3b2559c599f30a5d6293863e78ec9a..5cca60373f24a1e9100f4949b98b78e8c4d54e50 100644 (file)
@@ -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
@@ -384,6 +384,21 @@ void Lex_input_stream::body_utf8_append_literal(THD *thd,
   m_cpp_utf8_processed_ptr= end_ptr;
 }
 
+void Lex_input_stream::add_digest_token(uint token, LEX_YYSTYPE yylval)
+{
+  if (m_digest != NULL)
+  {
+    m_digest= digest_add_token(m_digest, token, yylval);
+  }
+}
+
+void Lex_input_stream::reduce_digest_token(uint token_left, uint token_right)
+{
+  if (m_digest != NULL)
+  {
+    m_digest= digest_reduce_token(m_digest, token_left, token_right);
+  }
+}
 
 /*
   This is called before every query that is to be parsed.
@@ -924,7 +939,7 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd)
     lip->lookahead_token= -1;
     *yylval= *(lip->lookahead_yylval);
     lip->lookahead_yylval= NULL;
-    lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, token, yylval);
+    lip->add_digest_token(token, yylval);
     return token;
   }
 
@@ -942,12 +957,10 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd)
     token= lex_one_token(yylval, thd);
     switch(token) {
     case CUBE_SYM:
-      lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, WITH_CUBE_SYM,
-                                         yylval);
+      lip->add_digest_token(WITH_CUBE_SYM, yylval);
       return WITH_CUBE_SYM;
     case ROLLUP_SYM:
-      lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, WITH_ROLLUP_SYM,
-                                         yylval);
+      lip->add_digest_token(WITH_ROLLUP_SYM, yylval);
       return WITH_ROLLUP_SYM;
     default:
       /*
@@ -956,7 +969,7 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd)
       lip->lookahead_yylval= lip->yylval;
       lip->yylval= NULL;
       lip->lookahead_token= token;
-      lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, WITH, yylval);
+      lip->add_digest_token(WITH, yylval);
       return WITH;
     }
     break;
@@ -964,7 +977,7 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd)
     break;
   }
 
-  lip->m_digest_psi= MYSQL_ADD_TOKEN(lip->m_digest_psi, token, yylval);
+  lip->add_digest_token(token, yylval);
   return token;
 }
 
@@ -1506,6 +1519,17 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
           }
           else
           {
+#ifdef WITH_WSREP
+           if (version == 99997 && thd->wsrep_exec_mode == LOCAL_STATE)
+           {
+             WSREP_DEBUG("consistency check: %s", thd->query());
+             thd->wsrep_consistency_check= CONSISTENCY_CHECK_DECLARED;
+             lip->yySkipn(5);
+             lip->set_echo(TRUE);
+             state=MY_LEX_START;
+             break;  /* Do not treat contents as a comment.  */
+           }
+#endif /* WITH_WSREP */
             /*
               Patch and skip the conditional comment to avoid it
               being propagated infinitely (eg. to a slave).
@@ -2497,26 +2521,46 @@ static void print_join(THD *thd,
   /* List is reversed => we should reverse it before using */
   List_iterator_fast<TABLE_LIST> ti(*tables);
   TABLE_LIST **table;
-  uint non_const_tables= 0;
+
+  /*
+    If the QT_NO_DATA_EXPANSION flag is specified, we print the
+    original table list, including constant tables that have been
+    optimized away, as the constant tables may be referenced in the
+    expression printed by Item_field::print() when this flag is given.
+    Otherwise, only non-const tables are printed.
+
+    Example:
+
+    Original SQL:
+    select * from (select 1) t
+
+    Printed without QT_NO_DATA_EXPANSION:
+    select '1' AS `1` from dual
+
+    Printed with QT_NO_DATA_EXPANSION:
+    select `t`.`1` from (select 1 AS `1`) `t`
+  */
+  const bool print_const_tables= (query_type & QT_NO_DATA_EXPANSION);
+  size_t tables_to_print= 0;
 
   for (TABLE_LIST *t= ti++; t ; t= ti++)
-    if (!t->optimized_away)
-      non_const_tables++;
-  if (!non_const_tables)
+    if (print_const_tables || !t->optimized_away)
+      tables_to_print++;
+  if (tables_to_print == 0)
   {
     str->append(STRING_WITH_LEN("dual"));
     return; // all tables were optimized away
   }
   ti.rewind();
 
-  if (!(table= (TABLE_LIST **)thd->alloc(sizeof(TABLE_LIST*) *
-                                                non_const_tables)))
+  if (!(table= static_cast<TABLE_LIST **>(thd->alloc(sizeof(TABLE_LIST*) *
+                                                     tables_to_print))))
     return;  // out of memory
 
-  TABLE_LIST *tmp, **t= table + (non_const_tables - 1);
+  TABLE_LIST *tmp, **t= table + (tables_to_print - 1);
   while ((tmp= ti++))
   {
-    if (tmp->optimized_away)
+    if (tmp->optimized_away && !print_const_tables)
       continue;
     *t--= tmp;
   }
@@ -2528,7 +2572,7 @@ static void print_join(THD *thd,
   */
   if ((*table)->sj_on_expr)
   {
-    TABLE_LIST **end= table + non_const_tables;
+    TABLE_LIST **end= table + tables_to_print;
     for (TABLE_LIST **t2= table; t2!=end; t2++)
     {
       if (!(*t2)->sj_on_expr)
@@ -2540,8 +2584,8 @@ static void print_join(THD *thd,
       }
     }
   }
-  DBUG_ASSERT(non_const_tables >= 1);
-  print_table_array(thd, str, table, table + non_const_tables, query_type);
+  DBUG_ASSERT(tables_to_print >= 1);
+  print_table_array(thd, str, table, table + tables_to_print, query_type);
 }
 
 
index ef44e934eed06b7a3e74182c9560cd1f3f358372..fdbf285c3eb97935a5b15e6c4dae538f82637265 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -46,6 +46,7 @@ class sys_var;
 class Item_func_match;
 class File_parser;
 class Key_part_spec;
+struct sql_digest_state;
 
 #ifdef MYSQL_SERVER
 /*
@@ -1409,6 +1410,11 @@ public:
     return get_stmt_unsafe_flags() != 0;
   }
 
+  inline bool is_stmt_unsafe(enum_binlog_stmt_unsafe unsafe)
+  {
+    return binlog_stmt_flags & (1 << unsafe);
+  }
+
   /**
     Flag the current (top-level) statement as unsafe.
     The flag will be reset after the statement has finished.
@@ -2099,6 +2105,10 @@ public:
   /** LALR(2) resolution, value of the look ahead token.*/
   LEX_YYSTYPE lookahead_yylval;
 
+  void add_digest_token(uint token, LEX_YYSTYPE yylval);
+
+  void reduce_digest_token(uint token_left, uint token_right);
+
 private:
   /** Pointer to the current position in the raw input stream. */
   char *m_ptr;
@@ -2218,7 +2228,7 @@ public:
   /**
     Current statement digest instrumentation. 
   */
-  PSI_digest_locker* m_digest_psi;
+  sql_digest_state* m_digest;
 };
 
 
@@ -2786,6 +2796,18 @@ public:
   */
 };
 
+/**
+  Input parameters to the parser.
+*/
+struct Parser_input
+{
+  bool m_compute_digest;
+
+  Parser_input()
+    : m_compute_digest(false)
+  {}
+};
+
 /**
   Internal state of the parser.
   The complete state consist of:
@@ -2813,9 +2835,15 @@ public:
   ~Parser_state()
   {}
 
+  Parser_input m_input;
   Lex_input_stream m_lip;
   Yacc_state m_yacc;
 
+  /**
+    Current performance digest instrumentation. 
+  */
+  PSI_digest_locker* m_digest_psi;
+
   void reset(char *found_semicolon, unsigned int length)
   {
     m_lip.reset(found_semicolon, length);
@@ -2823,6 +2851,11 @@ public:
   }
 };
 
+extern sql_digest_state *
+digest_add_token(sql_digest_state *state, uint token, LEX_YYSTYPE yylval);
+
+extern sql_digest_state *
+digest_reduce_token(sql_digest_state *state, uint token_left, uint token_right);
 
 struct st_lex_local: public LEX
 {
index f6838238dd572efe2a377b18030a17d175421dd0..4c30dfe674a1b8a7a0dfd3fe33ce8276828dc7dd 100644 (file)
@@ -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
@@ -209,7 +209,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
   */
   char *tdb= thd->db ? thd->db : db;           // Result is never null
   ulong skip_lines= ex->skip_lines;
-  bool transactional_table;
+  bool transactional_table __attribute__((unused));
   DBUG_ENTER("mysql_load");
 
   /*
@@ -262,6 +262,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
   {
     DBUG_RETURN(TRUE);
   }
+  THD_STAGE_INFO(thd, stage_executing);
   /*
     Let us emit an error if we are loading data to table which is used
     in subselect in SET clause like we do it for INSERT.
@@ -2043,8 +2044,15 @@ int READ_INFO::read_xml()
       break;
       
     case '/': /* close tag */
-      level--;
       chr= my_tospace(GET);
+      /* Decrease the 'level' only when (i) It's not an */
+      /* (without space) empty tag i.e. <tag/> or, (ii) */
+      /* It is of format <row col="val" .../>           */
+      if(chr != '>' || in_tag)
+      {
+        level--;
+        in_tag= false;
+      }
       if(chr != '>')   /* if this is an empty tag <tag   /> */
         tag.length(0); /* we should keep tag value          */
       while(chr != '>' && chr != my_b_EOF)
index a2cd75112e25e8ac2688b4201b478c039bcd3f99..a8427873b850053f763b2effa5932884fa04cbe2 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -223,8 +223,10 @@ JOIN::optimize()
       st_select_lex::fix_prepare_information(), and remove this second copy
       below.
     */
-    select_lex->prep_where=
-      conds ? conds->copy_andor_structure(thd, true) : NULL;
+      select_lex->prep_where=
+        conds ? conds->copy_andor_structure(thd, true): NULL;
+      if (conds)
+        thd->change_item_tree_place(&conds, &select_lex->prep_where);
   }
 
   /*
@@ -4883,6 +4885,18 @@ add_key_field(Key_field **key_fields,uint and_level, Item_func *cond,
   DBUG_PRINT("info",("add_key_field for field %s",field->field_name));
   uint exists_optimize= 0;
   TABLE_LIST *table= field->table->pos_in_table_list;
+
+  if (field->table->reginfo.join_tab == NULL)
+  {
+    /*
+       Due to a bug in IN-to-EXISTS (grep for real_item() in item_subselect.cc
+       for more info), an index over a field from an outer query might be
+       considered here, which is incorrect. Their query has been fully
+       optimized already so their reginfo.join_tab is NULL and we reject them.
+    */
+    return;
+  }
+
   if (!table->derived_keys_ready && table->uses_materialization() &&
       !field->table->is_created() &&
       table->update_derived_keys(field, value, num_values))
@@ -6757,6 +6771,8 @@ static bool convert_subquery_to_semijoin(JOIN *parent_join,
   parent_join->tables+= subq_lex->join->tables;
   parent_join->primary_tables+= subq_lex->join->tables;
 
+  parent_lex->between_count+= subq_lex->between_count;
+  parent_lex->cond_count+= subq_lex->cond_count;
   parent_lex->derived_table_count+= subq_lex->derived_table_count;
   parent_lex->materialized_table_count+= subq_lex->materialized_table_count;
   parent_lex->partitioned_table_count+= subq_lex->partitioned_table_count;
index 8d2983417af1b648a22c0c7ba637313808f852c1..b09b2c176a54e34e6a3be79b594433a91b935829 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQL_OPTIMIZER_INCLUDED
 #define SQL_OPTIMIZER_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
@@ -675,6 +675,7 @@ private:
   bool setup_materialized_table(JOIN_TAB *tab, uint tableno,
                                 const POSITION *inner_pos,
                                 POSITION *sjm_pos);
+  bool add_having_as_tmp_table_cond(uint curr_tmp_table);
   bool make_tmp_tables_info();
   bool compare_costs_of_subquery_strategies(
          Item_exists_subselect::enum_exec_method *method);
index 0ba8bcb5475249d13fd788f8fc45f58cad30dbe4..e8baa144eab7c15dcc7b1aa703171f8c21dacc99 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
 #include "sql_analyse.h"
 #include "table_cache.h" // table_cache_manager
 
+#include "sql_digest.h"
+
 #include <algorithm>
 using std::max;
 using std::min;
 
 #define FLAGSTR(V,F) ((V)&(F)?#F" ":"")
 
+#ifdef WITH_WSREP
+#include "wsrep_mysqld.h"
+#include "wsrep_thd.h"
+#include "wsrep_binlog.h"
+static void wsrep_mysql_parse(THD *thd, char *rawbuf, uint length,
+                              Parser_state *parser_state);
+#endif /* WITH_WSREP */
 /**
   @defgroup Runtime_Environment Runtime Environment
   @{
@@ -292,13 +301,44 @@ uint server_command_flags[COM_END+1];
 void init_update_queries(void)
 {
   /* Initialize the server command flags array. */
+#ifdef WITH_WSREP
   memset(server_command_flags, 0, sizeof(server_command_flags));
+  server_command_flags[COM_STATISTICS]=   CF_SKIP_QUESTIONS |
+    CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_PING]=         CF_SKIP_QUESTIONS |
+    CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_STMT_PREPARE]= CF_SKIP_QUESTIONS |
+    CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_STMT_EXECUTE]= CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_STMT_FETCH]=   CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_STMT_CLOSE]=   CF_SKIP_QUESTIONS |
+    CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_STMT_RESET]=   CF_SKIP_QUESTIONS |
+    CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_STMT_SEND_LONG_DATA] = CF_SKIP_WSREP_CHECK;
+
+  server_command_flags[COM_QUIT]= CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_PROCESS_INFO]= CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_PROCESS_KILL]= CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_SHUTDOWN]= CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_SLEEP]= CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_TIME]= CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_INIT_DB]= CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_END]= CF_SKIP_WSREP_CHECK;
 
+  /*
+    COM_QUERY and COM_SET_OPTION are allowed to pass the early COM_xxx filter,
+    they're checked later in mysql_execute_command().
+  */
+  server_command_flags[COM_QUERY]= CF_SKIP_WSREP_CHECK;
+  server_command_flags[COM_SET_OPTION]= CF_SKIP_WSREP_CHECK;
+#else
   server_command_flags[COM_STATISTICS]= CF_SKIP_QUESTIONS;
   server_command_flags[COM_PING]=       CF_SKIP_QUESTIONS;
   server_command_flags[COM_STMT_PREPARE]= CF_SKIP_QUESTIONS;
   server_command_flags[COM_STMT_CLOSE]=   CF_SKIP_QUESTIONS;
   server_command_flags[COM_STMT_RESET]=   CF_SKIP_QUESTIONS;
+#endif /* WITH_WSREP */
 
   /* Initialize the sql command flags array. */
   memset(sql_command_flags, 0, sizeof(sql_command_flags));
@@ -597,12 +637,11 @@ void init_update_queries(void)
   sql_command_flags[SQLCOM_UNINSTALL_PLUGIN]|= CF_DISALLOW_IN_RO_TRANS;
 }
 
-bool sqlcom_can_generate_row_events(const THD *thd)
+bool sqlcom_can_generate_row_events(enum enum_sql_command command)
 {
-  return (sql_command_flags[thd->lex->sql_command] &
-          CF_CAN_GENERATE_ROW_EVENTS);
+  return (sql_command_flags[command] & CF_CAN_GENERATE_ROW_EVENTS);
 }
+
 bool is_update_query(enum enum_sql_command command)
 {
   DBUG_ASSERT(command >= 0 && command <= SQLCOM_END);
@@ -823,7 +862,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;
@@ -890,6 +933,27 @@ void cleanup_items(Item *item)
   DBUG_VOID_RETURN;
 }
 
+#ifdef WITH_WSREP
+static bool wsrep_tables_accessible_when_detached(const TABLE_LIST *tables)
+{
+  bool has_tables = false;
+  for (const TABLE_LIST *table= tables; table; table= table->next_global)
+  {
+    TABLE_CATEGORY c;
+    LEX_STRING     db, tn;
+    lex_string_set(&db, table->db);
+    lex_string_set(&tn, table->table_name);
+    c= get_table_category(&db, &tn);
+    if (c != TABLE_CATEGORY_INFORMATION &&
+        c != TABLE_CATEGORY_PERFORMANCE)
+    {
+      return false;
+    }
+    has_tables = true;
+  }
+  return has_tables;
+}
+#endif /* WITH_WSREP */
 #ifndef EMBEDDED_LIBRARY
 
 /**
@@ -913,7 +977,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 +1027,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 +1042,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);
@@ -987,6 +1094,7 @@ bool do_command(THD *thd)
     /* Mark the statement completed. */
     MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
     thd->m_statement_psi= NULL;
+    thd->m_digest= NULL;
 
     if (net->error != 3)
     {
@@ -1026,6 +1134,30 @@ 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 || wsrep_reject_queries != WSREP_REJECT_NONE) &&
+        (server_command_flags[command] & CF_SKIP_WSREP_CHECK) == 0
+    ) {
+      my_message(ER_UNKNOWN_COM_ERROR,
+              "WSREP has not yet prepared node for application use", MYF(0));
+      thd->protocol->end_statement();
+
+      /* Performance Schema Interface instrumentation end */
+      MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
+      thd->m_statement_psi= NULL;
+      thd->m_digest= NULL;
+
+      return_value= FALSE;
+      goto out;
+    }
+  }
+#endif /* WITH_WSREP */
   /* Restore read timeout value */
   my_net_set_read_timeout(net, thd->variables.net_read_timeout);
 
@@ -1033,8 +1165,25 @@ 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_digest == NULL);
   DBUG_ASSERT(thd->m_statement_psi == NULL);
   DBUG_RETURN(return_value);
 }
@@ -1108,6 +1257,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 +1315,53 @@ 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)
+    {
+      if (command == COM_STMT_PREPARE          ||
+          command == COM_STMT_FETCH            ||
+          command == COM_STMT_SEND_LONG_DATA   ||
+          command == COM_STMT_CLOSE
+         )
+      {
+        WSREP_DEBUG("Prepared Statement bail out");
+      }
+      else
+      {
+        my_error(ER_LOCK_DEADLOCK, MYF(0), "wsrep aborted transaction");
+        WSREP_DEBUG("Deadlock error for: %s", WSREP_QUERY(thd));
+        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();
@@ -1306,6 +1531,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
   }
   case COM_QUERY:
   {
+    DBUG_ASSERT(thd->m_digest == NULL);
+    thd->m_digest= & thd->m_digest_state;
+    thd->m_digest->reset(thd->m_token_array, max_digest_length);
+
     if (alloc_query(thd, packet, packet_length))
       break;                                   // fatal error is set
     MYSQL_QUERY_START(thd->query(), thd->thread_id,
@@ -1319,6 +1548,38 @@ 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", WSREP_QUERY(thd));
+      mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+      thd->killed= THD::NOT_KILLED;
+      thd->mysys_var->abort= 0;
+      thd->wsrep_conflict_state= NO_CONFLICT;
+      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 +1590,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())
@@ -1363,6 +1628,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
 /* PSI end */
       MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
       thd->m_statement_psi= NULL;
+      thd->m_digest= NULL;
 
 /* DTRACE end */
       if (MYSQL_QUERY_DONE_ENABLED())
@@ -1388,6 +1654,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
                         (char *) thd->security_ctx->host_or_ip);
 
 /* PSI begin */
+      thd->m_digest= & thd->m_digest_state;
+
       thd->m_statement_psi= MYSQL_START_STATEMENT(&thd->m_statement_state,
                                                   com_statement_info[command].m_key,
                                                   thd->db, thd->db_length,
@@ -1401,10 +1669,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"));
@@ -1602,11 +1879,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
 #ifndef EMBEDDED_LIBRARY
   case COM_SHUTDOWN:
   {
-    if (packet_length < 1)
-    {
-      my_error(ER_MALFORMED_PACKET, MYF(0));
-      break;
-    }
     status_var_increment(thd->status_var.com_other);
     if (check_global_access(thd,SHUTDOWN_ACL))
       break; /* purecov: inspected */
@@ -1617,7 +1889,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
       packet[0].
     */
     enum mysql_enum_shutdown_level level;
-    if (!thd->is_valid_time())
+    if (packet_length == 0 || !thd->is_valid_time())
       level= SHUTDOWN_DEFAULT;
     else
       level= (enum mysql_enum_shutdown_level) (uchar) packet[0];
@@ -1746,6 +2018,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 +2050,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);
@@ -1777,6 +2072,7 @@ done:
   /* Performance Schema Interface instrumentation, end */
   MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
   thd->m_statement_psi= NULL;
+  thd->m_digest= NULL;
 
   dec_thread_running();
   thd->packet.shrink(thd->variables.net_buffer_length);        // Reclaim some memory
@@ -2256,6 +2552,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 +2800,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 +2808,51 @@ 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 and reads from information schema
+     * and dirty reads (if configured)
+     */
+    if (thd->variables.wsrep_on                                            &&
+        !thd->wsrep_applier                                                &&
+        !(wsrep_ready && wsrep_reject_queries == WSREP_REJECT_NONE)        &&
+        !(thd->variables.wsrep_dirty_reads &&
+          (sql_command_flags[lex->sql_command] & CF_CHANGES_DATA) == 0)    &&
+        !wsrep_tables_accessible_when_detached(all_tables)                 &&
+        lex->sql_command != SQLCOM_SET_OPTION                              &&
+        !wsrep_is_show_query(lex->sql_command))
+    {
+      my_message(ER_UNKNOWN_COM_ERROR,
+                 "WSREP has not yet prepared node for application use", MYF(0));
+      goto error;
+    }
+  }
+#endif /* WITH_WSREP */
 
   DBUG_ASSERT(thd->transaction.stmt.cannot_safely_rollback() == FALSE);
 
@@ -2546,7 +2893,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 +2953,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);
 
@@ -2633,12 +2988,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;
@@ -2902,7 +3267,7 @@ case SQLCOM_PREPARE:
 #ifdef WITH_PARTITION_STORAGE_ENGINE
     {
       partition_info *part_info= thd->lex->part_info;
-      if (part_info && !(part_info= thd->lex->part_info->get_clone()))
+      if (part_info && !(part_info= thd->lex->part_info->get_clone(true)))
       {
         res= -1;
         goto end_with_restore_list;
@@ -2938,7 +3303,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<Item> it(select_lex->item_list);
@@ -3056,6 +3421,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 +3463,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 +3556,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 +3586,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 +3652,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 +3664,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 +3707,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 +3780,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 +3818,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 +3867,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 +3969,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 +3988,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 +4058,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 +4107,6 @@ end_with_restore_list:
 
     if (!mysql_change_db(thd, &db_str, FALSE))
       my_ok(thd);
-
     break;
   }
 
@@ -3836,6 +4269,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 +4294,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 +4318,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 +4346,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;
   }
@@ -3917,6 +4354,9 @@ end_with_restore_list:
   {
     DBUG_EXECUTE_IF("4x_server_emul",
                     my_error(ER_UNKNOWN_ERROR, MYF(0)); goto error;);
+#ifdef WITH_WSREP
+    if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
     if (check_and_convert_db_name(&lex->name, TRUE) != IDENT_NAME_OK)
       break;
     res= mysqld_show_create_db(thd, lex->name.str, &lex->create_info);
@@ -3939,6 +4379,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:
     {
@@ -3969,10 +4410,14 @@ end_with_restore_list:
   /* lex->unit.cleanup() is called outside, no need to call it here */
   break;
   case SQLCOM_SHOW_CREATE_EVENT:
+#ifdef WITH_WSREP
+    if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
     res= Events::show_create_event(thd, lex->spname->m_db,
                                    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 +4432,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 +4447,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 +4459,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 +4470,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 +4485,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 +4552,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 +4566,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 +4582,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,
@@ -4188,12 +4641,59 @@ end_with_restore_list:
       break;
     }
 
+#ifdef WITH_WSREP
+    if (lex->type & (
+    REFRESH_GRANT                           |
+    REFRESH_HOSTS                           |
+#ifdef HAVE_OPENSSL
+    REFRESH_DES_KEY_FILE                    |
+#endif
+    /*
+      Write all flush log statements except
+      FLUSH LOGS
+      FLUSH BINARY LOGS
+      Check reload_acl_and_cache for why.
+    */
+    REFRESH_RELAY_LOG                       |
+    REFRESH_SLOW_LOG                        |
+    REFRESH_GENERAL_LOG                     |
+    REFRESH_ENGINE_LOG                      |
+    REFRESH_ERROR_LOG                       |
+#ifdef HAVE_QUERY_CACHE
+    REFRESH_QUERY_CACHE_FREE                |
+#endif /* HAVE_QUERY_CACHE */
+    REFRESH_STATUS                          |
+    REFRESH_USER_RESOURCES))
+    {
+      WSREP_TO_ISOLATION_BEGIN_WRTCHK(WSREP_MYSQL_DB, NULL, NULL)
+    }
+#endif /* WITH_WSREP*/
+
     /*
       reload_acl_and_cache() will tell us if we are allowed to write to the
       binlog or not.
     */
     if (!reload_acl_and_cache(thd, lex->type, first_table, &write_to_binlog))
     {
+#ifdef WITH_WSREP
+      if ((lex->type & REFRESH_TABLES) && !(lex->type & (REFRESH_FOR_EXPORT|REFRESH_READ_LOCK)))
+      {
+        /*
+          This is done after reload_acl_and_cache is because
+          LOCK TABLES is not replicated in galera, the upgrade of which
+          is checked in reload_acl_and_cache.
+          Hence, done after/if we are able to upgrade locks.
+        */
+        if (first_table)
+        {
+            WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
+        }
+        else
+        {
+            WSREP_TO_ISOLATION_BEGIN_WRTCHK(WSREP_MYSQL_DB, NULL, NULL);
+        }
+      }
+#endif /* WITH_WSREP */
       /*
         We WANT to write and we CAN write.
         ! we write after unlocking the table.
@@ -4247,8 +4747,7 @@ end_with_restore_list:
     LEX_USER *grant_user= get_current_user(thd, lex->grant_user);
     if (!grant_user)
       goto error;
-    if ((thd->security_ctx->priv_user &&
-        !strcmp(thd->security_ctx->priv_user, grant_user->user.str)) ||
+    if (!strcmp(thd->security_ctx->priv_user, grant_user->user.str) ||
         !check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 0))
     {
       res = mysql_show_grants(thd, grant_user);
@@ -4258,7 +4757,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 +4777,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 +4800,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 +4827,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 +4850,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 +4926,13 @@ end_with_restore_list:
     if (sp_process_definer(thd))
       goto create_sp_error;
 
+    /*
+      Record the CURRENT_USER in binlog. The CURRENT_USER is used on slave to
+      grant default privileges when sp_automatic_privileges variable is set.
+    */
+    thd->binlog_invoker();
+    WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
+
     res= (sp_result= sp_create_routine(thd, lex->sphead));
     switch (sp_result) {
     case SP_OK: {
@@ -4395,7 +4942,6 @@ end_with_restore_list:
       Security_context security_context;
       bool restore_backup_context= false;
       Security_context *backup= NULL;
-      LEX_USER *definer= thd->lex->definer;
       /*
         We're going to issue an implicit GRANT statement so we close all
         open tables. We have to keep metadata locks as this ensures that
@@ -4414,21 +4960,41 @@ end_with_restore_list:
       DBUG_ASSERT(thd->transaction.stmt.is_empty());
       close_thread_tables(thd);
       /*
-        Check if the definer exists on slave, 
+        Check if invoker exists on slave, then use invoker privilege to
+        insert routine privileges to mysql.procs_priv. If invoker is not
+        available then consider using definer.
+
+        Check if the definer exists on slave,
         then use definer privilege to insert routine privileges to mysql.procs_priv.
 
-        For current user of SQL thread has GLOBAL_ACL privilege, 
-        which doesn't any check routine privileges, 
+        For current user of SQL thread has GLOBAL_ACL privilege,
+        which doesn't any check routine privileges,
         so no routine privilege record  will insert into mysql.procs_priv.
       */
-      if (thd->slave_thread && is_acl_user(definer->host.str, definer->user.str))
+
+      if (thd->slave_thread)
       {
-        security_context.change_security_context(thd, 
-                                                 &thd->lex->definer->user,
-                                                 &thd->lex->definer->host,
-                                                 &thd->lex->sphead->m_db,
-                                                 &backup);
-        restore_backup_context= true;
+        LEX_STRING current_user;
+        LEX_STRING current_host;
+        if (thd->has_invoker())
+        {
+          current_host= thd->get_invoker_host();
+          current_user= thd->get_invoker_user();
+        }
+        else
+        {
+          current_host= lex->definer->host;
+          current_user= lex->definer->user;
+        }
+        if (is_acl_user(current_host.str, current_user.str))
+        {
+          security_context.change_security_context(thd,
+                                                   &current_user,
+                                                   &current_host,
+                                                   &thd->lex->sphead->m_db,
+                                                   &backup);
+          restore_backup_context= true;
+        }
       }
 
       if (sp_automatic_privileges && !opt_noacl &&
@@ -4602,6 +5168,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 +5240,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;
@@ -4740,12 +5308,18 @@ create_sp_error:
     }
   case SQLCOM_SHOW_CREATE_PROC:
     {
+#ifdef WITH_WSREP
+      if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
       if (sp_show_create_routine(thd, SP_TYPE_PROCEDURE, lex->spname))
         goto error;
       break;
     }
   case SQLCOM_SHOW_CREATE_FUNC:
     {
+#ifdef WITH_WSREP
+      if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
       if (sp_show_create_routine(thd, SP_TYPE_FUNCTION, lex->spname))
        goto error;
       break;
@@ -4758,6 +5332,9 @@ create_sp_error:
       enum_sp_type sp_type= (lex->sql_command == SQLCOM_SHOW_PROC_CODE) ?
                             SP_TYPE_PROCEDURE : SP_TYPE_FUNCTION;
 
+#ifdef WITH_WSREP
+      if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
       if (sp_cache_routine(thd, sp_type, lex->spname, false, &sp))
         goto error;
       if (!sp || sp->show_routine_code(thd))
@@ -4782,6 +5359,9 @@ create_sp_error:
         goto error;
       }
 
+#ifdef WITH_WSREP
+      if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
       if (show_create_trigger(thd, lex->spname))
         goto error; /* Error has been already logged. */
 
@@ -4793,6 +5373,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 +5382,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 +5397,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 +5418,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 +5436,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 +5462,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 +5610,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 +5658,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());
 }
@@ -5557,9 +6174,12 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
   for (; i < number && tables != first_not_own_table && tables;
        tables= tables->next_global, i++)
   {
+    TABLE_LIST *const table_ref= tables->correspondent_table ?
+      tables->correspondent_table : tables;
+
     ulong want_access= requirements;
-    if (tables->security_ctx)
-      sctx= tables->security_ctx;
+    if (table_ref->security_ctx)
+      sctx= table_ref->security_ctx;
     else
       sctx= backup_ctx;
 
@@ -5567,7 +6187,7 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
        Register access for view underlying table.
        Remove SHOW_VIEW_ACL, because it will be checked during making view
      */
-    tables->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL);
+    table_ref->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL);
 
     /*
       We should not encounter table list elements for reformed SHOW
@@ -5577,20 +6197,20 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
       (see check_show_access()). This check is carried out by caller,
       but only for the first table list element from the main select.
     */
-    DBUG_ASSERT(!tables->schema_table_reformed ||
-                tables == thd->lex->select_lex.table_list.first);
+    DBUG_ASSERT(!table_ref->schema_table_reformed ||
+                table_ref == thd->lex->select_lex.table_list.first);
 
-    DBUG_PRINT("info", ("derived: %d  view: %d", tables->derived != 0,
-                        tables->view != 0));
+    DBUG_PRINT("info", ("derived: %d  view: %d", table_ref->derived != 0,
+                        table_ref->view != 0));
 
-    if (tables->is_anonymous_derived_table())
+    if (table_ref->is_anonymous_derived_table())
       continue;
 
     thd->security_ctx= sctx;
 
-    if (check_access(thd, want_access, tables->get_db_name(),
-                     &tables->grant.privilege,
-                     &tables->grant.m_internal,
+    if (check_access(thd, want_access, table_ref->get_db_name(),
+                     &table_ref->grant.privilege,
+                     &table_ref->grant.m_internal,
                      0, no_errors))
       goto deny;
   }
@@ -5986,6 +6606,24 @@ 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 and
+    mysql slave may be processing STATEMENT format events, but he should
+    use autoinc values passed in binlog events, not the values forced by
+    the cluster.
+  */
+  if (WSREP(thd) && thd->wsrep_exec_mode == LOCAL_STATE &&
+      !thd->slave_thread && wsrep_auto_increment_control)
+  {
+    thd->variables.auto_increment_offset=
+      global_system_variables.auto_increment_offset;
+    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;
   /*
@@ -6023,9 +6661,6 @@ void THD::reset_for_next_command()
   thd->reset_current_stmt_binlog_format_row();
   thd->binlog_unsafe_warning_flags= 0;
 
-  thd->m_trans_end_pos= 0;
-  thd->m_trans_log_file= NULL;
-  thd->m_trans_fixed_log_file= NULL;
   thd->commit_error= THD::CE_NONE;
   thd->durability_property= HA_REGULAR_DURABILITY;
   thd->set_trans_pos(NULL, 0);
@@ -6211,6 +6846,133 @@ 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", WSREP_QUERY(thd));
+
+          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;
+          thd->m_digest= 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,
+                      WSREP_QUERY(thd));
+          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
@@ -6282,9 +7044,7 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
         no logging happens at all. If rewriting does not happen here,
         thd->rewritten_query is still empty from being reset in alloc_query().
       */
-      bool general= (opt_log && ! (opt_log_raw || thd->slave_thread));
-
-      if (general || opt_slow_log || opt_bin_log)
+      if (!(opt_log_raw || thd->slave_thread) || opt_slow_log || opt_bin_log)
       {
         mysql_rewrite_query(thd);
 
@@ -6292,7 +7052,7 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
           lex->safe_to_cache_query= false; // see comments below
       }
 
-      if (general)
+      if (!(opt_log_raw || thd->slave_thread))
       {
         if (thd->rewritten_query.length())
           general_log_write(thd, COM_QUERY, thd->rewritten_query.c_ptr_safe(),
@@ -6425,6 +7185,13 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
     if (!opt_log_raw)
       general_log_write(thd, COM_QUERY, thd->query(), thd->query_length());
     parser_state->m_lip.found_semicolon= NULL;
+
+#ifdef WITH_WSREP
+    if (WSREP_CLIENT(thd))
+    {
+      thd->wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+    }
+#endif /* WITH_WSREP */
   }
 
   DBUG_VOID_RETURN;
@@ -6446,6 +7213,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *rawbuf, uint length)
 {
   LEX *lex= thd->lex;
   bool ignorable= false;
+  sql_digest_state *parent_digest= thd->m_digest;
   PSI_statement_locker *parent_locker= thd->m_statement_psi;
   DBUG_ENTER("mysql_test_parse_for_slave");
 
@@ -6457,6 +7225,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *rawbuf, uint length)
     lex_start(thd);
     mysql_reset_thd_for_next_command(thd);
 
+    thd->m_digest= NULL;
     thd->m_statement_psi= NULL;
     if (parse_sql(thd, & parser_state, NULL) == 0)
     {
@@ -6470,6 +7239,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *rawbuf, uint length)
                !rpl_filter->db_ok(thd->db))
         ignorable= true;
     }
+    thd->m_digest= parent_digest;
     thd->m_statement_psi= parent_locker;
     thd->end_statement();
   }
@@ -7265,8 +8035,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.
@@ -8301,10 +9077,27 @@ bool parse_sql(THD *thd,
 
   thd->m_parser_state= parser_state;
 
-#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
-  /* Start Digest */
-  thd->m_parser_state->m_lip.m_digest_psi= MYSQL_DIGEST_START(thd->m_statement_psi);
-#endif
+  parser_state->m_digest_psi= NULL;
+  parser_state->m_lip.m_digest= NULL;
+
+  if (thd->m_digest != NULL)
+  {
+    /* Start Digest */
+    parser_state->m_digest_psi= MYSQL_DIGEST_START(thd->m_statement_psi);
+
+    if (parser_state->m_input.m_compute_digest ||
+       (parser_state->m_digest_psi != NULL))
+    {
+      /*
+        If either:
+        - the caller wants to compute a digest
+        - the performance schema wants to compute a digest
+        set the digest listener in the lexer.
+      */
+      parser_state->m_lip.m_digest= thd->m_digest;
+      parser_state->m_lip.m_digest->m_digest_storage.m_charset_number= thd->charset()->number;
+    }
+  }
 
   /* Parse the query. */
 
@@ -8337,6 +9130,18 @@ bool parse_sql(THD *thd,
   /* That's it. */
 
   ret_value= mysql_parse_status || thd->is_fatal_error;
+
+  if ((ret_value == 0) &&
+      (parser_state->m_digest_psi != NULL))
+  {
+    /*
+      On parsing success, record the digest in the performance schema.
+    */
+    DBUG_ASSERT(thd->m_digest != NULL);
+    MYSQL_DIGEST_END(parser_state->m_digest_psi,
+                     & thd->m_digest->m_digest_storage);
+  }
+
   MYSQL_QUERY_PARSE_DONE(ret_value);
   return ret_value;
 }
index b1124d1c170cd8145af7e089891b1be42d5a6ed3..867ab0777ae0abb90c63c5187816a0bf9f695dda 100644 (file)
@@ -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
@@ -210,8 +210,31 @@ inline bool is_supported_parser_charset(const CHARSET_INFO *cs)
 {
   return (cs->mbminlen == 1);
 }
+#ifdef WITH_WSREP
 
-extern "C" bool sqlcom_can_generate_row_events(const THD *thd);
+#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);
+
+/* Checks if lex->no_write_to_binlog is set for statements that use
+  LOCAL or NO_WRITE_TO_BINLOG
+*/
+#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)                   \
+  if (WSREP(thd) && !thd->lex->no_write_to_binlog                                   \
+         && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
+
+#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(enum enum_sql_command command);
 
 #endif /* SQL_PARSE_INCLUDED */
index 230469afaa9442620bac268097e9794b35937e7a..d0fd86f81d2c4a9e22a56a94288f8088118140c5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+/* 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
@@ -2063,6 +2063,13 @@ engine may include the filename.
 static int add_keyword_path(File fptr, const char *keyword,
                             const char *path)
 {
+
+  if (strlen(path) >= FN_REFLEN)
+  {
+    my_error(ER_PATH_LENGTH, MYF(0), "data/index directory (>=512 bytes)");
+    return 1;
+  }
+
   int err= add_string(fptr, keyword);
 
   err+= add_space(fptr);
@@ -2070,7 +2077,8 @@ static int add_keyword_path(File fptr, const char *keyword,
   err+= add_space(fptr);
 
   char temp_path[FN_REFLEN];
-  strcpy(temp_path, path);
+  strncpy(temp_path, path, FN_REFLEN-1);
+  temp_path[FN_REFLEN-1] = '\0';
 #ifdef __WIN__
   /* Convert \ to / to be able to create table on unix */
   char *pos, *end;
@@ -4368,6 +4376,7 @@ bool mysql_unpack_partition(THD *thd,
     thd->variables.character_set_client;
   LEX *old_lex= thd->lex;
   LEX lex;
+  sql_digest_state *parent_digest= thd->m_digest;
   PSI_statement_locker *parent_locker= thd->m_statement_psi;
   DBUG_ENTER("mysql_unpack_partition");
 
@@ -4399,14 +4408,17 @@ bool mysql_unpack_partition(THD *thd,
   part_info= lex.part_info;
   DBUG_PRINT("info", ("Parse: %s", part_buf));
 
+  thd->m_digest= NULL;
   thd->m_statement_psi= NULL;
   if (parse_sql(thd, & parser_state, NULL) ||
       part_info->fix_parser_data(thd))
   {
     thd->free_items();
+    thd->m_digest= parent_digest;
     thd->m_statement_psi= parent_locker;
     goto end;
   }
+  thd->m_digest= parent_digest;
   thd->m_statement_psi= parent_locker;
   /*
     The parsed syntax residing in the frm file can still contain defaults.
@@ -4768,8 +4780,8 @@ bool compare_partition_options(HA_CREATE_INFO *table_create_info,
   @param[in,out] create_info     Create info for CREATE TABLE
   @param[in]  alter_ctx          ALTER TABLE runtime context
   @param[out] partition_changed  Boolean indicating whether partition changed
-  @param[out] fast_alter_table   Boolean indicating if fast partition alter is
-                                 possible.
+  @param[out] new_part_info      New partition_info object if fast partition
+                                 alter is possible. (NULL if not possible).
 
   @return Operation status
     @retval TRUE                 Error
@@ -4789,9 +4801,10 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
                            HA_CREATE_INFO *create_info,
                            Alter_table_ctx *alter_ctx,
                            bool *partition_changed,
-                           bool *fast_alter_table)
+                           partition_info **new_part_info)
 {
   DBUG_ENTER("prep_alter_part_table");
+  DBUG_ASSERT(new_part_info);
 
   /* Foreign keys on partitioned tables are not supported, waits for WL#148 */
   if (table->part_info && (alter_info->flags & Alter_info::ADD_FOREIGN_KEY ||
@@ -4811,7 +4824,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
   thd->work_part_info= thd->lex->part_info;
 
   if (thd->work_part_info &&
-      !(thd->work_part_info= thd->lex->part_info->get_clone()))
+      !(thd->work_part_info= thd->lex->part_info->get_clone(true)))
     DBUG_RETURN(TRUE);
 
   /* ALTER_ADMIN_PARTITION is handled in mysql_admin_table */
@@ -4839,18 +4852,28 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
       DBUG_RETURN(TRUE);
     }
 
-    /*
-      Open our intermediate table, we will operate on a temporary instance
-      of the original table, to be able to skip copying all partitions.
-      Open it as a copy of the original table, and modify its partition_info
-      object to allow fast_alter_partition_table to perform the changes.
-    */
     DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE,
                                                alter_ctx->db,
                                                alter_ctx->table_name,
                                                MDL_INTENTION_EXCLUSIVE));
 
-    tab_part_info= table->part_info;
+    /*
+      We will operate on a cached instance of the original table,
+      to be able to skip copying all non-changed partitions
+      while allowing concurrent access.
+
+      We create a new partition_info object which will carry
+      the new state of the partitions. It will only be temporary
+      attached to the handler when needed and then detached afterwards
+      (through handler::set_part_info()). That way it will not get reused
+      by next statement, even if the table object is reused due to LOCK TABLE.
+    */
+    tab_part_info= table->part_info->get_full_clone();
+    if (!tab_part_info)
+    {
+      mem_alloc_error(sizeof(partition_info));
+      DBUG_RETURN(true);
+    }
 
     if (alter_info->flags & Alter_info::ALTER_TABLE_REORG)
     {
@@ -4881,19 +4904,10 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
         flags= table->file->alter_table_flags(alter_info->flags);
         if (flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE))
         {
-          *fast_alter_table= true;
+          *new_part_info= tab_part_info;
           /* Force table re-open for consistency with the main case. */
           table->m_needs_reopen= true;
         }
-        else
-        {
-          /*
-            Create copy of partition_info to avoid modifying original
-            TABLE::part_info, to keep it safe for later use.
-          */
-          if (!(tab_part_info= tab_part_info->get_clone()))
-            DBUG_RETURN(TRUE);
-        }
 
         thd->work_part_info= tab_part_info;
         DBUG_RETURN(FALSE);
@@ -4930,21 +4944,9 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
         information to storage engine in this case), so the table
         must be reopened.
       */
-      *fast_alter_table= true;
+      *new_part_info= tab_part_info;
       table->m_needs_reopen= true;
     }
-    else
-    {
-      /*
-        "Fast" changing of partitioning is not supported. Create
-        a copy of TABLE::part_info object, so we can modify it safely.
-        Modifying original TABLE::part_info will cause problems when
-        we read data from old version of table using this TABLE object
-        while copying them to new version of table.
-      */
-      if (!(tab_part_info= tab_part_info->get_clone()))
-        DBUG_RETURN(TRUE);
-    }
     DBUG_PRINT("info", ("*fast_alter_table flags: 0x%x", flags));
     if ((alter_info->flags & Alter_info::ALTER_ADD_PARTITION) ||
         (alter_info->flags & Alter_info::ALTER_REORGANIZE_PARTITION))
@@ -5133,7 +5135,7 @@ adding and copying partitions, the second after completing the adding
 and copying and finally the third line after also dropping the partitions
 that are reorganised.
 */
-      if (*fast_alter_table &&
+      if (*new_part_info &&
           tab_part_info->part_type == HASH_PARTITION)
       {
         uint part_no= 0, start_part= 1, start_sec_part= 1;
@@ -5238,7 +5240,7 @@ that are reorganised.
         do
         {
           partition_element *part_elem= alt_it++;
-          if (*fast_alter_table)
+          if (*new_part_info)
             part_elem->part_state= PART_TO_BE_ADDED;
           if (tab_part_info->partitions.push_back(part_elem))
           {
@@ -5325,7 +5327,7 @@ that are reorganised.
         my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REBUILD");
         goto err;
       }
-      if (!(*fast_alter_table))
+      if (!(*new_part_info))
       {
         table->file->print_error(HA_ERR_WRONG_COMMAND, MYF(0));
         goto err;
@@ -5388,7 +5390,7 @@ state of p1.
         uint part_count= 0, start_part= 1, start_sec_part= 1;
         uint end_part= 0, end_sec_part= 0;
         bool all_parts= TRUE;
-        if (*fast_alter_table &&
+        if (*new_part_info &&
             tab_part_info->linear_hash_ind)
         {
           uint upper_2n= tab_part_info->linear_hash_mask + 1;
@@ -5414,14 +5416,14 @@ state of p1.
         do
         {
           partition_element *p_elem= part_it++;
-          if (*fast_alter_table &&
+          if (*new_part_info &&
               (all_parts ||
               (part_count >= start_part && part_count <= end_part) ||
               (part_count >= start_sec_part && part_count <= end_sec_part)))
             p_elem->part_state= PART_CHANGED;
           if (++part_count > num_parts_remain)
           {
-            if (*fast_alter_table)
+            if (*new_part_info)
               p_elem->part_state= PART_REORGED_DROPPED;
             else
               part_it.remove();
@@ -5548,13 +5550,13 @@ the generated partition syntax in a correct manner.
             }
             else
               tab_max_range= part_elem->range_value;
-            if (*fast_alter_table &&
+            if (*new_part_info &&
                 tab_part_info->temp_partitions.push_back(part_elem))
             {
               mem_alloc_error(1);
               goto err;
             }
-            if (*fast_alter_table)
+            if (*new_part_info)
               part_elem->part_state= PART_TO_BE_REORGED;
             if (!found_first)
             {
@@ -5574,7 +5576,7 @@ the generated partition syntax in a correct manner.
                 else
                   alt_max_range= alt_part_elem->range_value;
 
-                if (*fast_alter_table)
+                if (*new_part_info)
                   alt_part_elem->part_state= PART_TO_BE_ADDED;
                 if (alt_part_count == 0)
                   tab_it.replace(alt_part_elem);
@@ -5822,7 +5824,7 @@ the generated partition syntax in a correct manner.
   }
   DBUG_RETURN(FALSE);
 err:
-  *fast_alter_table= false;
+  *new_part_info= NULL;
   DBUG_RETURN(TRUE);
 }
 
@@ -5859,6 +5861,7 @@ static bool mysql_change_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
   int error;
   handler *file= lpt->table->file;
   THD *thd= lpt->thd;
+  partition_info *old_part_info= lpt->table->part_info;
   DBUG_ENTER("mysql_change_partitions");
 
   build_table_filename(path, sizeof(path) - 1, lpt->db, lpt->table_name, "", 0);
@@ -5868,9 +5871,12 @@ static bool mysql_change_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
 
   /* TODO: test if bulk_insert would increase the performance */
 
-  if ((error= file->ha_change_partitions(lpt->create_info, path, &lpt->copied,
-                                         &lpt->deleted, lpt->pack_frm_data,
-                                         lpt->pack_frm_len)))
+  file->set_part_info(lpt->part_info, false);
+  error= file->ha_change_partitions(lpt->create_info, path, &lpt->copied,
+                                    &lpt->deleted, lpt->pack_frm_data,
+                                    lpt->pack_frm_len);
+  file->set_part_info(old_part_info, false);
+  if (error)
   {
     file->print_error(error, MYF(error != ER_OUTOFMEMORY ? 0 : ME_FATALERROR));
   }
@@ -5905,10 +5911,14 @@ static bool mysql_rename_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
 {
   char path[FN_REFLEN+1];
   int error;
+  partition_info *old_part_info= lpt->table->part_info;
   DBUG_ENTER("mysql_rename_partitions");
 
   build_table_filename(path, sizeof(path) - 1, lpt->db, lpt->table_name, "", 0);
-  if ((error= lpt->table->file->ha_rename_partitions(path)))
+  lpt->table->file->set_part_info(lpt->part_info, false);
+  error= lpt->table->file->ha_rename_partitions(path);
+  lpt->table->file->set_part_info(old_part_info, false);
+  if (error)
   {
     if (error != 1)
       lpt->table->file->print_error(error, MYF(0));
@@ -5941,7 +5951,8 @@ static bool mysql_rename_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
 static bool mysql_drop_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
 {
   char path[FN_REFLEN+1];
-  partition_info *part_info= lpt->table->part_info;
+  partition_info *old_part_info= lpt->table->part_info;
+  partition_info *part_info= lpt->part_info;
   List_iterator<partition_element> part_it(part_info->partitions);
   uint i= 0;
   uint remove_count= 0;
@@ -5954,7 +5965,10 @@ static bool mysql_drop_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
                                                 MDL_EXCLUSIVE));
 
   build_table_filename(path, sizeof(path) - 1, lpt->db, lpt->table_name, "", 0);
-  if ((error= lpt->table->file->ha_drop_partitions(path)))
+  lpt->table->file->set_part_info(part_info, false);
+  error= lpt->table->file->ha_drop_partitions(path);
+  lpt->table->file->set_part_info(old_part_info, false);
+  if (error)
   {
     lpt->table->file->print_error(error, MYF(0));
     DBUG_RETURN(TRUE);
@@ -6674,6 +6688,9 @@ static int alter_close_table(ALTER_PARTITION_PARAM_TYPE *lpt)
 {
   DBUG_ENTER("alter_close_table");
 
+  /* Remove other instances of the table before dropping partitions */
+  close_all_tables_for_name(lpt->thd, lpt->table->s, false, lpt->table);
+
   if (lpt->table->db_stat)
   {
     mysql_lock_remove(lpt->thd, lpt->thd->lock, lpt->table);
@@ -6691,61 +6708,57 @@ static int alter_close_table(ALTER_PARTITION_PARAM_TYPE *lpt)
   @param action_completed   The action must be completed, NOT reverted
   @param drop_partition     Partitions has not been dropped yet
   @param frm_install        The shadow frm-file has not yet been installed
-  @param close_table        Table is still open, close it before reverting
 */
 
 void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
                              bool action_completed,
                              bool drop_partition,
-                             bool frm_install,
-                             bool close_table)
+                             bool frm_install)
 {
-  partition_info *part_info= lpt->part_info;
+  partition_info *part_info= lpt->part_info->get_clone();
   THD *thd= lpt->thd;
   TABLE *table= lpt->table;
   DBUG_ENTER("handle_alter_part_error");
   DBUG_ASSERT(table->m_needs_reopen);
 
-  if (close_table)
-  {
-    /*
-      All instances of this table needs to be closed.
-      Better to do that here, than leave the cleaning up to others.
-      Aquire EXCLUSIVE mdl lock if not already aquired.
-    */
-    if (!thd->mdl_context.is_lock_owner(MDL_key::TABLE, lpt->db,
-                                        lpt->table_name,
-                                        MDL_EXCLUSIVE))
-    {
-      if (wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN))
-      {
-        /* At least remove this instance on failure */
-        goto err_exclusive_lock;
-      }
-    }
-    /* Ensure the share is destroyed and reopened. */
-    part_info= lpt->part_info->get_clone();
-    close_all_tables_for_name(thd, table->s, false, NULL);
-  }
-  else
+  /*
+    All instances of this table needs to be closed.
+    Better to do that here, than leave the cleaning up to others.
+    Acquire EXCLUSIVE mdl lock if not already acquired.
+  */
+  if (!thd->mdl_context.is_lock_owner(MDL_key::TABLE, lpt->db,
+                                      lpt->table_name,
+                                      MDL_EXCLUSIVE) &&
+      wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN))
   {
-err_exclusive_lock:
     /*
+      Did not succeed in getting exclusive access to the table.
+
+      Since we have altered a cached table object (and its part_info) we need
+      at least to remove this instance so it will not be reused.
+
       Temporarily remove it from the locked table list, so that it will get
       reopened.
     */
     thd->locked_tables_list.unlink_from_list(thd,
                                              table->pos_in_locked_tables,
                                              false);
+    /* Assert that the current table is the first in list of open tables */
+    DBUG_ASSERT(thd->open_tables == table);
+
     /*
       Make sure that the table is unlocked, closed and removed from
       the table cache.
     */
     mysql_lock_remove(thd, thd->lock, table);
-    part_info= lpt->part_info->get_clone();
     close_thread_table(thd, &thd->open_tables);
     lpt->table_list->table= NULL;
   }
+  else
+  {
+    /* Ensure the share is destroyed and reopened. */
+    close_all_tables_for_name(thd, table->s, false, NULL);
+  }
 
   if (part_info->first_log_entry &&
       execute_ddl_log_entry(thd, part_info->first_log_entry->entry_pos))
@@ -6889,12 +6902,13 @@ static void downgrade_mdl_if_lock_tables_mode(THD *thd, MDL_ticket *ticket,
   previously prepared.
 
   @param thd                           Thread object
-  @param table                         Original table object with new part_info
+  @param table                         Original table object
   @param alter_info                    ALTER TABLE info
   @param create_info                   Create info for CREATE TABLE
   @param table_list                    List of the table involved
   @param db                            Database name of new table
   @param table_name                    Table name of new table
+  @param new_part_info                 New partition_info to use
 
   @return Operation status
     @retval TRUE                          Error
@@ -6910,20 +6924,20 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
                                 HA_CREATE_INFO *create_info,
                                 TABLE_LIST *table_list,
                                 char *db,
-                                const char *table_name)
+                                const char *table_name,
+                                partition_info *new_part_info)
 {
   /* Set-up struct used to write frm files */
   partition_info *part_info;
   ALTER_PARTITION_PARAM_TYPE lpt_obj;
   ALTER_PARTITION_PARAM_TYPE *lpt= &lpt_obj;
   bool action_completed= FALSE;
-  bool close_table_on_failure= FALSE;
   bool frm_install= FALSE;
   MDL_ticket *mdl_ticket= table->mdl_ticket;
   DBUG_ENTER("fast_alter_partition_table");
   DBUG_ASSERT(table->m_needs_reopen);
 
-  part_info= table->part_info;
+  part_info= new_part_info;
   lpt->thd= thd;
   lpt->table_list= table_list;
   lpt->part_info= part_info;
@@ -7058,13 +7072,11 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
         wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN) ||
         ERROR_INJECT_CRASH("crash_drop_partition_3") ||
         ERROR_INJECT_ERROR("fail_drop_partition_3") ||
-        (close_table_on_failure= TRUE, FALSE) ||
         write_log_drop_partition(lpt) ||
         (action_completed= TRUE, FALSE) ||
         ERROR_INJECT_CRASH("crash_drop_partition_4") ||
         ERROR_INJECT_ERROR("fail_drop_partition_4") ||
         alter_close_table(lpt) ||
-        (close_table_on_failure= FALSE, FALSE) ||
         ERROR_INJECT_CRASH("crash_drop_partition_5") ||
         ERROR_INJECT_ERROR("fail_drop_partition_5") ||
         ((!thd->lex->no_write_to_binlog) &&
@@ -7085,8 +7097,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
         ERROR_INJECT_ERROR("fail_drop_partition_9") ||
         (alter_partition_lock_handling(lpt), FALSE)) 
     {
-      handle_alter_part_error(lpt, action_completed, TRUE, frm_install,
-                              close_table_on_failure);
+      handle_alter_part_error(lpt, action_completed, TRUE, frm_install);
       goto err;
     }
   }
@@ -7132,14 +7143,12 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
         wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN) ||
         ERROR_INJECT_CRASH("crash_add_partition_3") ||
         ERROR_INJECT_ERROR("fail_add_partition_3") ||
-        (close_table_on_failure= TRUE, FALSE) ||
         write_log_add_change_partition(lpt) ||
         ERROR_INJECT_CRASH("crash_add_partition_4") ||
         ERROR_INJECT_ERROR("fail_add_partition_4") ||
         mysql_change_partitions(lpt) ||
         ERROR_INJECT_CRASH("crash_add_partition_5") ||
         ERROR_INJECT_ERROR("fail_add_partition_5") ||
-        (close_table_on_failure= FALSE, FALSE) ||
         alter_close_table(lpt) ||
         ERROR_INJECT_CRASH("crash_add_partition_6") ||
         ERROR_INJECT_ERROR("fail_add_partition_6") ||
@@ -7162,8 +7171,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
         ERROR_INJECT_ERROR("fail_add_partition_10") ||
         (alter_partition_lock_handling(lpt), FALSE))
     {
-      handle_alter_part_error(lpt, action_completed, FALSE, frm_install,
-                              close_table_on_failure);
+      handle_alter_part_error(lpt, action_completed, FALSE, frm_install);
       goto err;
     }
   }
@@ -7228,7 +7236,6 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
         mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
         ERROR_INJECT_CRASH("crash_change_partition_2") ||
         ERROR_INJECT_ERROR("fail_change_partition_2") ||
-        (close_table_on_failure= TRUE, FALSE) ||
         write_log_add_change_partition(lpt) ||
         ERROR_INJECT_CRASH("crash_change_partition_3") ||
         ERROR_INJECT_ERROR("fail_change_partition_3") ||
@@ -7239,7 +7246,6 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
         ERROR_INJECT_CRASH("crash_change_partition_5") ||
         ERROR_INJECT_ERROR("fail_change_partition_5") ||
         alter_close_table(lpt) ||
-        (close_table_on_failure= FALSE, FALSE) ||
         ERROR_INJECT_CRASH("crash_change_partition_6") ||
         ERROR_INJECT_ERROR("fail_change_partition_6") ||
         write_log_final_change_partition(lpt) ||
@@ -7267,8 +7273,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
         ERROR_INJECT_ERROR("fail_change_partition_12") ||
         (alter_partition_lock_handling(lpt), FALSE))
     {
-      handle_alter_part_error(lpt, action_completed, FALSE, frm_install,
-                              close_table_on_failure);
+      handle_alter_part_error(lpt, action_completed, FALSE, frm_install);
       goto err;
     }
   }
index 211e28ac33ea2c94f0c7c4b61effa3b15cadae19..db2004103d2e3a9e33e9054bca4a817996c7cff2 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQL_PARTITION_INCLUDED
 #define SQL_PARTITION_INCLUDED
 
-/* Copyright (c) 2006, 2014, 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
@@ -248,7 +248,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
                                 HA_CREATE_INFO *create_info,
                                 TABLE_LIST *table_list,
                                 char *db,
-                                const char *table_name);
+                                const char *table_name,
+                                partition_info *new_part_info);
 void set_all_part_state(partition_info *tab_part_info,
                         enum partition_state part_state);
 bool set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
@@ -257,7 +258,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
                            HA_CREATE_INFO *create_info,
                            Alter_table_ctx *alter_ctx,
                            bool *partition_changed,
-                           bool *fast_alter_table);
+                           partition_info **new_part_info);
 char *generate_partition_syntax(partition_info *part_info,
                                 uint *buf_length, bool use_sql_alloc,
                                 bool show_partition_options,
index 15ead354d567d82cac24f98ccb9c7198c7851966..857f050c68a8dd3e6c152bd2e7272a24be4e1dfd 100644 (file)
@@ -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 (WSREP(thd) && (!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);
 
index 13aa77ad0cf0f7af5a46fd8b2b02f3c97669ae82..6c2d21b26df13831554648fb60e5f0e1e2fc71be 100644 (file)
@@ -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
@@ -878,11 +878,11 @@ void Optimize_table_order::best_access_path(
     (1) The found 'ref' access produces more records than a table scan
         (or index scan, or quick select), or 'ref' is more expensive than
         any of them.
-    (2) This doesn't hold: the best way to perform table scan is to to perform
-        'range' access using index IDX, and the best way to perform 'ref' 
-        access is to use the same index IDX, with the same or more key parts.
-        (note: it is not clear how this rule is/should be extended to 
-        index_merge quick selects)
+    (2) The best way to perform table or index scan is to use 'range' access
+        using index IDX. If it is a 'tight range' scan (i.e not a loose index
+        scan' or 'index merge'), then ref access on the same index will
+        perform equal or better if ref access can use the same or more number
+        of key parts.
     (3) See above note about InnoDB.
     (4) NOT ("FORCE INDEX(...)" is used for table and there is 'ref' access
              path, but there is no quick select)
@@ -904,7 +904,9 @@ void Optimize_table_order::best_access_path(
   }
 
   if ((s->quick && best_key && s->quick->index == best_key->key &&      // (2)
-       best_max_key_part >= s->table->quick_key_parts[best_key->key]))  // (2)
+       best_max_key_part >= s->table->quick_key_parts[best_key->key]) &&  // (2)
+      (s->quick->get_type() !=
+       QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX))                      // (2)
   {
     trace_access_scan.add_alnum("access_type", "range").
       add_alnum("cause", "heuristic_index_cheaper");
@@ -3034,6 +3036,7 @@ void Optimize_table_order::semijoin_dupsweedout_access_paths(
   double cost, rowcount;
   double inner_fanout= 1.0;
   double outer_fanout= 1.0;
+  double max_outer_fanout= 1.0;
   uint rowsize;             // Row size of the temporary table
   if (first_tab == join->const_tables)
   {
@@ -3048,47 +3051,59 @@ void Optimize_table_order::semijoin_dupsweedout_access_paths(
     rowsize= 8;             // This is not true but we'll make it so
   }
   /**
-    @todo: Some times, some outer fanout is "absorbed" into the inner fanout.
+    Some times, some outer fanout is "absorbed" into the inner fanout.
     In this case, we should make a better estimate for outer_fanout that
     is used to calculate the output rowcount.
-    Trial code:
-      if (inner_fanout > 1.0)
-      {
-       // We have inner table(s) before an outer table. If there are
-       // dependencies between these tables, the fanout for the outer
-       // table is not a good estimate for the final number of rows from
-       // the weedout execution, therefore we convert some of the inner
-       // fanout into an outer fanout, limited to the number of possible
-       // rows in the outer table.
-        double fanout= min(inner_fanout*p->records_read,
-                           p->table->table->quick_condition_rows);
-        inner_fanout*= p->records_read / fanout;
-        outer_fanout*= fanout;
-      }
-      else
-        outer_fanout*= p->records_read;
+    If we have inner table(s) before an outer table and if there are
+    dependencies between these tables, the fanout for the outer table is not
+    a good estimate for the final number of rows from the weedout execution,
+    therefore we convert some of the inner fanout into an outer fanout,
+    limited to the number of possible rows in the outer table.
   */
   for (uint j= first_tab; j <= last_tab; j++)
   {
     const POSITION *const p= join->positions + j;
     if (p->table->emb_sj_nest)
-    {
       inner_fanout*= p->records_read;
-    }
     else
     {
-      outer_fanout*= p->records_read;
-
+      /*
+        max_outer_fanout is the cardinality of the cross product of the
+        outer tables.
+        @note: We do not consider dependencies between these tables here.
+      */
+      max_outer_fanout*= p->table->table->quick_condition_rows;
+      if (inner_fanout > 1.0)
+      {
+        // Absorb inner fanout into the outer fanout:
+        outer_fanout*= inner_fanout * p->records_read;
+        inner_fanout= 1.0;
+      }
+      else
+        outer_fanout*= p->records_read;
       rowsize+= p->table->table->file->ref_length;
     }
     cost+= p->read_time +
            rowcount * inner_fanout * outer_fanout * ROW_EVALUATE_COST;
   }
 
+  if (max_outer_fanout < outer_fanout)
+  {
+    /*
+      The calculated fanout for the outer tables is bigger than the
+      cardinality of the cross product of the outer tables. Adjust outer
+      fanout to the max value, but also adjust inner fanout so that
+      inner_fanout * outer_fanout is still the same (dups weedout runs
+      a complete join internally).
+    */
+    if (max_outer_fanout > 0.0)
+      inner_fanout*= outer_fanout / max_outer_fanout;
+    outer_fanout= max_outer_fanout;
+  }
+
   /*
-    @todo: Change this paragraph in concert with the todo note above.
     Add the cost of temptable use. The table will have outer_fanout rows,
-    and we will make 
+    and we will make
     - rowcount * outer_fanout writes
     - rowcount * inner_fanout * outer_fanout lookups.
     We assume here that a lookup and a write has the same cost.
index bc89a8cf5bb36617a99dec3c1f0b5a9b8dda38c1..99b15a16178796af94c3fae913eb48227829d517 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+   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
@@ -1674,12 +1674,6 @@ void memcached_shutdown(void)
   struct st_plugin_int *plugin;
   if (initialized)
   {
-    /*
-      It's perfectly safe not to lock LOCK_plugin, as there're no
-      concurrent threads anymore. But some functions called from here
-      use mysql_mutex_assert_owner(), so we lock the mutex to satisfy it
-    */
-    mysql_mutex_lock(&LOCK_plugin);
 
     for (uint i= 0; i < plugin_array.elements; i++)
     {
@@ -1689,12 +1683,14 @@ void memcached_shutdown(void)
          && strcmp(plugin->name.str, "daemon_memcached") == 0)
       {
        plugin_deinitialize(plugin, true);
+
+        mysql_mutex_lock(&LOCK_plugin);
        plugin->state= PLUGIN_IS_DYING;
        plugin_del(plugin);
+        mysql_mutex_unlock(&LOCK_plugin);
       }
     }
 
-    mysql_mutex_unlock(&LOCK_plugin);
   }
 }
 
@@ -2827,7 +2823,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=
index d1874187301aca32ecaa75dd58a536a0bd035cd1..32a0f24bf9576ca562f0efcb600fb5aed652059b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
@@ -116,7 +116,7 @@ When one supplies long data for a placeholder:
 #include "sql_analyse.h"
 #include "sql_rewrite.h"
 #include "transaction.h"                        // trans_rollback_implicit
-
+#include "sql_audit.h"
 #include <algorithm>
 using std::max;
 using std::min;
@@ -306,11 +306,11 @@ static inline void log_execute_line(THD *thd)
     return;
 
   if (thd->rewritten_query.length())
-    logger.general_log_write(thd, COM_STMT_EXECUTE,
+    general_log_write(thd, COM_STMT_EXECUTE,
                              thd->rewritten_query.c_ptr_safe(),
                              thd->rewritten_query.length());
   else
-    logger.general_log_write(thd, COM_STMT_EXECUTE,
+    general_log_write(thd, COM_STMT_EXECUTE,
                              thd->query(), thd->query_length());
 }
 
@@ -3137,6 +3137,7 @@ Execute_sql_statement(LEX_STRING sql_text)
 bool
 Execute_sql_statement::execute_server_code(THD *thd)
 {
+  sql_digest_state *parent_digest;
   PSI_statement_locker *parent_locker;
   bool error;
 
@@ -3150,9 +3151,12 @@ Execute_sql_statement::execute_server_code(THD *thd)
   parser_state.m_lip.multi_statements= FALSE;
   lex_start(thd);
 
+  parent_digest= thd->m_digest;
   parent_locker= thd->m_statement_psi;
+  thd->m_digest= NULL;
   thd->m_statement_psi= NULL;
   error= parse_sql(thd, &parser_state, NULL) || thd->is_error();
+  thd->m_digest= parent_digest;
   thd->m_statement_psi= parent_locker;
 
   if (error)
@@ -3162,19 +3166,18 @@ Execute_sql_statement::execute_server_code(THD *thd)
 
   parent_locker= thd->m_statement_psi;
   thd->m_statement_psi= NULL;
+
   /*
     Rewrite first (if needed); execution might replace passwords
     with hashes in situ without flagging it, and then we'd make
     a hash of that hash.
   */
   rewrite_query_if_needed(thd);
+  log_execute_line(thd);
+
   error= mysql_execute_command(thd) ;
   thd->m_statement_psi= parent_locker;
 
-  /* report error issued during command execution */
-  if (error == 0)
-    log_execute_line(thd);
-
 end:
   lex_end(thd->lex);
 
@@ -3354,7 +3357,10 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
   bool error;
   Statement stmt_backup;
   Query_arena *old_stmt_arena;
+  sql_digest_state *parent_digest= thd->m_digest;
   PSI_statement_locker *parent_locker= thd->m_statement_psi;
+  unsigned char *token_array= NULL;
+
   DBUG_ENTER("Prepared_statement::prepare");
   /*
     If this is an SQLCOM_PREPARE, we also increase Com_prepare_sql.
@@ -3383,10 +3389,19 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
     DBUG_RETURN(TRUE);
   }
 
+  if (max_digest_length > 0)
+  {
+    token_array= (unsigned char*) thd->alloc(max_digest_length);
+  }
+
   old_stmt_arena= thd->stmt_arena;
   thd->stmt_arena= this;
 
   Parser_state parser_state;
+#ifndef EMBEDDED_LIBRARY
+  if (is_any_audit_plugin_active(thd))
+    parser_state.m_input.m_compute_digest= true;
+#endif
   if (parser_state.init(thd, thd->query(), thd->query_length()))
   {
     thd->restore_backup_statement(this, &stmt_backup);
@@ -3401,11 +3416,16 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
   lex_start(thd);
   lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_PREPARE;
 
+  thd->m_digest= NULL;
   thd->m_statement_psi= NULL;
+
+  sql_digest_state digest;
+  digest.reset(token_array, max_digest_length);
+  thd->m_digest= &digest;
+
   error= parse_sql(thd, & parser_state, NULL) ||
     thd->is_error() ||
     init_param_array(this);
-  thd->m_statement_psi= parent_locker;
 
   lex->set_trg_event_type_for_tables();
 
@@ -3515,14 +3535,19 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
     if (thd->sp_runtime_ctx == NULL)
     {
       if (thd->rewritten_query.length())
-        logger.general_log_write(thd, COM_STMT_PREPARE,
+        general_log_write(thd, COM_STMT_PREPARE,
                                  thd->rewritten_query.c_ptr_safe(),
                                  thd->rewritten_query.length());
       else
-        logger.general_log_write(thd, COM_STMT_PREPARE,
+        general_log_write(thd, COM_STMT_PREPARE,
                                  query(), query_length());
+
+      /* audit plugins can return an error */
+      error |= thd->is_error();
     }
   }
+  thd->m_digest= parent_digest;
+  thd->m_statement_psi= parent_locker;
   DBUG_RETURN(error);
 }
 
@@ -3584,7 +3609,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.
@@ -3663,6 +3690,22 @@ reexecute:
   error= execute(expanded_query, open_cursor) || thd->is_error();
 
   thd->pop_reprepare_observer();
+#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 */
 
   if ((sql_command_flags[lex->sql_command] & CF_REEXECUTION_FRAGILE) &&
       error && !thd->is_fatal_error && !thd->killed &&
@@ -3856,8 +3899,8 @@ Prepared_statement::swap_prepared_statement(Prepared_statement *copy)
   swap_variables(LEX_STRING, name, copy->name);
   /* Ditto */
   swap_variables(char *, db, copy->db);
+  std::swap(db_length, copy->db_length);
 
-  DBUG_ASSERT(db_length == copy->db_length);
   DBUG_ASSERT(param_count == copy->param_count);
   DBUG_ASSERT(thd == copy->thd);
   last_error[0]= '\0';
@@ -4005,12 +4048,28 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
                              1);
       parent_locker= thd->m_statement_psi;
       thd->m_statement_psi= NULL;
+
       /*
+        Log COM_STMT_EXECUTE to the general log. Note, that in case of SQL
+        prepared statements this causes two records to be output:
+
+        Query       EXECUTE <statement name>
+        Execute     <statement SQL text>
+
+        This is considered user-friendly, since in the
+        second log entry we output values of parameter markers.
+
+        Rewriting/password obfuscation:
+
+        - Any passwords in the "Execute" line should be substituted with
+        their hashes, or a notice.
+
         Rewrite first (if needed); execution might replace passwords
         with hashes in situ without flagging it, and then we'd make
         a hash of that hash.
       */
       rewrite_query_if_needed(thd);
+      log_execute_line(thd);
 
       error= mysql_execute_command(thd);
       thd->m_statement_psi= parent_locker;
@@ -4049,25 +4108,6 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
       thd->protocol->send_out_parameters(&this->lex->param_list);
   }
 
-  /*
-    Log COM_STMT_EXECUTE to the general log. Note, that in case of SQL
-    prepared statements this causes two records to be output:
-
-    Query       EXECUTE <statement name>
-    Execute     <statement SQL text>
-
-    This is considered user-friendly, since in the
-    second log entry we output values of parameter markers.
-
-    Rewriting/password obfuscation:
-
-    - Any passwords in the "Execute" line should be substituted with
-      their hashes, or a notice.
-
-  */
-  if (error == 0)
-    log_execute_line(thd);
-
 error:
   flags&= ~ (uint) IS_IN_USE;
   return error;
index 574ed4cee2a3cfd223f000d09d64f545e3e96c48..c99b00e331f23501b41a255f40074ff18a44dd4c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2014, 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
@@ -28,6 +28,7 @@
 #include "rpl_rli.h"     // rotate_relay_log
 #include "rpl_mi.h"
 #include "debug_sync.h"
+#include "des_key_file.h"
 
 
 /**
@@ -249,7 +250,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)
@@ -292,7 +304,16 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
           }
         }
       }
-
+#ifdef WITH_WSREP
+      if (thd && thd->wsrep_applier)
+      {
+        /*
+          In case of applier thread, do not wait for table share(s) to be
+          removed from table definition cache.
+        */
+        options|= REFRESH_FAST;
+      }
+#endif
       if (close_cached_tables(thd, tables,
                               ((options & REFRESH_FAST) ?  FALSE : TRUE),
                               (thd ? thd->variables.lock_wait_timeout :
@@ -325,7 +346,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
     }
   }
 #endif
-#ifdef OPENSSL
+#ifdef HAVE_OPENSSL
    if (options & REFRESH_DES_KEY_FILE)
    {
      if (des_key_file && load_des_key_file(des_key_file))
index e928df2b5c88738e89fc91cc4983d8a494fa717e..df8900fc0aa0269d7ce60f0f4c64396c684263df 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -1169,6 +1169,17 @@ find_order_in_list(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables
   uint el= all_fields.elements;
   all_fields.push_front(order_item); /* Add new field to field list. */
   ref_pointer_array[el]= order_item;
+  /*
+    If the order_item is a SUM_FUNC_ITEM, when fix_fields is called
+    ref_by is set to order->item which is the address of order_item.
+    But this needs to be address of order_item in the all_fields list.
+    As a result, when it gets replaced with Item_aggregate_ref
+    object in Item::split_sum_func2, we will be able to retrieve the
+    newly created object.
+  */
+  if (order_item->type() == Item::SUM_FUNC_ITEM)
+    ((Item_sum *)order_item)->ref_by= all_fields.head_ref();
+
   /*
     Currently, we assume that this assertion holds. If it turns out
     that it fails for some query, order->item has changed and the old
index b3a37414a3d5731ebaf34b6990f9efa33edcdc7c..503d9aecc9ab86f9ba1f5d653082ed6dbd6ffc41 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -909,7 +909,8 @@ bool JOIN::destroy()
     {
       if (tab->op->type() == QEP_operation::OT_TMP_TABLE)
       {
-        free_tmp_table(thd, tab->table);
+        if (tab->table) // Check tmp table is not yet freed.
+          free_tmp_table(thd, tab->table);
         delete tab->tmp_table_param;
         tab->tmp_table_param= NULL;
       }
@@ -4897,6 +4898,57 @@ bool JOIN::change_result(select_result *res)
   DBUG_RETURN(FALSE);
 }
 
+/**
+  Add having condition as a where clause condition of the given temp table.
+
+  @param    curr_tmp_table  Table number to which having conds are added.
+
+  @returns  false if success, true if error.
+*/
+
+bool JOIN::add_having_as_tmp_table_cond(uint curr_tmp_table)
+{
+  having->update_used_tables();
+  JOIN_TAB *curr_table= &join_tab[curr_tmp_table];
+  table_map used_tables= curr_table->table->map | OUTER_REF_TABLE_BIT;
+
+  /* If tmp table is not used then consider conditions of const table also */
+  if (!need_tmp)
+    used_tables|= const_table_map;
+
+  DBUG_ENTER("JOIN::add_having_as_table_conds");
+
+  Item* sort_table_cond= make_cond_for_table(having, used_tables,
+                                           (table_map) 0, false);
+  if (sort_table_cond)
+  {
+    if (!curr_table->select)
+      if (!(curr_table->select= new SQL_SELECT))
+        DBUG_RETURN(true);
+    if (!curr_table->select->cond)
+      curr_table->select->cond= sort_table_cond;
+    else
+    {
+      if (!(curr_table->select->cond=
+              new Item_cond_and(curr_table->select->cond,
+                                sort_table_cond)))
+        DBUG_RETURN(true);
+      curr_table->select->cond->fix_fields(thd, 0);
+    }
+    curr_table->set_condition(curr_table->select->cond, __LINE__);
+    curr_table->condition()->top_level_item();
+    DBUG_EXECUTE("where",print_where(curr_table->select->cond,
+                                     "select and having",
+                                     QT_ORDINARY););
+
+    having= make_cond_for_table(having, ~ (table_map) 0,
+                                ~used_tables, false);
+    DBUG_EXECUTE("where",
+                 print_where(having, "having after sort", QT_ORDINARY););
+  }
+
+  DBUG_RETURN(false);
+}
 
 /**
   Init tmp tables usage info.
@@ -5002,24 +5054,6 @@ bool JOIN::make_tmp_tables_info()
         join_tab[const_tables].position->sj_strategy != SJ_OPT_LOOSE_SCAN &&
         join_tab[const_tables].use_order()));
 
-    /*
-      We don't have to store rows in temp table that doesn't match HAVING if:
-      - we are sorting the table and writing complete group rows to the
-        temp table.
-      - We are using DISTINCT without resolving the distinct as a GROUP BY
-        on all columns.
-
-      If having is not handled here, it will be checked before the row
-      is sent to the client.
-    */
-    if (having &&
-        (sort_and_group || (exec_tmp_table->distinct && !group_list)))
-    {
-      // Attach HAVING to tmp table's condition
-      join_tab[curr_tmp_table].having= having;
-      having= NULL; // Already done
-    }
-
     /* Change sum_fields reference to calculated fields in tmp_table */
     DBUG_ASSERT(items1.is_null());
     items1= ref_ptr_array_slice(2);
@@ -5046,7 +5080,33 @@ bool JOIN::make_tmp_tables_info()
     join_tab[curr_tmp_table].all_fields= &tmp_all_fields1;
     join_tab[curr_tmp_table].fields= &tmp_fields_list1;
     setup_tmptable_write_func(&join_tab[curr_tmp_table]);
+
+    /*
+      If having is not handled here, it will be checked before the row is sent
+      to the client.
+    */
+    if (having &&
+        (sort_and_group || (exec_tmp_table->distinct && !group_list)))
+    {
+      /*
+        If there is no select distinct then move the having to table conds of
+        tmp table.
+        NOTE : We cannot apply having after distinct. If columns of having are
+               not part of select distinct, then distinct may remove rows
+               which can satisfy having.
+      */
+      if (!select_distinct && add_having_as_tmp_table_cond(curr_tmp_table))
+       DBUG_RETURN(true);
+
+      /*
+        Having condition which we are not able to add as tmp table conds are
+        kept as before. And, this will be applied before storing the rows in
+        tmp table.
+      */
+      join_tab[curr_tmp_table].having= having;
+      having= NULL; // Already done
+    }
+
     tmp_table_param.func_count= 0;
     tmp_table_param.field_count+= tmp_table_param.func_count;
     if (sort_and_group || join_tab[curr_tmp_table].table->group)
@@ -5249,39 +5309,8 @@ bool JOIN::make_tmp_tables_info()
     /* If we have already done the group, add HAVING to sorted table */
     if (having && !group_list && !sort_and_group)
     {
-      // Some tables may have been const
-      having->update_used_tables();
-      JOIN_TAB *curr_table= &join_tab[curr_tmp_table];
-      table_map used_tables= (const_table_map | curr_table->table->map);
-
-      Item* sort_table_cond= make_cond_for_table(having, used_tables,
-                                                 (table_map) 0, false);
-      if (sort_table_cond)
-      {
-       if (!curr_table->select)
-         if (!(curr_table->select= new SQL_SELECT))
-           DBUG_RETURN(true);
-       if (!curr_table->select->cond)
-         curr_table->select->cond= sort_table_cond;
-       else
-       {
-         if (!(curr_table->select->cond=
-               new Item_cond_and(curr_table->select->cond,
-                                 sort_table_cond)))
-           DBUG_RETURN(true);
-         curr_table->select->cond->fix_fields(thd, 0);
-       }
-        curr_table->set_condition(curr_table->select->cond, __LINE__);
-        curr_table->condition()->top_level_item();
-       DBUG_EXECUTE("where",print_where(curr_table->select->cond,
-                                        "select and having",
-                                         QT_ORDINARY););
-
-        having= make_cond_for_table(having, ~ (table_map) 0,
-                                    ~used_tables, false);
-        DBUG_EXECUTE("where",
-                     print_where(having, "having after sort", QT_ORDINARY););
-      }
+      if (add_having_as_tmp_table_cond(curr_tmp_table))
+        DBUG_RETURN(true);
     }
 
     if (group)
index 0dc4da504aede3aa0ba95121a454b8862cbf6488..9d6dad07170a3dac9c96e4c5bd71c2c78a74d15c 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -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) : "<nil>")
 
 #ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -570,10 +573,11 @@ is_in_ignore_db_dirs_list(const char *directory)
 
 find_files_result
 find_files(THD *thd, List<LEX_STRING> *files, const char *db,
-           const char *path, const char *wild, bool dir)
+           const char *path, const char *wild, bool dir, MEM_ROOT *tmp_mem_root)
 {
   uint i;
   MY_DIR *dirp;
+  MEM_ROOT **root_ptr= NULL, *old_root= NULL;
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
   uint col_access=thd->col_access;
 #endif
@@ -606,6 +610,13 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
     DBUG_RETURN(FIND_FILES_DIR);
   }
 
+  if (tmp_mem_root)
+  {
+    root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC);
+    old_root= *root_ptr;
+    *root_ptr= tmp_mem_root;
+  }
+
   for (i=0 ; i < (uint) dirp->number_off_files  ; i++)
   {
     char uname[NAME_LEN + 1];                   /* Unencoded name */
@@ -686,8 +697,11 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
         continue;
     }
 #endif
-    if (!(file_name= 
-          thd->make_lex_string(file_name, uname, file_name_len, TRUE)) ||
+    if (!(file_name= tmp_mem_root ?
+                     make_lex_string_root(tmp_mem_root, file_name, uname,
+                                          file_name_len, TRUE) :
+                     thd->make_lex_string(file_name, uname,
+                                          file_name_len, TRUE)) ||
         files->push_back(file_name))
     {
       my_dirend(dirp);
@@ -699,6 +713,9 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
 
   (void) ha_find_files(thd, db, path, wild, dir, files);
 
+  if (tmp_mem_root)
+    *root_ptr= old_root;
+
   DBUG_RETURN(FIND_FILES_OK);
 }
 
@@ -1107,29 +1124,44 @@ static const char *require_quotes(const char *name, uint name_length)
 }
 
 
-/*
-  Quote the given identifier if needed and append it to the target string.
-  If the given identifier is empty, it will be quoted.
-
-  SYNOPSIS
-  append_identifier()
-  thd                   thread handler
-  packet                target string
-  name                  the identifier to be appended
-  name_length           length of the appending identifier
+/**
+  Convert and quote the given identifier if needed and append it to the
+  target string. If the given identifier is empty, it will be quoted.
+  @thd                         thread handler
+  @packet                      target string
+  @name                        the identifier to be appended
+  @length                      length of the appending identifier
+  @param from_cs               Charset information about the input string
+  @param to_cs                 Charset information about the target string
 */
 
 void
-append_identifier(THD *thd, String *packet, const char *name, uint length)
+append_identifier(THD *thd, String *packet, const char *name, uint length,
+                  const CHARSET_INFO *from_cs, const CHARSET_INFO *to_cs)
 {
   const char *name_end;
   char quote_char;
   int q;
-  q= thd ? get_quote_char_for_identifier(thd, name, length) : '`';
 
+  const CHARSET_INFO *cs_info= system_charset_info;
+  const char *to_name= name;
+  size_t to_length= length;
+  String to_string(name,length, from_cs);
+
+  if (from_cs != NULL && to_cs != NULL && from_cs != to_cs)
+    thd->convert_string(&to_string, from_cs, to_cs);
+
+  if (to_cs != NULL)
+  {
+    to_name= to_string.c_ptr();
+    to_length= to_string.length();
+    cs_info= to_cs;
+  }
+
+  q= thd ? get_quote_char_for_identifier(thd, to_name, to_length) : '`';
   if (q == EOF)
   {
-    packet->append(name, length, packet->charset());
+    packet->append(to_name, to_length, packet->charset());
     return;
   }
 
@@ -1138,14 +1170,14 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
    it's a keyword
   */
 
-  (void) packet->reserve(length*2 + 2);
+  (void) packet->reserve(to_length*2 + 2);
   quote_char= (char) q;
   packet->append(&quote_char, 1, system_charset_info);
 
-  for (name_end= name+length ; name < name_end ; name+= length)
+  for (name_end= to_name+to_length ; to_name < name_end ; to_name+= to_length)
   {
-    uchar chr= (uchar) *name;
-    length= my_mbcharlen(system_charset_info, chr);
+    uchar chr= (uchar) *to_name;
+    to_length= my_mbcharlen(cs_info, chr);
     /*
       my_mbcharlen can return 0 on a wrong multibyte
       sequence. It is possible when upgrading from 4.0,
@@ -1153,11 +1185,11 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
       The manual says it does not work. So we'll just
       change length to 1 not to hang in the endless loop.
     */
-    if (!length)
-      length= 1;
-    if (length == 1 && chr == (uchar) quote_char)
+    if (!to_length)
+      to_length= 1;
+    if (to_length == 1 && chr == (uchar) quote_char)
       packet->append(&quote_char, 1, system_charset_info);
-    packet->append(name, length, system_charset_info);
+    packet->append(to_name, to_length, system_charset_info);
   }
   packet->append(&quote_char, 1, system_charset_info);
 }
@@ -1338,6 +1370,11 @@ static bool print_default_clause(THD *thd, Field *field, String *def_value,
                       to tailor the format of the statement.  Can be
                       NULL, in which case only SQL_MODE is considered
                       when building the statement.
+    show_database     If true, then print the database before the table
+                      name. The database name is only printed in the event
+                      that it is different from the current database.
+                      If false, then do not print the database before
+                      the table name.
   
   NOTE
     Currently always return 0, but might return error code in the
@@ -1430,6 +1467,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
   for (ptr=table->field ; (field= *ptr); ptr++)
   {
     uint flags = field->flags;
+    enum_field_types field_type= field->real_type();
 
     if (ptr != table->field)
       packet->append(STRING_WITH_LEN(",\n"));
@@ -1444,6 +1482,14 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
       type.set_charset(system_charset_info);
 
     field->sql_type(type);
+    /*
+      If the session variable 'show_old_temporals' is enabled and the field
+      is a temporal type of old format, add a comment to indicate the same.
+    */
+    if (thd->variables.show_old_temporals &&
+        (field_type == MYSQL_TYPE_TIME || field_type == MYSQL_TYPE_DATETIME ||
+         field_type == MYSQL_TYPE_TIMESTAMP))
+      type.append(" /* 5.5 binary format */");
     packet->append(type.ptr(), type.length(), system_charset_info);
 
     if (field->has_charset() && 
@@ -2085,7 +2131,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
       Security_context *tmp_sctx= tmp->security_ctx;
       struct st_my_thread_var *mysys_var;
       if ((tmp->vio_ok() || tmp->system_thread) &&
-          (!user || (tmp_sctx->user && !strcmp(tmp_sctx->user, user))))
+          (!user || (!tmp->system_thread && tmp_sctx->user &&
+                     !strcmp(tmp_sctx->user, user))))
       {
         thread_info *thd_info= new thread_info;
 
@@ -2193,6 +2240,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, Item* cond)
     mysql_mutex_lock(&LOCK_thd_remove);
     copy_global_thread_list(&global_thread_list_copy);
 
+    DEBUG_SYNC(thd,"fill_schema_processlist_after_copying_threads");
+
     Thread_iterator it= global_thread_list_copy.begin();
     Thread_iterator end= global_thread_list_copy.end();
     for (; it != end; ++it)
@@ -2203,7 +2252,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, Item* cond)
       const char *val, *db;
 
       if ((!tmp->vio_ok() && !tmp->system_thread) ||
-          (user && (!tmp_sctx->user || strcmp(tmp_sctx->user, user))))
+          (user && (tmp->system_thread || !tmp_sctx->user ||
+                    strcmp(tmp_sctx->user, user))))
         continue;
 
       restore_record(table, s->default_values);
@@ -3137,7 +3187,7 @@ enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table)
 
 int make_db_list(THD *thd, List<LEX_STRING> *files,
                  LOOKUP_FIELD_VALUES *lookup_field_vals,
-                 bool *with_i_schema)
+                 bool *with_i_schema, MEM_ROOT *tmp_mem_root)
 {
   LEX_STRING *i_s_name_copy= 0;
   i_s_name_copy= thd->make_lex_string(i_s_name_copy,
@@ -3161,7 +3211,8 @@ int make_db_list(THD *thd, List<LEX_STRING> *files,
         return 1;
     }
     return (find_files(thd, files, NullS, mysql_data_home,
-                       lookup_field_vals->db_value.str, 1) != FIND_FILES_OK);
+                       lookup_field_vals->db_value.str, 1, tmp_mem_root) !=
+                      FIND_FILES_OK);
   }
 
 
@@ -3203,7 +3254,7 @@ int make_db_list(THD *thd, List<LEX_STRING> *files,
     return 1;
   *with_i_schema= 1;
   return (find_files(thd, files, NullS,
-                     mysql_data_home, NullS, 1) != FIND_FILES_OK);
+                     mysql_data_home, NullS, 1, tmp_mem_root) != FIND_FILES_OK);
 }
 
 
@@ -3311,7 +3362,8 @@ int schema_tables_add(THD *thd, List<LEX_STRING> *files, const char *wild)
 static int
 make_table_name_list(THD *thd, List<LEX_STRING> *table_names, LEX *lex,
                      LOOKUP_FIELD_VALUES *lookup_field_vals,
-                     bool with_i_schema, LEX_STRING *db_name)
+                     bool with_i_schema, LEX_STRING *db_name,
+                     MEM_ROOT *tmp_mem_root)
 {
   char path[FN_REFLEN + 1];
   build_table_filename(path, sizeof(path) - 1, db_name->str, "", "", 0);
@@ -3365,7 +3417,8 @@ make_table_name_list(THD *thd, List<LEX_STRING> *table_names, LEX *lex,
                               lookup_field_vals->table_value.str));
 
   find_files_result res= find_files(thd, table_names, db_name->str, path,
-                                    lookup_field_vals->table_value.str, 0);
+                                    lookup_field_vals->table_value.str, 0,
+                                    tmp_mem_root);
   if (res != FIND_FILES_OK)
   {
     /*
@@ -4033,6 +4086,9 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, Item *cond)
   bool can_deadlock;
   DBUG_ENTER("get_all_tables");
 
+  MEM_ROOT tmp_mem_root;
+  init_sql_alloc(&tmp_mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+
   /*
     In cases when SELECT from I_S table being filled by this call is
     part of statement which also uses other tables or is being executed
@@ -4124,7 +4180,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, Item *cond)
     goto err;
   }
 
-  if (make_db_list(thd, &db_names, &lookup_field_vals, &with_i_schema))
+  if (make_db_list(thd, &db_names, &lookup_field_vals, &with_i_schema, &tmp_mem_root))
     goto err;
   it.rewind(); /* To get access to new elements in basis list */
   while ((db_name= it++))
@@ -4142,7 +4198,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, Item *cond)
       List<LEX_STRING> table_names;
       int res= make_table_name_list(thd, &table_names, lex,
                                     &lookup_field_vals,
-                                    with_i_schema, db_name);
+                                    with_i_schema, db_name, &tmp_mem_root);
       if (res == 2)   /* Not fatal error, continue */
         continue;
       if (res)
@@ -4229,9 +4285,10 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, Item *cond)
       with_i_schema= 0;
     }
   }
-
   error= 0;
 err:
+
+  free_root(&tmp_mem_root, MYF(0));
   thd->restore_backup_open_tables_state(&open_tables_state_backup);
 
   DBUG_RETURN(error);
@@ -4257,6 +4314,27 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, Item *cond)
     Returning error status in this case leads to client hangup.
   */
 
+  /*
+   * A temporary class is created to free tmp_mem_root when we return from
+   * this function, since we have 'return' from this function from many
+   * places. This is just to avoid goto.
+   */
+  class free_tmp_mem_root
+  {
+  public:
+    free_tmp_mem_root()
+    {
+      init_sql_alloc(&tmp_mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+    }
+    ~free_tmp_mem_root()
+    {
+      free_root(&tmp_mem_root, MYF(0));
+    }
+    MEM_ROOT tmp_mem_root;
+  };
+
+  free_tmp_mem_root dummy_member;
+
   LOOKUP_FIELD_VALUES lookup_field_vals;
   List<LEX_STRING> db_names;
   LEX_STRING *db_name;
@@ -4270,11 +4348,12 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, Item *cond)
 
   if (get_lookup_field_values(thd, cond, tables, &lookup_field_vals))
     DBUG_RETURN(0);
+
   DBUG_PRINT("INDEX VALUES",("db_name='%s', table_name='%s'",
                              lookup_field_vals.db_value.str,
                              lookup_field_vals.table_value.str));
   if (make_db_list(thd, &db_names, &lookup_field_vals,
-                   &with_i_schema))
+                   &with_i_schema, &dummy_member.tmp_mem_root))
     DBUG_RETURN(1);
 
   /*
@@ -4594,16 +4673,16 @@ err:
   @brief    Store field characteristics into appropriate I_S table columns
             starting from DATA_TYPE column till DTD_IDENTIFIER column.
 
+  @param[in]      thd               Thread context.
   @param[in]      table             I_S table
   @param[in]      field             processed field
   @param[in]      cs                I_S table charset
   @param[in]      offset            offset from beginning of table
                                     to DATE_TYPE column in I_S table
-                                    
   @return         void
 */
 
-void store_column_type(TABLE *table, Field *field, CHARSET_INFO *cs,
+void store_column_type(THD *thd, TABLE *table, Field *field, CHARSET_INFO *cs,
                        uint offset)
 {
   bool is_blob;
@@ -4611,10 +4690,25 @@ void store_column_type(TABLE *table, Field *field, CHARSET_INFO *cs,
   const char *tmp_buff;
   char column_type_buff[MAX_FIELD_WIDTH];
   String column_type(column_type_buff, sizeof(column_type_buff), cs);
+  enum_field_types field_type= field->real_type();
+  uint32 orig_column_type_length;
 
   field->sql_type(column_type);
+  orig_column_type_length= column_type.length();
+
+  /*
+    If the session variable 'show_old_temporals' is enabled and the field
+    is a temporal type of old format, add a comment to the COLUMN_TYPE
+    indicate the same.
+  */
+  if (thd->variables.show_old_temporals &&
+      (field_type == MYSQL_TYPE_TIME || field_type == MYSQL_TYPE_DATETIME ||
+       field_type == MYSQL_TYPE_TIMESTAMP))
+    column_type.append(" /* 5.5 binary format */");
+
   /* DTD_IDENTIFIER column */
   table->field[offset + 8]->store(column_type.ptr(), column_type.length(), cs);
+  column_type.length(orig_column_type_length);
   table->field[offset + 8]->set_notnull();
   /*
     DATA_TYPE column:
@@ -4819,7 +4913,7 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
     pos=(uchar*) ((field->flags & NOT_NULL_FLAG) ?  "NO" : "YES");
     table->field[IS_COLUMNS_IS_NULLABLE]->store((const char*) pos,
                            strlen((const char*) pos), cs);
-    store_column_type(table, field, cs, IS_COLUMNS_DATA_TYPE);
+    store_column_type(thd, table, field, cs, IS_COLUMNS_DATA_TYPE);
     pos=(uchar*) ((field->flags & PRI_KEY_FLAG) ? "PRI" :
                  (field->flags & UNIQUE_KEY_FLAG) ? "UNI" :
                  (field->flags & MULTIPLE_KEY_FLAG) ? "MUL":"");
@@ -5134,7 +5228,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
 
       field->table= &tbl;
       tbl.in_use= thd;
-      store_column_type(table, field, cs, IS_PARAMETERS_DATA_TYPE);
+      store_column_type(thd, table, field, cs, IS_PARAMETERS_DATA_TYPE);
       if (schema_table_store_record(thd, table))
       {
         free_table_share(&share);
@@ -5194,7 +5288,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
 
       field->table= &tbl;
       tbl.in_use= thd;
-      store_column_type(table, field, cs, IS_PARAMETERS_DATA_TYPE);
+      store_column_type(thd, table, field, cs, IS_PARAMETERS_DATA_TYPE);
       if (schema_table_store_record(thd, table))
       {
         free_table_share(&share);
@@ -5294,7 +5388,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
 
           field->table= &tbl;
           tbl.in_use= thd;
-          store_column_type(table, field, cs, IS_ROUTINES_DATA_TYPE);
+          store_column_type(thd, table, field, cs, IS_ROUTINES_DATA_TYPE);
           free_table_share(&share);
           if (free_sp_head)
             delete sp;
@@ -6605,7 +6699,11 @@ int fill_variables(THD *thd, TABLE_LIST *tables, Item *cond)
     Lock LOCK_plugin_delete to avoid deletion of any plugins while creating
     SHOW_VAR array and hold it until all variables are stored in the table.
   */
-  mysql_mutex_lock(&LOCK_plugin_delete);
+  if (thd->fill_variables_recursion_level++ == 0)
+  {
+    mysql_mutex_lock(&LOCK_plugin_delete);
+  }
+
   // Lock LOCK_system_variables_hash to prepare SHOW_VARs array.
   mysql_rwlock_rdlock(&LOCK_system_variables_hash);
   DEBUG_SYNC(thd, "acquired_LOCK_system_variables_hash");
@@ -6615,7 +6713,11 @@ int fill_variables(THD *thd, TABLE_LIST *tables, Item *cond)
   res= show_status_array(thd, wild, sys_var_array, option_type, NULL, "",
                          tables->table, upper_case_names, cond);
 
-  mysql_mutex_unlock(&LOCK_plugin_delete);
+  if (thd->fill_variables_recursion_level-- == 1)
+  {
+    mysql_mutex_unlock(&LOCK_plugin_delete);
+  }
+
   DBUG_RETURN(res);
 }
 
@@ -6655,6 +6757,8 @@ int fill_status(THD *thd, TABLE_LIST *tables, Item *cond)
     Avoid recursive acquisition of LOCK_status in cases when WHERE clause
     represented by "cond" contains subquery on I_S.SESSION/GLOBAL_STATUS.
   */
+  DEBUG_SYNC(thd, "before_preparing_global_status_array");
+
   if (thd->fill_status_recursion_level++ == 0) 
     mysql_mutex_lock(&LOCK_status);
   if (option_type == OPT_GLOBAL)
@@ -6665,6 +6769,8 @@ int fill_status(THD *thd, TABLE_LIST *tables, Item *cond)
                          upper_case_names, cond);
   if (thd->fill_status_recursion_level-- == 1) 
     mysql_mutex_unlock(&LOCK_status);
+
+  DEBUG_SYNC(thd, "after_preparing_global_status_array");
   DBUG_RETURN(res);
 }
 
@@ -7938,7 +8044,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}
 };
 
index 4b1599d0845728458f74af8a45248037f845ffaf..0f5c3aa701e33e8465fb2108838d96d9e3f935a4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+/* 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
@@ -156,7 +156,8 @@ enum find_files_result {
 #define IS_FILES_EXTRA               37
 
 find_files_result find_files(THD *thd, List<LEX_STRING> *files, const char *db,
-                             const char *path, const char *wild, bool dir);
+                             const char *path, const char *wild, bool dir,
+                             MEM_ROOT *tmp_mem_root);
 
 int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
                       HA_CREATE_INFO  *create_info_arg, bool show_database);
@@ -165,8 +166,13 @@ int view_store_create_info(THD *thd, TABLE_LIST *table, String *buff);
 int copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table);
 int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
 
-void append_identifier(THD *thd, String *packet, const char *name,
-                      uint length);
+void append_identifier(THD *thd, String *packet, const char *name, uint length,
+                       const CHARSET_INFO *from_cs, const CHARSET_INFO *to_cs);
+inline void append_identifier(THD *thd, String *packet, const char *name,
+                              uint length)
+{
+  append_identifier(thd, packet, name, length, NULL, NULL);
+}
 inline void append_identifier(THD *thd, String *packet, Simple_cstring str)
 {
   append_identifier(thd, packet, str.ptr(), static_cast<uint>(str.length()));
index f067b231c19c5889ffef21713a3ecbc7600e7263..49a84248d4f63483b7e9bc6d28b018d93668d99c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, 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
@@ -61,21 +61,6 @@ const LEX_STRING Diag_condition_item_names[]=
   { C_STRING_WITH_LEN("TRIGGER_SCHEMA") }
 };
 
-const LEX_STRING Diag_statement_item_names[]=
-{
-  { C_STRING_WITH_LEN("NUMBER") },
-  { C_STRING_WITH_LEN("MORE") },
-  { C_STRING_WITH_LEN("COMMAND_FUNCTION") },
-  { C_STRING_WITH_LEN("COMMAND_FUNCTION_CODE") },
-  { C_STRING_WITH_LEN("DYNAMIC_FUNCTION") },
-  { C_STRING_WITH_LEN("DYNAMIC_FUNCTION_CODE") },
-  { C_STRING_WITH_LEN("ROW_COUNT") },
-  { C_STRING_WITH_LEN("TRANSACTIONS_COMMITTED") },
-  { C_STRING_WITH_LEN("TRANSACTIONS_ROLLED_BACK") },
-  { C_STRING_WITH_LEN("TRANSACTION_ACTIVE") }
-};
-
-
 Set_signal_information::Set_signal_information(
   const Set_signal_information& set)
 {
index 1f9dda6bb9e7ea35e540da304417f083af3db581..d152301effd2152a5678f3428521152750334749 100644 (file)
@@ -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
@@ -64,14 +65,20 @@ bool String::real_alloc(uint32 length)
      - If the requested length is less or equal to what fits in the buffer, a
        null character is inserted at the appropriate position.
 
-   - If the String does not keep a private buffer on the heap, such a buffer
-     will be allocated and the string copied accoring to its length, as found
-     in String::length().
+   - If the String does not keep a private buffer on the heap:
+
+      - If the requested length is greater than what fits in the buffer, or
+        force_on_heap is true, a new buffer is allocated, data is copied.
+      - If the requested length is less or equal to what fits in the buffer,
+        and force_on_heap is false, a null character is inserted at the
+        appropriate position.
  
    For C compatibility, the new string buffer is null terminated.
 
    @param alloc_length The requested string size in characters, excluding any
    null terminator.
+   @param force_on_heap If the caller wants String's 'str' buffer to be on the
+   heap in all cases.
 
    @retval false Either the copy operation is complete or, if the size of the
    new buffer is smaller than the currently allocated buffer (if one exists),
@@ -79,12 +86,19 @@ bool String::real_alloc(uint32 length)
 
    @retval true An error occured when attempting to allocate memory.
 */
-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;
@@ -419,6 +433,8 @@ void String::strip_sp()
 
 bool String::append(const String &s)
 {
+  DBUG_ASSERT(!this->uses_buffer_owned_by(&s));
+  DBUG_ASSERT(!s.uses_buffer_owned_by(this));
   if (s.length())
   {
     if (realloc(str_length+s.length()))
@@ -783,18 +799,42 @@ int stringcmp(const String *s,const String *t)
   return (cmp) ? cmp : (int) (s_len - t_len);
 }
 
-
+/**
+  Makes a copy of a String's buffer unless it's already heap-allocated.
+
+  If the buffer ('str') of 'from' is on the heap, this function returns
+  'from', possibly re-allocated to be at least from_length bytes long.
+  It is also the case if from==to or to==NULL.
+  Otherwise, this function makes and returns a copy of "from" into "to"; the
+  buffer of "to" is heap-allocated; a pre-condition is that from->str and
+  to->str must point to non-overlapping buffers.
+  The logic behind this complex design, is that a caller, typically a
+  val_str() function, sometimes has an input String ('from') which buffer it
+  wants to modify; but this String's buffer may or not be heap-allocated; if
+  it's not heap-allocated it is possibly in static storage or belongs to an
+  outer context, and thus should not be modified; in that case the caller
+  wants a heap-allocated copy which it can freely modify.
+
+  @param  to    destination string
+  @param  from  source string
+  @param  from_length  destination string will hold at least from_length bytes.
+*/
 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
+
+  // from and to should not be overlapping
+  DBUG_ASSERT(!to->uses_buffer_owned_by(from));
+  DBUG_ASSERT(!from->uses_buffer_owned_by(to));
+
   if ((to->str_length=min(from->str_length,from_length)))
     memcpy(to->Ptr,from->Ptr,to->str_length);
   to->str_charset=from->str_charset;
@@ -1167,3 +1207,69 @@ uint convert_to_printable(char *to, size_t to_len,
     *t= '\0';
   return t - to;
 }
+
+/**
+  Check if an input byte sequence is a valid character string of a given charset
+
+  @param cs                     The input character set.
+  @param str                    The input byte sequence to validate.
+  @param length                 A byte length of the str.
+  @param [out] valid_length     A byte length of a valid prefix of the str.
+  @param [out] length_error     True in the case of a character length error:
+                                some byte[s] in the input is not a valid
+                                prefix for a character, i.e. the byte length
+                                of that invalid character is undefined.
+
+  @retval true if the whole input byte sequence is a valid character string.
+               The length_error output parameter is undefined.
+
+  @return
+    if the whole input byte sequence is a valid character string
+    then
+        return false
+    else
+        if the length of some character in the input is undefined (MY_CS_ILSEQ)
+           or the last character is truncated (MY_CS_TOOSMALL)
+        then
+            *length_error= true; // fatal error!
+        else
+            *length_error= false; // non-fatal error: there is no wide character
+                                  // encoding for some input character
+        return true
+*/
+bool validate_string(const CHARSET_INFO *cs, const char *str, uint32 length,
+                     size_t *valid_length, bool *length_error)
+{
+  if (cs->mbmaxlen > 1)
+  {
+    int well_formed_error;
+    *valid_length= cs->cset->well_formed_len(cs, str, str + length,
+                                             length, &well_formed_error);
+    *length_error= well_formed_error;
+    return well_formed_error;
+  }
+
+  /*
+    well_formed_len() is not functional on single-byte character sets,
+    so use mb_wc() instead:
+  */
+  *length_error= false;
+
+  const uchar *from= reinterpret_cast<const uchar *>(str);
+  const uchar *from_end= from + length;
+  my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc;
+
+  while (from < from_end)
+  {
+    my_wc_t wc;
+    int cnvres= (*mb_wc)(cs, &wc, (uchar*) from, from_end);
+    if (cnvres <= 0)
+    {
+      *valid_length= from - reinterpret_cast<const uchar *>(str);
+      return true;
+    }
+    from+= cnvres;
+  }
+  *valid_length= length;
+  return false;
+}
index bf360ca12e945b8fab81c9a7c5acba01cd2c24ff..3d1868dfea7f86422f1ace1f55d0e255d6cf0a8d 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef SQL_STRING_INCLUDED
 #define 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
@@ -321,7 +322,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)
@@ -600,4 +601,7 @@ static inline bool check_if_only_end_space(const CHARSET_INFO *cs, char *str,
   return str+ cs->cset->scan(cs, str, end, MY_SEQ_SPACES) == end;
 }
 
+bool
+validate_string(const CHARSET_INFO *cs, const char *str, uint32 length,
+                size_t *valid_length, bool *length_error);
 #endif /* SQL_STRING_INCLUDED */
index d85585ee07ed459f5766f12756e506b71451cba0..b90716ea978822b725eadfbc1a728f79923b56c3 100644 (file)
@@ -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
@@ -1730,6 +1730,7 @@ void execute_ddl_log_recovery()
   (void) mysql_file_delete(key_file_global_ddl_log, file_name, MYF(0));
   global_ddl_log.recovery_phase= FALSE;
   mysql_mutex_unlock(&LOCK_gdl);
+  thd->reset_query();
   delete thd;
   /* Remember that we don't have a THD */
   my_pthread_setspecific_ptr(THR_THD,  0);
@@ -1851,6 +1852,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
 #ifdef WITH_PARTITION_STORAGE_ENGINE
   char *part_syntax_buf;
   uint syntax_len;
+  partition_info *old_part_info= lpt->table->part_info;
 #endif
   DBUG_ENTER("mysql_write_frm");
 
@@ -1874,7 +1876,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
     }
 #ifdef WITH_PARTITION_STORAGE_ENGINE
     {
-      partition_info *part_info= lpt->table->part_info;
+      partition_info *part_info= lpt->part_info;
       if (part_info)
       {
         if (!(part_syntax_buf= generate_partition_syntax(part_info,
@@ -1888,6 +1890,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
         }
         part_info->part_info_string= part_syntax_buf;
         part_info->part_info_len= syntax_len;
+        lpt->table->file->set_part_info(part_info, false);
       }
     }
 #endif
@@ -1931,6 +1934,10 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
   {
 #ifdef WITH_PARTITION_STORAGE_ENGINE
     partition_info *part_info= lpt->part_info;
+    if (part_info)
+    {
+      lpt->table->file->set_part_info(part_info, false);
+    }
 #endif
     /*
       Build frm file name
@@ -2011,6 +2018,10 @@ err:
   }
 
 end:
+  if (old_part_info)
+  {
+    lpt->table->file->set_part_info(old_part_info, false);
+  }
   DBUG_RETURN(error);
 }
 
@@ -2249,7 +2260,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
   bool trans_tmp_table_deleted= 0, non_trans_tmp_table_deleted= 0;
   bool non_tmp_table_deleted= 0;
   bool have_nonexistent_tmp_table= 0;
-  bool is_drop_tmp_if_exists_added= 0;
+  bool is_drop_tmp_if_exists_with_no_defaultdb= 0;
   String built_query;
   String built_trans_tmp_query, built_non_trans_tmp_query;
   String nonexistent_tmp_tables;
@@ -2280,14 +2291,13 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
     transaction and changes to non-transactional tables must be written
     ahead of the transaction in some circumstances.
 
-    6- Slave SQL thread ignores all replicate-* filter rules
-    for temporary tables with 'IF EXISTS' clause. (See sql/sql_parse.cc:
-    mysql_execute_command() for details). These commands will be binlogged
-    as they are, even if the default database (from USE `db`) is not present
-    on the Slave. This can cause point in time recovery failures later
-    when user uses the slave's binlog to re-apply. Hence at the time of binary
-    logging, these commands will be written with fully qualified table names
-    and use `db` will be suppressed.
+    6 - At the time of writing 'DROP TEMPORARY TABLE IF EXISTS'
+    statements into the binary log if the default database specified in
+    thd->db is present then they are binlogged as
+    'USE `default_db`; DROP TEMPORARY TABLE IF EXISTS `t1`;'
+    otherwise they will be binlogged with the actual database name to
+    which the table belongs to.
+    'DROP TEMPORARY TABLE IF EXISTS `actual_db`.`t1`
   */
   if (!dont_log_query)
   {
@@ -2302,7 +2312,14 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
 
     if (thd->is_current_stmt_binlog_format_row() || if_exists)
     {
-      is_drop_tmp_if_exists_added= true;
+      /*
+        If default database doesnot exist in those cases set
+        'is_drop_tmp_if_exists_with_no_defaultdb flag to 'true' so that the
+        'DROP TEMPORARY TABLE IF EXISTS' command is logged with a qualified
+        table name.
+      */
+      if (thd->db != NULL && check_db_dir_existence(thd->db))
+        is_drop_tmp_if_exists_with_no_defaultdb= true;
       built_trans_tmp_query.set_charset(system_charset_info);
       built_trans_tmp_query.append("DROP TEMPORARY TABLE IF EXISTS ");
       built_non_trans_tmp_query.set_charset(system_charset_info);
@@ -2390,13 +2407,15 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
           query.
         */
         if (thd->db == NULL || strcmp(db,thd->db) != 0
-            || is_drop_tmp_if_exists_added )
+            || is_drop_tmp_if_exists_with_no_defaultdb )
         {
-          append_identifier(thd, built_ptr_query, db, db_len);
+          append_identifier(thd, built_ptr_query, db, db_len,
+                            system_charset_info, thd->charset());
           built_ptr_query->append(".");
         }
         append_identifier(thd, built_ptr_query, table->table_name,
-                          strlen(table->table_name));
+                          strlen(table->table_name), system_charset_info,
+                          thd->charset());
         built_ptr_query->append(",");
       }
       /*
@@ -2458,12 +2477,14 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
         */
         if (thd->db == NULL || strcmp(db,thd->db) != 0)
         {
-          append_identifier(thd, &built_query, db, db_len);
+          append_identifier(thd, &built_query, db, db_len,
+                            system_charset_info, thd->charset());
           built_query.append(".");
         }
 
         append_identifier(thd, &built_query, table->table_name,
-                          strlen(table->table_name));
+                          strlen(table->table_name), system_charset_info,
+                          thd->charset());
         built_query.append(",");
       }
     }
@@ -2637,7 +2658,7 @@ err:
                                    built_non_trans_tmp_query.ptr(),
                                    built_non_trans_tmp_query.length(),
                                    FALSE, FALSE,
-                                   is_drop_tmp_if_exists_added,
+                                   is_drop_tmp_if_exists_with_no_defaultdb,
                                    0);
         /*
           When temporary and regular tables or temporary tables with
@@ -2663,7 +2684,7 @@ err:
                                    built_trans_tmp_query.ptr(),
                                    built_trans_tmp_query.length(),
                                    TRUE, FALSE,
-                                   is_drop_tmp_if_exists_added,
+                                   is_drop_tmp_if_exists_with_no_defaultdb,
                                    0);
         /*
           When temporary and regular tables are dropped on a single
@@ -2676,7 +2697,13 @@ err:
         if (gtid_mode > 0 && non_tmp_table_deleted)
           error |= mysql_bin_log.commit(thd, true);
       }
-      if (non_tmp_table_deleted)
+      /*
+        when the DROP TABLE command is used to DROP a single table and if that
+        command fails then the query cannot generate 'partial results'. In
+        that case the query will not be written to the binary log.
+      */
+      if (non_tmp_table_deleted &&
+          (thd->lex->select_lex.table_list.elements > 1 || !error))
       {
         /* Chop of the last comma */
         built_query.chop();
@@ -3619,8 +3646,31 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
        else
        {
          /* Field redefined */
+
+          /*
+            If we are replacing a BIT field, revert the increment
+            of total_uneven_bit_length that was done above.
+          */
+          if (sql_field->sql_type == MYSQL_TYPE_BIT &&
+              file->ha_table_flags() & HA_CAN_BIT_FIELD)
+            total_uneven_bit_length-= sql_field->length & 7;
+
          sql_field->def=               dup_field->def;
          sql_field->sql_type=          dup_field->sql_type;
+
+          /*
+            If we are replacing a field with a BIT field, we need
+            to initialize pack_flag. Note that we do not need to
+            increment total_uneven_bit_length here as this dup_field
+            has already been processed.
+          */
+          if (sql_field->sql_type == MYSQL_TYPE_BIT)
+          {
+            sql_field->pack_flag= FIELDFLAG_NUMBER;
+            if (!(file->ha_table_flags() & HA_CAN_BIT_FIELD))
+              sql_field->pack_flag|= FIELDFLAG_TREAT_BIT_AS_CHAR;
+          }
+
          sql_field->charset=           (dup_field->charset ?
                                         dup_field->charset :
                                         create_info->default_table_charset);
@@ -4960,6 +5010,12 @@ bool create_table_impl(THD *thd,
     bool result= (open_table_def(thd, &share, 0) ||
                   open_table_from_share(thd, &share, "", 0, (uint) READ_ALL,
                                         0, &table, true));
+    /*
+      Assert that the change list is empty as no partition function currently
+      needs to modify item tree. May need call THD::rollback_item_tree_changes
+      later before calling closefrm if the change list is not empty.
+    */
+    DBUG_ASSERT(thd->change_list.is_empty());
     if (!result)
       (void) closefrm(&table, 0);
 
@@ -5301,6 +5357,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", 
+                  WSREP_QUERY(thd));
+    } 
+    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 <temporary table> 
+         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
@@ -5392,7 +5502,8 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
   /*
     We have to write the query before we unlock the tables.
   */
-  if (thd->is_current_stmt_binlog_format_row())
+  if (!thd->is_current_stmt_binlog_disabled() &&
+      thd->is_current_stmt_binlog_format_row())
   {
     /*
        Since temporary tables are not replicated under row-based
@@ -5441,9 +5552,24 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
             new_table= TRUE;
           }
 
+          /*
+            After opening a MERGE table add the children to the query list of
+            tables, so that children tables info can be used on "CREATE TABLE"
+            statement generation by the binary log.
+            Note that placeholders don't have the handler open.
+          */
+          if (table->table->file->extra(HA_EXTRA_ADD_CHILDREN_LIST))
+            goto err;
+
+          /*
+            As the reference table is temporary and may not exist on slave, we must
+            force the ENGINE to be present into CREATE TABLE.
+          */
+          create_info->used_fields|= HA_CREATE_USED_ENGINE;
+
           int result __attribute__((unused))=
             store_create_info(thd, table, &query,
-                              create_info, FALSE /* show_database */);
+                              create_info, TRUE /* show_database */);
 
           DBUG_ASSERT(result == 0); // store_create_info() always return 0
           if (write_bin_log(thd, TRUE, query.ptr(), query.length()))
@@ -5474,6 +5600,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 */
 }
 
 
@@ -6954,6 +7085,10 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
   if (create_info->storage_media == HA_SM_DEFAULT)
     create_info->storage_media= table->s->default_storage_media;
 
+  /* Creation of federated table with LIKE clause needs connection string */
+  if (!(used_fields & HA_CREATE_USED_CONNECTION))
+    create_info->connect_string= table->s->connect_string;
+
   restore_record(table, s->default_values);     // Empty record for DEFAULT
   Create_field *def;
 
@@ -7883,6 +8018,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);
 
@@ -8071,11 +8217,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
 
 #ifdef WITH_PARTITION_STORAGE_ENGINE
   bool partition_changed= false;
-  bool fast_alter_partition= false;
+  partition_info *new_part_info= NULL;
   {
     if (prep_alter_part_table(thd, table, alter_info, create_info,
                               &alter_ctx, &partition_changed,
-                              &fast_alter_partition))
+                              &new_part_info))
     {
       DBUG_RETURN(true);
     }
@@ -8091,7 +8237,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
   set_table_default_charset(thd, create_info, alter_ctx.db);
 
 #ifdef WITH_PARTITION_STORAGE_ENGINE
-  if (fast_alter_partition)
+  if (new_part_info)
   {
     /*
       ALGORITHM and LOCK clauses are generally not allowed by the
@@ -8133,7 +8279,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
     DBUG_RETURN(fast_alter_partition_table(thd, table, alter_info,
                                            create_info, table_list,
                                            alter_ctx.db,
-                                           alter_ctx.table_name));
+                                           alter_ctx.table_name,
+                                           new_part_info));
   }
 #endif
 
@@ -8167,8 +8314,21 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
     alter_info->requested_algorithm= Alter_info::ALTER_TABLE_ALGORITHM_COPY;
   }
 
-  if (upgrade_old_temporal_types(thd, alter_info))
-    DBUG_RETURN(true);
+  /*
+    If 'avoid_temporal_upgrade' mode is not enabled, then the
+    pre MySQL 5.6.4 old temporal types if present is upgraded to the
+    current format.
+  */
+
+  mysql_mutex_lock(&LOCK_global_system_variables);
+  bool check_temporal_upgrade= !avoid_temporal_upgrade;
+  mysql_mutex_unlock(&LOCK_global_system_variables);
+
+  if (check_temporal_upgrade)
+  {
+    if (upgrade_old_temporal_types(thd, alter_info))
+      DBUG_RETURN(true);
+  }
 
   /*
     ALTER TABLE ... ENGINE to the same engine is a common way to
@@ -8343,6 +8503,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
         Also note that we ignore the LOCK clause here.
       */
       close_temporary_table(thd, altered_table, true, false);
+      (void) quick_rm_table(thd, new_db_type, alter_ctx.new_db,
+                            alter_ctx.tmp_name, FN_IS_TMP | NO_HA_TABLE);
       goto end_inplace;
     }
 
index 05415e2988149d52553932783a219c3f3f7a6c22..f664e8f87ec0bea934e66b5a6436368f4911765b 100644 (file)
@@ -262,6 +262,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
   }
   case Item::FIELD_ITEM:
   case Item::DEFAULT_VALUE_ITEM:
+  case Item::TRIGGER_FIELD_ITEM:
   {
     Item_field *field= (Item_field*) item;
     bool orig_modify= modify_item;
index e98b327bdb1e3621c786c20afa65056a5465258b..3ba1cb2fda706a666ffe8b45216bc312fd105bf6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   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
@@ -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);
@@ -1174,6 +1180,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
   LEX_STRING path;
   File_parser *parser;
   LEX_STRING save_db;
+  sql_digest_state *parent_digest= thd->m_digest;
   PSI_statement_locker *parent_locker= thd->m_statement_psi;
 
   DBUG_ENTER("Table_triggers_list::check_n_load");
@@ -1410,8 +1417,10 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
 
         Deprecated_trigger_syntax_handler error_handler;
         thd->push_internal_handler(&error_handler);
+        thd->m_digest= NULL;
         thd->m_statement_psi= NULL;
         bool parse_error= parse_sql(thd, & parser_state, creation_ctx);
+        thd->m_digest= parent_digest;
         thd->m_statement_psi= parent_locker;
         thd->pop_internal_handler();
 
@@ -2528,3 +2537,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 */
index 4d3d4e9158164a8297064f669588d3b8f70d9d4d..4818e5a9cd62481f296b0c9a3728901df5d11052 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2014, 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
@@ -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 */
 
 
 /**
@@ -283,6 +286,12 @@ static bool recreate_temporary_table(THD *thd, TABLE *table)
 
   table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
 
+  /*
+    If LOCK TABLES list is not empty and contains this table
+    then unlock the table and remove it from this list.
+  */
+  mysql_lock_remove(thd, thd->lock, table);
+
   /* Don't free share. */
   close_temporary_table(thd, table, FALSE, FALSE);
 
@@ -461,6 +470,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 +557,6 @@ bool Sql_cmd_truncate_table::execute(THD *thd)
 
   if (! (res= truncate_table(thd, first_table)))
     my_ok(thd);
-
   DBUG_RETURN(res);
 }
 
index 4c4714e0b0f37fc13306bf2172be7c4d6fdd20a5..5ee39eb406bb39a08ccc6c9e50d6e4803d76780c 100644 (file)
@@ -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
@@ -826,7 +826,8 @@ int mysql_update(THD *thd,
             error= 0;
        }
        else if (!ignore ||
-                 table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
+                 table->file->is_fatal_error(error, HA_CHECK_DUP_KEY |
+                                                    HA_CHECK_FK_ERROR))
        {
           /*
             If (ignore && error is ignorable) we don't have to
@@ -834,13 +835,17 @@ int mysql_update(THD *thd,
           */
           myf flags= 0;
 
-          if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
+          if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY |
+                                                 HA_CHECK_FK_ERROR))
             flags|= ME_FATALERROR; /* Other handler errors are fatal */
 
          table->file->print_error(error,MYF(flags));
          error= 1;
          break;
        }
+        else if (ignore && !table->file->is_fatal_error(error,
+                                                        HA_CHECK_FK_ERROR))
+          warn_fk_constraint_violation(thd, table, error);
       }
 
       if (table->triggers &&
@@ -988,7 +993,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)
@@ -2073,7 +2082,8 @@ bool multi_update::send_data(List<Item> &not_used_values)
         {
           updated--;
           if (!ignore ||
-              table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
+              table->file->is_fatal_error(error, HA_CHECK_DUP_KEY |
+                                                 HA_CHECK_FK_ERROR))
           {
             /*
               If (ignore && error == is ignorable) we don't have to
@@ -2081,12 +2091,16 @@ bool multi_update::send_data(List<Item> &not_used_values)
             */
             myf flags= 0;
 
-            if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
+            if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY |
+                                                   HA_CHECK_FK_ERROR))
               flags|= ME_FATALERROR; /* Other handler errors are fatal */
 
             table->file->print_error(error,MYF(flags));
             DBUG_RETURN(1);
           }
+          else if (ignore && !table->file->is_fatal_error(error,
+                                                          HA_CHECK_FK_ERROR))
+            warn_fk_constraint_violation(thd, table, error);
         }
         else
         {
@@ -2203,7 +2217,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
@@ -2231,15 +2249,49 @@ int multi_update::do_updates()
   DBUG_ENTER("multi_update::do_updates");
 
   do_update= 0;                                        // Don't retry this function
+
   if (!found)
+  {
+    /*
+      If the binary log is on, we still need to check
+      if there are transactional tables involved. If
+      there are mark the transactional_tables flag correctly.
+
+      This flag determines whether the writes go into the
+      transactional or non transactional cache, even if they
+      do not change any table, they are still written into
+      the binary log when the format is STMT or MIXED.
+    */
+    if(mysql_bin_log.is_open())
+    {
+      for (cur_table= update_tables; cur_table;
+           cur_table= cur_table->next_local)
+      {
+        table = cur_table->table;
+        transactional_tables= transactional_tables ||
+                              table->file->has_transactions();
+      }
+    }
     DBUG_RETURN(0);
+  }
   for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local)
   {
     uint offset= cur_table->shared;
 
     table = cur_table->table;
+
+    /*
+      Always update the flag if - even if not updating the table,
+      when the binary log is ON. This will allow the right binlog
+      cache - stmt or trx cache - to be selected when logging
+      innefective statementst to the binary log (in STMT or MIXED
+      mode logging).
+     */
+    if (mysql_bin_log.is_open())
+      transactional_tables= transactional_tables || table->file->has_transactions();
+
     if (table == table_to_update)
-      continue;                                        // Already updated
+      continue;                                        // Already updated
     org_updated= updated;
     tmp_table= tmp_tables[cur_table->shared];
     tmp_table->file->extra(HA_EXTRA_CACHE);    // Change to read cache
@@ -2331,8 +2383,12 @@ int multi_update::do_updates()
         else if (local_error == HA_ERR_RECORD_IS_THE_SAME)
           local_error= 0;
         else if (!ignore ||
-                 table->file->is_fatal_error(local_error, HA_CHECK_DUP_KEY))
+                 table->file->is_fatal_error(local_error, HA_CHECK_DUP_KEY |
+                                                          HA_CHECK_FK_ERROR))
           goto err;
+       else if (ignore && !table->file->is_fatal_error(local_error,
+                                                          HA_CHECK_FK_ERROR))
+          warn_fk_constraint_violation(thd, table, local_error);
         else
           local_error= 0;
       }
@@ -2345,9 +2401,7 @@ int multi_update::do_updates()
 
     if (updated != org_updated)
     {
-      if (table->file->has_transactions())
-        transactional_tables= TRUE;
-      else
+      if (!table->file->has_transactions())
       {
         trans_safe= FALSE;                             // Can't do safe rollback
         thd->transaction.stmt.mark_modified_non_trans_table();
@@ -2435,7 +2489,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)
index 4152d688fc937c2122ecacdd524cbe9bb2239532..804076548b5ad3fd48046cba5bb15a4eba8471e2 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -162,18 +162,14 @@ err:
   possibly generate a conforming name for them if not.
 
   @param lex  Lex for this thread.
-
-  @retval false Operation was a success.
-  @retval true  An error occurred.
 */
 
-static bool make_valid_column_names(LEX *lex)
+static void make_valid_column_names(LEX *lex)
 {
   Item *item;
   uint name_len;
   char buff[NAME_LEN];
   uint column_no= 1;
-  DBUG_ENTER("make_valid_column_names");
 
   for (SELECT_LEX *sl= &lex->select_lex; sl; sl= sl->next_select())
   {
@@ -186,37 +182,7 @@ static bool make_valid_column_names(LEX *lex)
       item->orig_name= item->item_name;
       item->item_name.copy(buff, name_len);
     }
-
-    /*
-      There is a possibility of generating same name for column in more than
-      one SELECT_LEX. For Example:
-
-       CREATE TABLE t1 (Name_exp_1 INT, Name_exp_2 INT, Name_exp_3 INT);
-       CREATE TABLE t2 (Name_exp_1 INT, Name_exp_2 INT, Name_exp_3 INT);
-
-       CREATE VIEW v1 AS SELECT '', t1.Name_exp_2 AS Name_exp_2 FROM t1
-                         UNION
-                         SELECT '', t2.Name_exp_1 AS Name_exp_1 from t2;
-
-      But, column names of the first SELECT_LEX is considered
-      for the output.
-
-        mysql> SELECT * FROM v1;
-        +------------+------------+
-        | Name_exp_1 | Name_exp_2 |
-        +------------+------------+
-        |            |          2 |
-        |            |          3 |
-        +------------+------------+
-
-      So, checking for duplicate names in only "sl", current
-      SELECT_LEX.
-    */
-    if (check_duplicate_names(sl->item_list, 1))
-      DBUG_RETURN(true);
   }
-
-  DBUG_RETURN(false);
 }
 
 
@@ -635,7 +601,14 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
   }
 
   /* Check if the auto generated column names are conforming. */
-  if (make_valid_column_names(lex))
+  make_valid_column_names(lex);
+
+  /*
+    Only column names of the first select_lex should be checked for
+    duplication; any further UNION-ed part isn't used for determining
+    names of the view's columns.
+  */
+  if (check_duplicate_names(select_lex->item_list, 1))
   {
     res= TRUE;
     goto err;
@@ -719,53 +692,53 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
   */
 
   if (!res)
-    tdc_remove_table(thd, TDC_RT_REMOVE_ALL, view->db, view->table_name, false);
-
-  if (mysql_bin_log.is_open())
   {
-    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);
-    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)
+    tdc_remove_table(thd, TDC_RT_REMOVE_ALL, view->db, view->table_name, false);
+    if (mysql_bin_log.is_open())
     {
-      List_iterator_fast<LEX_STRING> names(lex->view_list);
-      LEX_STRING *name;
-      int i;
-      
-      for (i= 0; (name= names++); i++)
+      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);
+      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)))
       {
-        buff.append(i ? ", " : "(");
-        append_identifier(thd, &buff, name->str, name->length);
+        append_identifier(thd, &buff, views->db,
+                          views->db_length);
+        buff.append('.');
       }
-      buff.append(')');
-    }
-    buff.append(STRING_WITH_LEN(" AS "));
-    buff.append(views->source.str, views->source.length);
+      append_identifier(thd, &buff, views->table_name,
+                        views->table_name_length);
+      if (lex->view_list.elements)
+      {
+        List_iterator_fast<LEX_STRING> names(lex->view_list);
+        LEX_STRING *name;
+        int i;
 
-    int errcode= query_error_code(thd, TRUE);
-    thd->add_to_binlog_accessed_dbs(views->db);
-    if (thd->binlog_query(THD::STMT_QUERY_TYPE,
-                          buff.ptr(), buff.length(), FALSE, FALSE, FALSE, errcode))
-      res= TRUE;
-  }
+        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);
 
+      int errcode= query_error_code(thd, TRUE);
+      thd->add_to_binlog_accessed_dbs(views->db);
+      if (thd->binlog_query(THD::STMT_QUERY_TYPE,
+                            buff.ptr(), buff.length(), FALSE, FALSE, FALSE, errcode))
+        res= TRUE;
+    }
+  }
   if (mode != VIEW_CREATE_NEW)
     query_cache_invalidate3(thd, view, 0);
   if (res)
@@ -1400,6 +1373,9 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
     thd->variables.sql_mode&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
                                 MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES);
 
+    if (thd->m_digest != NULL)
+      thd->m_digest->reset(thd->m_token_array, max_digest_length);
+
     /* Parse the query. */
 
     parse_status= parse_sql(thd, & parser_state, table->view_creation_ctx);
diff --git a/mysql-wsrep-5.6/sql/sql_yacc.cc b/mysql-wsrep-5.6/sql/sql_yacc.cc
deleted file mode 100644 (file)
index e9dcd1c..0000000
+++ /dev/null
@@ -1,42249 +0,0 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-   
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-   
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
-   simplifying the original so-called "semantic" parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Bison version.  */
-#define YYBISON_VERSION "2.4.1"
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 1
-
-/* Push parsers.  */
-#define YYPUSH 0
-
-/* Pull parsers.  */
-#define YYPULL 1
-
-/* Using locations.  */
-#define YYLSP_NEEDED 0
-
-/* Substitute the variable and function names.  */
-#define yyparse         MYSQLparse
-#define yylex           MYSQLlex
-#define yyerror         MYSQLerror
-#define yylval          MYSQLlval
-#define yychar          MYSQLchar
-#define yydebug         MYSQLdebug
-#define yynerrs         MYSQLnerrs
-
-
-/* Copy the first part of user declarations.  */
-
-/* Line 189 of yacc.c  */
-#line 24 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-
-/*
-Note: YYTHD is passed as an argument to yyparse(), and subsequently to yylex().
-*/
-#define YYLIP (& YYTHD->m_parser_state->m_lip)
-#define YYPS (& YYTHD->m_parser_state->m_yacc)
-#define YYCSCL  YYTHD->variables.character_set_client
-
-#define MYSQL_YACC
-#define YYINITDEPTH 100
-#define YYMAXDEPTH 3200                        /* Because of 64K stack */
-#define Lex (YYTHD->lex)
-#define Select Lex->current_select
-#include "sql_priv.h"
-#include "unireg.h"                    // REQUIRED: for other includes
-#include "sql_parse.h"                        /* comp_*_creator */
-#include "sql_table.h"                        /* primary_key_name */
-#include "sql_partition.h"  /* mem_alloc_error, partition_info, HASH_PARTITION */
-#include "sql_acl.h"                          /* *_ACL */
-#include "password.h"       /* my_make_scrambled_password_323, my_make_scrambled_password */
-#include "sql_class.h"      /* Key_part_spec, enum_filetype, Diag_condition_item_name */
-#include "rpl_slave.h"
-#include "lex_symbol.h"
-#include "item_create.h"
-#include "sp_head.h"
-#include "sp_instr.h"
-#include "sp_pcontext.h"
-#include "sp_rcontext.h"
-#include "sp.h"
-#include "sql_alter.h"                         // Sql_cmd_alter_table*
-#include "sql_truncate.h"                      // Sql_cmd_truncate_table
-#include "sql_admin.h"                         // Sql_cmd_analyze/Check..._table
-#include "sql_partition_admin.h"               // Sql_cmd_alter_table_*_part.
-#include "sql_handler.h"                       // Sql_cmd_handler_*
-#include "sql_signal.h"
-#include "sql_get_diagnostics.h"               // Sql_cmd_get_diagnostics
-#include "event_parse_data.h"
-#include <myisam.h>
-#include <myisammrg.h>
-#include "keycaches.h"
-#include "set_var.h"
-#include "opt_explain_traditional.h"
-#include "opt_explain_json.h"
-
-/* this is to get the bison compilation windows warnings out */
-#ifdef _MSC_VER
-/* warning C4065: switch statement contains 'default' but no 'case' labels */
-#pragma warning (disable : 4065)
-#endif
-
-using std::min;
-using std::max;
-
-int yylex(void *yylval, void *yythd);
-
-#define yyoverflow(A,B,C,D,E,F)               \
-  {                                           \
-    ulong val= *(F);                          \
-    if (my_yyoverflow((B), (D), &val))        \
-    {                                         \
-      yyerror(YYTHD, (char*) (A));            \
-      return 2;                               \
-    }                                         \
-    else                                      \
-    {                                         \
-      *(F)= (YYSIZE_T)val;                    \
-    }                                         \
-  }
-
-#define MYSQL_YYABORT                         \
-  do                                          \
-  {                                           \
-    LEX::cleanup_lex_after_parse_error(YYTHD);\
-    YYABORT;                                  \
-  } while (0)
-
-#define MYSQL_YYABORT_UNLESS(A)         \
-  if (!(A))                             \
-  {                                     \
-    my_parse_error(ER(ER_SYNTAX_ERROR));\
-    MYSQL_YYABORT;                      \
-  }
-
-/*
-  Work around for broken code generated by bison 1.875.
-
-  The code generated by bison 1.875a and later, bison 2.1 and bison 2.2 is ok.
-  With bison 1.875 however, the generated code contains:
-<pre>
-  yyerrlab1:
-  #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
-    __attribute__ ((__unused__))
-  #endif
-</pre>
-  This usage of __attribute__ is illegal, so we remove it.
-  See the following references for details:
-  http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00014.html
-  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14273
-*/
-
-#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
-#undef __attribute__
-#define __attribute__(X)
-#endif
-
-
-#ifndef DBUG_OFF
-#define YYDEBUG 1
-#else
-#define YYDEBUG 0
-#endif
-
-/**
-  @brief Push an error message into MySQL error stack with line
-  and position information.
-
-  This function provides semantic action implementers with a way
-  to push the famous "You have a syntax error near..." error
-  message into the error stack, which is normally produced only if
-  a parse error is discovered internally by the Bison generated
-  parser.
-*/
-
-void my_parse_error(const char *s)
-{
-  THD *thd= current_thd;
-  Lex_input_stream *lip= & thd->m_parser_state->m_lip;
-
-  const char *yytext= lip->get_tok_start();
-  if (!yytext)
-    yytext= "";
-
-  /* Push an error into the error stack */
-  ErrConvString err(yytext, thd->variables.character_set_client);
-  my_printf_error(ER_PARSE_ERROR,  ER(ER_PARSE_ERROR), MYF(0), s,
-                  err.ptr(), lip->yylineno);
-}
-
-/**
-  @brief Bison callback to report a syntax/OOM error
-
-  This function is invoked by the bison-generated parser
-  when a syntax error, a parse error or an out-of-memory
-  condition occurs. This function is not invoked when the
-  parser is requested to abort by semantic action code
-  by means of YYABORT or YYACCEPT macros. This is why these
-  macros should not be used (use MYSQL_YYABORT/MYSQL_YYACCEPT
-  instead).
-
-  The parser will abort immediately after invoking this callback.
-
-  This function is not for use in semantic actions and is internal to
-  the parser, as it performs some pre-return cleanup. 
-  In semantic actions, please use my_parse_error or my_error to
-  push an error into the error stack and MYSQL_YYABORT
-  to abort from the parser.
-*/
-
-void MYSQLerror(THD *thd, const char *s)
-{
-  /*
-    Restore the original LEX if it was replaced when parsing
-    a stored procedure. We must ensure that a parsing error
-    does not leave any side effects in the THD.
-  */
-  LEX::cleanup_lex_after_parse_error(thd);
-
-  /* "parse error" changed into "syntax error" between bison 1.75 and 1.875 */
-  if (strcmp(s,"parse error") == 0 || strcmp(s,"syntax error") == 0)
-    s= ER(ER_SYNTAX_ERROR);
-  my_parse_error(s);
-}
-
-
-#ifndef DBUG_OFF
-void turn_parser_debug_on()
-{
-  /*
-     MYSQLdebug is in sql/sql_yacc.cc, in bison generated code.
-     Turning this option on is **VERY** verbose, and should be
-     used when investigating a syntax error problem only.
-
-     The syntax to run with bison traces is as follows :
-     - Starting a server manually :
-       mysqld --debug="d,parser_debug" ...
-     - Running a test :
-       mysql-test-run.pl --mysqld="--debug=d,parser_debug" ...
-
-     The result will be in the process stderr (var/log/master.err)
-   */
-
-  extern int yydebug;
-  yydebug= 1;
-}
-#endif
-
-static bool is_native_function(THD *thd, const LEX_STRING *name)
-{
-  if (find_native_function_builder(thd, *name))
-    return true;
-
-  if (is_lex_native_function(name))
-    return true;
-
-  return false;
-}
-
-
-/**
-  Helper action for a case statement (entering the CASE).
-  This helper is used for both 'simple' and 'searched' cases.
-  This helper, with the other case_stmt_action_..., is executed when
-  the following SQL code is parsed:
-<pre>
-CREATE PROCEDURE proc_19194_simple(i int)
-BEGIN
-  DECLARE str CHAR(10);
-
-  CASE i
-    WHEN 1 THEN SET str="1";
-    WHEN 2 THEN SET str="2";
-    WHEN 3 THEN SET str="3";
-    ELSE SET str="unknown";
-  END CASE;
-
-  SELECT str;
-END
-</pre>
-  The actions are used to generate the following code:
-<pre>
-SHOW PROCEDURE CODE proc_19194_simple;
-Pos     Instruction
-0       set str@1 NULL
-1       set_case_expr (12) 0 i@0
-2       jump_if_not 5(12) (case_expr@0 = 1)
-3       set str@1 _latin1'1'
-4       jump 12
-5       jump_if_not 8(12) (case_expr@0 = 2)
-6       set str@1 _latin1'2'
-7       jump 12
-8       jump_if_not 11(12) (case_expr@0 = 3)
-9       set str@1 _latin1'3'
-10      jump 12
-11      set str@1 _latin1'unknown'
-12      stmt 0 "SELECT str"
-</pre>
-
-  @param thd thread handler
-*/
-
-void case_stmt_action_case(THD *thd)
-{
-  LEX *lex= thd->lex;
-  sp_head *sp= lex->sphead;
-  sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-  sp->m_parser_data.new_cont_backpatch();
-
-  /*
-    BACKPATCH: Creating target label for the jump to
-    "case_stmt_action_end_case"
-    (Instruction 12 in the example)
-  */
-
-  pctx->push_label(thd, EMPTY_STR, sp->instructions());
-}
-
-/**
-  Helper action for a case then statements.
-  This helper is used for both 'simple' and 'searched' cases.
-  @param lex the parser lex context
-*/
-
-bool case_stmt_action_then(THD *thd, LEX *lex)
-{
-  sp_head *sp= lex->sphead;
-  sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-  sp_instr_jump *i =
-    new (thd->mem_root) sp_instr_jump(sp->instructions(), pctx);
-
-  if (!i || sp->add_instr(thd, i))
-    return true;
-
-  /*
-    BACKPATCH: Resolving forward jump from
-    "case_stmt_action_when" to "case_stmt_action_then"
-    (jump_if_not from instruction 2 to 5, 5 to 8 ... in the example)
-  */
-
-  sp->m_parser_data.do_backpatch(pctx->pop_label(), sp->instructions());
-
-  /*
-    BACKPATCH: Registering forward jump from
-    "case_stmt_action_then" to "case_stmt_action_end_case"
-    (jump from instruction 4 to 12, 7 to 12 ... in the example)
-  */
-
-  return sp->m_parser_data.add_backpatch_entry(i, pctx->last_label());
-}
-
-/**
-  Helper action for an end case.
-  This helper is used for both 'simple' and 'searched' cases.
-  @param lex the parser lex context
-  @param simple true for simple cases, false for searched cases
-*/
-
-void case_stmt_action_end_case(LEX *lex, bool simple)
-{
-  sp_head *sp= lex->sphead;
-  sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-  /*
-    BACKPATCH: Resolving forward jump from
-    "case_stmt_action_then" to "case_stmt_action_end_case"
-    (jump from instruction 4 to 12, 7 to 12 ... in the example)
-  */
-  sp->m_parser_data.do_backpatch(pctx->pop_label(), sp->instructions());
-
-  if (simple)
-    pctx->pop_case_expr_id();
-
-  sp->m_parser_data.do_cont_backpatch(sp->instructions());
-}
-
-
-static bool
-find_sys_var_null_base(THD *thd, struct sys_var_with_base *tmp)
-{
-  tmp->var= find_sys_var(thd, tmp->base_name.str, tmp->base_name.length);
-
-  if (tmp->var == NULL)
-    my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), tmp->base_name.str);
-  else
-    tmp->base_name= null_lex_str;
-
-  return thd->is_error();
-}
-
-
-/**
-  Helper action for a SET statement.
-  Used to push a system variable into the assignment list.
-
-  @param thd      the current thread
-  @param tmp      the system variable with base name
-  @param var_type the scope of the variable
-  @param val      the value being assigned to the variable
-
-  @return TRUE if error, FALSE otherwise.
-*/
-
-static bool
-set_system_variable(THD *thd, struct sys_var_with_base *tmp,
-                    enum enum_var_type var_type, Item *val)
-{
-  set_var *var;
-  LEX *lex= thd->lex;
-  sp_head *sp= lex->sphead;
-  sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-  /* No AUTOCOMMIT from a stored function or trigger. */
-  if (pctx && tmp->var == Sys_autocommit_ptr)
-    sp->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT;
-
-#ifdef HAVE_REPLICATION
-  if (lex->uses_stored_routines() &&
-      ((tmp->var == Sys_gtid_next_ptr
-#ifdef HAVE_GTID_NEXT_LIST
-       || tmp->var == Sys_gtid_next_list_ptr
-#endif
-       ) ||
-       Sys_gtid_purged_ptr == tmp->var))
-  {
-    my_error(ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION, MYF(0),
-             tmp->var->name.str);
-    return TRUE;
-  }
-#endif
-
-  if (val && val->type() == Item::FIELD_ITEM &&
-      ((Item_field*)val)->table_name)
-  {
-    my_error(ER_WRONG_TYPE_FOR_VAR, MYF(0), tmp->var->name.str);
-    return TRUE;
-  }
-
-  if (! (var= new set_var(var_type, tmp->var, &tmp->base_name, val)))
-    return TRUE;
-
-  return lex->var_list.push_back(var);
-}
-
-
-/**
-  Helper action for a SET statement.
-  Used to SET a field of NEW row.
-
-  @param thd                thread handler
-  @param trigger_field_name the NEW-row field name
-  @param expr_item          the value expression being assigned
-  @param expr_query         the value expression query
-
-  @return error status (true if error, false otherwise).
-*/
-
-static bool set_trigger_new_row(THD *thd,
-                                LEX_STRING trigger_field_name,
-                                Item *expr_item,
-                                LEX_STRING expr_query)
-{
-  LEX *lex= thd->lex;
-  sp_head *sp= lex->sphead;
-
-  DBUG_ASSERT(expr_item);
-  DBUG_ASSERT(sp->m_trg_chistics.action_time == TRG_ACTION_BEFORE &&
-              (sp->m_trg_chistics.event == TRG_EVENT_INSERT ||
-               sp->m_trg_chistics.event == TRG_EVENT_UPDATE));
-
-  Item_trigger_field *trg_fld=
-    new (thd->mem_root) Item_trigger_field(lex->current_context(),
-                                           Item_trigger_field::NEW_ROW,
-                                           trigger_field_name.str,
-                                           UPDATE_ACL, false);
-
-  if (!trg_fld)
-    return true;
-
-  sp_instr_set_trigger_field *i=
-    new (thd->mem_root)
-      sp_instr_set_trigger_field(sp->instructions(),
-                                 lex,
-                                 trigger_field_name,
-                                 trg_fld, expr_item,
-                                 expr_query);
-
-  if (!i)
-    return true;
-
-  /*
-    Let us add this item to list of all Item_trigger_field
-    objects in trigger.
-  */
-  sp->m_cur_instr_trig_field_items.link_in_list(trg_fld,
-                                                &trg_fld->next_trg_field);
-
-  return sp->add_instr(thd, i);
-}
-
-
-/**
-  Create an object to represent a SP variable in the Item-hierarchy.
-
-  @param thd              The current thread.
-  @param name             The SP variable name.
-  @param spv              The SP variable (optional).
-  @param query_start_ptr  Start of the SQL-statement query string (optional).
-  @param start_in_q       Start position of the SP variable name in the query.
-  @param end_in_q         End position of the SP variable name in the query.
-
-  @remark If spv is not specified, the name is used to search for the
-          variable in the parse-time context. If the variable does not
-          exist, a error is set and NULL is returned to the caller.
-
-  @return An Item_splocal object representing the SP variable, or NULL on error.
-*/
-static Item_splocal* create_item_for_sp_var(THD *thd,
-                                            LEX_STRING name,
-                                            sp_variable *spv,
-                                            const char *query_start_ptr,
-                                            const char *start_in_q,
-                                            const char *end_in_q)
-{
-  LEX *lex= thd->lex;
-  uint spv_pos_in_query= 0;
-  uint spv_len_in_query= 0;
-  sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-  /* If necessary, look for the variable. */
-  if (pctx && !spv)
-    spv= pctx->find_variable(name, false);
-
-  if (!spv)
-  {
-    my_error(ER_SP_UNDECLARED_VAR, MYF(0), name.str);
-    return NULL;
-  }
-
-  DBUG_ASSERT(pctx && spv);
-
-  if (query_start_ptr)
-  {
-    /* Position and length of the SP variable name in the query. */
-    spv_pos_in_query= start_in_q - query_start_ptr;
-    spv_len_in_query= end_in_q - start_in_q;
-  }
-
-  Item_splocal *item=
-    new (thd->mem_root) Item_splocal(
-      name, spv->offset, spv->type, spv_pos_in_query, spv_len_in_query);
-
-#ifndef DBUG_OFF
-  if (item)
-    item->m_sp= lex->sphead;
-#endif
-
-  return item;
-}
-
-
-/**
-  Helper to resolve the SQL:2003 Syntax exception 1) in <in predicate>.
-  See SQL:2003, Part 2, section 8.4 <in predicate>, Note 184, page 383.
-  This function returns the proper item for the SQL expression
-  <code>left [NOT] IN ( expr )</code>
-  @param thd the current thread
-  @param left the in predicand
-  @param equal true for IN predicates, false for NOT IN predicates
-  @param expr first and only expression of the in value list
-  @return an expression representing the IN predicate.
-*/
-Item* handle_sql2003_note184_exception(THD *thd, Item* left, bool equal,
-                                       Item *expr)
-{
-  /*
-    Relevant references for this issue:
-    - SQL:2003, Part 2, section 8.4 <in predicate>, page 383,
-    - SQL:2003, Part 2, section 7.2 <row value expression>, page 296,
-    - SQL:2003, Part 2, section 6.3 <value expression primary>, page 174,
-    - SQL:2003, Part 2, section 7.15 <subquery>, page 370,
-    - SQL:2003 Feature F561, "Full value expressions".
-
-    The exception in SQL:2003 Note 184 means:
-    Item_singlerow_subselect, which corresponds to a <scalar subquery>,
-    should be re-interpreted as an Item_in_subselect, which corresponds
-    to a <table subquery> when used inside an <in predicate>.
-
-    Our reading of Note 184 is reccursive, so that all:
-    - IN (( <subquery> ))
-    - IN ((( <subquery> )))
-    - IN '('^N <subquery> ')'^N
-    - etc
-    should be interpreted as a <table subquery>, no matter how deep in the
-    expression the <subquery> is.
-  */
-
-  Item *result;
-
-  DBUG_ENTER("handle_sql2003_note184_exception");
-
-  if (expr->type() == Item::SUBSELECT_ITEM)
-  {
-    Item_subselect *expr2 = (Item_subselect*) expr;
-
-    if (expr2->substype() == Item_subselect::SINGLEROW_SUBS)
-    {
-      Item_singlerow_subselect *expr3 = (Item_singlerow_subselect*) expr2;
-      st_select_lex *subselect;
-
-      /*
-        Implement the mandated change, by altering the semantic tree:
-          left IN Item_singlerow_subselect(subselect)
-        is modified to
-          left IN (subselect)
-        which is represented as
-          Item_in_subselect(left, subselect)
-      */
-      subselect= expr3->invalidate_and_restore_select_lex();
-      result= new (thd->mem_root) Item_in_subselect(left, subselect);
-
-      if (! equal)
-        result = negate_expression(thd, result);
-
-      DBUG_RETURN(result);
-    }
-  }
-
-  if (equal)
-    result= new (thd->mem_root) Item_func_eq(left, expr);
-  else
-    result= new (thd->mem_root) Item_func_ne(left, expr);
-
-  DBUG_RETURN(result);
-}
-
-/**
-   @brief Creates a new SELECT_LEX for a UNION branch.
-
-   Sets up and initializes a SELECT_LEX structure for a query once the parser
-   discovers a UNION token. The current SELECT_LEX is pushed on the stack and
-   the new SELECT_LEX becomes the current one.
-
-   @param lex The parser state.
-
-   @param is_union_distinct True if the union preceding the new select statement
-   uses UNION DISTINCT.
-
-   @param is_top_level This should be @c TRUE if the newly created SELECT_LEX
-   is a non-nested statement.
-
-   @return <code>false</code> if successful, <code>true</code> if an error was
-   reported. In the latter case parsing should stop.
- */
-bool add_select_to_union_list(LEX *lex, bool is_union_distinct, 
-                              bool is_top_level)
-{
-  /* 
-     Only the last SELECT can have INTO. Since the grammar won't allow INTO in
-     a nested SELECT, we make this check only when creating a top-level SELECT.
-  */
-  if (is_top_level && lex->result)
-  {
-    my_error(ER_WRONG_USAGE, MYF(0), "UNION", "INTO");
-    return TRUE;
-  }
-  if (lex->proc_analyse)
-  {
-    my_error(ER_WRONG_USAGE, MYF(0), "UNION", "SELECT ... PROCEDURE ANALYSE()");
-    return TRUE;
-  }
-  if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
-  {
-    my_parse_error(ER(ER_SYNTAX_ERROR));
-    return TRUE;
-  }
-  /* This counter shouldn't be incremented for UNION parts */
-  lex->nest_level--;
-  if (mysql_new_select(lex, 0))
-    return TRUE;
-  mysql_init_select(lex);
-  lex->current_select->linkage=UNION_TYPE;
-  if (is_union_distinct) /* UNION DISTINCT - remember position */
-    lex->current_select->master_unit()->union_distinct=
-      lex->current_select;
-  return FALSE;
-}
-
-/**
-   @brief Initializes a SELECT_LEX for a query within parentheses (aka
-   braces).
-
-   @return false if successful, true if an error was reported. In the latter
-   case parsing should stop.
- */
-bool setup_select_in_parentheses(LEX *lex) 
-{
-  SELECT_LEX * sel= lex->current_select;
-  if (sel->set_braces(1))
-  {
-    my_parse_error(ER(ER_SYNTAX_ERROR));
-    return TRUE;
-  }
-  if (sel->linkage == UNION_TYPE &&
-      !sel->master_unit()->first_select()->braces &&
-      sel->master_unit()->first_select()->linkage ==
-      UNION_TYPE)
-  {
-    my_parse_error(ER(ER_SYNTAX_ERROR));
-    return TRUE;
-  }
-  if (sel->linkage == UNION_TYPE &&
-      sel->olap != UNSPECIFIED_OLAP_TYPE &&
-      sel->master_unit()->fake_select_lex)
-  {
-    my_error(ER_WRONG_USAGE, MYF(0), "CUBE/ROLLUP", "ORDER BY");
-    return TRUE;
-  }
-  /* select in braces, can't contain global parameters */
-  if (sel->master_unit()->fake_select_lex)
-    sel->master_unit()->global_parameters=
-      sel->master_unit()->fake_select_lex;
-  return FALSE;
-}
-
-static bool add_create_index_prepare (LEX *lex, Table_ident *table)
-{
-  lex->sql_command= SQLCOM_CREATE_INDEX;
-  if (!lex->current_select->add_table_to_list(lex->thd, table, NULL,
-                                              TL_OPTION_UPDATING,
-                                              TL_READ_NO_INSERT,
-                                              MDL_SHARED_UPGRADABLE))
-    return TRUE;
-  lex->alter_info.reset();
-  lex->alter_info.flags= Alter_info::ALTER_ADD_INDEX;
-  lex->col_list.empty();
-  lex->change= NullS;
-  return FALSE;
-}
-
-static bool add_create_index (LEX *lex, Key::Keytype type,
-                              const LEX_STRING &name,
-                              KEY_CREATE_INFO *info= NULL, bool generated= 0)
-{
-  Key *key;
-  key= new Key(type, name, info ? info : &lex->key_create_info, generated, 
-               lex->col_list);
-  if (key == NULL)
-    return TRUE;
-
-  lex->alter_info.key_list.push_back(key);
-  lex->col_list.empty();
-  return FALSE;
-}
-
-/**
-  Make a new string allocated on THD's mem-root.
-
-  @param thd        thread handler.
-  @param start_ptr  start of the new string.
-  @param end_ptr    end of the new string.
-
-  @return LEX_STRING object, containing a pointer to a newly
-  constructed/allocated string, and its length. The pointer is NULL
-  in case of out-of-memory error.
-*/
-static LEX_STRING make_string(THD *thd,
-                              const char *start_ptr,
-                              const char *end_ptr)
-{
-  LEX_STRING s;
-
-  s.length= end_ptr - start_ptr;
-  s.str= (char *) thd->alloc(s.length + 1);
-
-  if (s.str)
-    strmake(s.str, start_ptr, s.length);
-
-  return s;
-}
-
-/*
-  The start is either lip->ptr, if there was no lookahead, lip->tok_start
-  otherwise.
-*/
-#define YY_TOKEN_START \
-  ((yychar == YYEMPTY) ?  YYLIP->get_ptr() : YYLIP->get_tok_start())
-
-/*
-   The end is either lip->ptr, if there was no lookahead,
-   or lip->tok_end otherwise.
-*/
-
-#define YY_TOKEN_END \
-  ((yychar == YYEMPTY) ?  YYLIP->get_ptr() : YYLIP->get_tok_end())
-
-/**
-  Create a separate LEX for each assignment if in SP.
-
-  If we are in SP we want have own LEX for each assignment.
-  This is mostly because it is hard for several sp_instr_set
-  and sp_instr_set_trigger instructions share one LEX.
-  (Well, it is theoretically possible but adds some extra
-  overhead on preparation for execution stage and IMO less
-  robust).
-
-  @see sp_create_assignment_instr
-
-  @param thd        Thread context
-  @param option_ptr Option-value-expression start pointer
-*/
-
-static void sp_create_assignment_lex(THD *thd, const char *option_ptr)
-{
-  LEX *lex= thd->lex;
-  sp_head *sp= lex->sphead;
-
-  /*
-    We can come here in the following cases:
-
-      1. it's a regular SET statement outside stored programs
-        (lex->sphead is NULL);
-
-      2. we're parsing a stored program normally (loading from mysql.proc, ...);
-
-      3. we're re-parsing SET-statement with a user variable after meta-data
-        change. It's guaranteed, that:
-        - this SET-statement deals with a user/system variable (otherwise, it
-          would be a different SP-instruction, and we would parse an expression);
-        - this SET-statement has a single user/system variable assignment
-          (that's how we generate sp_instr_stmt-instructions for SET-statements).
-        So, in this case, even if lex->sphead is set, we should not process
-        further.
-  */
-
-  if (!sp ||            // case #1
-      sp->is_invoked()) // case #3
-  {
-    return;
-  }
-
-  LEX *old_lex= lex;
-  sp->reset_lex(thd);
-  lex= thd->lex;
-
-  /* Set new LEX as if we at start of set rule. */
-  mysql_init_select(lex);
-  lex->sql_command= SQLCOM_SET_OPTION;
-  lex->var_list.empty();
-  lex->one_shot_set= 0;
-  lex->autocommit= 0;
-
-  /*
-    It's a SET statement within SP. It will be either translated
-    into one or more sp_instr_stmt instructions, or it will be
-    sp_instr_set / sp_instr_set_trigger_field instructions.
-    In any case, position of SP-variable can not be determined
-    reliably. So, we set the start pointer of the current statement
-    to NULL.
-  */
-  sp->m_parser_data.set_current_stmt_start_ptr(NULL);
-  sp->m_parser_data.set_option_start_ptr(option_ptr);
-
-  /* Inherit from outer lex. */
-  lex->option_type= old_lex->option_type;
-}
-
-
-/**
-  Create a SP instruction for a SET assignment.
-
-  @see sp_create_assignment_lex
-
-  @param thd           Thread context
-  @param expr_end_ptr  Option-value-expression end pointer
-
-  @return false if success, true otherwise.
-*/
-
-static bool sp_create_assignment_instr(THD *thd, const char *expr_end_ptr)
-{
-  LEX *lex= thd->lex;
-  sp_head *sp= lex->sphead;
-
-  /*
-    We can come here in the following cases:
-
-      1. it's a regular SET statement outside stored programs
-        (lex->sphead is NULL);
-
-      2. we're parsing a stored program normally (loading from mysql.proc, ...);
-
-      3. we're re-parsing SET-statement with a user variable after meta-data
-        change. It's guaranteed, that:
-        - this SET-statement deals with a user/system variable (otherwise, it
-          would be a different SP-instruction, and we would parse an expression);
-        - this SET-statement has a single user/system variable assignment
-          (that's how we generate sp_instr_stmt-instructions for SET-statements).
-        So, in this case, even if lex->sphead is set, we should not process
-        further.
-  */
-
-  if (!sp ||            // case #1
-      sp->is_invoked()) // case #3
-  {
-    return false;
-  }
-
-  if (!lex->var_list.is_empty())
-  {
-    /* Extract expression string. */
-
-    const char *expr_start_ptr= sp->m_parser_data.get_option_start_ptr();
-
-    LEX_STRING expr;
-    expr.str= (char *) expr_start_ptr;
-    expr.length= expr_end_ptr - expr_start_ptr;
-
-    /* Construct SET-statement query. */
-
-    LEX_STRING set_stmt_query;
-
-    set_stmt_query.length= expr.length + 3;
-    set_stmt_query.str= (char *) thd->alloc(set_stmt_query.length + 1);
-
-    if (!set_stmt_query.str)
-      return true;
-
-    strmake(strmake(set_stmt_query.str, "SET", 3),
-            expr.str, expr.length);
-
-    /*
-      We have assignment to user or system variable or option setting, so we
-      should construct sp_instr_stmt for it.
-    */
-
-    sp_instr_stmt *i=
-      new (thd->mem_root)
-        sp_instr_stmt(sp->instructions(), lex, set_stmt_query);
-
-    if (!i || sp->add_instr(thd, i))
-      return true;
-  }
-
-  /* Remember option_type of the currently parsed LEX. */
-  enum_var_type inner_option_type= lex->option_type;
-
-  if (sp->restore_lex(thd))
-    return true;
-
-  /* Copy option_type to outer lex in case it has changed. */
-  thd->lex->option_type= inner_option_type;
-
-  return false;
-}
-
-/**
-  Compare a LEX_USER against the current user as defined by the exact user and
-  host used during authentication.
-
-  @param user A pointer to a user which needs to be matched against the
-              current.
-
-  @see SET PASSWORD rules
-
-  @retval true The specified user is the authorized user
-  @retval false The user doesn't match
-*/
-
-bool match_authorized_user(Security_context *ctx, LEX_USER *user)
-{
-  if(user->user.str && my_strcasecmp(system_charset_info,
-                                     ctx->priv_user,
-                                     user->user.str) == 0)
-  {
-    /*
-      users match; let's compare hosts.
-      1. first compare with the host we actually authorized,
-      2. then see if we match the host mask of the priv_host
-    */
-    if (user->host.str && my_strcasecmp(system_charset_info,
-                                        user->host.str,
-                                        ctx->priv_host) == 0)
-    {
-      /* specified user exactly match the authorized user */
-      return true;
-    }
-  }
-  return false;
-}
-
-
-
-
-/* Line 189 of yacc.c  */
-#line 1026 "/export/home/pb2/build/sb_0-14135359-1421674846.01/dist_GPL/sql/sql_yacc.cc"
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table.  */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     ABORT_SYM = 258,
-     ACCESSIBLE_SYM = 259,
-     ACTION = 260,
-     ADD = 261,
-     ADDDATE_SYM = 262,
-     AFTER_SYM = 263,
-     AGAINST = 264,
-     AGGREGATE_SYM = 265,
-     ALGORITHM_SYM = 266,
-     ALL = 267,
-     ALTER = 268,
-     ANALYSE_SYM = 269,
-     ANALYZE_SYM = 270,
-     AND_AND_SYM = 271,
-     AND_SYM = 272,
-     ANY_SYM = 273,
-     AS = 274,
-     ASC = 275,
-     ASCII_SYM = 276,
-     ASENSITIVE_SYM = 277,
-     AT_SYM = 278,
-     AUTOEXTEND_SIZE_SYM = 279,
-     AUTO_INC = 280,
-     AVG_ROW_LENGTH = 281,
-     AVG_SYM = 282,
-     BACKUP_SYM = 283,
-     BEFORE_SYM = 284,
-     BEGIN_SYM = 285,
-     BETWEEN_SYM = 286,
-     BIGINT = 287,
-     BINARY = 288,
-     BINLOG_SYM = 289,
-     BIN_NUM = 290,
-     BIT_AND = 291,
-     BIT_OR = 292,
-     BIT_SYM = 293,
-     BIT_XOR = 294,
-     BLOB_SYM = 295,
-     BLOCK_SYM = 296,
-     BOOLEAN_SYM = 297,
-     BOOL_SYM = 298,
-     BOTH = 299,
-     BTREE_SYM = 300,
-     BY = 301,
-     BYTE_SYM = 302,
-     CACHE_SYM = 303,
-     CALL_SYM = 304,
-     CASCADE = 305,
-     CASCADED = 306,
-     CASE_SYM = 307,
-     CAST_SYM = 308,
-     CATALOG_NAME_SYM = 309,
-     CHAIN_SYM = 310,
-     CHANGE = 311,
-     CHANGED = 312,
-     CHARSET = 313,
-     CHAR_SYM = 314,
-     CHECKSUM_SYM = 315,
-     CHECK_SYM = 316,
-     CIPHER_SYM = 317,
-     CLASS_ORIGIN_SYM = 318,
-     CLIENT_SYM = 319,
-     CLOSE_SYM = 320,
-     COALESCE = 321,
-     CODE_SYM = 322,
-     COLLATE_SYM = 323,
-     COLLATION_SYM = 324,
-     COLUMNS = 325,
-     COLUMN_SYM = 326,
-     COLUMN_FORMAT_SYM = 327,
-     COLUMN_NAME_SYM = 328,
-     COMMENT_SYM = 329,
-     COMMITTED_SYM = 330,
-     COMMIT_SYM = 331,
-     COMPACT_SYM = 332,
-     COMPLETION_SYM = 333,
-     COMPRESSED_SYM = 334,
-     CONCURRENT = 335,
-     CONDITION_SYM = 336,
-     CONNECTION_SYM = 337,
-     CONSISTENT_SYM = 338,
-     CONSTRAINT = 339,
-     CONSTRAINT_CATALOG_SYM = 340,
-     CONSTRAINT_NAME_SYM = 341,
-     CONSTRAINT_SCHEMA_SYM = 342,
-     CONTAINS_SYM = 343,
-     CONTEXT_SYM = 344,
-     CONTINUE_SYM = 345,
-     CONVERT_SYM = 346,
-     COUNT_SYM = 347,
-     CPU_SYM = 348,
-     CREATE = 349,
-     CROSS = 350,
-     CUBE_SYM = 351,
-     CURDATE = 352,
-     CURRENT_SYM = 353,
-     CURRENT_USER = 354,
-     CURSOR_SYM = 355,
-     CURSOR_NAME_SYM = 356,
-     CURTIME = 357,
-     DATABASE = 358,
-     DATABASES = 359,
-     DATAFILE_SYM = 360,
-     DATA_SYM = 361,
-     DATETIME = 362,
-     DATE_ADD_INTERVAL = 363,
-     DATE_SUB_INTERVAL = 364,
-     DATE_SYM = 365,
-     DAY_HOUR_SYM = 366,
-     DAY_MICROSECOND_SYM = 367,
-     DAY_MINUTE_SYM = 368,
-     DAY_SECOND_SYM = 369,
-     DAY_SYM = 370,
-     DEALLOCATE_SYM = 371,
-     DECIMAL_NUM = 372,
-     DECIMAL_SYM = 373,
-     DECLARE_SYM = 374,
-     DEFAULT = 375,
-     DEFAULT_AUTH_SYM = 376,
-     DEFINER_SYM = 377,
-     DELAYED_SYM = 378,
-     DELAY_KEY_WRITE_SYM = 379,
-     DELETE_SYM = 380,
-     DESC = 381,
-     DESCRIBE = 382,
-     DES_KEY_FILE = 383,
-     DETERMINISTIC_SYM = 384,
-     DIAGNOSTICS_SYM = 385,
-     DIRECTORY_SYM = 386,
-     DISABLE_SYM = 387,
-     DISCARD = 388,
-     DISK_SYM = 389,
-     DISTINCT = 390,
-     DIV_SYM = 391,
-     DOUBLE_SYM = 392,
-     DO_SYM = 393,
-     DROP = 394,
-     DUAL_SYM = 395,
-     DUMPFILE = 396,
-     DUPLICATE_SYM = 397,
-     DYNAMIC_SYM = 398,
-     EACH_SYM = 399,
-     ELSE = 400,
-     ELSEIF_SYM = 401,
-     ENABLE_SYM = 402,
-     ENCLOSED = 403,
-     END = 404,
-     ENDS_SYM = 405,
-     END_OF_INPUT = 406,
-     ENGINES_SYM = 407,
-     ENGINE_SYM = 408,
-     ENUM = 409,
-     EQ = 410,
-     EQUAL_SYM = 411,
-     ERROR_SYM = 412,
-     ERRORS = 413,
-     ESCAPED = 414,
-     ESCAPE_SYM = 415,
-     EVENTS_SYM = 416,
-     EVENT_SYM = 417,
-     EVERY_SYM = 418,
-     EXCHANGE_SYM = 419,
-     EXECUTE_SYM = 420,
-     EXISTS = 421,
-     EXIT_SYM = 422,
-     EXPANSION_SYM = 423,
-     EXPIRE_SYM = 424,
-     EXPORT_SYM = 425,
-     EXTENDED_SYM = 426,
-     EXTENT_SIZE_SYM = 427,
-     EXTRACT_SYM = 428,
-     FALSE_SYM = 429,
-     FAST_SYM = 430,
-     FAULTS_SYM = 431,
-     FETCH_SYM = 432,
-     FILE_SYM = 433,
-     FIRST_SYM = 434,
-     FIXED_SYM = 435,
-     FLOAT_NUM = 436,
-     FLOAT_SYM = 437,
-     FLUSH_SYM = 438,
-     FORCE_SYM = 439,
-     FOREIGN = 440,
-     FOR_SYM = 441,
-     FORMAT_SYM = 442,
-     FOUND_SYM = 443,
-     FROM = 444,
-     FULL = 445,
-     FULLTEXT_SYM = 446,
-     FUNCTION_SYM = 447,
-     GE = 448,
-     GENERAL = 449,
-     GEOMETRYCOLLECTION = 450,
-     GEOMETRY_SYM = 451,
-     GET_FORMAT = 452,
-     GET_SYM = 453,
-     GLOBAL_SYM = 454,
-     GRANT = 455,
-     GRANTS = 456,
-     GROUP_SYM = 457,
-     GROUP_CONCAT_SYM = 458,
-     GT_SYM = 459,
-     HANDLER_SYM = 460,
-     HASH_SYM = 461,
-     HAVING = 462,
-     HELP_SYM = 463,
-     HEX_NUM = 464,
-     HIGH_PRIORITY = 465,
-     HOST_SYM = 466,
-     HOSTS_SYM = 467,
-     HOUR_MICROSECOND_SYM = 468,
-     HOUR_MINUTE_SYM = 469,
-     HOUR_SECOND_SYM = 470,
-     HOUR_SYM = 471,
-     IDENT = 472,
-     IDENTIFIED_SYM = 473,
-     IDENT_QUOTED = 474,
-     IF = 475,
-     IGNORE_SYM = 476,
-     IGNORE_SERVER_IDS_SYM = 477,
-     IMPORT = 478,
-     INDEXES = 479,
-     INDEX_SYM = 480,
-     INFILE = 481,
-     INITIAL_SIZE_SYM = 482,
-     INNER_SYM = 483,
-     INOUT_SYM = 484,
-     INSENSITIVE_SYM = 485,
-     INSERT = 486,
-     INSERT_METHOD = 487,
-     INSTALL_SYM = 488,
-     INTERVAL_SYM = 489,
-     INTO = 490,
-     INT_SYM = 491,
-     INVOKER_SYM = 492,
-     IN_SYM = 493,
-     IO_AFTER_GTIDS = 494,
-     IO_BEFORE_GTIDS = 495,
-     IO_SYM = 496,
-     IPC_SYM = 497,
-     IS = 498,
-     ISOLATION = 499,
-     ISSUER_SYM = 500,
-     ITERATE_SYM = 501,
-     JOIN_SYM = 502,
-     KEYS = 503,
-     KEY_BLOCK_SIZE = 504,
-     KEY_SYM = 505,
-     KILL_SYM = 506,
-     LANGUAGE_SYM = 507,
-     LAST_SYM = 508,
-     LE = 509,
-     LEADING = 510,
-     LEAVES = 511,
-     LEAVE_SYM = 512,
-     LEFT = 513,
-     LESS_SYM = 514,
-     LEVEL_SYM = 515,
-     LEX_HOSTNAME = 516,
-     LIKE = 517,
-     LIMIT = 518,
-     LINEAR_SYM = 519,
-     LINES = 520,
-     LINESTRING = 521,
-     LIST_SYM = 522,
-     LOAD = 523,
-     LOCAL_SYM = 524,
-     LOCATOR_SYM = 525,
-     LOCKS_SYM = 526,
-     LOCK_SYM = 527,
-     LOGFILE_SYM = 528,
-     LOGS_SYM = 529,
-     LONGBLOB = 530,
-     LONGTEXT = 531,
-     LONG_NUM = 532,
-     LONG_SYM = 533,
-     LOOP_SYM = 534,
-     LOW_PRIORITY = 535,
-     LT = 536,
-     MASTER_AUTO_POSITION_SYM = 537,
-     MASTER_BIND_SYM = 538,
-     MASTER_CONNECT_RETRY_SYM = 539,
-     MASTER_DELAY_SYM = 540,
-     MASTER_HOST_SYM = 541,
-     MASTER_LOG_FILE_SYM = 542,
-     MASTER_LOG_POS_SYM = 543,
-     MASTER_PASSWORD_SYM = 544,
-     MASTER_PORT_SYM = 545,
-     MASTER_RETRY_COUNT_SYM = 546,
-     MASTER_SERVER_ID_SYM = 547,
-     MASTER_SSL_CAPATH_SYM = 548,
-     MASTER_SSL_CA_SYM = 549,
-     MASTER_SSL_CERT_SYM = 550,
-     MASTER_SSL_CIPHER_SYM = 551,
-     MASTER_SSL_CRL_SYM = 552,
-     MASTER_SSL_CRLPATH_SYM = 553,
-     MASTER_SSL_KEY_SYM = 554,
-     MASTER_SSL_SYM = 555,
-     MASTER_SSL_VERIFY_SERVER_CERT_SYM = 556,
-     MASTER_SYM = 557,
-     MASTER_USER_SYM = 558,
-     MASTER_HEARTBEAT_PERIOD_SYM = 559,
-     MATCH = 560,
-     MAX_CONNECTIONS_PER_HOUR = 561,
-     MAX_QUERIES_PER_HOUR = 562,
-     MAX_ROWS = 563,
-     MAX_SIZE_SYM = 564,
-     MAX_SYM = 565,
-     MAX_UPDATES_PER_HOUR = 566,
-     MAX_USER_CONNECTIONS_SYM = 567,
-     MAX_VALUE_SYM = 568,
-     MEDIUMBLOB = 569,
-     MEDIUMINT = 570,
-     MEDIUMTEXT = 571,
-     MEDIUM_SYM = 572,
-     MEMORY_SYM = 573,
-     MERGE_SYM = 574,
-     MESSAGE_TEXT_SYM = 575,
-     MICROSECOND_SYM = 576,
-     MIGRATE_SYM = 577,
-     MINUTE_MICROSECOND_SYM = 578,
-     MINUTE_SECOND_SYM = 579,
-     MINUTE_SYM = 580,
-     MIN_ROWS = 581,
-     MIN_SYM = 582,
-     MODE_SYM = 583,
-     MODIFIES_SYM = 584,
-     MODIFY_SYM = 585,
-     MOD_SYM = 586,
-     MONTH_SYM = 587,
-     MULTILINESTRING = 588,
-     MULTIPOINT = 589,
-     MULTIPOLYGON = 590,
-     MUTEX_SYM = 591,
-     MYSQL_ERRNO_SYM = 592,
-     NAMES_SYM = 593,
-     NAME_SYM = 594,
-     NATIONAL_SYM = 595,
-     NATURAL = 596,
-     NCHAR_STRING = 597,
-     NCHAR_SYM = 598,
-     NDBCLUSTER_SYM = 599,
-     NE = 600,
-     NEG = 601,
-     NEW_SYM = 602,
-     NEXT_SYM = 603,
-     NODEGROUP_SYM = 604,
-     NONE_SYM = 605,
-     NOT2_SYM = 606,
-     NOT_SYM = 607,
-     NOW_SYM = 608,
-     NO_SYM = 609,
-     NO_WAIT_SYM = 610,
-     NO_WRITE_TO_BINLOG = 611,
-     NULL_SYM = 612,
-     NUM = 613,
-     NUMBER_SYM = 614,
-     NUMERIC_SYM = 615,
-     NVARCHAR_SYM = 616,
-     OFFSET_SYM = 617,
-     OLD_PASSWORD = 618,
-     ON = 619,
-     ONE_SYM = 620,
-     ONLY_SYM = 621,
-     OPEN_SYM = 622,
-     OPTIMIZE = 623,
-     OPTIONS_SYM = 624,
-     OPTION = 625,
-     OPTIONALLY = 626,
-     OR2_SYM = 627,
-     ORDER_SYM = 628,
-     OR_OR_SYM = 629,
-     OR_SYM = 630,
-     OUTER = 631,
-     OUTFILE = 632,
-     OUT_SYM = 633,
-     OWNER_SYM = 634,
-     PACK_KEYS_SYM = 635,
-     PAGE_SYM = 636,
-     PARAM_MARKER = 637,
-     PARSER_SYM = 638,
-     PARTIAL = 639,
-     PARTITION_SYM = 640,
-     PARTITIONS_SYM = 641,
-     PARTITIONING_SYM = 642,
-     PASSWORD = 643,
-     PHASE_SYM = 644,
-     PLUGIN_DIR_SYM = 645,
-     PLUGIN_SYM = 646,
-     PLUGINS_SYM = 647,
-     POINT_SYM = 648,
-     POLYGON = 649,
-     PORT_SYM = 650,
-     POSITION_SYM = 651,
-     PRECISION = 652,
-     PREPARE_SYM = 653,
-     PRESERVE_SYM = 654,
-     PREV_SYM = 655,
-     PRIMARY_SYM = 656,
-     PRIVILEGES = 657,
-     PROCEDURE_SYM = 658,
-     PROCESS = 659,
-     PROCESSLIST_SYM = 660,
-     PROFILE_SYM = 661,
-     PROFILES_SYM = 662,
-     PROXY_SYM = 663,
-     PURGE = 664,
-     QUARTER_SYM = 665,
-     QUERY_SYM = 666,
-     QUICK = 667,
-     RANGE_SYM = 668,
-     READS_SYM = 669,
-     READ_ONLY_SYM = 670,
-     READ_SYM = 671,
-     READ_WRITE_SYM = 672,
-     REAL = 673,
-     REBUILD_SYM = 674,
-     RECOVER_SYM = 675,
-     REDOFILE_SYM = 676,
-     REDO_BUFFER_SIZE_SYM = 677,
-     REDUNDANT_SYM = 678,
-     REFERENCES = 679,
-     REGEXP = 680,
-     RELAY = 681,
-     RELAYLOG_SYM = 682,
-     RELAY_LOG_FILE_SYM = 683,
-     RELAY_LOG_POS_SYM = 684,
-     RELAY_THREAD = 685,
-     RELEASE_SYM = 686,
-     RELOAD = 687,
-     REMOVE_SYM = 688,
-     RENAME = 689,
-     REORGANIZE_SYM = 690,
-     REPAIR = 691,
-     REPEATABLE_SYM = 692,
-     REPEAT_SYM = 693,
-     REPLACE = 694,
-     REPLICATION = 695,
-     REQUIRE_SYM = 696,
-     RESET_SYM = 697,
-     RESIGNAL_SYM = 698,
-     RESOURCES = 699,
-     RESTORE_SYM = 700,
-     RESTRICT = 701,
-     RESUME_SYM = 702,
-     RETURNED_SQLSTATE_SYM = 703,
-     RETURNS_SYM = 704,
-     RETURN_SYM = 705,
-     REVERSE_SYM = 706,
-     REVOKE = 707,
-     RIGHT = 708,
-     ROLLBACK_SYM = 709,
-     ROLLUP_SYM = 710,
-     ROUTINE_SYM = 711,
-     ROWS_SYM = 712,
-     ROW_FORMAT_SYM = 713,
-     ROW_SYM = 714,
-     ROW_COUNT_SYM = 715,
-     RTREE_SYM = 716,
-     SAVEPOINT_SYM = 717,
-     SCHEDULE_SYM = 718,
-     SCHEMA_NAME_SYM = 719,
-     SECOND_MICROSECOND_SYM = 720,
-     SECOND_SYM = 721,
-     SECURITY_SYM = 722,
-     SELECT_SYM = 723,
-     SENSITIVE_SYM = 724,
-     SEPARATOR_SYM = 725,
-     SERIALIZABLE_SYM = 726,
-     SERIAL_SYM = 727,
-     SESSION_SYM = 728,
-     SERVER_SYM = 729,
-     SERVER_OPTIONS = 730,
-     SET = 731,
-     SET_VAR = 732,
-     SHARE_SYM = 733,
-     SHIFT_LEFT = 734,
-     SHIFT_RIGHT = 735,
-     SHOW = 736,
-     SHUTDOWN = 737,
-     SIGNAL_SYM = 738,
-     SIGNED_SYM = 739,
-     SIMPLE_SYM = 740,
-     SLAVE = 741,
-     SLOW = 742,
-     SMALLINT = 743,
-     SNAPSHOT_SYM = 744,
-     SOCKET_SYM = 745,
-     SONAME_SYM = 746,
-     SOUNDS_SYM = 747,
-     SOURCE_SYM = 748,
-     SPATIAL_SYM = 749,
-     SPECIFIC_SYM = 750,
-     SQLEXCEPTION_SYM = 751,
-     SQLSTATE_SYM = 752,
-     SQLWARNING_SYM = 753,
-     SQL_AFTER_GTIDS = 754,
-     SQL_AFTER_MTS_GAPS = 755,
-     SQL_BEFORE_GTIDS = 756,
-     SQL_BIG_RESULT = 757,
-     SQL_BUFFER_RESULT = 758,
-     SQL_CACHE_SYM = 759,
-     SQL_CALC_FOUND_ROWS = 760,
-     SQL_NO_CACHE_SYM = 761,
-     SQL_SMALL_RESULT = 762,
-     SQL_SYM = 763,
-     SQL_THREAD = 764,
-     SSL_SYM = 765,
-     STARTING = 766,
-     STARTS_SYM = 767,
-     START_SYM = 768,
-     STATS_AUTO_RECALC_SYM = 769,
-     STATS_PERSISTENT_SYM = 770,
-     STATS_SAMPLE_PAGES_SYM = 771,
-     STATUS_SYM = 772,
-     STDDEV_SAMP_SYM = 773,
-     STD_SYM = 774,
-     STOP_SYM = 775,
-     STORAGE_SYM = 776,
-     STRAIGHT_JOIN = 777,
-     STRING_SYM = 778,
-     SUBCLASS_ORIGIN_SYM = 779,
-     SUBDATE_SYM = 780,
-     SUBJECT_SYM = 781,
-     SUBPARTITIONS_SYM = 782,
-     SUBPARTITION_SYM = 783,
-     SUBSTRING = 784,
-     SUM_SYM = 785,
-     SUPER_SYM = 786,
-     SUSPEND_SYM = 787,
-     SWAPS_SYM = 788,
-     SWITCHES_SYM = 789,
-     SYSDATE = 790,
-     TABLES = 791,
-     TABLESPACE = 792,
-     TABLE_REF_PRIORITY = 793,
-     TABLE_SYM = 794,
-     TABLE_CHECKSUM_SYM = 795,
-     TABLE_NAME_SYM = 796,
-     TEMPORARY = 797,
-     TEMPTABLE_SYM = 798,
-     TERMINATED = 799,
-     TEXT_STRING = 800,
-     TEXT_SYM = 801,
-     THAN_SYM = 802,
-     THEN_SYM = 803,
-     TIMESTAMP = 804,
-     TIMESTAMP_ADD = 805,
-     TIMESTAMP_DIFF = 806,
-     TIME_SYM = 807,
-     TINYBLOB = 808,
-     TINYINT = 809,
-     TINYTEXT = 810,
-     TO_SYM = 811,
-     TRAILING = 812,
-     TRANSACTION_SYM = 813,
-     TRIGGERS_SYM = 814,
-     TRIGGER_SYM = 815,
-     TRIM = 816,
-     TRUE_SYM = 817,
-     TRUNCATE_SYM = 818,
-     TYPES_SYM = 819,
-     TYPE_SYM = 820,
-     UDF_RETURNS_SYM = 821,
-     ULONGLONG_NUM = 822,
-     UNCOMMITTED_SYM = 823,
-     UNDEFINED_SYM = 824,
-     UNDERSCORE_CHARSET = 825,
-     UNDOFILE_SYM = 826,
-     UNDO_BUFFER_SIZE_SYM = 827,
-     UNDO_SYM = 828,
-     UNICODE_SYM = 829,
-     UNINSTALL_SYM = 830,
-     UNION_SYM = 831,
-     UNIQUE_SYM = 832,
-     UNKNOWN_SYM = 833,
-     UNLOCK_SYM = 834,
-     UNSIGNED = 835,
-     UNTIL_SYM = 836,
-     UPDATE_SYM = 837,
-     UPGRADE_SYM = 838,
-     USAGE = 839,
-     USER = 840,
-     USE_FRM = 841,
-     USE_SYM = 842,
-     USING = 843,
-     UTC_DATE_SYM = 844,
-     UTC_TIMESTAMP_SYM = 845,
-     UTC_TIME_SYM = 846,
-     VALUES = 847,
-     VALUE_SYM = 848,
-     VARBINARY = 849,
-     VARCHAR = 850,
-     VARIABLES = 851,
-     VARIANCE_SYM = 852,
-     VARYING = 853,
-     VAR_SAMP_SYM = 854,
-     VIEW_SYM = 855,
-     WAIT_SYM = 856,
-     WARNINGS = 857,
-     WEEK_SYM = 858,
-     WEIGHT_STRING_SYM = 859,
-     WHEN_SYM = 860,
-     WHERE = 861,
-     WHILE_SYM = 862,
-     WITH = 863,
-     WITH_CUBE_SYM = 864,
-     WITH_ROLLUP_SYM = 865,
-     WORK_SYM = 866,
-     WRAPPER_SYM = 867,
-     WRITE_SYM = 868,
-     X509_SYM = 869,
-     XA_SYM = 870,
-     XML_SYM = 871,
-     XOR = 872,
-     YEAR_MONTH_SYM = 873,
-     YEAR_SYM = 874,
-     ZEROFILL = 875
-   };
-#endif
-/* Tokens.  */
-#define ABORT_SYM 258
-#define ACCESSIBLE_SYM 259
-#define ACTION 260
-#define ADD 261
-#define ADDDATE_SYM 262
-#define AFTER_SYM 263
-#define AGAINST 264
-#define AGGREGATE_SYM 265
-#define ALGORITHM_SYM 266
-#define ALL 267
-#define ALTER 268
-#define ANALYSE_SYM 269
-#define ANALYZE_SYM 270
-#define AND_AND_SYM 271
-#define AND_SYM 272
-#define ANY_SYM 273
-#define AS 274
-#define ASC 275
-#define ASCII_SYM 276
-#define ASENSITIVE_SYM 277
-#define AT_SYM 278
-#define AUTOEXTEND_SIZE_SYM 279
-#define AUTO_INC 280
-#define AVG_ROW_LENGTH 281
-#define AVG_SYM 282
-#define BACKUP_SYM 283
-#define BEFORE_SYM 284
-#define BEGIN_SYM 285
-#define BETWEEN_SYM 286
-#define BIGINT 287
-#define BINARY 288
-#define BINLOG_SYM 289
-#define BIN_NUM 290
-#define BIT_AND 291
-#define BIT_OR 292
-#define BIT_SYM 293
-#define BIT_XOR 294
-#define BLOB_SYM 295
-#define BLOCK_SYM 296
-#define BOOLEAN_SYM 297
-#define BOOL_SYM 298
-#define BOTH 299
-#define BTREE_SYM 300
-#define BY 301
-#define BYTE_SYM 302
-#define CACHE_SYM 303
-#define CALL_SYM 304
-#define CASCADE 305
-#define CASCADED 306
-#define CASE_SYM 307
-#define CAST_SYM 308
-#define CATALOG_NAME_SYM 309
-#define CHAIN_SYM 310
-#define CHANGE 311
-#define CHANGED 312
-#define CHARSET 313
-#define CHAR_SYM 314
-#define CHECKSUM_SYM 315
-#define CHECK_SYM 316
-#define CIPHER_SYM 317
-#define CLASS_ORIGIN_SYM 318
-#define CLIENT_SYM 319
-#define CLOSE_SYM 320
-#define COALESCE 321
-#define CODE_SYM 322
-#define COLLATE_SYM 323
-#define COLLATION_SYM 324
-#define COLUMNS 325
-#define COLUMN_SYM 326
-#define COLUMN_FORMAT_SYM 327
-#define COLUMN_NAME_SYM 328
-#define COMMENT_SYM 329
-#define COMMITTED_SYM 330
-#define COMMIT_SYM 331
-#define COMPACT_SYM 332
-#define COMPLETION_SYM 333
-#define COMPRESSED_SYM 334
-#define CONCURRENT 335
-#define CONDITION_SYM 336
-#define CONNECTION_SYM 337
-#define CONSISTENT_SYM 338
-#define CONSTRAINT 339
-#define CONSTRAINT_CATALOG_SYM 340
-#define CONSTRAINT_NAME_SYM 341
-#define CONSTRAINT_SCHEMA_SYM 342
-#define CONTAINS_SYM 343
-#define CONTEXT_SYM 344
-#define CONTINUE_SYM 345
-#define CONVERT_SYM 346
-#define COUNT_SYM 347
-#define CPU_SYM 348
-#define CREATE 349
-#define CROSS 350
-#define CUBE_SYM 351
-#define CURDATE 352
-#define CURRENT_SYM 353
-#define CURRENT_USER 354
-#define CURSOR_SYM 355
-#define CURSOR_NAME_SYM 356
-#define CURTIME 357
-#define DATABASE 358
-#define DATABASES 359
-#define DATAFILE_SYM 360
-#define DATA_SYM 361
-#define DATETIME 362
-#define DATE_ADD_INTERVAL 363
-#define DATE_SUB_INTERVAL 364
-#define DATE_SYM 365
-#define DAY_HOUR_SYM 366
-#define DAY_MICROSECOND_SYM 367
-#define DAY_MINUTE_SYM 368
-#define DAY_SECOND_SYM 369
-#define DAY_SYM 370
-#define DEALLOCATE_SYM 371
-#define DECIMAL_NUM 372
-#define DECIMAL_SYM 373
-#define DECLARE_SYM 374
-#define DEFAULT 375
-#define DEFAULT_AUTH_SYM 376
-#define DEFINER_SYM 377
-#define DELAYED_SYM 378
-#define DELAY_KEY_WRITE_SYM 379
-#define DELETE_SYM 380
-#define DESC 381
-#define DESCRIBE 382
-#define DES_KEY_FILE 383
-#define DETERMINISTIC_SYM 384
-#define DIAGNOSTICS_SYM 385
-#define DIRECTORY_SYM 386
-#define DISABLE_SYM 387
-#define DISCARD 388
-#define DISK_SYM 389
-#define DISTINCT 390
-#define DIV_SYM 391
-#define DOUBLE_SYM 392
-#define DO_SYM 393
-#define DROP 394
-#define DUAL_SYM 395
-#define DUMPFILE 396
-#define DUPLICATE_SYM 397
-#define DYNAMIC_SYM 398
-#define EACH_SYM 399
-#define ELSE 400
-#define ELSEIF_SYM 401
-#define ENABLE_SYM 402
-#define ENCLOSED 403
-#define END 404
-#define ENDS_SYM 405
-#define END_OF_INPUT 406
-#define ENGINES_SYM 407
-#define ENGINE_SYM 408
-#define ENUM 409
-#define EQ 410
-#define EQUAL_SYM 411
-#define ERROR_SYM 412
-#define ERRORS 413
-#define ESCAPED 414
-#define ESCAPE_SYM 415
-#define EVENTS_SYM 416
-#define EVENT_SYM 417
-#define EVERY_SYM 418
-#define EXCHANGE_SYM 419
-#define EXECUTE_SYM 420
-#define EXISTS 421
-#define EXIT_SYM 422
-#define EXPANSION_SYM 423
-#define EXPIRE_SYM 424
-#define EXPORT_SYM 425
-#define EXTENDED_SYM 426
-#define EXTENT_SIZE_SYM 427
-#define EXTRACT_SYM 428
-#define FALSE_SYM 429
-#define FAST_SYM 430
-#define FAULTS_SYM 431
-#define FETCH_SYM 432
-#define FILE_SYM 433
-#define FIRST_SYM 434
-#define FIXED_SYM 435
-#define FLOAT_NUM 436
-#define FLOAT_SYM 437
-#define FLUSH_SYM 438
-#define FORCE_SYM 439
-#define FOREIGN 440
-#define FOR_SYM 441
-#define FORMAT_SYM 442
-#define FOUND_SYM 443
-#define FROM 444
-#define FULL 445
-#define FULLTEXT_SYM 446
-#define FUNCTION_SYM 447
-#define GE 448
-#define GENERAL 449
-#define GEOMETRYCOLLECTION 450
-#define GEOMETRY_SYM 451
-#define GET_FORMAT 452
-#define GET_SYM 453
-#define GLOBAL_SYM 454
-#define GRANT 455
-#define GRANTS 456
-#define GROUP_SYM 457
-#define GROUP_CONCAT_SYM 458
-#define GT_SYM 459
-#define HANDLER_SYM 460
-#define HASH_SYM 461
-#define HAVING 462
-#define HELP_SYM 463
-#define HEX_NUM 464
-#define HIGH_PRIORITY 465
-#define HOST_SYM 466
-#define HOSTS_SYM 467
-#define HOUR_MICROSECOND_SYM 468
-#define HOUR_MINUTE_SYM 469
-#define HOUR_SECOND_SYM 470
-#define HOUR_SYM 471
-#define IDENT 472
-#define IDENTIFIED_SYM 473
-#define IDENT_QUOTED 474
-#define IF 475
-#define IGNORE_SYM 476
-#define IGNORE_SERVER_IDS_SYM 477
-#define IMPORT 478
-#define INDEXES 479
-#define INDEX_SYM 480
-#define INFILE 481
-#define INITIAL_SIZE_SYM 482
-#define INNER_SYM 483
-#define INOUT_SYM 484
-#define INSENSITIVE_SYM 485
-#define INSERT 486
-#define INSERT_METHOD 487
-#define INSTALL_SYM 488
-#define INTERVAL_SYM 489
-#define INTO 490
-#define INT_SYM 491
-#define INVOKER_SYM 492
-#define IN_SYM 493
-#define IO_AFTER_GTIDS 494
-#define IO_BEFORE_GTIDS 495
-#define IO_SYM 496
-#define IPC_SYM 497
-#define IS 498
-#define ISOLATION 499
-#define ISSUER_SYM 500
-#define ITERATE_SYM 501
-#define JOIN_SYM 502
-#define KEYS 503
-#define KEY_BLOCK_SIZE 504
-#define KEY_SYM 505
-#define KILL_SYM 506
-#define LANGUAGE_SYM 507
-#define LAST_SYM 508
-#define LE 509
-#define LEADING 510
-#define LEAVES 511
-#define LEAVE_SYM 512
-#define LEFT 513
-#define LESS_SYM 514
-#define LEVEL_SYM 515
-#define LEX_HOSTNAME 516
-#define LIKE 517
-#define LIMIT 518
-#define LINEAR_SYM 519
-#define LINES 520
-#define LINESTRING 521
-#define LIST_SYM 522
-#define LOAD 523
-#define LOCAL_SYM 524
-#define LOCATOR_SYM 525
-#define LOCKS_SYM 526
-#define LOCK_SYM 527
-#define LOGFILE_SYM 528
-#define LOGS_SYM 529
-#define LONGBLOB 530
-#define LONGTEXT 531
-#define LONG_NUM 532
-#define LONG_SYM 533
-#define LOOP_SYM 534
-#define LOW_PRIORITY 535
-#define LT 536
-#define MASTER_AUTO_POSITION_SYM 537
-#define MASTER_BIND_SYM 538
-#define MASTER_CONNECT_RETRY_SYM 539
-#define MASTER_DELAY_SYM 540
-#define MASTER_HOST_SYM 541
-#define MASTER_LOG_FILE_SYM 542
-#define MASTER_LOG_POS_SYM 543
-#define MASTER_PASSWORD_SYM 544
-#define MASTER_PORT_SYM 545
-#define MASTER_RETRY_COUNT_SYM 546
-#define MASTER_SERVER_ID_SYM 547
-#define MASTER_SSL_CAPATH_SYM 548
-#define MASTER_SSL_CA_SYM 549
-#define MASTER_SSL_CERT_SYM 550
-#define MASTER_SSL_CIPHER_SYM 551
-#define MASTER_SSL_CRL_SYM 552
-#define MASTER_SSL_CRLPATH_SYM 553
-#define MASTER_SSL_KEY_SYM 554
-#define MASTER_SSL_SYM 555
-#define MASTER_SSL_VERIFY_SERVER_CERT_SYM 556
-#define MASTER_SYM 557
-#define MASTER_USER_SYM 558
-#define MASTER_HEARTBEAT_PERIOD_SYM 559
-#define MATCH 560
-#define MAX_CONNECTIONS_PER_HOUR 561
-#define MAX_QUERIES_PER_HOUR 562
-#define MAX_ROWS 563
-#define MAX_SIZE_SYM 564
-#define MAX_SYM 565
-#define MAX_UPDATES_PER_HOUR 566
-#define MAX_USER_CONNECTIONS_SYM 567
-#define MAX_VALUE_SYM 568
-#define MEDIUMBLOB 569
-#define MEDIUMINT 570
-#define MEDIUMTEXT 571
-#define MEDIUM_SYM 572
-#define MEMORY_SYM 573
-#define MERGE_SYM 574
-#define MESSAGE_TEXT_SYM 575
-#define MICROSECOND_SYM 576
-#define MIGRATE_SYM 577
-#define MINUTE_MICROSECOND_SYM 578
-#define MINUTE_SECOND_SYM 579
-#define MINUTE_SYM 580
-#define MIN_ROWS 581
-#define MIN_SYM 582
-#define MODE_SYM 583
-#define MODIFIES_SYM 584
-#define MODIFY_SYM 585
-#define MOD_SYM 586
-#define MONTH_SYM 587
-#define MULTILINESTRING 588
-#define MULTIPOINT 589
-#define MULTIPOLYGON 590
-#define MUTEX_SYM 591
-#define MYSQL_ERRNO_SYM 592
-#define NAMES_SYM 593
-#define NAME_SYM 594
-#define NATIONAL_SYM 595
-#define NATURAL 596
-#define NCHAR_STRING 597
-#define NCHAR_SYM 598
-#define NDBCLUSTER_SYM 599
-#define NE 600
-#define NEG 601
-#define NEW_SYM 602
-#define NEXT_SYM 603
-#define NODEGROUP_SYM 604
-#define NONE_SYM 605
-#define NOT2_SYM 606
-#define NOT_SYM 607
-#define NOW_SYM 608
-#define NO_SYM 609
-#define NO_WAIT_SYM 610
-#define NO_WRITE_TO_BINLOG 611
-#define NULL_SYM 612
-#define NUM 613
-#define NUMBER_SYM 614
-#define NUMERIC_SYM 615
-#define NVARCHAR_SYM 616
-#define OFFSET_SYM 617
-#define OLD_PASSWORD 618
-#define ON 619
-#define ONE_SYM 620
-#define ONLY_SYM 621
-#define OPEN_SYM 622
-#define OPTIMIZE 623
-#define OPTIONS_SYM 624
-#define OPTION 625
-#define OPTIONALLY 626
-#define OR2_SYM 627
-#define ORDER_SYM 628
-#define OR_OR_SYM 629
-#define OR_SYM 630
-#define OUTER 631
-#define OUTFILE 632
-#define OUT_SYM 633
-#define OWNER_SYM 634
-#define PACK_KEYS_SYM 635
-#define PAGE_SYM 636
-#define PARAM_MARKER 637
-#define PARSER_SYM 638
-#define PARTIAL 639
-#define PARTITION_SYM 640
-#define PARTITIONS_SYM 641
-#define PARTITIONING_SYM 642
-#define PASSWORD 643
-#define PHASE_SYM 644
-#define PLUGIN_DIR_SYM 645
-#define PLUGIN_SYM 646
-#define PLUGINS_SYM 647
-#define POINT_SYM 648
-#define POLYGON 649
-#define PORT_SYM 650
-#define POSITION_SYM 651
-#define PRECISION 652
-#define PREPARE_SYM 653
-#define PRESERVE_SYM 654
-#define PREV_SYM 655
-#define PRIMARY_SYM 656
-#define PRIVILEGES 657
-#define PROCEDURE_SYM 658
-#define PROCESS 659
-#define PROCESSLIST_SYM 660
-#define PROFILE_SYM 661
-#define PROFILES_SYM 662
-#define PROXY_SYM 663
-#define PURGE 664
-#define QUARTER_SYM 665
-#define QUERY_SYM 666
-#define QUICK 667
-#define RANGE_SYM 668
-#define READS_SYM 669
-#define READ_ONLY_SYM 670
-#define READ_SYM 671
-#define READ_WRITE_SYM 672
-#define REAL 673
-#define REBUILD_SYM 674
-#define RECOVER_SYM 675
-#define REDOFILE_SYM 676
-#define REDO_BUFFER_SIZE_SYM 677
-#define REDUNDANT_SYM 678
-#define REFERENCES 679
-#define REGEXP 680
-#define RELAY 681
-#define RELAYLOG_SYM 682
-#define RELAY_LOG_FILE_SYM 683
-#define RELAY_LOG_POS_SYM 684
-#define RELAY_THREAD 685
-#define RELEASE_SYM 686
-#define RELOAD 687
-#define REMOVE_SYM 688
-#define RENAME 689
-#define REORGANIZE_SYM 690
-#define REPAIR 691
-#define REPEATABLE_SYM 692
-#define REPEAT_SYM 693
-#define REPLACE 694
-#define REPLICATION 695
-#define REQUIRE_SYM 696
-#define RESET_SYM 697
-#define RESIGNAL_SYM 698
-#define RESOURCES 699
-#define RESTORE_SYM 700
-#define RESTRICT 701
-#define RESUME_SYM 702
-#define RETURNED_SQLSTATE_SYM 703
-#define RETURNS_SYM 704
-#define RETURN_SYM 705
-#define REVERSE_SYM 706
-#define REVOKE 707
-#define RIGHT 708
-#define ROLLBACK_SYM 709
-#define ROLLUP_SYM 710
-#define ROUTINE_SYM 711
-#define ROWS_SYM 712
-#define ROW_FORMAT_SYM 713
-#define ROW_SYM 714
-#define ROW_COUNT_SYM 715
-#define RTREE_SYM 716
-#define SAVEPOINT_SYM 717
-#define SCHEDULE_SYM 718
-#define SCHEMA_NAME_SYM 719
-#define SECOND_MICROSECOND_SYM 720
-#define SECOND_SYM 721
-#define SECURITY_SYM 722
-#define SELECT_SYM 723
-#define SENSITIVE_SYM 724
-#define SEPARATOR_SYM 725
-#define SERIALIZABLE_SYM 726
-#define SERIAL_SYM 727
-#define SESSION_SYM 728
-#define SERVER_SYM 729
-#define SERVER_OPTIONS 730
-#define SET 731
-#define SET_VAR 732
-#define SHARE_SYM 733
-#define SHIFT_LEFT 734
-#define SHIFT_RIGHT 735
-#define SHOW 736
-#define SHUTDOWN 737
-#define SIGNAL_SYM 738
-#define SIGNED_SYM 739
-#define SIMPLE_SYM 740
-#define SLAVE 741
-#define SLOW 742
-#define SMALLINT 743
-#define SNAPSHOT_SYM 744
-#define SOCKET_SYM 745
-#define SONAME_SYM 746
-#define SOUNDS_SYM 747
-#define SOURCE_SYM 748
-#define SPATIAL_SYM 749
-#define SPECIFIC_SYM 750
-#define SQLEXCEPTION_SYM 751
-#define SQLSTATE_SYM 752
-#define SQLWARNING_SYM 753
-#define SQL_AFTER_GTIDS 754
-#define SQL_AFTER_MTS_GAPS 755
-#define SQL_BEFORE_GTIDS 756
-#define SQL_BIG_RESULT 757
-#define SQL_BUFFER_RESULT 758
-#define SQL_CACHE_SYM 759
-#define SQL_CALC_FOUND_ROWS 760
-#define SQL_NO_CACHE_SYM 761
-#define SQL_SMALL_RESULT 762
-#define SQL_SYM 763
-#define SQL_THREAD 764
-#define SSL_SYM 765
-#define STARTING 766
-#define STARTS_SYM 767
-#define START_SYM 768
-#define STATS_AUTO_RECALC_SYM 769
-#define STATS_PERSISTENT_SYM 770
-#define STATS_SAMPLE_PAGES_SYM 771
-#define STATUS_SYM 772
-#define STDDEV_SAMP_SYM 773
-#define STD_SYM 774
-#define STOP_SYM 775
-#define STORAGE_SYM 776
-#define STRAIGHT_JOIN 777
-#define STRING_SYM 778
-#define SUBCLASS_ORIGIN_SYM 779
-#define SUBDATE_SYM 780
-#define SUBJECT_SYM 781
-#define SUBPARTITIONS_SYM 782
-#define SUBPARTITION_SYM 783
-#define SUBSTRING 784
-#define SUM_SYM 785
-#define SUPER_SYM 786
-#define SUSPEND_SYM 787
-#define SWAPS_SYM 788
-#define SWITCHES_SYM 789
-#define SYSDATE 790
-#define TABLES 791
-#define TABLESPACE 792
-#define TABLE_REF_PRIORITY 793
-#define TABLE_SYM 794
-#define TABLE_CHECKSUM_SYM 795
-#define TABLE_NAME_SYM 796
-#define TEMPORARY 797
-#define TEMPTABLE_SYM 798
-#define TERMINATED 799
-#define TEXT_STRING 800
-#define TEXT_SYM 801
-#define THAN_SYM 802
-#define THEN_SYM 803
-#define TIMESTAMP 804
-#define TIMESTAMP_ADD 805
-#define TIMESTAMP_DIFF 806
-#define TIME_SYM 807
-#define TINYBLOB 808
-#define TINYINT 809
-#define TINYTEXT 810
-#define TO_SYM 811
-#define TRAILING 812
-#define TRANSACTION_SYM 813
-#define TRIGGERS_SYM 814
-#define TRIGGER_SYM 815
-#define TRIM 816
-#define TRUE_SYM 817
-#define TRUNCATE_SYM 818
-#define TYPES_SYM 819
-#define TYPE_SYM 820
-#define UDF_RETURNS_SYM 821
-#define ULONGLONG_NUM 822
-#define UNCOMMITTED_SYM 823
-#define UNDEFINED_SYM 824
-#define UNDERSCORE_CHARSET 825
-#define UNDOFILE_SYM 826
-#define UNDO_BUFFER_SIZE_SYM 827
-#define UNDO_SYM 828
-#define UNICODE_SYM 829
-#define UNINSTALL_SYM 830
-#define UNION_SYM 831
-#define UNIQUE_SYM 832
-#define UNKNOWN_SYM 833
-#define UNLOCK_SYM 834
-#define UNSIGNED 835
-#define UNTIL_SYM 836
-#define UPDATE_SYM 837
-#define UPGRADE_SYM 838
-#define USAGE 839
-#define USER 840
-#define USE_FRM 841
-#define USE_SYM 842
-#define USING 843
-#define UTC_DATE_SYM 844
-#define UTC_TIMESTAMP_SYM 845
-#define UTC_TIME_SYM 846
-#define VALUES 847
-#define VALUE_SYM 848
-#define VARBINARY 849
-#define VARCHAR 850
-#define VARIABLES 851
-#define VARIANCE_SYM 852
-#define VARYING 853
-#define VAR_SAMP_SYM 854
-#define VIEW_SYM 855
-#define WAIT_SYM 856
-#define WARNINGS 857
-#define WEEK_SYM 858
-#define WEIGHT_STRING_SYM 859
-#define WHEN_SYM 860
-#define WHERE 861
-#define WHILE_SYM 862
-#define WITH 863
-#define WITH_CUBE_SYM 864
-#define WITH_ROLLUP_SYM 865
-#define WORK_SYM 866
-#define WRAPPER_SYM 867
-#define WRITE_SYM 868
-#define X509_SYM 869
-#define XA_SYM 870
-#define XML_SYM 871
-#define XOR 872
-#define YEAR_MONTH_SYM 873
-#define YEAR_SYM 874
-#define ZEROFILL 875
-
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-{
-
-/* Line 214 of yacc.c  */
-#line 967 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-
-  int  num;
-  ulong ulong_num;
-  ulonglong ulonglong_number;
-  longlong longlong_number;
-  LEX_STRING lex_str;
-  LEX_STRING *lex_str_ptr;
-  LEX_SYMBOL symbol;
-  Table_ident *table;
-  char *simple_string;
-  Item *item;
-  Item_num *item_num;
-  List<Item> *item_list;
-  List<String> *string_list;
-  String *string;
-  Key_part_spec *key_part;
-  TABLE_LIST *table_list;
-  udf_func *udf;
-  LEX_USER *lex_user;
-  struct sys_var_with_base variable;
-  enum enum_var_type var_type;
-  Key::Keytype key_type;
-  enum ha_key_alg key_alg;
-  handlerton *db_type;
-  enum row_type row_type;
-  enum ha_rkey_function ha_rkey_mode;
-  enum enum_ha_read_modes ha_read_mode;
-  enum enum_tx_isolation tx_isolation;
-  enum Cast_target cast_type;
-  enum Item_udftype udf_type;
-  const CHARSET_INFO *charset;
-  thr_lock_type lock_type;
-  interval_type interval, interval_time_st;
-  timestamp_type date_time_type;
-  st_select_lex *select_lex;
-  chooser_compare_func_creator boolfunc2creator;
-  class sp_condition_value *spcondvalue;
-  struct { int vars, conds, hndlrs, curs; } spblock;
-  sp_name *spname;
-  LEX *lex;
-  sp_head *sphead;
-  struct p_elem_val *p_elem_value;
-  enum index_hint_type index_hint;
-  enum enum_filetype filetype;
-  enum Foreign_key::fk_option m_fk_option;
-  enum enum_yes_no_unknown m_yes_no_unk;
-  Diag_condition_item_name diag_condition_item_name;
-  Diagnostics_information::Which_area diag_area;
-  Diagnostics_information *diag_info;
-  Statement_information_item *stmt_info_item;
-  Statement_information_item::Name stmt_info_item_name;
-  List<Statement_information_item> *stmt_info_list;
-  Condition_information_item *cond_info_item;
-  Condition_information_item::Name cond_info_item_name;
-  List<Condition_information_item> *cond_info_list;
-  bool is_not_empty;
-
-
-
-/* Line 214 of yacc.c  */
-#line 2362 "/export/home/pb2/build/sb_0-14135359-1421674846.01/dist_GPL/sql/sql_yacc.cc"
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-/* Copy the second part of user declarations.  */
-
-/* Line 264 of yacc.c  */
-#line 1025 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-
-bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
-
-
-/* Line 264 of yacc.c  */
-#line 2379 "/export/home/pb2/build/sb_0-14135359-1421674846.01/dist_GPL/sql/sql_yacc.cc"
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-#  define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-#  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# else
-#  define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if YYENABLE_NLS
-#  if ENABLE_NLS
-#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(msgid) dgettext ("bison-runtime", msgid)
-#  endif
-# endif
-# ifndef YY_
-#  define YY_(msgid) msgid
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
-#else
-# define YYUSE(e) /* empty */
-#endif
-
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(n) (n)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
-    int yyi;
-#endif
-{
-  return yyi;
-}
-#endif
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-# ifdef YYSTACK_USE_ALLOCA
-#  if YYSTACK_USE_ALLOCA
-#   ifdef __GNUC__
-#    define YYSTACK_ALLOC __builtin_alloca
-#   elif defined __BUILTIN_VA_ARG_INCR
-#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-#   elif defined _AIX
-#    define YYSTACK_ALLOC __alloca
-#   elif defined _MSC_VER
-#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-#    define alloca _alloca
-#   else
-#    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef _STDLIB_H
-#      define _STDLIB_H 1
-#     endif
-#    endif
-#   endif
-#  endif
-# endif
-
-# ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-    /* The OS might guarantee only one guard page at the bottom of the stack,
-       and a page size can be as small as 4096 bytes.  So we cannot safely
-       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
-       to allow for a few compiler-allocated temporary stack slots.  */
-#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-#  endif
-# else
-#  define YYSTACK_ALLOC YYMALLOC
-#  define YYSTACK_FREE YYFREE
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-#  endif
-#  if (defined __cplusplus && ! defined _STDLIB_H \
-       && ! ((defined YYMALLOC || defined malloc) \
-            && (defined YYFREE || defined free)))
-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef _STDLIB_H
-#    define _STDLIB_H 1
-#   endif
-#  endif
-#  ifndef YYMALLOC
-#   define YYMALLOC malloc
-#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-#  ifndef YYFREE
-#   define YYFREE free
-#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
-     && (! defined __cplusplus \
-        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-  yytype_int16 yyss_alloc;
-  YYSTYPE yyvs_alloc;
-};
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-# define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
-      + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)             \
-      do                                       \
-       {                                       \
-         YYSIZE_T yyi;                         \
-         for (yyi = 0; yyi < (Count); yyi++)   \
-           (To)[yyi] = (From)[yyi];            \
-       }                                       \
-      while (YYID (0))
-#  endif
-# endif
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)                          \
-    do                                                                 \
-      {                                                                        \
-       YYSIZE_T yynewbytes;                                            \
-       YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
-       Stack = &yyptr->Stack_alloc;                                    \
-       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-       yyptr += yynewbytes / sizeof (*yyptr);                          \
-      }                                                                        \
-    while (YYID (0))
-
-#endif
-
-/* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  597
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   55552
-
-/* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  640
-/* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  952
-/* YYNRULES -- Number of rules.  */
-#define YYNRULES  2670
-/* YYNRULES -- Number of states.  */
-#define YYNSTATES  4530
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
-#define YYUNDEFTOK  2
-#define YYMAXUTOK   875
-
-#define YYTRANSLATE(YYX)                                               \
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const yytype_uint16 yytranslate[] =
-{
-       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,   633,     2,     2,     2,   627,   622,     2,
-     630,   631,   625,   624,   632,   623,   638,   626,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,   639,   636,
-       2,     2,     2,     2,   637,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,   628,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,   634,   621,   635,   629,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
-       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
-      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
-      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
-      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
-      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
-      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
-      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
-     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
-     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
-     125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
-     135,   136,   137,   138,   139,   140,   141,   142,   143,   144,
-     145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
-     155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
-     165,   166,   167,   168,   169,   170,   171,   172,   173,   174,
-     175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
-     185,   186,   187,   188,   189,   190,   191,   192,   193,   194,
-     195,   196,   197,   198,   199,   200,   201,   202,   203,   204,
-     205,   206,   207,   208,   209,   210,   211,   212,   213,   214,
-     215,   216,   217,   218,   219,   220,   221,   222,   223,   224,
-     225,   226,   227,   228,   229,   230,   231,   232,   233,   234,
-     235,   236,   237,   238,   239,   240,   241,   242,   243,   244,
-     245,   246,   247,   248,   249,   250,   251,   252,   253,   254,
-     255,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
-     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
-     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
-     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
-     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
-     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
-     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
-     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
-     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
-     385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
-     405,   406,   407,   408,   409,   410,   411,   412,   413,   414,
-     415,   416,   417,   418,   419,   420,   421,   422,   423,   424,
-     425,   426,   427,   428,   429,   430,   431,   432,   433,   434,
-     435,   436,   437,   438,   439,   440,   441,   442,   443,   444,
-     445,   446,   447,   448,   449,   450,   451,   452,   453,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-     465,   466,   467,   468,   469,   470,   471,   472,   473,   474,
-     475,   476,   477,   478,   479,   480,   481,   482,   483,   484,
-     485,   486,   487,   488,   489,   490,   491,   492,   493,   494,
-     495,   496,   497,   498,   499,   500,   501,   502,   503,   504,
-     505,   506,   507,   508,   509,   510,   511,   512,   513,   514,
-     515,   516,   517,   518,   519,   520,   521,   522,   523,   524,
-     525,   526,   527,   528,   529,   530,   531,   532,   533,   534,
-     535,   536,   537,   538,   539,   540,   541,   542,   543,   544,
-     545,   546,   547,   548,   549,   550,   551,   552,   553,   554,
-     555,   556,   557,   558,   559,   560,   561,   562,   563,   564,
-     565,   566,   567,   568,   569,   570,   571,   572,   573,   574,
-     575,   576,   577,   578,   579,   580,   581,   582,   583,   584,
-     585,   586,   587,   588,   589,   590,   591,   592,   593,   594,
-     595,   596,   597,   598,   599,   600,   601,   602,   603,   604,
-     605,   606,   607,   608,   609,   610,   611,   612,   613,   614,
-     615,   616,   617,   618,   619,   620
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint16 yyprhs[] =
-{
-       0,     0,     3,     5,     6,    11,    14,    15,    17,    19,
-      21,    23,    25,    27,    29,    31,    33,    35,    37,    39,
-      41,    43,    45,    47,    49,    51,    53,    55,    57,    59,
-      61,    63,    65,    67,    69,    71,    73,    75,    77,    79,
-      81,    83,    85,    87,    89,    91,    93,    95,    97,    99,
-     101,   103,   105,   107,   109,   111,   113,   115,   117,   119,
-     121,   123,   125,   129,   131,   133,   138,   140,   143,   144,
-     149,   150,   153,   157,   159,   162,   163,   167,   168,   174,
-     176,   180,   184,   188,   192,   196,   200,   204,   208,   212,
-     216,   220,   224,   228,   232,   236,   240,   244,   248,   252,
-     258,   262,   264,   265,   267,   271,   273,   277,   281,   285,
-     289,   290,   298,   299,   300,   315,   316,   317,   332,   333,
-     334,   349,   350,   357,   358,   362,   367,   372,   376,   379,
-     390,   392,   396,   399,   402,   405,   408,   411,   414,   417,
-     418,   432,   433,   440,   443,   444,   446,   450,   452,   453,
-     456,   457,   460,   461,   463,   467,   472,   473,   476,   477,
-     480,   482,   484,   486,   488,   490,   492,   494,   496,   498,
-     500,   502,   504,   506,   507,   511,   513,   514,   517,   518,
-     521,   524,   527,   530,   533,   537,   541,   543,   545,   547,
-     550,   554,   558,   559,   564,   565,   569,   570,   572,   576,
-     578,   579,   581,   585,   587,   588,   592,   593,   595,   599,
-     601,   606,   607,   609,   611,   613,   614,   618,   621,   625,
-     626,   630,   631,   637,   643,   644,   652,   653,   660,   662,
-     664,   666,   670,   672,   674,   676,   680,   681,   683,   685,
-     687,   689,   692,   694,   698,   700,   702,   703,   705,   706,
-     709,   713,   719,   721,   723,   725,   727,   729,   731,   733,
-     735,   737,   739,   741,   743,   745,   747,   749,   753,   758,
-     759,   761,   763,   767,   769,   773,   777,   779,   782,   784,
-     786,   788,   790,   794,   798,   800,   802,   804,   806,   808,
-     810,   812,   814,   816,   818,   820,   822,   824,   826,   830,
-     831,   832,   836,   838,   840,   842,   844,   846,   848,   850,
-     852,   854,   856,   858,   860,   862,   863,   869,   870,   873,
-     874,   878,   879,   882,   885,   888,   891,   892,   899,   902,
-     903,   906,   908,   910,   914,   915,   916,   917,   925,   926,
-     929,   932,   934,   936,   937,   938,   947,   948,   955,   957,
-     960,   962,   965,   966,   967,   974,   975,   976,   983,   984,
-     987,   988,   994,   995,   997,   998,  1004,  1005,  1008,  1009,
-    1015,  1020,  1021,  1022,  1031,  1032,  1033,  1042,  1044,  1046,
-    1048,  1050,  1052,  1055,  1060,  1066,  1067,  1072,  1077,  1082,
-    1086,  1090,  1093,  1096,  1097,  1100,  1102,  1105,  1109,  1111,
-    1113,  1115,  1116,  1118,  1120,  1123,  1127,  1129,  1131,  1133,
-    1135,  1137,  1139,  1141,  1143,  1144,  1146,  1148,  1151,  1155,
-    1157,  1159,  1161,  1163,  1165,  1166,  1168,  1170,  1173,  1177,
-    1179,  1181,  1183,  1185,  1187,  1189,  1191,  1192,  1194,  1196,
-    1199,  1203,  1205,  1207,  1209,  1212,  1215,  1218,  1220,  1222,
-    1224,  1226,  1229,  1233,  1237,  1241,  1245,  1249,  1253,  1257,
-    1261,  1266,  1268,  1270,  1272,  1274,  1277,  1281,  1284,  1289,
-    1295,  1296,  1302,  1303,  1304,  1310,  1311,  1319,  1321,  1322,
-    1324,  1325,  1330,  1331,  1332,  1336,  1342,  1349,  1350,  1355,
-    1358,  1361,  1364,  1367,  1368,  1370,  1371,  1375,  1376,  1378,
-    1380,  1384,  1386,  1391,  1397,  1403,  1404,  1407,  1408,  1409,
-    1417,  1418,  1429,  1431,  1435,  1437,  1439,  1440,  1443,  1444,
-    1448,  1450,  1454,  1455,  1462,  1464,  1465,  1466,  1472,  1473,
-    1478,  1480,  1482,  1484,  1488,  1490,  1494,  1495,  1496,  1502,
-    1504,  1508,  1510,  1512,  1513,  1517,  1519,  1523,  1524,  1529,
-    1531,  1532,  1534,  1537,  1539,  1543,  1548,  1552,  1556,  1560,
-    1565,  1570,  1574,  1575,  1576,  1583,  1584,  1586,  1587,  1589,
-    1591,  1594,  1596,  1598,  1599,  1601,  1603,  1606,  1608,  1609,
-    1613,  1614,  1616,  1618,  1621,  1623,  1626,  1630,  1634,  1638,
-    1642,  1646,  1650,  1654,  1658,  1662,  1666,  1670,  1674,  1678,
-    1682,  1686,  1690,  1694,  1698,  1702,  1706,  1707,  1714,  1716,
-    1718,  1722,  1727,  1732,  1735,  1738,  1741,  1745,  1749,  1754,
-    1759,  1761,  1763,  1765,  1767,  1769,  1771,  1773,  1775,  1777,
-    1779,  1781,  1783,  1786,  1788,  1790,  1792,  1794,  1796,  1798,
-    1802,  1804,  1806,  1809,  1812,  1820,  1829,  1838,  1847,  1856,
-    1859,  1860,  1862,  1867,  1868,  1870,  1873,  1874,  1879,  1883,
-    1887,  1891,  1893,  1896,  1898,  1900,  1904,  1907,  1911,  1914,
-    1917,  1919,  1923,  1927,  1930,  1934,  1936,  1939,  1942,  1945,
-    1947,  1950,  1952,  1954,  1956,  1959,  1963,  1966,  1970,  1973,
-    1976,  1980,  1984,  1988,  1989,  1996,  1997,  2004,  2007,  2009,
-    2011,  2013,  2015,  2017,  2019,  2021,  2023,  2025,  2027,  2029,
-    2032,  2035,  2037,  2040,  2042,  2045,  2049,  2052,  2054,  2056,
-    2058,  2060,  2062,  2064,  2066,  2069,  2070,  2072,  2074,  2080,
-    2081,  2085,  2086,  2089,  2093,  2094,  2096,  2099,  2101,  2103,
-    2105,  2107,  2111,  2115,  2119,  2123,  2124,  2126,  2127,  2129,
-    2130,  2132,  2135,  2137,  2139,  2142,  2145,  2149,  2151,  2155,
-    2158,  2160,  2163,  2166,  2169,  2172,  2175,  2178,  2181,  2184,
-    2187,  2190,  2193,  2195,  2197,  2200,  2202,  2204,  2206,  2208,
-    2210,  2211,  2214,  2216,  2218,  2220,  2222,  2224,  2225,  2228,
-    2230,  2232,  2233,  2235,  2237,  2240,  2243,  2245,  2248,  2251,
-    2252,  2254,  2256,  2258,  2262,  2264,  2268,  2269,  2271,  2272,
-    2277,  2279,  2281,  2283,  2284,  2286,  2289,  2291,  2293,  2296,
-    2298,  2302,  2306,  2308,  2310,  2311,  2314,  2315,  2317,  2323,
-    2324,  2328,  2332,  2334,  2335,  2338,  2341,  2344,  2345,  2349,
-    2353,  2360,  2367,  2369,  2371,  2374,  2377,  2380,  2382,  2385,
-    2388,  2390,  2392,  2393,  2395,  2397,  2399,  2401,  2402,  2404,
-    2406,  2408,  2409,  2411,  2414,  2415,  2417,  2418,  2420,  2421,
-    2423,  2425,  2428,  2430,  2433,  2435,  2438,  2441,  2444,  2448,
-    2451,  2453,  2455,  2457,  2459,  2463,  2465,  2467,  2469,  2474,
-    2477,  2479,  2484,  2485,  2487,  2488,  2491,  2493,  2497,  2498,
-    2505,  2506,  2512,  2520,  2521,  2527,  2528,  2534,  2535,  2541,
-    2542,  2547,  2548,  2559,  2563,  2568,  2572,  2576,  2584,  2589,
-    2593,  2599,  2600,  2604,  2606,  2611,  2612,  2616,  2617,  2620,
-    2621,  2623,  2624,  2627,  2630,  2633,  2636,  2638,  2640,  2642,
-    2646,  2651,  2652,  2659,  2664,  2665,  2671,  2672,  2679,  2684,
-    2688,  2690,  2698,  2702,  2704,  2706,  2707,  2713,  2714,  2718,
-    2721,  2722,  2728,  2729,  2730,  2737,  2739,  2743,  2745,  2747,
-    2751,  2754,  2758,  2761,  2766,  2767,  2774,  2775,  2776,  2785,
-    2790,  2795,  2799,  2803,  2806,  2809,  2816,  2822,  2826,  2832,
-    2834,  2836,  2838,  2840,  2842,  2843,  2845,  2847,  2850,  2853,
-    2857,  2861,  2865,  2869,  2870,  2872,  2873,  2875,  2876,  2878,
-    2880,  2881,  2884,  2886,  2887,  2889,  2891,  2893,  2894,  2901,
-    2905,  2909,  2910,  2912,  2914,  2918,  2922,  2925,  2928,  2933,
-    2934,  2938,  2939,  2943,  2944,  2948,  2949,  2953,  2954,  2956,
-    2958,  2962,  2964,  2966,  2967,  2970,  2972,  2976,  2980,  2984,
-    2986,  2987,  2993,  2994,  2996,  2998,  2999,  3006,  3007,  3009,
-    3011,  3014,  3016,  3018,  3020,  3021,  3027,  3030,  3031,  3037,
-    3038,  3040,  3042,  3045,  3047,  3049,  3051,  3053,  3055,  3058,
-    3059,  3065,  3066,  3068,  3070,  3071,  3076,  3081,  3085,  3091,
-    3093,  3097,  3101,  3102,  3109,  3111,  3113,  3115,  3119,  3122,
-    3126,  3128,  3130,  3131,  3138,  3140,  3142,  3144,  3148,  3152,
-    3157,  3158,  3165,  3166,  3169,  3170,  3175,  3176,  3179,  3181,
-    3184,  3189,  3192,  3196,  3199,  3203,  3204,  3208,  3209,  3210,
-    3217,  3220,  3222,  3224,  3227,  3230,  3239,  3244,  3245,  3247,
-    3250,  3252,  3254,  3256,  3258,  3259,  3262,  3267,  3271,  3273,
-    3275,  3279,  3284,  3285,  3286,  3287,  3290,  3293,  3295,  3297,
-    3298,  3301,  3305,  3309,  3313,  3316,  3320,  3325,  3329,  3334,
-    3338,  3343,  3345,  3349,  3354,  3358,  3362,  3369,  3371,  3377,
-    3384,  3390,  3398,  3405,  3414,  3420,  3427,  3432,  3437,  3443,
-    3447,  3452,  3454,  3458,  3462,  3466,  3470,  3474,  3478,  3484,
-    3490,  3494,  3498,  3502,  3506,  3510,  3514,  3516,  3518,  3520,
-    3522,  3524,  3526,  3528,  3530,  3532,  3534,  3536,  3538,  3540,
-    3542,  3544,  3546,  3548,  3550,  3552,  3554,  3556,  3558,  3562,
-    3564,  3566,  3568,  3570,  3574,  3577,  3580,  3583,  3586,  3590,
-    3594,  3600,  3607,  3612,  3617,  3625,  3628,  3635,  3641,  3648,
-    3655,  3660,  3665,  3671,  3676,  3683,  3686,  3691,  3696,  3701,
-    3712,  3719,  3728,  3735,  3740,  3745,  3752,  3757,  3762,  3767,
-    3774,  3779,  3787,  3795,  3803,  3810,  3817,  3824,  3831,  3835,
-    3840,  3847,  3856,  3859,  3862,  3871,  3880,  3887,  3894,  3896,
-    3903,  3910,  3919,  3928,  3935,  3944,  3951,  3954,  3963,  3972,
-    3975,  3978,  3981,  3986,  3991,  3996,  4001,  4005,  4014,  4021,
-    4030,  4035,  4042,  4047,  4052,  4057,  4064,  4073,  4078,  4082,
-    4089,  4094,  4101,  4107,  4116,  4124,  4135,  4137,  4144,  4149,
-    4154,  4159,  4164,  4169,  4176,  4181,  4182,  4188,  4195,  4198,
-    4202,  4203,  4208,  4209,  4213,  4214,  4216,  4218,  4222,  4227,
-    4232,  4238,  4243,  4248,  4253,  4259,  4264,  4265,  4266,  4274,
-    4279,  4285,  4290,  4296,  4301,  4306,  4311,  4316,  4321,  4327,
-    4328,  4337,  4338,  4342,  4346,  4348,  4353,  4354,  4356,  4357,
-    4360,  4361,  4362,  4367,  4372,  4375,  4376,  4380,  4383,  4387,
-    4390,  4392,  4395,  4397,  4400,  4402,  4405,  4408,  4411,  4412,
-    4414,  4416,  4420,  4422,  4426,  4428,  4432,  4433,  4435,  4436,
-    4439,  4444,  4450,  4452,  4454,  4456,  4458,  4463,  4465,  4469,
-    4473,  4477,  4478,  4485,  4486,  4493,  4494,  4503,  4508,  4509,
-    4518,  4519,  4530,  4537,  4538,  4547,  4548,  4559,  4566,  4568,
-    4571,  4574,  4575,  4577,  4583,  4584,  4590,  4594,  4600,  4603,
-    4604,  4605,  4613,  4615,  4616,  4617,  4624,  4625,  4629,  4630,
-    4631,  4637,  4638,  4640,  4641,  4643,  4644,  4647,  4651,  4655,
-    4657,  4659,  4660,  4668,  4669,  4677,  4679,  4682,  4683,  4684,
-    4687,  4688,  4691,  4692,  4694,  4696,  4698,  4700,  4704,  4706,
-    4710,  4712,  4714,  4716,  4718,  4720,  4722,  4724,  4726,  4728,
-    4730,  4732,  4734,  4736,  4738,  4740,  4742,  4744,  4746,  4748,
-    4750,  4752,  4754,  4756,  4758,  4760,  4761,  4763,  4765,  4766,
-    4769,  4770,  4772,  4773,  4774,  4778,  4779,  4780,  4784,  4787,
-    4788,  4789,  4794,  4799,  4802,  4803,  4805,  4807,  4811,  4815,
-    4817,  4820,  4821,  4823,  4824,  4829,  4834,  4837,  4838,  4840,
-    4842,  4843,  4845,  4846,  4848,  4851,  4853,  4857,  4861,  4863,
-    4865,  4867,  4869,  4871,  4872,  4875,  4877,  4879,  4881,  4883,
-    4885,  4887,  4889,  4891,  4893,  4895,  4897,  4899,  4901,  4903,
-    4905,  4907,  4909,  4911,  4913,  4915,  4917,  4919,  4921,  4922,
-    4923,  4930,  4931,  4933,  4937,  4939,  4940,  4943,  4947,  4949,
-    4952,  4954,  4955,  4959,  4960,  4961,  4969,  4972,  4974,  4975,
-    4979,  4980,  4988,  4989,  4990,  4999,  5004,  5011,  5016,  5021,
-    5026,  5027,  5034,  5039,  5044,  5049,  5055,  5060,  5062,  5066,
-    5068,  5071,  5073,  5077,  5079,  5080,  5083,  5084,  5086,  5087,
-    5089,  5091,  5094,  5098,  5100,  5102,  5103,  5104,  5113,  5114,
-    5115,  5122,  5123,  5125,  5127,  5129,  5131,  5133,  5136,  5138,
-    5140,  5142,  5146,  5151,  5152,  5156,  5160,  5162,  5165,  5168,
-    5169,  5173,  5174,  5180,  5184,  5186,  5190,  5192,  5196,  5198,
-    5200,  5201,  5203,  5204,  5209,  5210,  5212,  5216,  5218,  5220,
-    5222,  5223,  5224,  5231,  5232,  5233,  5245,  5249,  5251,  5255,
-    5259,  5261,  5265,  5266,  5268,  5269,  5274,  5275,  5283,  5284,
-    5290,  5291,  5298,  5300,  5304,  5307,  5312,  5313,  5316,  5317,
-    5320,  5322,  5324,  5326,  5327,  5332,  5333,  5335,  5336,  5338,
-    5340,  5344,  5346,  5348,  5351,  5354,  5357,  5359,  5361,  5363,
-    5365,  5366,  5370,  5371,  5375,  5378,  5383,  5388,  5392,  5397,
-    5402,  5404,  5408,  5412,  5419,  5422,  5425,  5426,  5433,  5434,
-    5441,  5447,  5450,  5452,  5458,  5464,  5467,  5470,  5472,  5477,
-    5481,  5484,  5488,  5491,  5494,  5496,  5500,  5505,  5509,  5513,
-    5516,  5519,  5523,  5527,  5531,  5535,  5539,  5543,  5547,  5551,
-    5553,  5555,  5557,  5559,  5561,  5562,  5564,  5565,  5568,  5569,
-    5571,  5573,  5575,  5576,  5579,  5580,  5583,  5584,  5587,  5590,
-    5591,  5596,  5597,  5602,  5604,  5606,  5608,  5610,  5612,  5614,
-    5616,  5617,  5619,  5621,  5625,  5626,  5628,  5630,  5631,  5636,
-    5637,  5638,  5644,  5646,  5647,  5651,  5652,  5656,  5660,  5662,
-    5665,  5668,  5671,  5674,  5677,  5680,  5683,  5685,  5687,  5689,
-    5691,  5693,  5695,  5696,  5698,  5699,  5703,  5707,  5709,  5710,
-    5714,  5716,  5719,  5720,  5722,  5723,  5727,  5731,  5734,  5737,
-    5741,  5742,  5744,  5746,  5749,  5750,  5751,  5752,  5753,  5776,
-    5778,  5780,  5781,  5783,  5784,  5786,  5788,  5789,  5791,  5793,
-    5794,  5797,  5800,  5802,  5806,  5811,  5815,  5819,  5820,  5823,
-    5826,  5828,  5832,  5836,  5837,  5842,  5843,  5847,  5849,  5851,
-    5852,  5856,  5859,  5863,  5865,  5867,  5870,  5871,  5874,  5878,
-    5880,  5886,  5888,  5890,  5893,  5896,  5898,  5900,  5902,  5904,
-    5906,  5909,  5912,  5914,  5916,  5918,  5920,  5922,  5924,  5926,
-    5928,  5931,  5934,  5936,  5938,  5940,  5942,  5944,  5947,  5950,
-    5953,  5955,  5957,  5961,  5967,  5969,  5971,  5973,  5975,  5977,
-    5981,  5986,  5992,  5994,  6000,  6004,  6007,  6009,  6013,  6016,
-    6019,  6024,  6026,  6028,  6030,  6032,  6034,  6036,  6038,  6040,
-    6042,  6044,  6046,  6048,  6050,  6052,  6054,  6058,  6061,  6063,
-    6065,  6067,  6069,  6071,  6073,  6075,  6077,  6079,  6081,  6083,
-    6085,  6087,  6089,  6091,  6093,  6095,  6097,  6099,  6101,  6103,
-    6105,  6107,  6109,  6111,  6113,  6115,  6117,  6119,  6121,  6123,
-    6125,  6127,  6129,  6131,  6133,  6135,  6137,  6139,  6141,  6143,
-    6145,  6147,  6149,  6151,  6153,  6155,  6157,  6159,  6161,  6163,
-    6165,  6167,  6169,  6171,  6173,  6175,  6177,  6179,  6181,  6183,
-    6185,  6187,  6189,  6191,  6193,  6195,  6197,  6199,  6201,  6203,
-    6205,  6207,  6209,  6211,  6213,  6215,  6217,  6219,  6221,  6223,
-    6225,  6227,  6229,  6231,  6233,  6235,  6237,  6239,  6241,  6243,
-    6245,  6247,  6249,  6251,  6253,  6255,  6257,  6259,  6261,  6263,
-    6265,  6267,  6269,  6271,  6273,  6275,  6277,  6279,  6281,  6283,
-    6285,  6287,  6289,  6291,  6293,  6295,  6297,  6299,  6301,  6303,
-    6305,  6307,  6309,  6311,  6313,  6315,  6317,  6319,  6321,  6323,
-    6325,  6327,  6329,  6331,  6333,  6335,  6337,  6339,  6341,  6343,
-    6345,  6347,  6349,  6351,  6353,  6355,  6357,  6359,  6361,  6363,
-    6365,  6367,  6369,  6371,  6373,  6375,  6377,  6379,  6381,  6383,
-    6385,  6387,  6389,  6391,  6393,  6395,  6397,  6399,  6401,  6403,
-    6405,  6407,  6409,  6411,  6413,  6415,  6417,  6419,  6421,  6423,
-    6425,  6427,  6429,  6431,  6433,  6435,  6437,  6439,  6441,  6443,
-    6445,  6447,  6449,  6451,  6453,  6455,  6457,  6459,  6461,  6463,
-    6465,  6467,  6469,  6471,  6473,  6475,  6477,  6479,  6481,  6483,
-    6485,  6487,  6489,  6491,  6493,  6495,  6497,  6499,  6501,  6503,
-    6505,  6507,  6509,  6511,  6513,  6515,  6517,  6519,  6521,  6523,
-    6525,  6527,  6529,  6531,  6533,  6535,  6537,  6539,  6541,  6543,
-    6545,  6547,  6549,  6551,  6553,  6555,  6557,  6559,  6561,  6563,
-    6565,  6567,  6569,  6571,  6573,  6575,  6577,  6579,  6581,  6583,
-    6585,  6587,  6589,  6591,  6593,  6595,  6597,  6599,  6601,  6603,
-    6605,  6607,  6609,  6611,  6613,  6615,  6617,  6619,  6621,  6623,
-    6625,  6627,  6629,  6631,  6633,  6635,  6637,  6639,  6641,  6643,
-    6645,  6647,  6649,  6651,  6653,  6655,  6657,  6659,  6661,  6663,
-    6665,  6667,  6669,  6671,  6673,  6675,  6677,  6679,  6681,  6683,
-    6685,  6687,  6689,  6691,  6693,  6695,  6697,  6699,  6701,  6703,
-    6705,  6707,  6709,  6711,  6713,  6715,  6717,  6719,  6721,  6723,
-    6725,  6727,  6729,  6731,  6733,  6735,  6737,  6739,  6741,  6743,
-    6745,  6747,  6749,  6751,  6753,  6755,  6757,  6759,  6761,  6763,
-    6764,  6768,  6769,  6773,  6774,  6778,  6779,  6783,  6784,  6788,
-    6791,  6792,  6795,  6796,  6799,  6800,  6805,  6806,  6810,  6812,
-    6814,  6816,  6818,  6819,  6821,  6823,  6825,  6826,  6829,  6832,
-    6835,  6839,  6840,  6845,  6850,  6857,  6860,  6864,  6868,  6872,
-    6878,  6880,  6884,  6888,  6890,  6892,  6896,  6900,  6902,  6906,
-    6909,  6912,  6915,  6918,  6921,  6923,  6925,  6930,  6935,  6937,
-    6939,  6941,  6943,  6945,  6946,  6951,  6953,  6955,  6957,  6961,
-    6965,  6967,  6969,  6972,  6975,  6976,  6980,  6985,  6989,  6990,
-    6998,  7000,  7003,  7005,  7007,  7009,  7011,  7013,  7015,  7016,
-    7022,  7024,  7026,  7028,  7030,  7032,  7033,  7038,  7045,  7052,
-    7059,  7067,  7073,  7074,  7079,  7088,  7097,  7106,  7113,  7114,
-    7116,  7118,  7121,  7122,  7124,  7126,  7130,  7131,  7135,  7136,
-    7140,  7141,  7145,  7146,  7150,  7152,  7154,  7156,  7158,  7160,
-    7162,  7164,  7166,  7168,  7170,  7172,  7175,  7178,  7180,  7184,
-    7187,  7190,  7193,  7196,  7199,  7202,  7205,  7208,  7210,  7212,
-    7215,  7216,  7218,  7222,  7224,  7227,  7230,  7233,  7235,  7239,
-    7243,  7245,  7247,  7251,  7253,  7257,  7262,  7268,  7273,  7280,
-    7282,  7283,  7287,  7291,  7293,  7295,  7296,  7299,  7302,  7305,
-    7308,  7309,  7312,  7313,  7317,  7320,  7322,  7325,  7328,  7331,
-    7334,  7337,  7338,  7342,  7343,  7345,  7346,  7350,  7353,  7354,
-    7356,  7359,  7360,  7362,  7367,  7372,  7378,  7381,  7385,  7386,
-    7388,  7389,  7394,  7395,  7397,  7399,  7400,  7402,  7403,  7406,
-    7409,  7411,  7412,  7414,  7416,  7419,  7423,  7426,  7427,  7434,
-    7438,  7439,  7440,  7441,  7443,  7446,  7448,  7450,  7452,  7454,
-    7456,  7458,  7460,  7462,  7464,  7467,  7470,  7474,  7476,  7478,
-    7480,  7482,  7484,  7486,  7488,  7490,  7492,  7494,  7496,  7498,
-    7500,  7501,  7505,  7507,  7510,  7512,  7515,  7519,  7523,  7527,
-    7528,  7532,  7536,  7537,  7545,  7546,  7550,  7552,  7556,  7557,
-    7561,  7562,  7566,  7571,  7573,  7577,  7578,  7582,  7583,  7587,
-    7592,  7597,  7598,  7599,  7600,  7617,  7626,  7634,  7635,  7636,
-    7637,  7638,  7639,  7655,  7656,  7657,  7658,  7659,  7672,  7677,
-    7682,  7686,  7691,  7695,  7698,  7700,  7704,  7710,  7712,  7714,
-    7715,  7717,  7719,  7720,  7723,  7724,  7725,  7729,  7730,  7733,
-    7739
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int16 yyrhs[] =
-{
-     641,     0,    -1,   151,    -1,    -1,   644,   642,   636,   643,
-      -1,   644,   151,    -1,    -1,   151,    -1,   645,    -1,  1516,
-      -1,  1016,    -1,  1082,    -1,  1084,    -1,   697,    -1,   657,
-      -1,  1085,    -1,  1074,    -1,  1522,    -1,   664,    -1,   646,
-      -1,  1329,    -1,  1361,    -1,  1276,    -1,  1278,    -1,   650,
-      -1,  1368,    -1,   732,    -1,  1489,    -1,  1479,    -1,   655,
-      -1,  1293,    -1,  1590,    -1,  1388,    -1,  1391,    -1,  1471,
-      -1,  1090,    -1,  1098,    -1,   851,    -1,  1105,    -1,   648,
-      -1,  1384,    -1,  1525,    -1,  1093,    -1,  1077,    -1,  1296,
-      -1,  1378,    -1,   731,    -1,  1486,    -1,  1523,    -1,  1524,
-      -1,  1117,    -1,  1443,    -1,   724,    -1,  1347,    -1,  1058,
-      -1,  1060,    -1,  1340,    -1,  1591,    -1,  1477,    -1,  1321,
-      -1,  1390,    -1,  1582,    -1,   647,   398,  1437,    -1,   116,
-      -1,   139,    -1,   398,  1437,   189,   649,    -1,  1434,    -1,
-     637,  1439,    -1,    -1,   165,  1437,   651,   652,    -1,    -1,
-     588,   653,    -1,   653,   632,   654,    -1,   654,    -1,   637,
-    1439,    -1,    -1,   208,   656,  1439,    -1,    -1,    56,   302,
-     556,   658,   659,    -1,   660,    -1,   659,   632,   660,    -1,
-     286,   155,  1433,    -1,   283,   155,  1433,    -1,   303,   155,
-    1433,    -1,   289,   155,  1433,    -1,   290,   155,  1257,    -1,
-     284,   155,  1257,    -1,   291,   155,  1257,    -1,   285,   155,
-    1257,    -1,   300,   155,  1257,    -1,   294,   155,  1433,    -1,
-     293,   155,  1433,    -1,   295,   155,  1433,    -1,   296,   155,
-    1433,    -1,   299,   155,  1433,    -1,   301,   155,  1257,    -1,
-     297,   155,  1433,    -1,   298,   155,  1433,    -1,   304,   155,
-    1420,    -1,   222,   155,   630,   661,   631,    -1,   282,   155,
-    1257,    -1,   663,    -1,    -1,   662,    -1,   661,   632,   662,
-      -1,  1257,    -1,   287,   155,  1433,    -1,   288,   155,  1259,
-      -1,   428,   155,  1433,    -1,   429,   155,  1257,    -1,    -1,
-      94,   903,   539,   906,  1429,   665,   840,    -1,    -1,    -1,
-      94,   994,   225,  1437,   998,   364,  1429,   666,   630,  1011,
-     631,   999,   667,  1050,    -1,    -1,    -1,    94,   995,   225,
-    1437,   997,   364,  1429,   668,   630,  1011,   631,  1000,   669,
-    1050,    -1,    -1,    -1,    94,   996,   225,  1437,   997,   364,
-    1429,   670,   630,  1011,   631,  1001,   671,  1050,    -1,    -1,
-      94,   103,   906,  1437,   672,   900,    -1,    -1,    94,   673,
-    1544,    -1,    94,   585,   690,  1506,    -1,    94,   273,   202,
-     804,    -1,    94,   537,   801,    -1,    94,   674,    -1,   474,
-    1439,   185,   106,   612,  1439,   369,   630,   675,   631,    -1,
-     676,    -1,   675,   632,   676,    -1,   585,  1434,    -1,   211,
-    1434,    -1,   103,  1434,    -1,   379,  1434,    -1,   388,  1434,
-      -1,   490,  1434,    -1,   395,  1257,    -1,    -1,  1134,   162,
-     906,   691,   678,   364,   463,   679,   684,   681,   686,   138,
-     687,    -1,    -1,   163,  1138,  1229,   680,   682,   683,    -1,
-      23,  1138,    -1,    -1,   147,    -1,   132,   364,   486,    -1,
-     132,    -1,    -1,   512,  1138,    -1,    -1,   150,  1138,    -1,
-      -1,   685,    -1,   364,    78,   399,    -1,   364,    78,   352,
-     399,    -1,    -1,    74,  1434,    -1,    -1,   688,   689,    -1,
-     749,    -1,   751,    -1,   747,    -1,   768,    -1,   786,    -1,
-     788,    -1,   783,    -1,   753,    -1,   755,    -1,   756,    -1,
-     757,    -1,   758,    -1,   760,    -1,    -1,  1437,   638,  1437,
-      -1,  1437,    -1,    -1,   692,   694,    -1,    -1,   693,   695,
-      -1,    74,  1434,    -1,   252,   508,    -1,   354,   508,    -1,
-      88,   508,    -1,   414,   508,   106,    -1,   329,   508,   106,
-      -1,   696,    -1,   694,    -1,   129,    -1,  1144,   129,    -1,
-     508,   467,   122,    -1,   508,   467,   237,    -1,    -1,    49,
-     691,   698,   699,    -1,    -1,   630,   700,   631,    -1,    -1,
-     701,    -1,   701,   632,  1138,    -1,  1138,    -1,    -1,   703,
-      -1,   703,   632,   705,    -1,   705,    -1,    -1,  1437,   704,
-     954,    -1,    -1,   707,    -1,   707,   632,   708,    -1,   708,
-      -1,   709,   704,  1437,   954,    -1,    -1,   238,    -1,   378,
-      -1,   229,    -1,    -1,   710,   746,   636,    -1,   746,   636,
-      -1,   711,   746,   636,    -1,    -1,   712,   713,   636,    -1,
-      -1,   119,   743,   714,   954,   744,    -1,   119,  1437,    81,
-     186,   720,    -1,    -1,   119,   717,   205,   186,   715,   718,
-     746,    -1,    -1,   119,  1437,   100,   186,   716,  1117,    -1,
-     167,    -1,    90,    -1,   719,    -1,   718,   632,   719,    -1,
-     723,    -1,  1257,    -1,   721,    -1,   497,   722,  1435,    -1,
-      -1,   593,    -1,   720,    -1,  1437,    -1,   498,    -1,  1144,
-     188,    -1,   496,    -1,   483,   725,   727,    -1,  1437,    -1,
-     721,    -1,    -1,   725,    -1,    -1,   476,   728,    -1,   730,
-     155,   729,    -1,   728,   632,   730,   155,   729,    -1,  1419,
-      -1,  1165,    -1,  1425,    -1,    63,    -1,   524,    -1,    85,
-      -1,    87,    -1,    86,    -1,    54,    -1,   464,    -1,   541,
-      -1,    73,    -1,   101,    -1,   320,    -1,   337,    -1,   443,
-     726,   727,    -1,   198,   733,   130,   734,    -1,    -1,    98,
-      -1,   735,    -1,    81,   739,   740,    -1,   736,    -1,   735,
-     632,   736,    -1,   737,   155,   738,    -1,  1437,    -1,   637,
-    1439,    -1,   359,    -1,   460,    -1,   729,    -1,   741,    -1,
-     740,   632,   741,    -1,   737,   155,   742,    -1,    63,    -1,
-     524,    -1,    85,    -1,    87,    -1,    86,    -1,    54,    -1,
-     464,    -1,   541,    -1,    73,    -1,   101,    -1,   320,    -1,
-     337,    -1,   448,    -1,  1437,    -1,   743,   632,  1437,    -1,
-      -1,    -1,   120,   745,  1138,    -1,   749,    -1,   751,    -1,
-     747,    -1,   768,    -1,   786,    -1,   788,    -1,   783,    -1,
-     753,    -1,   755,    -1,   756,    -1,   757,    -1,   758,    -1,
-     760,    -1,    -1,   220,   748,   763,   149,   220,    -1,    -1,
-     750,   645,    -1,    -1,   450,   752,  1138,    -1,    -1,   754,
-     792,    -1,   257,  1438,    -1,   246,  1438,    -1,   367,  1437,
-      -1,    -1,   177,   761,  1437,   235,   759,   762,    -1,    65,
-    1437,    -1,    -1,   348,   189,    -1,   189,    -1,  1437,    -1,
-     762,   632,  1437,    -1,    -1,    -1,    -1,   764,  1138,   765,
-     548,   711,   766,   767,    -1,    -1,   146,   763,    -1,   145,
-     711,    -1,   769,    -1,   772,    -1,    -1,    -1,    52,   770,
-    1138,   771,   774,   782,   149,    52,    -1,    -1,    52,   773,
-     775,   782,   149,    52,    -1,   776,    -1,   774,   776,    -1,
-     779,    -1,   775,   779,    -1,    -1,    -1,   605,   777,  1138,
-     778,   548,   711,    -1,    -1,    -1,   605,   780,  1138,   781,
-     548,   711,    -1,    -1,   145,   711,    -1,    -1,  1438,   639,
-     784,   792,   785,    -1,    -1,  1438,    -1,    -1,  1438,   639,
-     787,   790,   785,    -1,    -1,   789,   790,    -1,    -1,    30,
-     791,   712,   710,   149,    -1,   279,   711,   149,   279,    -1,
-      -1,    -1,   607,   793,  1138,   794,   138,   711,   149,   607,
-      -1,    -1,    -1,   438,   711,   581,   795,  1138,   796,   149,
-     438,    -1,    29,    -1,     8,    -1,   231,    -1,   582,    -1,
-     125,    -1,   826,   828,    -1,   826,    56,   823,   807,    -1,
-     826,     6,   823,   802,   811,    -1,    -1,   587,   273,   202,
-    1437,    -1,   826,     6,   823,   814,    -1,   826,   139,   823,
-     814,    -1,   827,   806,   817,    -1,   827,   806,   820,    -1,
-       6,   824,    -1,     6,   825,    -1,    -1,   808,   809,    -1,
-     810,    -1,   809,   810,    -1,   809,   632,   810,    -1,   829,
-      -1,   830,    -1,   831,    -1,    -1,   812,    -1,   813,    -1,
-     812,   813,    -1,   812,   632,   813,    -1,   829,    -1,   830,
-      -1,   831,    -1,   832,    -1,   835,    -1,   837,    -1,   838,
-      -1,   836,    -1,    -1,   815,    -1,   816,    -1,   815,   816,
-      -1,   815,   632,   816,    -1,   829,    -1,   830,    -1,   831,
-      -1,   837,    -1,   838,    -1,    -1,   818,    -1,   819,    -1,
-     818,   819,    -1,   818,   632,   819,    -1,   829,    -1,   833,
-      -1,   834,    -1,   835,    -1,   837,    -1,   838,    -1,   836,
-      -1,    -1,   821,    -1,   822,    -1,   821,   822,    -1,   821,
-     632,   822,    -1,   829,    -1,   837,    -1,   838,    -1,   105,
-    1434,    -1,   571,  1434,    -1,   421,  1434,    -1,  1437,    -1,
-    1437,    -1,   415,    -1,   417,    -1,   352,     4,    -1,   227,
-    1313,   839,    -1,    24,  1313,   839,    -1,   309,  1313,   839,
-      -1,   172,  1313,   839,    -1,   572,  1313,   839,    -1,   422,
-    1313,   839,    -1,   349,  1313,  1258,    -1,    74,  1313,  1434,
-      -1,  1354,   153,  1313,   914,    -1,   601,    -1,   355,    -1,
-    1260,    -1,  1432,    -1,   630,   841,    -1,   907,   846,   843,
-      -1,   262,  1429,    -1,   630,   262,  1429,   631,    -1,   920,
-     631,   907,   846,   843,    -1,    -1,   846,   896,   631,   842,
-    1529,    -1,    -1,    -1,  1399,   899,   896,   844,  1526,    -1,
-      -1,  1399,   899,   630,   896,   631,   845,  1529,    -1,   847,
-      -1,    -1,   848,    -1,    -1,   385,   850,   849,   853,    -1,
-      -1,    -1,   385,   852,   853,    -1,    46,   854,   864,   865,
-     872,    -1,   856,   250,   857,   630,   858,   631,    -1,    -1,
-     856,   206,   855,   862,    -1,   413,   862,    -1,   413,   861,
-      -1,   267,   862,    -1,   267,   861,    -1,    -1,   264,    -1,
-      -1,    11,   155,  1258,    -1,    -1,   859,    -1,   860,    -1,
-     859,   632,   860,    -1,  1437,    -1,    70,   630,   858,   631,
-      -1,   630,  1134,   870,  1135,   631,    -1,   630,  1134,   870,
-    1135,   631,    -1,    -1,   386,  1258,    -1,    -1,    -1,   528,
-      46,   856,   206,   863,   866,   871,    -1,    -1,   528,    46,
-     856,   250,   857,   630,   868,   631,   867,   871,    -1,   869,
-      -1,   868,   632,   869,    -1,  1437,    -1,  1141,    -1,    -1,
-     527,  1258,    -1,    -1,   630,   873,   631,    -1,   874,    -1,
-     873,   632,   874,    -1,    -1,   385,   875,   876,   877,   893,
-     888,    -1,  1437,    -1,    -1,    -1,   592,   259,   547,   878,
-     880,    -1,    -1,   592,   238,   879,   881,    -1,   313,    -1,
-     883,    -1,   883,    -1,   630,   882,   631,    -1,   883,    -1,
-     882,   632,   883,    -1,    -1,    -1,   630,   884,   886,   885,
-     631,    -1,   887,    -1,   886,   632,   887,    -1,   313,    -1,
-    1141,    -1,    -1,   630,   889,   631,    -1,   890,    -1,   889,
-     632,   890,    -1,    -1,   528,   891,   892,   893,    -1,  1439,
-      -1,    -1,   894,    -1,   894,   895,    -1,   895,    -1,   537,
-    1313,  1439,    -1,  1354,   153,  1313,   914,    -1,   349,  1313,
-    1258,    -1,   308,  1313,  1260,    -1,   326,  1313,  1260,    -1,
-     106,   131,  1313,  1434,    -1,   225,   131,  1313,  1434,    -1,
-      74,  1313,  1434,    -1,    -1,    -1,   468,   897,  1128,  1132,
-     898,   918,    -1,    -1,    19,    -1,    -1,   901,    -1,   902,
-      -1,   901,   902,    -1,   913,    -1,   912,    -1,    -1,   904,
-      -1,   905,    -1,   905,   904,    -1,   542,    -1,    -1,   220,
-    1144,   166,    -1,    -1,   909,    -1,   910,    -1,   910,   908,
-      -1,   910,    -1,   910,   909,    -1,   910,   632,   909,    -1,
-     153,  1313,   914,    -1,   308,  1313,  1259,    -1,   326,  1313,
-    1259,    -1,    26,  1313,  1257,    -1,   388,  1313,  1434,    -1,
-      74,  1313,  1434,    -1,    25,  1313,  1259,    -1,   380,  1313,
-    1257,    -1,   380,  1313,   120,    -1,   514,  1313,  1257,    -1,
-     514,  1313,   120,    -1,   515,  1313,  1257,    -1,   515,  1313,
-     120,    -1,   516,  1313,  1257,    -1,   516,  1313,   120,    -1,
-      60,  1313,  1257,    -1,   540,  1313,  1257,    -1,   124,  1313,
-    1257,    -1,   458,  1313,   916,    -1,    -1,   576,  1313,   911,
-     630,  1377,   631,    -1,   912,    -1,   913,    -1,   232,  1313,
-     917,    -1,   106,   131,  1313,  1434,    -1,   225,   131,  1313,
-    1434,    -1,   537,  1437,    -1,   521,   134,    -1,   521,   318,
-      -1,    82,  1313,  1434,    -1,   249,  1313,  1257,    -1,   966,
-     957,  1313,   959,    -1,   966,    68,  1313,   965,    -1,  1439,
-      -1,  1439,    -1,   120,    -1,   180,    -1,   143,    -1,    79,
-      -1,   423,    -1,    77,    -1,   354,    -1,   179,    -1,   253,
-      -1,  1252,    -1,  1127,  1131,    -1,   523,    -1,   418,    -1,
-     118,    -1,   236,    -1,   921,    -1,   922,    -1,   921,   632,
-     922,    -1,   923,    -1,   924,    -1,   929,   925,    -1,   929,
-     983,    -1,   989,  1013,   998,   630,  1011,   631,   999,    -1,
-     995,   992,  1013,   997,   630,  1011,   631,  1000,    -1,   996,
-     992,  1013,   997,   630,  1011,   631,  1001,    -1,   927,   990,
-    1013,   998,   630,  1011,   631,   999,    -1,   927,   185,   250,
-    1013,   630,  1011,   631,   983,    -1,   927,   926,    -1,    -1,
-     926,    -1,    61,   630,  1138,   631,    -1,    -1,   928,    -1,
-      84,  1013,    -1,    -1,  1428,   930,   931,   951,    -1,   939,
-     949,   945,    -1,   940,   950,   945,    -1,   182,   941,   945,
-      -1,    38,    -1,    38,   948,    -1,    43,    -1,    42,    -1,
-     935,   948,   969,    -1,   935,   969,    -1,   936,   948,   970,
-      -1,   936,   970,    -1,    33,   948,    -1,    33,    -1,   937,
-     948,   969,    -1,   938,   948,   970,    -1,   594,   948,    -1,
-     619,   949,   945,    -1,   110,    -1,   552,   943,    -1,   549,
-     943,    -1,   107,   943,    -1,   553,    -1,    40,   949,    -1,
-     934,    -1,   314,    -1,   275,    -1,   278,   594,    -1,   278,
-     937,   969,    -1,   555,   969,    -1,   546,   949,   969,    -1,
-     316,   969,    -1,   276,   969,    -1,   118,   941,   945,    -1,
-     360,   941,   945,    -1,   180,   941,   945,    -1,    -1,   154,
-     932,   630,  1015,   631,   969,    -1,    -1,   476,   933,   630,
-    1015,   631,   969,    -1,   278,   969,    -1,   472,    -1,   196,
-      -1,   195,    -1,   393,    -1,   334,    -1,   266,    -1,   333,
-      -1,   394,    -1,   335,    -1,    59,    -1,   343,    -1,   340,
-      59,    -1,   935,   598,    -1,   595,    -1,   340,   595,    -1,
-     361,    -1,   343,   595,    -1,   340,    59,   598,    -1,   343,
-     598,    -1,   236,    -1,   554,    -1,   488,    -1,   315,    -1,
-      32,    -1,   418,    -1,   137,    -1,   137,   397,    -1,    -1,
-     948,    -1,   942,    -1,   630,   358,   632,   358,   631,    -1,
-      -1,   630,   358,   631,    -1,    -1,   630,   631,    -1,   630,
-     358,   631,    -1,    -1,   946,    -1,   946,   947,    -1,   947,
-      -1,   484,    -1,   580,    -1,   620,    -1,   630,   277,   631,
-      -1,   630,   567,   631,    -1,   630,   117,   631,    -1,   630,
-     358,   631,    -1,    -1,   948,    -1,    -1,   942,    -1,    -1,
-     952,    -1,   952,   953,    -1,   953,    -1,   357,    -1,  1144,
-     357,    -1,   120,   956,    -1,   364,   582,   955,    -1,    25,
-      -1,   472,   120,   593,    -1,   982,   250,    -1,   577,    -1,
-     577,   250,    -1,    74,  1434,    -1,    68,   963,    -1,    72,
-     120,    -1,    72,   180,    -1,    72,   143,    -1,   521,   120,
-      -1,   521,   134,    -1,   521,   318,    -1,   931,   964,    -1,
-     353,   944,    -1,   955,    -1,  1418,    -1,    59,   476,    -1,
-      58,    -1,  1439,    -1,    33,    -1,   958,    -1,   120,    -1,
-      -1,   957,   959,    -1,  1439,    -1,    33,    -1,   961,    -1,
-     120,    -1,  1439,    -1,    -1,    68,   965,    -1,   963,    -1,
-     120,    -1,    -1,   120,    -1,    21,    -1,    33,    21,    -1,
-      21,    33,    -1,   574,    -1,   574,    33,    -1,    33,   574,
-      -1,    -1,   967,    -1,   968,    -1,    47,    -1,   957,   958,
-     970,    -1,    33,    -1,    33,   957,   958,    -1,    -1,    33,
-      -1,    -1,   630,  1258,   972,   631,    -1,    20,    -1,   126,
-      -1,   451,    -1,    -1,   973,    -1,   973,   974,    -1,   974,
-      -1,  1258,    -1,   976,   975,    -1,   977,    -1,   978,   632,
-     977,    -1,   976,   623,   976,    -1,   978,    -1,   979,    -1,
-      -1,   260,   980,    -1,    -1,   401,    -1,   424,  1429,   984,
-     986,   987,    -1,    -1,   630,   985,   631,    -1,   985,   632,
-    1437,    -1,  1437,    -1,    -1,   305,   190,    -1,   305,   384,
-      -1,   305,   485,    -1,    -1,   364,   582,   988,    -1,   364,
-     125,   988,    -1,   364,   582,   988,   364,   125,   988,    -1,
-     364,   125,   988,   364,   582,   988,    -1,   446,    -1,    50,
-      -1,   476,   357,    -1,   354,     5,    -1,   476,   120,    -1,
-     991,    -1,   401,   250,    -1,   577,   992,    -1,   250,    -1,
-     225,    -1,    -1,   991,    -1,   248,    -1,   225,    -1,   224,
-      -1,    -1,   577,    -1,   191,    -1,   494,    -1,    -1,   997,
-      -1,   997,  1005,    -1,    -1,  1002,    -1,    -1,  1004,    -1,
-      -1,  1003,    -1,  1007,    -1,  1002,  1007,    -1,  1008,    -1,
-    1003,  1008,    -1,  1009,    -1,  1004,  1009,    -1,   588,  1010,
-      -1,   565,  1010,    -1,   249,  1313,  1257,    -1,    74,  1434,
-      -1,  1006,    -1,  1005,    -1,  1006,    -1,  1006,    -1,   608,
-     383,  1432,    -1,    45,    -1,   461,    -1,   206,    -1,  1011,
-     632,  1012,  1250,    -1,  1012,  1250,    -1,  1437,    -1,  1437,
-     630,   358,   631,    -1,    -1,  1428,    -1,    -1,   638,  1437,
-      -1,  1416,    -1,  1015,   632,  1416,    -1,    -1,    13,  1054,
-     539,  1429,  1017,  1029,    -1,    -1,    13,   103,  1028,  1018,
-     901,    -1,    13,   103,  1437,   583,   106,   131,   339,    -1,
-      -1,    13,   403,   691,  1019,   692,    -1,    -1,    13,   192,
-     691,  1020,   692,    -1,    -1,    13,  1552,  1547,  1021,  1554,
-      -1,    -1,    13,  1547,  1022,  1554,    -1,    -1,    13,  1547,
-     162,   691,  1023,  1025,  1026,   681,   686,  1027,    -1,    13,
-     537,   803,    -1,    13,   273,   202,   805,    -1,    13,   537,
-     800,    -1,    13,   537,   799,    -1,    13,   474,  1439,   369,
-     630,   675,   631,    -1,    13,   585,   690,  1024,    -1,  1440,
-     388,   169,    -1,  1024,   632,  1440,   388,   169,    -1,    -1,
-     364,   463,   679,    -1,   685,    -1,   364,   463,   679,   685,
-      -1,    -1,   434,   556,   691,    -1,    -1,   138,   687,    -1,
-      -1,  1437,    -1,    -1,   133,   537,    -1,   223,   537,    -1,
-    1044,   847,    -1,  1044,  1033,    -1,  1033,    -1,   848,    -1,
-    1035,    -1,   139,   385,  1042,    -1,   419,   385,  1092,  1034,
-      -1,    -1,   368,   385,  1092,  1034,  1030,  1092,    -1,    15,
-     385,  1092,  1034,    -1,    -1,    61,   385,  1034,  1031,  1087,
-      -1,    -1,   436,   385,  1092,  1034,  1032,  1079,    -1,    66,
-     385,  1092,  1258,    -1,   563,   385,  1034,    -1,  1038,    -1,
-     164,   385,  1043,   608,   539,  1429,   850,    -1,   433,   387,
-     850,    -1,    12,    -1,  1042,    -1,    -1,     6,   385,  1092,
-    1036,  1037,    -1,    -1,   630,   873,   631,    -1,   386,  1258,
-      -1,    -1,   435,   385,  1092,  1039,  1040,    -1,    -1,    -1,
-    1042,  1041,   235,   630,   873,   631,    -1,  1043,    -1,  1042,
-     632,  1043,    -1,  1437,    -1,  1046,    -1,  1044,   632,  1046,
-      -1,     6,  1053,    -1,  1045,   923,  1056,    -1,     6,   924,
-      -1,  1045,   630,   920,   631,    -1,    -1,    56,  1053,  1428,
-    1047,   929,  1056,    -1,    -1,    -1,   330,  1053,  1428,  1048,
-     931,   951,  1049,  1056,    -1,   139,  1053,  1428,  1055,    -1,
-     139,   185,   250,  1428,    -1,   139,   401,   250,    -1,   139,
-     991,  1428,    -1,   132,   248,    -1,   147,   248,    -1,    13,
-    1053,  1428,   476,   120,  1418,    -1,    13,  1053,  1428,   139,
-     120,    -1,   434,  1057,  1429,    -1,    91,   556,   957,   959,
-     964,    -1,   908,    -1,   184,    -1,  1243,    -1,  1051,    -1,
-    1052,    -1,    -1,  1052,    -1,  1051,    -1,  1052,  1051,    -1,
-    1051,  1052,    -1,    11,  1313,   120,    -1,    11,  1313,  1437,
-      -1,   272,  1313,   120,    -1,   272,  1313,  1437,    -1,    -1,
-      71,    -1,    -1,   221,    -1,    -1,   446,    -1,    50,    -1,
-      -1,     8,  1437,    -1,   179,    -1,    -1,   556,    -1,   155,
-      -1,    19,    -1,    -1,   513,   486,  1069,  1059,  1072,  1064,
-      -1,   520,   486,  1069,    -1,   513,   558,  1061,    -1,    -1,
-    1062,    -1,  1063,    -1,  1062,   632,  1063,    -1,   608,    83,
-     489,    -1,   416,   366,    -1,   416,   613,    -1,  1065,  1066,
-    1067,  1068,    -1,    -1,   585,   155,  1434,    -1,    -1,   388,
-     155,  1434,    -1,    -1,   121,   155,  1434,    -1,    -1,   390,
-     155,  1434,    -1,    -1,  1070,    -1,  1071,    -1,  1070,   632,
-    1071,    -1,   509,    -1,   430,    -1,    -1,   581,  1073,    -1,
-     663,    -1,  1073,   632,   663,    -1,   501,   155,  1434,    -1,
-     499,   155,  1434,    -1,   500,    -1,    -1,    60,  1473,  1075,
-    1283,  1076,    -1,    -1,   412,    -1,   171,    -1,    -1,   436,
-    1092,  1473,  1078,  1283,  1079,    -1,    -1,  1080,    -1,  1081,
-      -1,  1081,  1080,    -1,   412,    -1,   171,    -1,   586,    -1,
-      -1,    15,  1092,  1473,  1083,  1283,    -1,    34,  1434,    -1,
-      -1,    61,  1473,  1086,  1283,  1087,    -1,    -1,  1088,    -1,
-    1089,    -1,  1089,  1088,    -1,   412,    -1,   175,    -1,   317,
-      -1,   171,    -1,    57,    -1,   186,   583,    -1,    -1,   368,
-    1092,  1473,  1091,  1283,    -1,    -1,   356,    -1,   269,    -1,
-      -1,   434,  1473,  1094,  1096,    -1,   434,   585,   690,  1095,
-      -1,  1440,   556,  1440,    -1,  1095,   632,  1440,   556,  1440,
-      -1,  1097,    -1,  1096,   632,  1097,    -1,  1429,   556,  1429,
-      -1,    -1,    48,   225,  1099,  1100,   238,  1104,    -1,  1101,
-      -1,  1103,    -1,  1102,    -1,  1101,   632,  1102,    -1,  1429,
-    1113,    -1,  1429,  1111,  1113,    -1,  1437,    -1,   120,    -1,
-      -1,   268,   225,   235,    48,  1106,  1107,    -1,  1110,    -1,
-    1108,    -1,  1109,    -1,  1108,   632,  1109,    -1,  1429,  1113,
-    1116,    -1,  1429,  1111,  1113,  1116,    -1,    -1,   385,   850,
-    1112,   630,  1034,   631,    -1,    -1,  1114,  1115,    -1,    -1,
-     991,   630,  1225,   631,    -1,    -1,   221,   256,    -1,  1118,
-      -1,   468,  1121,    -1,   630,  1119,   631,  1529,    -1,   468,
-    1123,    -1,   630,  1119,   631,    -1,   468,  1204,    -1,   630,
-    1120,   631,    -1,    -1,  1123,  1122,  1526,    -1,    -1,    -1,
-    1124,  1128,  1132,  1125,  1126,  1131,    -1,  1246,  1252,    -1,
-    1271,    -1,  1127,    -1,  1271,  1127,    -1,  1127,  1271,    -1,
-     189,  1184,  1235,  1240,  1237,  1246,  1252,  1263,    -1,   189,
-     140,  1235,  1252,    -1,    -1,  1129,    -1,  1129,  1130,    -1,
-    1130,    -1,  1543,    -1,   506,    -1,   504,    -1,    -1,   186,
-     582,    -1,   272,   238,   478,   328,    -1,  1132,   632,  1133,
-      -1,  1133,    -1,   625,    -1,  1134,  1423,  1135,    -1,  1134,
-    1138,  1135,  1136,    -1,    -1,    -1,    -1,    19,  1437,    -1,
-      19,  1434,    -1,  1437,    -1,  1434,    -1,    -1,   630,   631,
-      -1,  1138,  1142,  1138,    -1,  1138,   617,  1138,    -1,  1138,
-    1143,  1138,    -1,   352,  1138,    -1,  1139,   243,   562,    -1,
-    1139,   243,  1144,   562,    -1,  1139,   243,   174,    -1,  1139,
-     243,  1144,   174,    -1,  1139,   243,   578,    -1,  1139,   243,
-    1144,   578,    -1,  1139,    -1,  1139,   243,   357,    -1,  1139,
-     243,  1144,   357,    -1,  1139,   156,  1140,    -1,  1139,  1146,
-    1140,    -1,  1139,  1146,  1147,   630,  1538,   631,    -1,  1140,
-      -1,  1141,   238,   630,  1538,   631,    -1,  1141,  1144,   238,
-     630,  1538,   631,    -1,  1141,   238,   630,  1138,   631,    -1,
-    1141,   238,   630,  1138,   632,  1177,   631,    -1,  1141,  1144,
-     238,   630,  1138,   631,    -1,  1141,  1144,   238,   630,  1138,
-     632,  1177,   631,    -1,  1141,    31,  1141,    17,  1140,    -1,
-    1141,  1144,    31,  1141,    17,  1140,    -1,  1141,   492,   262,
-    1141,    -1,  1141,   262,  1148,  1239,    -1,  1141,  1144,   262,
-    1148,  1239,    -1,  1141,   425,  1141,    -1,  1141,  1144,   425,
-    1141,    -1,  1141,    -1,  1141,   621,  1141,    -1,  1141,   622,
-    1141,    -1,  1141,   479,  1141,    -1,  1141,   480,  1141,    -1,
-    1141,   624,  1141,    -1,  1141,   623,  1141,    -1,  1141,   624,
-     234,  1138,  1229,    -1,  1141,   623,   234,  1138,  1229,    -1,
-    1141,   625,  1141,    -1,  1141,   626,  1141,    -1,  1141,   627,
-    1141,    -1,  1141,   136,  1141,    -1,  1141,   331,  1141,    -1,
-    1141,   628,  1141,    -1,  1148,    -1,   375,    -1,   372,    -1,
-      17,    -1,    16,    -1,   352,    -1,   351,    -1,   633,    -1,
-     351,    -1,   155,    -1,   193,    -1,   204,    -1,   254,    -1,
-     281,    -1,   345,    -1,    12,    -1,    18,    -1,  1425,    -1,
-    1149,    -1,  1150,    -1,  1153,    -1,  1151,    -1,  1148,    68,
-    1439,    -1,  1419,    -1,  1417,    -1,  1165,    -1,  1161,    -1,
-    1148,   374,  1148,    -1,   624,  1148,    -1,   623,  1148,    -1,
-     629,  1148,    -1,  1145,  1148,    -1,   630,  1538,   631,    -1,
-     630,  1138,   631,    -1,   630,  1138,   632,  1177,   631,    -1,
-     459,   630,  1138,   632,  1177,   631,    -1,   166,   630,  1538,
-     631,    -1,   634,  1437,  1138,   635,    -1,   305,  1178,     9,
-     630,  1141,  1155,   631,    -1,    33,  1148,    -1,    53,   630,
-    1138,    19,  1175,   631,    -1,    52,  1180,  1182,  1181,   149,
-      -1,    91,   630,  1138,   632,  1175,   631,    -1,    91,   630,
-    1138,   588,   958,   631,    -1,   120,   630,  1425,   631,    -1,
-     592,   630,  1426,   631,    -1,   234,  1138,  1229,   624,  1138,
-      -1,    59,   630,  1177,   631,    -1,    59,   630,  1177,   588,
-     958,   631,    -1,    99,  1137,    -1,   110,   630,  1138,   631,
-      -1,   115,   630,  1138,   631,    -1,   216,   630,  1138,   631,
-      -1,   231,   630,  1138,   632,  1138,   632,  1138,   632,  1138,
-     631,    -1,   234,   630,  1138,   632,  1138,   631,    -1,   234,
-     630,  1138,   632,  1138,   632,  1177,   631,    -1,   258,   630,
-    1138,   632,  1138,   631,    -1,   325,   630,  1138,   631,    -1,
-     332,   630,  1138,   631,    -1,   453,   630,  1138,   632,  1138,
-     631,    -1,   466,   630,  1138,   631,    -1,   552,   630,  1138,
-     631,    -1,   549,   630,  1138,   631,    -1,   549,   630,  1138,
-     632,  1138,   631,    -1,   561,   630,  1138,   631,    -1,   561,
-     630,   255,  1138,   189,  1138,   631,    -1,   561,   630,   557,
-    1138,   189,  1138,   631,    -1,   561,   630,    44,  1138,   189,
-    1138,   631,    -1,   561,   630,   255,   189,  1138,   631,    -1,
-     561,   630,   557,   189,  1138,   631,    -1,   561,   630,    44,
-     189,  1138,   631,    -1,   561,   630,  1138,   189,  1138,   631,
-      -1,   585,   630,   631,    -1,   619,   630,  1138,   631,    -1,
-       7,   630,  1138,   632,  1138,   631,    -1,     7,   630,  1138,
-     632,   234,  1138,  1229,   631,    -1,    97,  1137,    -1,   102,
-     944,    -1,   108,   630,  1138,   632,   234,  1138,  1229,   631,
-      -1,   109,   630,  1138,   632,   234,  1138,  1229,   631,    -1,
-     173,   630,  1229,   189,  1138,   631,    -1,   197,   630,  1231,
-     632,  1138,   631,    -1,   955,    -1,   396,   630,  1141,   238,
-    1138,   631,    -1,   525,   630,  1138,   632,  1138,   631,    -1,
-     525,   630,  1138,   632,   234,  1138,  1229,   631,    -1,   529,
-     630,  1138,   632,  1138,   632,  1138,   631,    -1,   529,   630,
-    1138,   632,  1138,   631,    -1,   529,   630,  1138,   189,  1138,
-     186,  1138,   631,    -1,   529,   630,  1138,   189,  1138,   631,
-      -1,   535,   944,    -1,   550,   630,  1230,   632,  1138,   632,
-    1138,   631,    -1,   551,   630,  1230,   632,  1138,   632,  1138,
-     631,    -1,   589,  1137,    -1,   591,   944,    -1,   590,   944,
-      -1,    21,   630,  1138,   631,    -1,    58,   630,  1138,   631,
-      -1,    66,   630,  1177,   631,    -1,    69,   630,  1138,   631,
-      -1,   103,   630,   631,    -1,   220,   630,  1138,   632,  1138,
-     632,  1138,   631,    -1,   187,   630,  1138,   632,  1138,   631,
-      -1,   187,   630,  1138,   632,  1138,   632,  1138,   631,    -1,
-     321,   630,  1138,   631,    -1,   331,   630,  1138,   632,  1138,
-     631,    -1,   363,   630,  1138,   631,    -1,   388,   630,  1138,
-     631,    -1,   410,   630,  1138,   631,    -1,   438,   630,  1138,
-     632,  1138,   631,    -1,   439,   630,  1138,   632,  1138,   632,
-    1138,   631,    -1,   451,   630,  1138,   631,    -1,   460,   630,
-     631,    -1,   563,   630,  1138,   632,  1138,   631,    -1,   603,
-     630,  1138,   631,    -1,   603,   630,  1138,   632,  1138,   631,
-      -1,   604,   630,  1138,   981,   631,    -1,   604,   630,  1138,
-      19,    59,   971,   981,   631,    -1,   604,   630,  1138,    19,
-      33,   971,   631,    -1,   604,   630,  1138,   632,  1257,   632,
-    1257,   632,  1257,   631,    -1,  1152,    -1,    88,   630,  1138,
-     632,  1138,   631,    -1,   195,   630,  1177,   631,    -1,   266,
-     630,  1177,   631,    -1,   333,   630,  1177,   631,    -1,   334,
-     630,  1177,   631,    -1,   335,   630,  1177,   631,    -1,   393,
-     630,  1138,   632,  1138,   631,    -1,   394,   630,  1177,   631,
-      -1,    -1,  1432,   630,  1154,  1158,   631,    -1,  1437,   638,
-    1437,   630,  1176,   631,    -1,  1156,  1157,    -1,   238,    42,
-     328,    -1,    -1,   238,   341,   252,   328,    -1,    -1,   608,
-     411,   168,    -1,    -1,  1159,    -1,  1160,    -1,  1159,   632,
-    1160,    -1,  1134,  1138,  1135,  1136,    -1,    27,   630,  1173,
-     631,    -1,    27,   630,   135,  1173,   631,    -1,    36,   630,
-    1173,   631,    -1,    37,   630,  1173,   631,    -1,    39,   630,
-    1173,   631,    -1,    92,   630,  1234,   625,   631,    -1,    92,
-     630,  1173,   631,    -1,    -1,    -1,    92,   630,   135,  1162,
-    1177,  1163,   631,    -1,   327,   630,  1173,   631,    -1,   327,
-     630,   135,  1173,   631,    -1,   310,   630,  1173,   631,    -1,
-     310,   630,   135,  1173,   631,    -1,   519,   630,  1173,   631,
-      -1,   597,   630,  1173,   631,    -1,   518,   630,  1173,   631,
-      -1,   599,   630,  1173,   631,    -1,   530,   630,  1173,   631,
-      -1,   530,   630,   135,  1173,   631,    -1,    -1,   203,   630,
-    1168,  1164,  1177,  1170,  1169,   631,    -1,    -1,   637,  1166,
-    1167,    -1,  1439,   477,  1138,    -1,  1439,    -1,   637,  1459,
-    1439,  1014,    -1,    -1,   135,    -1,    -1,   470,  1416,    -1,
-      -1,    -1,   373,    46,  1171,  1172,    -1,  1172,   632,  1424,
-    1250,    -1,  1424,  1250,    -1,    -1,  1234,  1174,  1138,    -1,
-      33,   949,    -1,    59,   949,   969,    -1,   343,   949,    -1,
-     484,    -1,   484,   236,    -1,   580,    -1,   580,   236,    -1,
-     110,    -1,   552,   943,    -1,   107,   943,    -1,   118,   941,
-      -1,    -1,  1177,    -1,  1138,    -1,  1177,   632,  1138,    -1,
-    1179,    -1,   630,  1179,   631,    -1,  1425,    -1,  1179,   632,
-    1425,    -1,    -1,  1138,    -1,    -1,   145,  1138,    -1,   605,
-    1138,   548,  1138,    -1,  1182,   605,  1138,   548,  1138,    -1,
-    1198,    -1,  1187,    -1,  1186,    -1,  1183,    -1,   634,  1437,
-    1183,   635,    -1,  1185,    -1,  1186,   632,  1185,    -1,  1183,
-    1195,  1183,    -1,  1183,   522,  1198,    -1,    -1,  1183,  1195,
-    1183,   364,  1188,  1138,    -1,    -1,  1183,   522,  1198,   364,
-    1189,  1138,    -1,    -1,  1183,  1195,  1183,   588,  1190,   630,
-    1228,   631,    -1,  1183,   341,   247,  1198,    -1,    -1,  1183,
-     258,  1214,   247,  1183,   364,  1191,  1138,    -1,    -1,  1183,
-     258,  1214,   247,  1198,  1192,   588,   630,  1228,   631,    -1,
-    1183,   341,   258,  1214,   247,  1198,    -1,    -1,  1183,   453,
-    1214,   247,  1183,   364,  1193,  1138,    -1,    -1,  1183,   453,
-    1214,   247,  1198,  1194,   588,   630,  1228,   631,    -1,  1183,
-     341,   453,  1214,   247,  1198,    -1,   247,    -1,   228,   247,
-      -1,    95,   247,    -1,    -1,  1197,    -1,   385,   630,  1228,
-     631,   850,    -1,    -1,  1199,  1429,  1196,  1233,  1223,    -1,
-    1213,  1212,  1209,    -1,   630,  1212,  1200,   631,  1233,    -1,
-    1207,  1530,    -1,    -1,    -1,  1200,   576,  1534,  1201,  1535,
-    1202,  1530,    -1,  1204,    -1,    -1,    -1,  1205,  1541,  1132,
-    1206,   918,  1131,    -1,    -1,  1212,  1208,  1186,    -1,    -1,
-      -1,  1210,  1128,  1132,  1211,   918,    -1,    -1,   468,    -1,
-      -1,   376,    -1,    -1,   186,   247,    -1,   186,   373,    46,
-      -1,   186,   202,    46,    -1,   184,    -1,   221,    -1,    -1,
-    1216,   991,  1215,  1218,   630,  1227,   631,    -1,    -1,   587,
-     991,  1215,  1219,   630,  1225,   631,    -1,  1217,    -1,  1220,
-    1217,    -1,    -1,    -1,  1222,  1220,    -1,    -1,  1224,  1221,
-      -1,    -1,  1227,    -1,  1437,    -1,   401,    -1,  1226,    -1,
-    1227,   632,  1226,    -1,  1437,    -1,  1228,   632,  1437,    -1,
-    1230,    -1,   111,    -1,   112,    -1,   113,    -1,   114,    -1,
-     213,    -1,   214,    -1,   215,    -1,   323,    -1,   324,    -1,
-     465,    -1,   618,    -1,   115,    -1,   603,    -1,   216,    -1,
-     325,    -1,   332,    -1,   410,    -1,   466,    -1,   321,    -1,
-     619,    -1,   110,    -1,   552,    -1,   549,    -1,   107,    -1,
-      -1,    19,    -1,   155,    -1,    -1,  1232,  1437,    -1,    -1,
-      12,    -1,    -1,    -1,   606,  1236,  1138,    -1,    -1,    -1,
-     207,  1238,  1138,    -1,   160,  1148,    -1,    -1,    -1,   202,
-      46,  1241,  1242,    -1,  1241,   632,  1424,  1250,    -1,  1424,
-    1250,    -1,    -1,   609,    -1,   610,    -1,   373,    46,  1244,
-      -1,  1244,   632,  1245,    -1,  1245,    -1,  1426,  1250,    -1,
-      -1,  1247,    -1,    -1,   373,    46,  1248,  1249,    -1,  1249,
-     632,  1424,  1250,    -1,  1424,  1250,    -1,    -1,    20,    -1,
-     126,    -1,    -1,  1253,    -1,    -1,  1253,    -1,   263,  1254,
-      -1,  1255,    -1,  1255,   632,  1255,    -1,  1255,   362,  1255,
-      -1,  1437,    -1,  1417,    -1,   567,    -1,   277,    -1,   358,
-      -1,    -1,   263,  1255,    -1,   358,    -1,   209,    -1,   277,
-      -1,   567,    -1,   117,    -1,   181,    -1,   358,    -1,   209,
-      -1,   277,    -1,   567,    -1,  1261,    -1,   358,    -1,   567,
-      -1,   277,    -1,   117,    -1,   181,    -1,   358,    -1,   567,
-      -1,   277,    -1,  1261,    -1,  1262,    -1,   117,    -1,   181,
-      -1,    -1,    -1,   403,    14,  1264,   630,  1265,   631,    -1,
-      -1,  1266,    -1,  1266,   632,  1266,    -1,   358,    -1,    -1,
-    1268,  1269,    -1,  1269,   632,  1270,    -1,  1270,    -1,   637,
-    1439,    -1,  1439,    -1,    -1,   235,  1272,  1273,    -1,    -1,
-      -1,   377,  1436,  1274,   960,  1275,  1400,  1403,    -1,   141,
-    1436,    -1,  1267,    -1,    -1,   138,  1277,  1177,    -1,    -1,
-     139,  1289,  1473,  1288,  1279,  1283,  1055,    -1,    -1,    -1,
-     139,   225,  1437,   364,  1429,  1280,  1281,  1050,    -1,   139,
-     103,  1288,  1437,    -1,   139,   192,  1288,  1437,   638,  1437,
-      -1,   139,   192,  1288,  1437,    -1,   139,   403,  1288,   691,
-      -1,   139,   585,   690,  1505,    -1,    -1,   139,   600,  1288,
-    1282,  1283,  1055,    -1,   139,   162,  1288,   691,    -1,   139,
-     560,  1288,   691,    -1,   139,   537,   826,  1290,    -1,   139,
-     273,   202,   827,  1290,    -1,   139,   474,  1288,  1439,    -1,
-    1284,    -1,  1283,   632,  1284,    -1,  1429,    -1,  1429,  1196,
-      -1,  1287,    -1,  1286,   632,  1287,    -1,  1430,    -1,    -1,
-     220,   166,    -1,    -1,   542,    -1,    -1,  1291,    -1,  1292,
-      -1,  1291,  1292,    -1,  1290,   632,  1292,    -1,   837,    -1,
-     838,    -1,    -1,    -1,   231,  1294,  1299,  1054,  1301,  1295,
-    1303,  1319,    -1,    -1,    -1,   439,  1297,  1300,  1301,  1298,
-    1303,    -1,    -1,   280,    -1,   123,    -1,   210,    -1,  1328,
-      -1,   123,    -1,   235,  1302,    -1,  1302,    -1,  1285,    -1,
-    1306,    -1,   630,   631,  1306,    -1,   630,  1305,   631,  1306,
-      -1,    -1,   476,  1304,  1310,    -1,  1305,   632,  1422,    -1,
-    1422,    -1,   592,  1309,    -1,   593,  1309,    -1,    -1,   896,
-    1307,  1526,    -1,    -1,   630,   896,   631,  1308,  1529,    -1,
-    1309,   632,  1314,    -1,  1314,    -1,  1310,   632,  1311,    -1,
-    1311,    -1,  1426,  1312,  1318,    -1,   155,    -1,   477,    -1,
-      -1,  1312,    -1,    -1,   630,  1315,  1316,   631,    -1,    -1,
-    1317,    -1,  1317,   632,  1318,    -1,  1318,    -1,  1138,    -1,
-     120,    -1,    -1,    -1,   364,   142,  1320,   250,   582,  1326,
-      -1,    -1,    -1,   582,  1322,  1328,  1054,  1184,   476,  1324,
-    1323,  1235,  1246,  1256,    -1,  1324,   632,  1325,    -1,  1325,
-      -1,  1426,  1312,  1318,    -1,  1326,   632,  1327,    -1,  1327,
-      -1,  1426,  1312,  1318,    -1,    -1,   280,    -1,    -1,   125,
-    1330,  1338,  1331,    -1,    -1,   189,  1429,  1196,  1332,  1235,
-    1246,  1256,    -1,    -1,  1335,  1333,   189,  1184,  1235,    -1,
-      -1,   189,  1286,  1334,   588,  1184,  1235,    -1,  1336,    -1,
-    1335,   632,  1336,    -1,  1437,  1337,    -1,  1437,   638,  1437,
-    1337,    -1,    -1,   638,   625,    -1,    -1,  1339,  1338,    -1,
-     412,    -1,   280,    -1,   221,    -1,    -1,   563,  1342,  1341,
-    1284,    -1,    -1,   539,    -1,    -1,  1344,    -1,  1345,    -1,
-    1344,   632,  1345,    -1,    93,    -1,   318,    -1,    41,   241,
-      -1,    89,   534,    -1,   381,   176,    -1,   242,    -1,   533,
-      -1,   493,    -1,    12,    -1,    -1,   186,   411,   358,    -1,
-      -1,   481,  1348,  1349,    -1,   104,  1360,    -1,  1356,   536,
-    1355,  1360,    -1,  1356,   559,  1355,  1360,    -1,   161,  1355,
-    1360,    -1,   539,   517,  1355,  1360,    -1,   367,   536,  1355,
-    1360,    -1,   392,    -1,   153,   915,  1352,    -1,   153,    12,
-    1352,    -1,  1356,    70,  1357,  1429,  1355,  1360,    -1,  1353,
-     274,    -1,   486,   212,    -1,    -1,    34,   161,  1358,  1359,
-    1350,  1251,    -1,    -1,   427,   161,  1358,  1359,  1351,  1251,
-      -1,   993,  1357,  1429,  1355,  1235,    -1,  1354,   152,    -1,
-     402,    -1,    92,   630,   625,   631,   602,    -1,    92,   630,
-     625,   631,   158,    -1,   602,  1251,    -1,   158,  1251,    -1,
-     407,    -1,   406,  1343,  1346,  1251,    -1,  1458,   517,  1360,
-      -1,  1356,   405,    -1,  1458,   596,  1360,    -1,   957,  1360,
-      -1,    69,  1360,    -1,   201,    -1,   201,   186,  1440,    -1,
-      94,   103,   906,  1437,    -1,    94,   539,  1429,    -1,    94,
-     600,  1429,    -1,   302,   517,    -1,   486,   517,    -1,    94,
-     403,   691,    -1,    94,   192,   691,    -1,    94,   560,   691,
-      -1,   403,   517,  1360,    -1,   192,   517,  1360,    -1,   403,
-      67,   691,    -1,   192,    67,   691,    -1,    94,   162,   691,
-      -1,   517,    -1,   336,    -1,   274,    -1,   302,    -1,    33,
-      -1,    -1,   521,    -1,    -1,  1357,  1437,    -1,    -1,   190,
-      -1,   189,    -1,   238,    -1,    -1,   238,  1434,    -1,    -1,
-     189,  1259,    -1,    -1,   262,  1434,    -1,   606,  1138,    -1,
-      -1,  1365,  1429,  1362,  1367,    -1,    -1,  1365,  1366,  1363,
-    1364,    -1,  1117,    -1,  1293,    -1,  1296,    -1,  1321,    -1,
-    1329,    -1,   126,    -1,   127,    -1,    -1,   171,    -1,   386,
-      -1,   187,   155,  1439,    -1,    -1,  1416,    -1,  1437,    -1,
-      -1,   183,  1092,  1369,  1370,    -1,    -1,    -1,  1473,  1371,
-    1377,  1372,  1373,    -1,  1375,    -1,    -1,   608,   416,   272,
-      -1,    -1,   186,  1374,   170,    -1,  1375,   632,  1376,    -1,
-    1376,    -1,   157,   274,    -1,   153,   274,    -1,   194,   274,
-      -1,   487,   274,    -1,    33,   274,    -1,   426,   274,    -1,
-     411,    48,    -1,   212,    -1,   402,    -1,   274,    -1,   517,
-      -1,   128,    -1,   444,    -1,    -1,  1283,    -1,    -1,   442,
-    1379,  1380,    -1,  1380,   632,  1381,    -1,  1381,    -1,    -1,
-     486,  1382,  1383,    -1,   302,    -1,   411,    48,    -1,    -1,
-      12,    -1,    -1,   409,  1385,  1386,    -1,  1353,   274,  1387,
-      -1,   556,  1434,    -1,    29,  1138,    -1,   251,  1389,  1138,
-      -1,    -1,    82,    -1,   411,    -1,   587,  1437,    -1,    -1,
-      -1,    -1,    -1,   268,  1396,  1392,  1398,  1397,   226,  1436,
-    1393,  1399,   235,   539,  1429,  1196,  1394,   960,  1395,  1406,
-    1400,  1403,  1407,  1409,  1412,    -1,   106,    -1,   616,    -1,
-      -1,   269,    -1,    -1,    80,    -1,   280,    -1,    -1,   439,
-      -1,   221,    -1,    -1,    70,  1401,    -1,  1401,  1402,    -1,
-    1402,    -1,   544,    46,  1416,    -1,   371,   148,    46,  1416,
-      -1,   148,    46,  1416,    -1,   159,    46,  1416,    -1,    -1,
-     265,  1404,    -1,  1404,  1405,    -1,  1405,    -1,   544,    46,
-    1416,    -1,   511,    46,  1416,    -1,    -1,   457,   218,    46,
-    1416,    -1,    -1,   221,   358,  1408,    -1,   265,    -1,   457,
-      -1,    -1,   630,  1410,   631,    -1,   630,   631,    -1,  1410,
-     632,  1411,    -1,  1411,    -1,  1426,    -1,   637,  1439,    -1,
-      -1,   476,  1413,    -1,  1413,   632,  1414,    -1,  1414,    -1,
-    1426,  1312,  1134,  1318,  1135,    -1,   545,    -1,   342,    -1,
-     570,   545,    -1,  1415,  1435,    -1,  1435,    -1,   209,    -1,
-      35,    -1,   382,    -1,  1419,    -1,   624,  1420,    -1,   623,
-    1420,    -1,  1415,    -1,  1420,    -1,  1421,    -1,   357,    -1,
-     174,    -1,   562,    -1,   209,    -1,    35,    -1,   570,   209,
-      -1,   570,    35,    -1,   358,    -1,   277,    -1,   567,    -1,
-     117,    -1,   181,    -1,   110,   545,    -1,   552,   545,    -1,
-     549,   545,    -1,  1426,    -1,  1423,    -1,  1437,   638,   625,
-      -1,  1437,   638,  1437,   638,   625,    -1,  1138,    -1,  1437,
-      -1,  1427,    -1,  1437,    -1,  1427,    -1,  1437,   638,  1437,
-      -1,   638,  1437,   638,  1437,    -1,  1437,   638,  1437,   638,
-    1437,    -1,  1437,    -1,  1437,   638,  1437,   638,  1437,    -1,
-    1437,   638,  1437,    -1,   638,  1437,    -1,  1437,    -1,  1437,
-     638,  1437,    -1,   638,  1437,    -1,  1437,  1337,    -1,  1437,
-     638,  1437,  1337,    -1,  1437,    -1,   217,    -1,   219,    -1,
-    1434,    -1,   545,    -1,   545,    -1,   545,    -1,  1432,    -1,
-    1441,    -1,  1432,    -1,  1442,    -1,  1437,    -1,  1434,    -1,
-     261,    -1,  1439,    -1,  1439,   637,  1439,    -1,    99,  1137,
-      -1,  1442,    -1,    21,    -1,    28,    -1,    30,    -1,    47,
-      -1,    48,    -1,    58,    -1,    60,    -1,    65,    -1,    74,
-      -1,    76,    -1,    88,    -1,   116,    -1,   138,    -1,   149,
-      -1,   165,    -1,   183,    -1,   187,    -1,   205,    -1,   208,
-      -1,   211,    -1,   233,    -1,   252,    -1,   354,    -1,   367,
-      -1,   369,    -1,   379,    -1,   383,    -1,   395,    -1,   398,
-      -1,   433,    -1,   436,    -1,   442,    -1,   445,    -1,   454,
-      -1,   462,    -1,   467,    -1,   474,    -1,   484,    -1,   490,
-      -1,   486,    -1,   491,    -1,   513,    -1,   520,    -1,   563,
-      -1,   574,    -1,   575,    -1,   612,    -1,   615,    -1,   583,
-      -1,     5,    -1,     7,    -1,     8,    -1,     9,    -1,    10,
-      -1,    11,    -1,    14,    -1,    18,    -1,    23,    -1,    25,
-      -1,    24,    -1,    26,    -1,    27,    -1,    34,    -1,    38,
-      -1,    41,    -1,    43,    -1,    42,    -1,    45,    -1,    51,
-      -1,    54,    -1,    55,    -1,    57,    -1,    62,    -1,    64,
-      -1,    63,    -1,    66,    -1,    67,    -1,    69,    -1,    73,
-      -1,    72,    -1,    70,    -1,    75,    -1,    77,    -1,    78,
-      -1,    79,    -1,    80,    -1,    82,    -1,    83,    -1,    85,
-      -1,    87,    -1,    86,    -1,    89,    -1,    93,    -1,    96,
-      -1,    98,    -1,   101,    -1,   106,    -1,   105,    -1,   107,
-      -1,   110,    -1,   115,    -1,   121,    -1,   122,    -1,   124,
-      -1,   128,    -1,   130,    -1,   131,    -1,   132,    -1,   133,
-      -1,   134,    -1,   141,    -1,   142,    -1,   143,    -1,   150,
-      -1,   154,    -1,   153,    -1,   152,    -1,   157,    -1,   158,
-      -1,   160,    -1,   162,    -1,   161,    -1,   163,    -1,   164,
-      -1,   168,    -1,   169,    -1,   170,    -1,   171,    -1,   172,
-      -1,   176,    -1,   175,    -1,   188,    -1,   147,    -1,   190,
-      -1,   178,    -1,   179,    -1,   180,    -1,   194,    -1,   196,
-      -1,   195,    -1,   197,    -1,   201,    -1,   199,    -1,   206,
-      -1,   212,    -1,   216,    -1,   218,    -1,   222,    -1,   237,
-      -1,   223,    -1,   224,    -1,   227,    -1,   241,    -1,   242,
-      -1,   244,    -1,   245,    -1,   232,    -1,   249,    -1,   253,
-      -1,   256,    -1,   259,    -1,   260,    -1,   266,    -1,   267,
-      -1,   269,    -1,   271,    -1,   273,    -1,   274,    -1,   308,
-      -1,   302,    -1,   304,    -1,   286,    -1,   290,    -1,   287,
-      -1,   288,    -1,   303,    -1,   289,    -1,   292,    -1,   284,
-      -1,   291,    -1,   285,    -1,   300,    -1,   294,    -1,   293,
-      -1,   295,    -1,   296,    -1,   297,    -1,   298,    -1,   299,
-      -1,   282,    -1,   306,    -1,   307,    -1,   309,    -1,   311,
-      -1,   312,    -1,   317,    -1,   318,    -1,   319,    -1,   320,
-      -1,   321,    -1,   322,    -1,   325,    -1,   326,    -1,   330,
-      -1,   328,    -1,   332,    -1,   333,    -1,   334,    -1,   335,
-      -1,   336,    -1,   337,    -1,   339,    -1,   338,    -1,   340,
-      -1,   343,    -1,   344,    -1,   348,    -1,   347,    -1,   355,
-      -1,   349,    -1,   350,    -1,   359,    -1,   361,    -1,   362,
-      -1,   363,    -1,   365,    -1,   366,    -1,   380,    -1,   381,
-      -1,   384,    -1,   387,    -1,   386,    -1,   388,    -1,   389,
-      -1,   390,    -1,   391,    -1,   392,    -1,   393,    -1,   394,
-      -1,   399,    -1,   400,    -1,   402,    -1,   404,    -1,   405,
-      -1,   406,    -1,   407,    -1,   408,    -1,   410,    -1,   411,
-      -1,   412,    -1,   415,    -1,   419,    -1,   420,    -1,   422,
-      -1,   421,    -1,   423,    -1,   426,    -1,   427,    -1,   428,
-      -1,   429,    -1,   430,    -1,   432,    -1,   435,    -1,   437,
-      -1,   440,    -1,   444,    -1,   447,    -1,   448,    -1,   449,
-      -1,   451,    -1,   455,    -1,   456,    -1,   457,    -1,   460,
-      -1,   458,    -1,   459,    -1,   461,    -1,   463,    -1,   464,
-      -1,   466,    -1,   472,    -1,   471,    -1,   473,    -1,   485,
-      -1,   478,    -1,   482,    -1,   487,    -1,   489,    -1,   492,
-      -1,   493,    -1,   499,    -1,   500,    -1,   501,    -1,   504,
-      -1,   503,    -1,   506,    -1,   509,    -1,   512,    -1,   514,
-      -1,   515,    -1,   516,    -1,   517,    -1,   521,    -1,   523,
-      -1,   524,    -1,   525,    -1,   526,    -1,   528,    -1,   527,
-      -1,   531,    -1,   532,    -1,   533,    -1,   534,    -1,   541,
-      -1,   536,    -1,   540,    -1,   537,    -1,   542,    -1,   543,
-      -1,   546,    -1,   547,    -1,   558,    -1,   559,    -1,   549,
-      -1,   550,    -1,   551,    -1,   552,    -1,   564,    -1,   565,
-      -1,   566,    -1,   192,    -1,   568,    -1,   569,    -1,   572,
-      -1,   571,    -1,   578,    -1,   581,    -1,   585,    -1,   586,
-      -1,   596,    -1,   600,    -1,   593,    -1,   602,    -1,   601,
-      -1,   603,    -1,   611,    -1,   604,    -1,   614,    -1,   616,
-      -1,   619,    -1,    -1,   476,  1444,  1445,    -1,    -1,  1461,
-    1446,  1451,    -1,    -1,   558,  1447,  1464,    -1,    -1,  1457,
-    1448,  1449,    -1,    -1,  1460,  1450,  1451,    -1,   558,  1464,
-      -1,    -1,   632,  1452,    -1,    -1,  1453,  1455,    -1,    -1,
-    1452,   632,  1454,  1455,    -1,    -1,  1457,  1456,  1460,    -1,
-    1461,    -1,   199,    -1,   269,    -1,   473,    -1,    -1,   199,
-      -1,   269,    -1,   473,    -1,    -1,   199,   638,    -1,   269,
-     638,    -1,   473,   638,    -1,  1463,  1312,  1470,    -1,    -1,
-    1463,  1312,  1462,  1470,    -1,   637,  1439,  1312,  1138,    -1,
-     637,   637,  1459,  1463,  1312,  1470,    -1,   957,   962,    -1,
-     338,  1312,  1138,    -1,   338,   959,   964,    -1,   388,  1312,
-    1469,    -1,   388,   186,  1440,  1312,  1469,    -1,  1437,    -1,
-    1437,   638,  1437,    -1,   120,   638,  1437,    -1,  1465,    -1,
-    1466,    -1,  1465,   632,  1466,    -1,  1466,   632,  1465,    -1,
-    1467,    -1,   244,   260,  1468,    -1,   416,   366,    -1,   416,
-     613,    -1,   416,   568,    -1,   416,    75,    -1,   437,   416,
-      -1,   471,    -1,   545,    -1,   388,   630,   545,   631,    -1,
-     363,   630,   545,   631,    -1,  1138,    -1,   120,    -1,   364,
-      -1,    12,    -1,    33,    -1,    -1,   272,  1473,  1472,  1474,
-      -1,   539,    -1,   536,    -1,  1475,    -1,  1474,   632,  1475,
-      -1,  1429,  1233,  1476,    -1,   416,    -1,   613,    -1,   280,
-     613,    -1,   416,   269,    -1,    -1,   579,  1478,  1473,    -1,
-     205,  1429,   367,  1233,    -1,   205,  1431,    65,    -1,    -1,
-     205,  1431,   416,  1480,  1481,  1235,  1252,    -1,  1482,    -1,
-    1437,  1483,    -1,   179,    -1,   348,    -1,   179,    -1,   348,
-      -1,   400,    -1,   253,    -1,    -1,  1485,  1484,   630,  1317,
-     631,    -1,   155,    -1,   193,    -1,   254,    -1,   204,    -1,
-     281,    -1,    -1,   452,   690,  1487,  1488,    -1,  1493,   364,
-    1492,  1504,   189,  1506,    -1,  1493,   364,   192,  1504,   189,
-    1506,    -1,  1493,   364,   403,  1504,   189,  1506,    -1,    12,
-    1494,   632,   200,   370,   189,  1506,    -1,   408,   364,  1440,
-     189,  1506,    -1,    -1,   200,   690,  1490,  1491,    -1,  1493,
-     364,  1492,  1504,   556,  1506,  1511,  1512,    -1,  1493,   364,
-     192,  1504,   556,  1506,  1511,  1512,    -1,  1493,   364,   403,
-    1504,   556,  1506,  1511,  1512,    -1,   408,   364,  1440,   556,
-    1506,  1513,    -1,    -1,   539,    -1,  1495,    -1,    12,  1494,
-      -1,    -1,   402,    -1,  1496,    -1,  1495,   632,  1496,    -1,
-      -1,   468,  1497,  1508,    -1,    -1,   231,  1498,  1508,    -1,
-      -1,   582,  1499,  1508,    -1,    -1,   424,  1500,  1508,    -1,
-     125,    -1,   584,    -1,   225,    -1,    13,    -1,    94,    -1,
-     139,    -1,   165,    -1,   432,    -1,   482,    -1,   404,    -1,
-     178,    -1,   200,   370,    -1,   481,   104,    -1,   531,    -1,
-      94,   542,   536,    -1,   272,   536,    -1,   440,   486,    -1,
-     440,    64,    -1,    94,   600,    -1,   481,   600,    -1,    94,
-     456,    -1,    13,   456,    -1,    94,   585,    -1,   162,    -1,
-     560,    -1,    94,   537,    -1,    -1,    17,    -1,  1503,  1501,
-    1502,    -1,  1503,    -1,   526,   545,    -1,   245,   545,    -1,
-      62,   545,    -1,   625,    -1,  1437,   638,   625,    -1,   625,
-     638,   625,    -1,  1429,    -1,  1440,    -1,  1505,   632,  1440,
-      -1,  1507,    -1,  1506,   632,  1507,    -1,  1440,   218,    46,
-     545,    -1,  1440,   218,    46,   388,   545,    -1,  1440,   218,
-     608,  1439,    -1,  1440,   218,   608,  1439,    19,  1434,    -1,
-    1440,    -1,    -1,   630,  1509,   631,    -1,  1509,   632,  1510,
-      -1,  1510,    -1,  1437,    -1,    -1,   441,  1502,    -1,   441,
-     510,    -1,   441,   614,    -1,   441,   350,    -1,    -1,   608,
-    1514,    -1,    -1,   608,   200,   370,    -1,  1514,  1515,    -1,
-    1515,    -1,   200,   370,    -1,   307,  1257,    -1,   311,  1257,
-      -1,   306,  1257,    -1,   312,  1257,    -1,    -1,    30,  1517,
-    1518,    -1,    -1,   611,    -1,    -1,    17,   354,    55,    -1,
-      17,    55,    -1,    -1,   431,    -1,   354,   431,    -1,    -1,
-     462,    -1,    76,  1518,  1519,  1520,    -1,   454,  1518,  1519,
-    1520,    -1,   454,  1518,   556,  1521,  1437,    -1,   462,  1437,
-      -1,   431,   462,  1437,    -1,    -1,  1527,    -1,    -1,   576,
-    1534,  1528,  1118,    -1,    -1,  1527,    -1,  1531,    -1,    -1,
-    1531,    -1,    -1,  1532,  1533,    -1,  1247,  1251,    -1,  1253,
-      -1,    -1,   135,    -1,    12,    -1,   468,  1203,    -1,   630,
-    1120,   631,    -1,  1535,  1530,    -1,    -1,  1536,   576,  1534,
-    1537,  1535,  1530,    -1,  1539,  1536,  1540,    -1,    -1,    -1,
-      -1,  1542,    -1,  1542,  1543,    -1,  1543,    -1,   522,    -1,
-     210,    -1,   135,    -1,   507,    -1,   502,    -1,   503,    -1,
-     505,    -1,    12,    -1,  1549,  1545,    -1,  1548,  1546,    -1,
-    1550,  1547,  1554,    -1,  1554,    -1,  1566,    -1,  1577,    -1,
-    1571,    -1,   677,    -1,  1554,    -1,  1566,    -1,  1577,    -1,
-    1571,    -1,  1570,    -1,   677,    -1,  1548,    -1,  1549,    -1,
-      -1,   122,   155,  1440,    -1,  1551,    -1,  1551,  1552,    -1,
-    1552,    -1,   375,   439,    -1,    11,   155,   569,    -1,    11,
-     155,   319,    -1,    11,   155,   543,    -1,    -1,   508,   467,
-     122,    -1,   508,   467,   237,    -1,    -1,  1553,   600,  1429,
-    1555,  1556,    19,  1558,    -1,    -1,   630,  1557,   631,    -1,
-    1437,    -1,  1557,   632,  1437,    -1,    -1,  1559,  1560,  1565,
-      -1,    -1,  1563,  1561,  1526,    -1,   630,  1562,   631,  1529,
-      -1,  1563,    -1,   630,  1562,   631,    -1,    -1,   468,  1564,
-    1123,    -1,    -1,   608,    61,   370,    -1,   608,    51,    61,
-     370,    -1,   608,   269,    61,   370,    -1,    -1,    -1,    -1,
-     560,  1134,   691,   797,   798,   364,  1134,  1567,  1429,   186,
-    1134,  1568,   144,   459,  1569,   746,    -1,    10,  1134,   192,
-    1437,   449,   919,   491,  1434,    -1,  1134,   192,  1437,   449,
-     919,   491,  1434,    -1,    -1,    -1,    -1,    -1,    -1,  1134,
-     192,   691,   630,  1572,   702,   631,  1573,   449,  1574,   954,
-    1575,   693,  1576,   746,    -1,    -1,    -1,    -1,    -1,   403,
-    1134,   691,  1578,   630,  1579,   706,   631,  1580,   693,  1581,
-     746,    -1,   615,  1584,  1583,  1585,    -1,   615,   149,  1583,
-    1587,    -1,   615,   398,  1583,    -1,   615,    76,  1583,  1586,
-      -1,   615,   454,  1583,    -1,   615,   420,    -1,  1416,    -1,
-    1416,   632,  1416,    -1,  1416,   632,  1416,   632,  1257,    -1,
-      30,    -1,   513,    -1,    -1,   247,    -1,   447,    -1,    -1,
-     365,   389,    -1,    -1,    -1,   532,  1588,  1589,    -1,    -1,
-     186,   322,    -1,   233,   391,  1437,   491,  1434,    -1,   575,
-     391,  1437,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const yytype_uint16 yyrline[] =
-{
-       0,  1968,  1968,  1981,  1980,  2005,  2012,  2014,  2018,  2019,
-    2024,  2025,  2026,  2027,  2028,  2029,  2030,  2031,  2032,  2033,
-    2034,  2035,  2036,  2037,  2038,  2039,  2040,  2041,  2042,  2043,
-    2044,  2045,  2046,  2047,  2048,  2049,  2050,  2051,  2052,  2053,
-    2054,  2055,  2056,  2057,  2058,  2059,  2060,  2061,  2062,  2063,
-    2064,  2065,  2066,  2067,  2068,  2069,  2070,  2071,  2072,  2073,
-    2074,  2075,  2079,  2089,  2090,  2094,  2114,  2121,  2132,  2131,
-    2142,  2144,  2148,  2149,  2153,  2166,  2165,  2185,  2184,  2202,
-    2203,  2207,  2211,  2215,  2219,  2224,  2228,  2232,  2237,  2250,
-    2255,  2259,  2263,  2267,  2271,  2275,  2280,  2284,  2289,  2320,
-    2325,  2332,  2335,  2337,  2338,  2342,  2356,  2360,  2376,  2380,
-    2393,  2392,  2438,  2443,  2437,  2450,  2455,  2448,  2462,  2467,
-    2460,  2473,  2472,  2485,  2484,  2492,  2496,  2500,  2504,  2511,
-    2524,  2525,  2529,  2533,  2537,  2541,  2545,  2550,  2554,  2562,
-    2561,  2593,  2592,  2599,  2606,  2607,  2613,  2619,  2629,  2635,
-    2641,  2643,  2650,  2651,  2655,  2661,  2670,  2671,  2679,  2679,
-    2734,  2735,  2736,  2737,  2738,  2739,  2740,  2741,  2742,  2743,
-    2744,  2745,  2746,  2751,  2765,  2779,  2798,  2799,  2803,  2804,
-    2809,  2811,  2813,  2815,  2817,  2819,  2821,  2827,  2828,  2829,
-    2833,  2837,  2845,  2844,  2857,  2859,  2862,  2864,  2868,  2872,
-    2879,  2881,  2885,  2886,  2891,  2910,  2940,  2942,  2946,  2947,
-    2951,  2980,  2981,  2982,  2983,  2987,  2988,  2992,  2993,  2998,
-    3001,  3028,  3027,  3111,  3128,  3127,  3202,  3201,  3274,  3275,
-    3280,  3282,  3287,  3310,  3321,  3325,  3347,  3348,  3352,  3356,
-    3369,  3375,  3381,  3390,  3405,  3431,  3437,  3438,  3444,  3447,
-    3451,  3459,  3479,  3481,  3499,  3505,  3507,  3509,  3511,  3513,
-    3515,  3517,  3519,  3521,  3523,  3525,  3527,  3532,  3548,  3564,
-    3565,  3570,  3576,  3585,  3591,  3600,  3608,  3637,  3646,  3648,
-    3657,  3662,  3668,  3677,  3685,  3687,  3689,  3691,  3693,  3695,
-    3697,  3699,  3701,  3703,  3705,  3707,  3709,  3714,  3734,  3758,
-    3760,  3759,  3766,  3767,  3768,  3769,  3770,  3771,  3772,  3773,
-    3774,  3775,  3776,  3777,  3778,  3783,  3782,  3793,  3793,  3850,
-    3849,  3906,  3906,  3928,  3987,  4037,  4062,  4061,  4087,  4110,
-    4112,  4113,  4117,  4135,  4156,  4165,  4201,  4156,  4230,  4232,
-    4233,  4237,  4238,  4243,  4254,  4242,  4305,  4304,  4318,  4319,
-    4323,  4324,  4329,  4338,  4328,  4387,  4396,  4386,  4440,  4453,
-    4458,  4457,  4495,  4496,  4501,  4500,  4534,  4534,  4553,  4552,
-    4602,  4619,  4628,  4618,  4682,  4691,  4681,  4731,  4733,  4738,
-    4740,  4742,  4759,  4764,  4770,  4777,  4778,  4786,  4792,  4801,
-    4807,  4813,  4814,  4818,  4818,  4823,  4824,  4825,  4829,  4830,
-    4831,  4834,  4836,  4840,  4841,  4842,  4846,  4847,  4848,  4849,
-    4850,  4851,  4852,  4853,  4856,  4858,  4862,  4863,  4864,  4868,
-    4869,  4870,  4871,  4872,  4875,  4877,  4881,  4882,  4883,  4887,
-    4888,  4889,  4890,  4891,  4892,  4893,  4896,  4898,  4902,  4903,
-    4904,  4908,  4909,  4910,  4915,  4923,  4931,  4939,  4951,  4963,
-    4968,  4973,  4981,  4989,  4997,  5005,  5013,  5021,  5029,  5042,
-    5055,  5069,  5074,  5087,  5088,  5139,  5140,  5143,  5158,  5176,
-    5181,  5179,  5186,  5188,  5187,  5191,  5190,  5196,  5233,  5234,
-    5239,  5238,  5257,  5276,  5275,  5292,  5296,  5304,  5303,  5306,
-    5308,  5310,  5312,  5317,  5318,  5324,  5325,  5342,  5343,  5347,
-    5348,  5352,  5371,  5381,  5392,  5401,  5402,  5418,  5420,  5419,
-    5424,  5422,  5433,  5434,  5438,  5456,  5472,  5473,  5489,  5504,
-    5526,  5527,  5532,  5531,  5555,  5565,  5587,  5586,  5604,  5603,
-    5623,  5645,  5649,  5678,  5690,  5691,  5696,  5707,  5695,  5732,
-    5733,  5737,  5750,  5771,  5784,  5810,  5811,  5816,  5815,  5852,
-    5857,  5858,  5862,  5863,  5867,  5869,  5875,  5877,  5879,  5881,
-    5883,  5885,  5895,  5910,  5894,  5924,  5925,  5929,  5930,  5934,
-    5935,  5939,  5940,  5944,  5945,  5949,  5950,  5954,  5958,  5959,
-    5962,  5964,  5968,  5969,  5973,  5974,  5975,  5979,  5984,  5989,
-    5994,  5999,  6004,  6009,  6014,  6029,  6035,  6050,  6055,  6070,
-    6076,  6094,  6099,  6104,  6109,  6114,  6120,  6119,  6145,  6146,
-    6147,  6152,  6157,  6162,  6164,  6166,  6168,  6174,  6182,  6200,
-    6217,  6243,  6261,  6262,  6263,  6264,  6265,  6266,  6270,  6271,
-    6272,  6276,  6277,  6281,  6282,  6283,  6284,  6289,  6296,  6297,
-    6301,  6302,  6306,  6307,  6314,  6319,  6325,  6331,  6337,  6356,
-    6362,  6364,  6368,  6372,  6373,  6377,  6382,  6381,  6404,  6405,
-    6406,  6407,  6412,  6416,  6421,  6426,  6430,  6435,  6440,  6446,
-    6451,  6457,  6461,  6466,  6471,  6489,  6491,  6493,  6509,  6511,
-    6516,  6521,  6533,  6538,  6543,  6548,  6550,  6552,  6554,  6556,
-    6558,  6560,  6562,  6565,  6564,  6569,  6568,  6572,  6574,  6583,
-    6584,  6585,  6591,  6592,  6593,  6594,  6595,  6599,  6603,  6604,
-    6608,  6609,  6613,  6614,  6615,  6616,  6617,  6621,  6622,  6623,
-    6624,  6625,  6629,  6634,  6636,  6642,  6643,  6645,  6650,  6660,
-    6661,  6665,  6666,  6667,  6675,  6676,  6680,  6681,  6685,  6686,
-    6687,  6691,  6692,  6693,  6694,  6697,  6698,  6702,  6703,  6707,
-    6708,  6712,  6713,  6717,  6718,  6719,  6720,  6721,  6722,  6728,
-    6734,  6740,  6746,  6747,  6760,  6766,  6772,  6778,  6783,  6788,
-    6797,  6818,  6826,  6827,  6832,  6833,  6837,  6845,  6849,  6850,
-    6854,  6855,  6859,  6868,  6872,  6873,  6877,  6885,  6886,  6890,
-    6891,  6895,  6896,  6901,  6902,  6906,  6913,  6922,  6927,  6935,
-    6936,  6937,  6938,  6939,  6940,  6945,  6953,  6954,  6959,  6958,
-    6971,  6972,  6976,  6979,  6980,  6981,  6982,  6986,  6994,  7001,
-    7002,  7006,  7016,  7017,  7021,  7022,  7025,  7027,  7031,  7043,
-    7044,  7048,  7055,  7068,  7069,  7071,  7073,  7079,  7084,  7090,
-    7096,  7103,  7113,  7114,  7115,  7116,  7117,  7121,  7125,  7126,
-    7130,  7131,  7135,  7136,  7140,  7141,  7142,  7146,  7147,  7151,
-    7155,  7168,  7180,  7181,  7185,  7186,  7190,  7191,  7195,  7196,
-    7200,  7201,  7205,  7206,  7210,  7211,  7215,  7216,  7220,  7222,
-    7226,  7227,  7231,  7235,  7236,  7249,  7250,  7251,  7255,  7256,
-    7260,  7266,  7280,  7281,  7285,  7286,  7290,  7291,  7299,  7298,
-    7344,  7343,  7357,  7369,  7368,  7387,  7386,  7405,  7404,  7423,
-    7417,  7437,  7436,  7469,  7474,  7479,  7484,  7489,  7496,  7503,
-    7508,  7516,  7517,  7518,  7519,  7523,  7524,  7536,  7537,  7541,
-    7542,  7545,  7547,  7555,  7563,  7565,  7567,  7568,  7576,  7577,
-    7581,  7590,  7588,  7602,  7616,  7615,  7629,  7627,  7641,  7648,
-    7659,  7660,  7688,  7695,  7699,  7704,  7703,  7719,  7721,  7726,
-    7734,  7733,  7749,  7753,  7752,  7764,  7765,  7769,  7784,  7785,
-    7789,  7798,  7802,  7807,  7813,  7812,  7823,  7832,  7822,  7847,
-    7856,  7865,  7874,  7883,  7889,  7895,  7904,  7913,  7941,  7962,
-    7972,  7976,  7981,  7982,  7985,  7987,  7988,  7989,  7990,  7993,
-    7998,  8009,  8014,  8025,  8026,  8030,  8031,  8035,  8036,  8037,
-    8041,  8042,  8047,  8055,  8056,  8057,  8058,  8063,  8062,  8091,
-    8101,  8118,  8121,  8128,  8132,  8139,  8143,  8147,  8154,  8159,
-    8162,  8169,  8172,  8179,  8182,  8189,  8192,  8200,  8203,  8210,
-    8214,  8221,  8225,  8232,  8233,  8258,  8259,  8260,  8265,  8270,
-    8278,  8277,  8289,  8290,  8291,  8296,  8295,  8317,  8318,  8322,
-    8323,  8327,  8328,  8329,  8334,  8333,  8355,  8364,  8363,  8390,
-    8391,  8395,  8396,  8400,  8401,  8402,  8403,  8404,  8405,  8410,
-    8409,  8431,  8432,  8433,  8438,  8437,  8443,  8450,  8455,  8463,
-    8464,  8468,  8482,  8481,  8494,  8495,  8499,  8500,  8504,  8514,
-    8524,  8525,  8530,  8529,  8540,  8541,  8545,  8546,  8550,  8560,
-    8571,  8570,  8578,  8578,  8589,  8590,  8595,  8596,  8605,  8614,
-    8615,  8619,  8624,  8629,  8634,  8639,  8638,  8658,  8666,  8658,
-    8673,  8674,  8675,  8676,  8677,  8681,  8688,  8695,  8697,  8708,
-    8709,  8713,  8714,  8742,  8772,  8774,  8780,  8790,  8791,  8792,
-    8807,  8814,  8839,  8845,  8851,  8852,  8853,  8854,  8855,  8859,
-    8860,  8865,  8916,  8923,  8966,  8972,  8978,  8984,  8990,  8996,
-    9002,  9008,  9012,  9018,  9024,  9030,  9036,  9042,  9046,  9052,
-    9062,  9068,  9076,  9082,  9092,  9098,  9107,  9117,  9123,  9133,
-    9139,  9148,  9152,  9158,  9164,  9170,  9176,  9182,  9188,  9194,
-    9200,  9206,  9212,  9218,  9224,  9230,  9236,  9240,  9241,  9245,
-    9246,  9250,  9251,  9255,  9256,  9260,  9261,  9262,  9263,  9264,
-    9265,  9269,  9270,  9274,  9275,  9276,  9277,  9278,  9279,  9291,
-    9292,  9293,  9294,  9295,  9301,  9305,  9311,  9317,  9323,  9329,
-    9331,  9338,  9345,  9351,  9392,  9401,  9408,  9416,  9422,  9429,
-    9435,  9449,  9456,  9472,  9478,  9484,  9492,  9498,  9504,  9510,
-    9516,  9531,  9543,  9549,  9555,  9561,  9567,  9573,  9579,  9585,
-    9591,  9597,  9603,  9609,  9615,  9621,  9627,  9633,  9639,  9647,
-    9668,  9675,  9681,  9688,  9695,  9702,  9709,  9715,  9721,  9726,
-    9732,  9739,  9745,  9751,  9757,  9763,  9769,  9787,  9793,  9799,
-    9806,  9813,  9828,  9834,  9840,  9846,  9852,  9859,  9865,  9871,
-    9877,  9883,  9889,  9897,  9910,  9916,  9922,  9928,  9934,  9942,
-    9948,  9960,  9966,  9972,  9980,  9990,  9996, 10012, 10018, 10025,
-   10032, 10039, 10046, 10053, 10057, 10077, 10076, 10149, 10189, 10191,
-   10196, 10197, 10201, 10202, 10206, 10207, 10211, 10218, 10226, 10252,
-   10258, 10264, 10270, 10276, 10282, 10291, 10298, 10300, 10297, 10307,
-   10318, 10324, 10330, 10336, 10342, 10348, 10354, 10360, 10366, 10373,
-   10372, 10392, 10391, 10406, 10417, 10425, 10441, 10442, 10447, 10452,
-   10455, 10458, 10457, 10474, 10476, 10482, 10481, 10498, 10500, 10502,
-   10504, 10506, 10508, 10510, 10512, 10514, 10516, 10518, 10523, 10524,
-   10528, 10535, 10543, 10544, 10548, 10555, 10563, 10564, 10568, 10569,
-   10573, 10581, 10592, 10593, 10602, 10613, 10614, 10620, 10621, 10641,
-   10643, 10647, 10645, 10662, 10660, 10678, 10676, 10683, 10692, 10690,
-   10708, 10707, 10717, 10728, 10726, 10745, 10744, 10755, 10766, 10767,
-   10768, 10776, 10777, 10781, 10796, 10796, 10811, 10851, 10924, 10935,
-   10940, 10932, 10959, 10979, 10987, 10979, 10996, 10995, 11018, 11035,
-   11018, 11042, 11046, 11072, 11073, 11078, 11081, 11082, 11083, 11087,
-   11088, 11093, 11092, 11098, 11097, 11105, 11106, 11109, 11111, 11111,
-   11115, 11115, 11120, 11121, 11125, 11127, 11132, 11133, 11137, 11148,
-   11161, 11162, 11163, 11164, 11165, 11166, 11167, 11168, 11169, 11170,
-   11171, 11172, 11176, 11177, 11178, 11179, 11180, 11181, 11182, 11183,
-   11184, 11188, 11189, 11190, 11191, 11194, 11196, 11197, 11201, 11202,
-   11210, 11212, 11216, 11218, 11217, 11231, 11234, 11233, 11248, 11254,
-   11269, 11271, 11275, 11277, 11282, 11283, 11303, 11334, 11338, 11339,
-   11343, 11356, 11358, 11363, 11362, 11397, 11399, 11404, 11405, 11406,
-   11411, 11417, 11421, 11422, 11426, 11433, 11440, 11447, 11457, 11484,
-   11488, 11494, 11500, 11510, 11514, 11524, 11525, 11526, 11527, 11528,
-   11529, 11533, 11534, 11535, 11536, 11537, 11541, 11542, 11543, 11544,
-   11545, 11549, 11550, 11551, 11552, 11556, 11561, 11562, 11565, 11568,
-   11567, 11601, 11602, 11606, 11614, 11627, 11627, 11637, 11638, 11642,
-   11661, 11701, 11700, 11713, 11721, 11712, 11723, 11735, 11747, 11746,
-   11764, 11763, 11774, 11775, 11774, 11791, 11798, 11819, 11840, 11852,
-   11857, 11856, 11866, 11872, 11879, 11884, 11889, 11899, 11900, 11904,
-   11915, 11928, 11929, 11933, 11944, 11945, 11949, 11950, 11953, 11955,
-   11958, 11959, 11960, 11964, 11965, 11973, 11981, 11972, 11991, 11998,
-   11990, 12008, 12020, 12021, 12034, 12038, 12039, 12055, 12056, 12060,
-   12069, 12070, 12071, 12073, 12072, 12083, 12084, 12088, 12089, 12091,
-   12090, 12094, 12093, 12099, 12100, 12104, 12105, 12109, 12119, 12120,
-   12124, 12125, 12130, 12129, 12143, 12144, 12148, 12153, 12161, 12162,
-   12170, 12172, 12172, 12180, 12188, 12179, 12210, 12211, 12215, 12223,
-   12224, 12228, 12238, 12239, 12246, 12245, 12261, 12260, 12274, 12273,
-   12285, 12284, 12298, 12299, 12303, 12316, 12332, 12333, 12337, 12338,
-   12342, 12343, 12344, 12349, 12348, 12370, 12372, 12375, 12377, 12380,
-   12381, 12384, 12388, 12392, 12396, 12400, 12404, 12408, 12412, 12416,
-   12424, 12427, 12437, 12436, 12451, 12458, 12466, 12474, 12482, 12490,
-   12498, 12505, 12507, 12509, 12518, 12522, 12527, 12526, 12532, 12531,
-   12536, 12545, 12552, 12557, 12559, 12561, 12563, 12565, 12573, 12584,
-   12592, 12594, 12602, 12609, 12616, 12626, 12633, 12639, 12648, 12656,
-   12660, 12664, 12671, 12678, 12684, 12691, 12698, 12703, 12708, 12716,
-   12718, 12720, 12725, 12726, 12729, 12731, 12735, 12736, 12740, 12741,
-   12745, 12746, 12750, 12751, 12755, 12756, 12759, 12761, 12768, 12779,
-   12778, 12794, 12793, 12800, 12801, 12802, 12803, 12804, 12808, 12809,
-   12814, 12818, 12824, 12830, 12852, 12853, 12854, 12869, 12868, 12881,
-   12890, 12880, 12892, 12896, 12897, 12909, 12908, 12930, 12931, 12936,
-   12938, 12940, 12942, 12944, 12946, 12948, 12950, 12952, 12954, 12956,
-   12958, 12960, 12965, 12966, 12971, 12970, 12980, 12981, 12985, 12985,
-   12987, 12988, 12992, 12993, 12998, 12997, 13008, 13012, 13016, 13028,
-   13038, 13039, 13040, 13046, 13058, 13070, 13080, 13090, 13057, 13098,
-   13099, 13103, 13104, 13108, 13109, 13121, 13125, 13126, 13127, 13130,
-   13132, 13136, 13137, 13141, 13146, 13153, 13158, 13165, 13167, 13171,
-   13172, 13176, 13181, 13189, 13190, 13193, 13195, 13203, 13205, 13209,
-   13210, 13211, 13215, 13217, 13222, 13223, 13232, 13233, 13237, 13238,
-   13242, 13262, 13286, 13298, 13309, 13328, 13336, 13348, 13363, 13384,
-   13385, 13386, 13395, 13396, 13397, 13398, 13405, 13411, 13417, 13423,
-   13429, 13458, 13489, 13499, 13509, 13515, 13524, 13536, 13542, 13548,
-   13564, 13565, 13569, 13578, 13594, 13598, 13649, 13653, 13671, 13675,
-   13755, 13780, 13811, 13812, 13828, 13838, 13842, 13848, 13854, 13864,
-   13870, 13879, 13889, 13890, 13920, 13933, 13949, 13965, 13982, 13983,
-   13994, 13995, 14006, 14007, 14008, 14012, 14039, 14072, 14087, 14088,
-   14089, 14090, 14091, 14092, 14093, 14094, 14095, 14096, 14097, 14098,
-   14099, 14100, 14101, 14102, 14103, 14104, 14105, 14106, 14107, 14108,
-   14109, 14110, 14111, 14112, 14113, 14114, 14115, 14116, 14117, 14118,
-   14119, 14120, 14121, 14122, 14123, 14124, 14125, 14126, 14127, 14128,
-   14129, 14130, 14131, 14132, 14133, 14134, 14135, 14136, 14146, 14147,
-   14148, 14149, 14150, 14151, 14152, 14153, 14154, 14155, 14156, 14157,
-   14158, 14159, 14160, 14161, 14162, 14163, 14164, 14165, 14166, 14167,
-   14168, 14169, 14170, 14171, 14172, 14173, 14174, 14175, 14176, 14177,
-   14178, 14179, 14180, 14181, 14182, 14183, 14184, 14185, 14186, 14187,
-   14188, 14189, 14190, 14195, 14196, 14197, 14198, 14199, 14200, 14201,
-   14202, 14203, 14204, 14205, 14206, 14207, 14208, 14209, 14210, 14211,
-   14212, 14213, 14214, 14215, 14216, 14217, 14218, 14219, 14220, 14221,
-   14222, 14223, 14224, 14225, 14226, 14227, 14228, 14229, 14230, 14231,
-   14232, 14233, 14234, 14235, 14236, 14237, 14238, 14239, 14240, 14241,
-   14242, 14243, 14244, 14245, 14246, 14247, 14248, 14249, 14250, 14251,
-   14252, 14253, 14254, 14255, 14256, 14257, 14258, 14259, 14260, 14261,
-   14262, 14263, 14264, 14265, 14266, 14267, 14268, 14269, 14270, 14271,
-   14272, 14273, 14274, 14275, 14276, 14277, 14278, 14279, 14280, 14281,
-   14282, 14283, 14284, 14285, 14286, 14287, 14288, 14289, 14290, 14291,
-   14292, 14293, 14294, 14295, 14296, 14297, 14298, 14299, 14300, 14301,
-   14302, 14303, 14304, 14305, 14306, 14307, 14308, 14309, 14310, 14311,
-   14312, 14313, 14314, 14315, 14316, 14317, 14318, 14319, 14320, 14321,
-   14322, 14323, 14324, 14325, 14326, 14327, 14328, 14329, 14330, 14331,
-   14332, 14333, 14334, 14335, 14336, 14337, 14338, 14339, 14340, 14341,
-   14342, 14343, 14344, 14345, 14346, 14347, 14348, 14349, 14350, 14351,
-   14352, 14353, 14354, 14355, 14356, 14357, 14358, 14359, 14360, 14361,
-   14362, 14363, 14364, 14365, 14366, 14367, 14368, 14369, 14370, 14371,
-   14372, 14373, 14374, 14375, 14376, 14377, 14378, 14379, 14380, 14381,
-   14382, 14383, 14384, 14385, 14386, 14387, 14388, 14389, 14390, 14391,
-   14392, 14393, 14394, 14395, 14396, 14397, 14398, 14399, 14400, 14401,
-   14402, 14403, 14404, 14405, 14406, 14407, 14408, 14409, 14410, 14411,
-   14412, 14413, 14414, 14415, 14416, 14417, 14418, 14419, 14420, 14421,
-   14422, 14423, 14424, 14425, 14426, 14427, 14428, 14429, 14430, 14431,
-   14432, 14433, 14434, 14435, 14436, 14437, 14438, 14439, 14440, 14441,
-   14442, 14443, 14444, 14445, 14446, 14447, 14448, 14449, 14450, 14462,
-   14461, 14481, 14480, 14487, 14486, 14496, 14495, 14506, 14505, 14511,
-   14519, 14521, 14526, 14526, 14535, 14534, 14548, 14547, 14552, 14556,
-   14557, 14558, 14562, 14563, 14564, 14565, 14569, 14570, 14571, 14572,
-   14577, 14603, 14602, 14702, 14713, 14726, 14742, 14755, 14777, 14812,
-   14854, 14882, 14928, 14942, 14943, 14944, 14945, 14949, 14967, 14985,
-   14986, 14990, 14991, 14992, 14993, 14997, 14998, 15016, 15030, 15031,
-   15032, 15038, 15044, 15056, 15055, 15071, 15072, 15076, 15077, 15081,
-   15094, 15095, 15096, 15101, 15106, 15105, 15125, 15141, 15158, 15157,
-   15196, 15197, 15201, 15202, 15206, 15207, 15208, 15209, 15211, 15210,
-   15224, 15225, 15226, 15227, 15228, 15234, 15234, 15239, 15244, 15254,
-   15264, 15268, 15277, 15277, 15282, 15288, 15299, 15310, 15318, 15320,
-   15324, 15331, 15338, 15340, 15344, 15345, 15350, 15349, 15353, 15352,
-   15356, 15355, 15359, 15358, 15361, 15362, 15363, 15364, 15365, 15366,
-   15367, 15368, 15369, 15370, 15371, 15372, 15373, 15374, 15375, 15376,
-   15377, 15378, 15379, 15380, 15381, 15382, 15383, 15384, 15385, 15386,
-   15390, 15391, 15395, 15396, 15400, 15410, 15420, 15433, 15448, 15461,
-   15474, 15486, 15491, 15499, 15504, 15512, 15530, 15550, 15562, 15575,
-   15584, 15588, 15592, 15593, 15597, 15624, 15626, 15630, 15634, 15638,
-   15645, 15646, 15650, 15651, 15655, 15656, 15660, 15661, 15667, 15673,
-   15679, 15689, 15688, 15698, 15699, 15704, 15705, 15706, 15711, 15712,
-   15713, 15717, 15718, 15722, 15734, 15743, 15753, 15762, 15776, 15777,
-   15782, 15781, 15797, 15798, 15799, 15803, 15804, 15808, 15808, 15832,
-   15833, 15837, 15838, 15839, 15843, 15847, 15854, 15857, 15855, 15871,
-   15878, 15899, 15916, 15918, 15922, 15923, 15927, 15928, 15936, 15937,
-   15938, 15939, 15945, 15951, 15961, 15963, 15965, 15970, 15971, 15972,
-   15973, 15974, 15978, 15979, 15980, 15981, 15982, 15983, 15993, 15994,
-   15999, 16012, 16025, 16027, 16029, 16034, 16039, 16041, 16043, 16049,
-   16050, 16052, 16058, 16057, 16075, 16076, 16080, 16085, 16093, 16093,
-   16119, 16118, 16135, 16139, 16144, 16149, 16148, 16160, 16161, 16163,
-   16165, 16183, 16189, 16194, 16176, 16257, 16275, 16300, 16332, 16337,
-   16345, 16368, 16296, 16434, 16454, 16467, 16477, 16433, 16498, 16502,
-   16506, 16510, 16514, 16518, 16525, 16532, 16539, 16549, 16550, 16554,
-   16555, 16556, 16560, 16561, 16566, 16568, 16567, 16573, 16574, 16578,
-   16588
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
-static const char *const yytname[] =
-{
-  "$end", "error", "$undefined", "ABORT_SYM", "ACCESSIBLE_SYM", "ACTION",
-  "ADD", "ADDDATE_SYM", "AFTER_SYM", "AGAINST", "AGGREGATE_SYM",
-  "ALGORITHM_SYM", "ALL", "ALTER", "ANALYSE_SYM", "ANALYZE_SYM",
-  "AND_AND_SYM", "AND_SYM", "ANY_SYM", "AS", "ASC", "ASCII_SYM",
-  "ASENSITIVE_SYM", "AT_SYM", "AUTOEXTEND_SIZE_SYM", "AUTO_INC",
-  "AVG_ROW_LENGTH", "AVG_SYM", "BACKUP_SYM", "BEFORE_SYM", "BEGIN_SYM",
-  "BETWEEN_SYM", "BIGINT", "BINARY", "BINLOG_SYM", "BIN_NUM", "BIT_AND",
-  "BIT_OR", "BIT_SYM", "BIT_XOR", "BLOB_SYM", "BLOCK_SYM", "BOOLEAN_SYM",
-  "BOOL_SYM", "BOTH", "BTREE_SYM", "BY", "BYTE_SYM", "CACHE_SYM",
-  "CALL_SYM", "CASCADE", "CASCADED", "CASE_SYM", "CAST_SYM",
-  "CATALOG_NAME_SYM", "CHAIN_SYM", "CHANGE", "CHANGED", "CHARSET",
-  "CHAR_SYM", "CHECKSUM_SYM", "CHECK_SYM", "CIPHER_SYM",
-  "CLASS_ORIGIN_SYM", "CLIENT_SYM", "CLOSE_SYM", "COALESCE", "CODE_SYM",
-  "COLLATE_SYM", "COLLATION_SYM", "COLUMNS", "COLUMN_SYM",
-  "COLUMN_FORMAT_SYM", "COLUMN_NAME_SYM", "COMMENT_SYM", "COMMITTED_SYM",
-  "COMMIT_SYM", "COMPACT_SYM", "COMPLETION_SYM", "COMPRESSED_SYM",
-  "CONCURRENT", "CONDITION_SYM", "CONNECTION_SYM", "CONSISTENT_SYM",
-  "CONSTRAINT", "CONSTRAINT_CATALOG_SYM", "CONSTRAINT_NAME_SYM",
-  "CONSTRAINT_SCHEMA_SYM", "CONTAINS_SYM", "CONTEXT_SYM", "CONTINUE_SYM",
-  "CONVERT_SYM", "COUNT_SYM", "CPU_SYM", "CREATE", "CROSS", "CUBE_SYM",
-  "CURDATE", "CURRENT_SYM", "CURRENT_USER", "CURSOR_SYM",
-  "CURSOR_NAME_SYM", "CURTIME", "DATABASE", "DATABASES", "DATAFILE_SYM",
-  "DATA_SYM", "DATETIME", "DATE_ADD_INTERVAL", "DATE_SUB_INTERVAL",
-  "DATE_SYM", "DAY_HOUR_SYM", "DAY_MICROSECOND_SYM", "DAY_MINUTE_SYM",
-  "DAY_SECOND_SYM", "DAY_SYM", "DEALLOCATE_SYM", "DECIMAL_NUM",
-  "DECIMAL_SYM", "DECLARE_SYM", "DEFAULT", "DEFAULT_AUTH_SYM",
-  "DEFINER_SYM", "DELAYED_SYM", "DELAY_KEY_WRITE_SYM", "DELETE_SYM",
-  "DESC", "DESCRIBE", "DES_KEY_FILE", "DETERMINISTIC_SYM",
-  "DIAGNOSTICS_SYM", "DIRECTORY_SYM", "DISABLE_SYM", "DISCARD", "DISK_SYM",
-  "DISTINCT", "DIV_SYM", "DOUBLE_SYM", "DO_SYM", "DROP", "DUAL_SYM",
-  "DUMPFILE", "DUPLICATE_SYM", "DYNAMIC_SYM", "EACH_SYM", "ELSE",
-  "ELSEIF_SYM", "ENABLE_SYM", "ENCLOSED", "END", "ENDS_SYM",
-  "END_OF_INPUT", "ENGINES_SYM", "ENGINE_SYM", "ENUM", "EQ", "EQUAL_SYM",
-  "ERROR_SYM", "ERRORS", "ESCAPED", "ESCAPE_SYM", "EVENTS_SYM",
-  "EVENT_SYM", "EVERY_SYM", "EXCHANGE_SYM", "EXECUTE_SYM", "EXISTS",
-  "EXIT_SYM", "EXPANSION_SYM", "EXPIRE_SYM", "EXPORT_SYM", "EXTENDED_SYM",
-  "EXTENT_SIZE_SYM", "EXTRACT_SYM", "FALSE_SYM", "FAST_SYM", "FAULTS_SYM",
-  "FETCH_SYM", "FILE_SYM", "FIRST_SYM", "FIXED_SYM", "FLOAT_NUM",
-  "FLOAT_SYM", "FLUSH_SYM", "FORCE_SYM", "FOREIGN", "FOR_SYM",
-  "FORMAT_SYM", "FOUND_SYM", "FROM", "FULL", "FULLTEXT_SYM",
-  "FUNCTION_SYM", "GE", "GENERAL", "GEOMETRYCOLLECTION", "GEOMETRY_SYM",
-  "GET_FORMAT", "GET_SYM", "GLOBAL_SYM", "GRANT", "GRANTS", "GROUP_SYM",
-  "GROUP_CONCAT_SYM", "GT_SYM", "HANDLER_SYM", "HASH_SYM", "HAVING",
-  "HELP_SYM", "HEX_NUM", "HIGH_PRIORITY", "HOST_SYM", "HOSTS_SYM",
-  "HOUR_MICROSECOND_SYM", "HOUR_MINUTE_SYM", "HOUR_SECOND_SYM", "HOUR_SYM",
-  "IDENT", "IDENTIFIED_SYM", "IDENT_QUOTED", "IF", "IGNORE_SYM",
-  "IGNORE_SERVER_IDS_SYM", "IMPORT", "INDEXES", "INDEX_SYM", "INFILE",
-  "INITIAL_SIZE_SYM", "INNER_SYM", "INOUT_SYM", "INSENSITIVE_SYM",
-  "INSERT", "INSERT_METHOD", "INSTALL_SYM", "INTERVAL_SYM", "INTO",
-  "INT_SYM", "INVOKER_SYM", "IN_SYM", "IO_AFTER_GTIDS", "IO_BEFORE_GTIDS",
-  "IO_SYM", "IPC_SYM", "IS", "ISOLATION", "ISSUER_SYM", "ITERATE_SYM",
-  "JOIN_SYM", "KEYS", "KEY_BLOCK_SIZE", "KEY_SYM", "KILL_SYM",
-  "LANGUAGE_SYM", "LAST_SYM", "LE", "LEADING", "LEAVES", "LEAVE_SYM",
-  "LEFT", "LESS_SYM", "LEVEL_SYM", "LEX_HOSTNAME", "LIKE", "LIMIT",
-  "LINEAR_SYM", "LINES", "LINESTRING", "LIST_SYM", "LOAD", "LOCAL_SYM",
-  "LOCATOR_SYM", "LOCKS_SYM", "LOCK_SYM", "LOGFILE_SYM", "LOGS_SYM",
-  "LONGBLOB", "LONGTEXT", "LONG_NUM", "LONG_SYM", "LOOP_SYM",
-  "LOW_PRIORITY", "LT", "MASTER_AUTO_POSITION_SYM", "MASTER_BIND_SYM",
-  "MASTER_CONNECT_RETRY_SYM", "MASTER_DELAY_SYM", "MASTER_HOST_SYM",
-  "MASTER_LOG_FILE_SYM", "MASTER_LOG_POS_SYM", "MASTER_PASSWORD_SYM",
-  "MASTER_PORT_SYM", "MASTER_RETRY_COUNT_SYM", "MASTER_SERVER_ID_SYM",
-  "MASTER_SSL_CAPATH_SYM", "MASTER_SSL_CA_SYM", "MASTER_SSL_CERT_SYM",
-  "MASTER_SSL_CIPHER_SYM", "MASTER_SSL_CRL_SYM", "MASTER_SSL_CRLPATH_SYM",
-  "MASTER_SSL_KEY_SYM", "MASTER_SSL_SYM",
-  "MASTER_SSL_VERIFY_SERVER_CERT_SYM", "MASTER_SYM", "MASTER_USER_SYM",
-  "MASTER_HEARTBEAT_PERIOD_SYM", "MATCH", "MAX_CONNECTIONS_PER_HOUR",
-  "MAX_QUERIES_PER_HOUR", "MAX_ROWS", "MAX_SIZE_SYM", "MAX_SYM",
-  "MAX_UPDATES_PER_HOUR", "MAX_USER_CONNECTIONS_SYM", "MAX_VALUE_SYM",
-  "MEDIUMBLOB", "MEDIUMINT", "MEDIUMTEXT", "MEDIUM_SYM", "MEMORY_SYM",
-  "MERGE_SYM", "MESSAGE_TEXT_SYM", "MICROSECOND_SYM", "MIGRATE_SYM",
-  "MINUTE_MICROSECOND_SYM", "MINUTE_SECOND_SYM", "MINUTE_SYM", "MIN_ROWS",
-  "MIN_SYM", "MODE_SYM", "MODIFIES_SYM", "MODIFY_SYM", "MOD_SYM",
-  "MONTH_SYM", "MULTILINESTRING", "MULTIPOINT", "MULTIPOLYGON",
-  "MUTEX_SYM", "MYSQL_ERRNO_SYM", "NAMES_SYM", "NAME_SYM", "NATIONAL_SYM",
-  "NATURAL", "NCHAR_STRING", "NCHAR_SYM", "NDBCLUSTER_SYM", "NE", "NEG",
-  "NEW_SYM", "NEXT_SYM", "NODEGROUP_SYM", "NONE_SYM", "NOT2_SYM",
-  "NOT_SYM", "NOW_SYM", "NO_SYM", "NO_WAIT_SYM", "NO_WRITE_TO_BINLOG",
-  "NULL_SYM", "NUM", "NUMBER_SYM", "NUMERIC_SYM", "NVARCHAR_SYM",
-  "OFFSET_SYM", "OLD_PASSWORD", "ON", "ONE_SYM", "ONLY_SYM", "OPEN_SYM",
-  "OPTIMIZE", "OPTIONS_SYM", "OPTION", "OPTIONALLY", "OR2_SYM",
-  "ORDER_SYM", "OR_OR_SYM", "OR_SYM", "OUTER", "OUTFILE", "OUT_SYM",
-  "OWNER_SYM", "PACK_KEYS_SYM", "PAGE_SYM", "PARAM_MARKER", "PARSER_SYM",
-  "PARTIAL", "PARTITION_SYM", "PARTITIONS_SYM", "PARTITIONING_SYM",
-  "PASSWORD", "PHASE_SYM", "PLUGIN_DIR_SYM", "PLUGIN_SYM", "PLUGINS_SYM",
-  "POINT_SYM", "POLYGON", "PORT_SYM", "POSITION_SYM", "PRECISION",
-  "PREPARE_SYM", "PRESERVE_SYM", "PREV_SYM", "PRIMARY_SYM", "PRIVILEGES",
-  "PROCEDURE_SYM", "PROCESS", "PROCESSLIST_SYM", "PROFILE_SYM",
-  "PROFILES_SYM", "PROXY_SYM", "PURGE", "QUARTER_SYM", "QUERY_SYM",
-  "QUICK", "RANGE_SYM", "READS_SYM", "READ_ONLY_SYM", "READ_SYM",
-  "READ_WRITE_SYM", "REAL", "REBUILD_SYM", "RECOVER_SYM", "REDOFILE_SYM",
-  "REDO_BUFFER_SIZE_SYM", "REDUNDANT_SYM", "REFERENCES", "REGEXP", "RELAY",
-  "RELAYLOG_SYM", "RELAY_LOG_FILE_SYM", "RELAY_LOG_POS_SYM",
-  "RELAY_THREAD", "RELEASE_SYM", "RELOAD", "REMOVE_SYM", "RENAME",
-  "REORGANIZE_SYM", "REPAIR", "REPEATABLE_SYM", "REPEAT_SYM", "REPLACE",
-  "REPLICATION", "REQUIRE_SYM", "RESET_SYM", "RESIGNAL_SYM", "RESOURCES",
-  "RESTORE_SYM", "RESTRICT", "RESUME_SYM", "RETURNED_SQLSTATE_SYM",
-  "RETURNS_SYM", "RETURN_SYM", "REVERSE_SYM", "REVOKE", "RIGHT",
-  "ROLLBACK_SYM", "ROLLUP_SYM", "ROUTINE_SYM", "ROWS_SYM",
-  "ROW_FORMAT_SYM", "ROW_SYM", "ROW_COUNT_SYM", "RTREE_SYM",
-  "SAVEPOINT_SYM", "SCHEDULE_SYM", "SCHEMA_NAME_SYM",
-  "SECOND_MICROSECOND_SYM", "SECOND_SYM", "SECURITY_SYM", "SELECT_SYM",
-  "SENSITIVE_SYM", "SEPARATOR_SYM", "SERIALIZABLE_SYM", "SERIAL_SYM",
-  "SESSION_SYM", "SERVER_SYM", "SERVER_OPTIONS", "SET", "SET_VAR",
-  "SHARE_SYM", "SHIFT_LEFT", "SHIFT_RIGHT", "SHOW", "SHUTDOWN",
-  "SIGNAL_SYM", "SIGNED_SYM", "SIMPLE_SYM", "SLAVE", "SLOW", "SMALLINT",
-  "SNAPSHOT_SYM", "SOCKET_SYM", "SONAME_SYM", "SOUNDS_SYM", "SOURCE_SYM",
-  "SPATIAL_SYM", "SPECIFIC_SYM", "SQLEXCEPTION_SYM", "SQLSTATE_SYM",
-  "SQLWARNING_SYM", "SQL_AFTER_GTIDS", "SQL_AFTER_MTS_GAPS",
-  "SQL_BEFORE_GTIDS", "SQL_BIG_RESULT", "SQL_BUFFER_RESULT",
-  "SQL_CACHE_SYM", "SQL_CALC_FOUND_ROWS", "SQL_NO_CACHE_SYM",
-  "SQL_SMALL_RESULT", "SQL_SYM", "SQL_THREAD", "SSL_SYM", "STARTING",
-  "STARTS_SYM", "START_SYM", "STATS_AUTO_RECALC_SYM",
-  "STATS_PERSISTENT_SYM", "STATS_SAMPLE_PAGES_SYM", "STATUS_SYM",
-  "STDDEV_SAMP_SYM", "STD_SYM", "STOP_SYM", "STORAGE_SYM", "STRAIGHT_JOIN",
-  "STRING_SYM", "SUBCLASS_ORIGIN_SYM", "SUBDATE_SYM", "SUBJECT_SYM",
-  "SUBPARTITIONS_SYM", "SUBPARTITION_SYM", "SUBSTRING", "SUM_SYM",
-  "SUPER_SYM", "SUSPEND_SYM", "SWAPS_SYM", "SWITCHES_SYM", "SYSDATE",
-  "TABLES", "TABLESPACE", "TABLE_REF_PRIORITY", "TABLE_SYM",
-  "TABLE_CHECKSUM_SYM", "TABLE_NAME_SYM", "TEMPORARY", "TEMPTABLE_SYM",
-  "TERMINATED", "TEXT_STRING", "TEXT_SYM", "THAN_SYM", "THEN_SYM",
-  "TIMESTAMP", "TIMESTAMP_ADD", "TIMESTAMP_DIFF", "TIME_SYM", "TINYBLOB",
-  "TINYINT", "TINYTEXT", "TO_SYM", "TRAILING", "TRANSACTION_SYM",
-  "TRIGGERS_SYM", "TRIGGER_SYM", "TRIM", "TRUE_SYM", "TRUNCATE_SYM",
-  "TYPES_SYM", "TYPE_SYM", "UDF_RETURNS_SYM", "ULONGLONG_NUM",
-  "UNCOMMITTED_SYM", "UNDEFINED_SYM", "UNDERSCORE_CHARSET", "UNDOFILE_SYM",
-  "UNDO_BUFFER_SIZE_SYM", "UNDO_SYM", "UNICODE_SYM", "UNINSTALL_SYM",
-  "UNION_SYM", "UNIQUE_SYM", "UNKNOWN_SYM", "UNLOCK_SYM", "UNSIGNED",
-  "UNTIL_SYM", "UPDATE_SYM", "UPGRADE_SYM", "USAGE", "USER", "USE_FRM",
-  "USE_SYM", "USING", "UTC_DATE_SYM", "UTC_TIMESTAMP_SYM", "UTC_TIME_SYM",
-  "VALUES", "VALUE_SYM", "VARBINARY", "VARCHAR", "VARIABLES",
-  "VARIANCE_SYM", "VARYING", "VAR_SAMP_SYM", "VIEW_SYM", "WAIT_SYM",
-  "WARNINGS", "WEEK_SYM", "WEIGHT_STRING_SYM", "WHEN_SYM", "WHERE",
-  "WHILE_SYM", "WITH", "WITH_CUBE_SYM", "WITH_ROLLUP_SYM", "WORK_SYM",
-  "WRAPPER_SYM", "WRITE_SYM", "X509_SYM", "XA_SYM", "XML_SYM", "XOR",
-  "YEAR_MONTH_SYM", "YEAR_SYM", "ZEROFILL", "'|'", "'&'", "'-'", "'+'",
-  "'*'", "'/'", "'%'", "'^'", "'~'", "'('", "')'", "','", "'!'", "'{'",
-  "'}'", "';'", "'@'", "'.'", "':'", "$accept", "query", "$@1",
-  "opt_end_of_input", "verb_clause", "statement", "deallocate",
-  "deallocate_or_drop", "prepare", "prepare_src", "execute", "$@2",
-  "execute_using", "execute_var_list", "execute_var_ident", "help", "$@3",
-  "change", "$@4", "master_defs", "master_def", "ignore_server_id_list",
-  "ignore_server_id", "master_file_def", "create", "$@5", "$@6", "$@7",
-  "$@8", "$@9", "$@10", "$@11", "$@12", "$@13", "server_def",
-  "server_options_list", "server_option", "event_tail", "$@14",
-  "ev_schedule_time", "$@15", "opt_ev_status", "ev_starts", "ev_ends",
-  "opt_ev_on_completion", "ev_on_completion", "opt_ev_comment",
-  "ev_sql_stmt", "$@16", "ev_sql_stmt_inner", "clear_privileges",
-  "sp_name", "sp_a_chistics", "sp_c_chistics", "sp_chistic",
-  "sp_c_chistic", "sp_suid", "call", "$@17", "opt_sp_cparam_list",
-  "opt_sp_cparams", "sp_cparams", "sp_fdparam_list", "sp_fdparams",
-  "sp_init_param", "sp_fdparam", "sp_pdparam_list", "sp_pdparams",
-  "sp_pdparam", "sp_opt_inout", "sp_proc_stmts", "sp_proc_stmts1",
-  "sp_decls", "sp_decl", "$@18", "$@19", "$@20", "sp_handler_type",
-  "sp_hcond_list", "sp_hcond_element", "sp_cond", "sqlstate", "opt_value",
-  "sp_hcond", "signal_stmt", "signal_value", "opt_signal_value",
-  "opt_set_signal_information", "signal_information_item_list",
-  "signal_allowed_expr", "signal_condition_information_item_name",
-  "resignal_stmt", "get_diagnostics", "which_area",
-  "diagnostics_information", "statement_information",
-  "statement_information_item", "simple_target_specification",
-  "statement_information_item_name", "condition_number",
-  "condition_information", "condition_information_item",
-  "condition_information_item_name", "sp_decl_idents", "sp_opt_default",
-  "$@21", "sp_proc_stmt", "sp_proc_stmt_if", "$@22",
-  "sp_proc_stmt_statement", "$@23", "sp_proc_stmt_return", "$@24",
-  "sp_proc_stmt_unlabeled", "$@25", "sp_proc_stmt_leave",
-  "sp_proc_stmt_iterate", "sp_proc_stmt_open", "sp_proc_stmt_fetch",
-  "$@26", "sp_proc_stmt_close", "sp_opt_fetch_noise", "sp_fetch_list",
-  "sp_if", "$@27", "$@28", "$@29", "sp_elseifs", "case_stmt_specification",
-  "simple_case_stmt", "$@30", "$@31", "searched_case_stmt", "$@32",
-  "simple_when_clause_list", "searched_when_clause_list",
-  "simple_when_clause", "$@33", "$@34", "searched_when_clause", "$@35",
-  "$@36", "else_clause_opt", "sp_labeled_control", "$@37", "sp_opt_label",
-  "sp_labeled_block", "$@38", "sp_unlabeled_block", "$@39",
-  "sp_block_content", "$@40", "sp_unlabeled_control", "$@41", "$@42",
-  "$@43", "$@44", "trg_action_time", "trg_event",
-  "change_tablespace_access", "change_tablespace_info", "tablespace_info",
-  "opt_logfile_group_name", "alter_tablespace_info", "logfile_group_info",
-  "alter_logfile_group_info", "add_log_file", "change_ts_option_list",
-  "$@45", "change_ts_options", "change_ts_option",
-  "tablespace_option_list", "tablespace_options", "tablespace_option",
-  "alter_tablespace_option_list", "alter_tablespace_options",
-  "alter_tablespace_option", "logfile_group_option_list",
-  "logfile_group_options", "logfile_group_option",
-  "alter_logfile_group_option_list", "alter_logfile_group_options",
-  "alter_logfile_group_option", "ts_datafile", "lg_undofile",
-  "lg_redofile", "tablespace_name", "logfile_group_name", "ts_access_mode",
-  "opt_ts_initial_size", "opt_ts_autoextend_size", "opt_ts_max_size",
-  "opt_ts_extent_size", "opt_ts_undo_buffer_size",
-  "opt_ts_redo_buffer_size", "opt_ts_nodegroup", "opt_ts_comment",
-  "opt_ts_engine", "ts_wait", "size_number", "create2", "create2a", "$@46",
-  "create3", "$@47", "$@48", "opt_create_partitioning", "opt_partitioning",
-  "partitioning", "$@49", "have_partitioning", "partition_entry", "$@50",
-  "partition", "part_type_def", "$@51", "opt_linear", "opt_key_algo",
-  "part_field_list", "part_field_item_list", "part_field_item",
-  "part_column_list", "part_func", "sub_part_func", "opt_num_parts",
-  "opt_sub_part", "$@52", "$@53", "sub_part_field_list",
-  "sub_part_field_item", "part_func_expr", "opt_num_subparts", "part_defs",
-  "part_def_list", "part_definition", "$@54", "part_name",
-  "opt_part_values", "$@55", "$@56", "part_func_max", "part_values_in",
-  "part_value_list", "part_value_item", "$@57", "$@58",
-  "part_value_item_list", "part_value_expr_item", "opt_sub_partition",
-  "sub_part_list", "sub_part_definition", "$@59", "sub_name",
-  "opt_part_options", "opt_part_option_list", "opt_part_option",
-  "create_select", "$@60", "$@61", "opt_as", "opt_create_database_options",
-  "create_database_options", "create_database_option", "opt_table_options",
-  "table_options", "table_option", "opt_if_not_exists",
-  "opt_create_table_options", "create_table_options_space_separated",
-  "create_table_options", "create_table_option", "$@62", "default_charset",
-  "default_collation", "storage_engines", "known_storage_engines",
-  "row_types", "merge_insert_types", "opt_select_from", "udf_type",
-  "create_field_list", "field_list", "field_list_item", "column_def",
-  "key_def", "opt_check_constraint", "check_constraint", "opt_constraint",
-  "constraint", "field_spec", "$@63", "type", "$@64", "$@65",
-  "spatial_type", "char", "nchar", "varchar", "nvarchar", "int_type",
-  "real_type", "float_options", "precision", "type_datetime_precision",
-  "func_datetime_precision", "field_options", "field_opt_list",
-  "field_option", "field_length", "opt_field_length", "opt_precision",
-  "opt_attribute", "opt_attribute_list", "attribute",
-  "type_with_opt_collate", "now", "now_or_signed_literal", "charset",
-  "charset_name", "charset_name_or_default", "opt_load_data_charset",
-  "old_or_new_charset_name", "old_or_new_charset_name_or_default",
-  "collation_name", "opt_collate", "collation_name_or_default",
-  "opt_default", "ascii", "unicode", "opt_binary", "opt_bin_mod",
-  "ws_nweights", "$@66", "ws_level_flag_desc", "ws_level_flag_reverse",
-  "ws_level_flags", "ws_level_number", "ws_level_list_item",
-  "ws_level_list", "ws_level_range", "ws_level_list_or_range",
-  "opt_ws_levels", "opt_primary", "references", "opt_ref_list", "ref_list",
-  "opt_match_clause", "opt_on_update_delete", "delete_option",
-  "normal_key_type", "constraint_key_type", "key_or_index",
-  "opt_key_or_index", "keys_or_index", "opt_unique", "fulltext", "spatial",
-  "init_key_options", "key_alg", "normal_key_options",
-  "fulltext_key_options", "spatial_key_options", "normal_key_opts",
-  "spatial_key_opts", "fulltext_key_opts", "key_using_alg", "all_key_opt",
-  "normal_key_opt", "spatial_key_opt", "fulltext_key_opt",
-  "btree_or_rtree", "key_list", "key_part", "opt_ident", "opt_component",
-  "string_list", "alter", "$@67", "$@68", "$@69", "$@70", "$@71", "$@72",
-  "$@73", "alter_user_list", "ev_alter_on_schedule_completion",
-  "opt_ev_rename_to", "opt_ev_sql_stmt", "ident_or_empty",
-  "alter_commands", "$@74", "$@75", "$@76", "remove_partitioning",
-  "all_or_alt_part_name_list", "add_partition_rule", "$@77",
-  "add_part_extra", "reorg_partition_rule", "$@78", "reorg_parts_rule",
-  "$@79", "alt_part_name_list", "alt_part_name_item", "alter_list",
-  "add_column", "alter_list_item", "$@80", "$@81", "$@82",
-  "opt_index_lock_algorithm", "alter_algorithm_option",
-  "alter_lock_option", "opt_column", "opt_ignore", "opt_restrict",
-  "opt_place", "opt_to", "slave", "$@83", "start",
-  "opt_start_transaction_option_list", "start_transaction_option_list",
-  "start_transaction_option", "slave_connection_opts",
-  "slave_user_name_opt", "slave_user_pass_opt", "slave_plugin_auth_opt",
-  "slave_plugin_dir_opt", "opt_slave_thread_option_list",
-  "slave_thread_option_list", "slave_thread_option", "slave_until",
-  "slave_until_opts", "checksum", "$@84", "opt_checksum_type", "repair",
-  "$@85", "opt_mi_repair_type", "mi_repair_types", "mi_repair_type",
-  "analyze", "$@86", "binlog_base64_event", "check", "$@87",
-  "opt_mi_check_type", "mi_check_types", "mi_check_type", "optimize",
-  "$@88", "opt_no_write_to_binlog", "rename", "$@89", "rename_list",
-  "table_to_table_list", "table_to_table", "keycache", "$@90",
-  "keycache_list_or_parts", "keycache_list", "assign_to_keycache",
-  "assign_to_keycache_parts", "key_cache_name", "preload", "$@91",
-  "preload_list_or_parts", "preload_list", "preload_keys",
-  "preload_keys_parts", "adm_partition", "$@92", "cache_keys_spec", "$@93",
-  "cache_key_list_or_empty", "opt_ignore_leaves", "select", "select_init",
-  "select_paren", "select_paren_derived", "select_init2", "$@94",
-  "select_part2", "$@95", "$@96", "select_into", "select_from",
-  "select_options", "select_option_list", "select_option",
-  "select_lock_type", "select_item_list", "select_item", "remember_name",
-  "remember_end", "select_alias", "optional_braces", "expr", "bool_pri",
-  "predicate", "bit_expr", "or", "and", "not", "not2", "comp_op",
-  "all_or_any", "simple_expr", "function_call_keyword",
-  "function_call_nonkeyword", "function_call_conflict",
-  "geometry_function", "function_call_generic", "@97", "fulltext_options",
-  "opt_natural_language_mode", "opt_query_expansion", "opt_udf_expr_list",
-  "udf_expr_list", "udf_expr", "sum_expr", "$@98", "$@99", "$@100",
-  "variable", "$@101", "variable_aux", "opt_distinct",
-  "opt_gconcat_separator", "opt_gorder_clause", "$@102", "gorder_list",
-  "in_sum_expr", "$@103", "cast_type", "opt_expr_list", "expr_list",
-  "ident_list_arg", "ident_list", "opt_expr", "opt_else", "when_list",
-  "table_ref", "join_table_list", "esc_table_ref", "derived_table_list",
-  "join_table", "$@104", "$@105", "$@106", "$@107", "$@108", "$@109",
-  "$@110", "normal_join", "opt_use_partition", "use_partition",
-  "table_factor", "$@111", "select_derived_union", "$@112", "$@113",
-  "select_init2_derived", "select_part2_derived", "$@114", "$@115",
-  "select_derived", "$@116", "select_derived2", "$@117", "$@118",
-  "get_select_lex", "select_derived_init", "opt_outer",
-  "index_hint_clause", "index_hint_type", "index_hint_definition", "$@119",
-  "$@120", "index_hints_list", "opt_index_hints_list", "$@121",
-  "opt_key_definition", "$@122", "opt_key_usage_list", "key_usage_element",
-  "key_usage_list", "using_list", "interval", "interval_time_stamp",
-  "date_time_type", "table_alias", "opt_table_alias", "opt_all",
-  "where_clause", "$@123", "having_clause", "$@124", "opt_escape",
-  "group_clause", "group_list", "olap_opt", "alter_order_clause",
-  "alter_order_list", "alter_order_item", "opt_order_clause",
-  "order_clause", "$@125", "order_list", "order_dir",
-  "opt_limit_clause_init", "opt_limit_clause", "limit_clause",
-  "limit_options", "limit_option", "delete_limit_clause", "ulong_num",
-  "real_ulong_num", "ulonglong_num", "real_ulonglong_num", "dec_num_error",
-  "dec_num", "procedure_analyse_clause", "$@126",
-  "opt_procedure_analyse_params", "procedure_analyse_param",
-  "select_var_list_init", "$@127", "select_var_list", "select_var_ident",
-  "into", "$@128", "into_destination", "$@129", "$@130", "do", "$@131",
-  "drop", "$@132", "$@133", "$@134", "$@135", "table_list", "table_name",
-  "table_name_with_opt_use_partition", "table_alias_ref_list",
-  "table_alias_ref", "if_exists", "opt_temporary", "drop_ts_options_list",
-  "drop_ts_options", "drop_ts_option", "insert", "$@136", "$@137",
-  "replace", "$@138", "$@139", "insert_lock_option", "replace_lock_option",
-  "insert2", "insert_table", "insert_field_spec", "$@140", "fields",
-  "insert_values", "$@141", "$@142", "values_list", "ident_eq_list",
-  "ident_eq_value", "equal", "opt_equal", "no_braces", "$@143",
-  "opt_values", "values", "expr_or_default", "opt_insert_update", "$@144",
-  "update", "$@145", "$@146", "update_list", "update_elem",
-  "insert_update_list", "insert_update_elem", "opt_low_priority", "delete",
-  "$@147", "single_multi", "$@148", "$@149", "$@150", "table_wild_list",
-  "table_wild_one", "opt_wild", "opt_delete_options", "opt_delete_option",
-  "truncate", "$@151", "opt_table_sym", "opt_profile_defs", "profile_defs",
-  "profile_def", "opt_profile_args", "show", "$@152", "show_param",
-  "$@153", "$@154", "show_engine_param", "master_or_binary", "opt_storage",
-  "opt_db", "opt_full", "from_or_in", "binlog_in", "binlog_from",
-  "wild_and_where", "describe", "$@155", "$@156", "explanable_command",
-  "describe_command", "opt_extended_describe", "opt_describe_column",
-  "flush", "$@157", "flush_options", "$@158", "$@159", "opt_flush_lock",
-  "$@160", "flush_options_list", "flush_option", "opt_table_list", "reset",
-  "$@161", "reset_options", "reset_option", "$@162", "slave_reset_options",
-  "purge", "$@163", "purge_options", "purge_option", "kill", "kill_option",
-  "use", "load", "$@164", "$@165", "$@166", "$@167", "data_or_xml",
-  "opt_local", "load_data_lock", "opt_duplicate", "opt_field_term",
-  "field_term_list", "field_term", "opt_line_term", "line_term_list",
-  "line_term", "opt_xml_rows_identified_by", "opt_ignore_lines",
-  "lines_or_rows", "opt_field_or_var_spec", "fields_or_vars",
-  "field_or_var", "opt_load_data_set_spec", "load_data_set_list",
-  "load_data_set_elem", "text_literal", "text_string", "param_marker",
-  "signed_literal", "literal", "NUM_literal", "temporal_literal",
-  "insert_ident", "table_wild", "order_ident", "simple_ident",
-  "simple_ident_nospvar", "simple_ident_q", "field_ident", "table_ident",
-  "table_ident_opt_wild", "table_ident_nodb", "IDENT_sys",
-  "TEXT_STRING_sys_nonewline", "TEXT_STRING_sys", "TEXT_STRING_literal",
-  "TEXT_STRING_filesystem", "ident", "label_ident", "ident_or_text",
-  "user", "keyword", "keyword_sp", "set", "$@168",
-  "start_option_value_list", "$@169", "$@170", "$@171",
-  "start_option_value_list_following_option_type", "$@172",
-  "option_value_list_continued", "option_value_list", "$@173", "$@174",
-  "option_value", "$@175", "option_type", "opt_var_type",
-  "opt_var_ident_type", "option_value_following_option_type",
-  "option_value_no_option_type", "$@176", "internal_variable_name",
-  "transaction_characteristics", "transaction_access_mode",
-  "isolation_level", "transaction_access_mode_types", "isolation_types",
-  "text_or_password", "set_expr_or_default", "lock", "$@177",
-  "table_or_tables", "table_lock_list", "table_lock", "lock_option",
-  "unlock", "$@178", "handler", "$@179", "handler_read_or_scan",
-  "handler_scan_function", "handler_rkey_function", "$@180",
-  "handler_rkey_mode", "revoke", "$@181", "revoke_command", "grant",
-  "$@182", "grant_command", "opt_table", "grant_privileges",
-  "opt_privileges", "object_privilege_list", "object_privilege", "$@183",
-  "$@184", "$@185", "$@186", "opt_and", "require_list",
-  "require_list_element", "grant_ident", "user_list", "grant_list",
-  "grant_user", "opt_column_list", "column_list", "column_list_id",
-  "require_clause", "grant_options", "opt_grant_option",
-  "grant_option_list", "grant_option", "begin", "$@187", "opt_work",
-  "opt_chain", "opt_release", "opt_savepoint", "commit", "rollback",
-  "savepoint", "release", "union_clause", "union_list", "$@188",
-  "union_opt", "opt_union_order_or_limit", "union_order_or_limit", "$@189",
-  "order_or_limit", "union_option", "query_specification",
-  "query_expression_body", "$@190", "subselect", "subselect_start",
-  "subselect_end", "opt_query_expression_options",
-  "query_expression_option_list", "query_expression_option",
-  "view_or_trigger_or_sp_or_event", "definer_tail", "no_definer_tail",
-  "definer_opt", "no_definer", "definer", "view_replace_or_algorithm",
-  "view_replace", "view_algorithm", "view_suid", "view_tail", "$@191",
-  "view_list_opt", "view_list", "view_select", "$@192", "view_select_aux",
-  "$@193", "create_view_select_paren", "create_view_select", "$@194",
-  "view_check_option", "trigger_tail", "$@195", "$@196", "$@197",
-  "udf_tail", "sf_tail", "$@198", "$@199", "$@200", "$@201", "$@202",
-  "sp_tail", "$@203", "$@204", "$@205", "$@206", "xa", "xid",
-  "begin_or_start", "opt_join_or_resume", "opt_one_phase", "opt_suspend",
-  "$@207", "opt_migrate", "install", "uninstall", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
-static const yytype_uint16 yytoknum[] =
-{
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
-     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
-     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
-     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
-     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
-     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
-     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
-     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
-     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
-     385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
-     405,   406,   407,   408,   409,   410,   411,   412,   413,   414,
-     415,   416,   417,   418,   419,   420,   421,   422,   423,   424,
-     425,   426,   427,   428,   429,   430,   431,   432,   433,   434,
-     435,   436,   437,   438,   439,   440,   441,   442,   443,   444,
-     445,   446,   447,   448,   449,   450,   451,   452,   453,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-     465,   466,   467,   468,   469,   470,   471,   472,   473,   474,
-     475,   476,   477,   478,   479,   480,   481,   482,   483,   484,
-     485,   486,   487,   488,   489,   490,   491,   492,   493,   494,
-     495,   496,   497,   498,   499,   500,   501,   502,   503,   504,
-     505,   506,   507,   508,   509,   510,   511,   512,   513,   514,
-     515,   516,   517,   518,   519,   520,   521,   522,   523,   524,
-     525,   526,   527,   528,   529,   530,   531,   532,   533,   534,
-     535,   536,   537,   538,   539,   540,   541,   542,   543,   544,
-     545,   546,   547,   548,   549,   550,   551,   552,   553,   554,
-     555,   556,   557,   558,   559,   560,   561,   562,   563,   564,
-     565,   566,   567,   568,   569,   570,   571,   572,   573,   574,
-     575,   576,   577,   578,   579,   580,   581,   582,   583,   584,
-     585,   586,   587,   588,   589,   590,   591,   592,   593,   594,
-     595,   596,   597,   598,   599,   600,   601,   602,   603,   604,
-     605,   606,   607,   608,   609,   610,   611,   612,   613,   614,
-     615,   616,   617,   618,   619,   620,   621,   622,   623,   624,
-     625,   626,   627,   628,   629,   630,   631,   632,   633,   634,
-     635,   636,   637,   638,   639,   640,   641,   642,   643,   644,
-     645,   646,   647,   648,   649,   650,   651,   652,   653,   654,
-     655,   656,   657,   658,   659,   660,   661,   662,   663,   664,
-     665,   666,   667,   668,   669,   670,   671,   672,   673,   674,
-     675,   676,   677,   678,   679,   680,   681,   682,   683,   684,
-     685,   686,   687,   688,   689,   690,   691,   692,   693,   694,
-     695,   696,   697,   698,   699,   700,   701,   702,   703,   704,
-     705,   706,   707,   708,   709,   710,   711,   712,   713,   714,
-     715,   716,   717,   718,   719,   720,   721,   722,   723,   724,
-     725,   726,   727,   728,   729,   730,   731,   732,   733,   734,
-     735,   736,   737,   738,   739,   740,   741,   742,   743,   744,
-     745,   746,   747,   748,   749,   750,   751,   752,   753,   754,
-     755,   756,   757,   758,   759,   760,   761,   762,   763,   764,
-     765,   766,   767,   768,   769,   770,   771,   772,   773,   774,
-     775,   776,   777,   778,   779,   780,   781,   782,   783,   784,
-     785,   786,   787,   788,   789,   790,   791,   792,   793,   794,
-     795,   796,   797,   798,   799,   800,   801,   802,   803,   804,
-     805,   806,   807,   808,   809,   810,   811,   812,   813,   814,
-     815,   816,   817,   818,   819,   820,   821,   822,   823,   824,
-     825,   826,   827,   828,   829,   830,   831,   832,   833,   834,
-     835,   836,   837,   838,   839,   840,   841,   842,   843,   844,
-     845,   846,   847,   848,   849,   850,   851,   852,   853,   854,
-     855,   856,   857,   858,   859,   860,   861,   862,   863,   864,
-     865,   866,   867,   868,   869,   870,   871,   872,   873,   874,
-     875,   124,    38,    45,    43,    42,    47,    37,    94,   126,
-      40,    41,    44,    33,   123,   125,    59,    64,    46,    58
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint16 yyr1[] =
-{
-       0,   640,   641,   642,   641,   641,   643,   643,   644,   644,
-     645,   645,   645,   645,   645,   645,   645,   645,   645,   645,
-     645,   645,   645,   645,   645,   645,   645,   645,   645,   645,
-     645,   645,   645,   645,   645,   645,   645,   645,   645,   645,
-     645,   645,   645,   645,   645,   645,   645,   645,   645,   645,
-     645,   645,   645,   645,   645,   645,   645,   645,   645,   645,
-     645,   645,   646,   647,   647,   648,   649,   649,   651,   650,
-     652,   652,   653,   653,   654,   656,   655,   658,   657,   659,
-     659,   660,   660,   660,   660,   660,   660,   660,   660,   660,
-     660,   660,   660,   660,   660,   660,   660,   660,   660,   660,
-     660,   660,   661,   661,   661,   662,   663,   663,   663,   663,
-     665,   664,   666,   667,   664,   668,   669,   664,   670,   671,
-     664,   672,   664,   673,   664,   664,   664,   664,   664,   674,
-     675,   675,   676,   676,   676,   676,   676,   676,   676,   678,
-     677,   680,   679,   679,   681,   681,   681,   681,   682,   682,
-     683,   683,   684,   684,   685,   685,   686,   686,   688,   687,
-     689,   689,   689,   689,   689,   689,   689,   689,   689,   689,
-     689,   689,   689,   690,   691,   691,   692,   692,   693,   693,
-     694,   694,   694,   694,   694,   694,   694,   695,   695,   695,
-     696,   696,   698,   697,   699,   699,   700,   700,   701,   701,
-     702,   702,   703,   703,   704,   705,   706,   706,   707,   707,
-     708,   709,   709,   709,   709,   710,   710,   711,   711,   712,
-     712,   714,   713,   713,   715,   713,   716,   713,   717,   717,
-     718,   718,   719,   720,   720,   721,   722,   722,   723,   723,
-     723,   723,   723,   724,   725,   725,   726,   726,   727,   727,
-     728,   728,   729,   729,   729,   730,   730,   730,   730,   730,
-     730,   730,   730,   730,   730,   730,   730,   731,   732,   733,
-     733,   734,   734,   735,   735,   736,   737,   737,   738,   738,
-     739,   740,   740,   741,   742,   742,   742,   742,   742,   742,
-     742,   742,   742,   742,   742,   742,   742,   743,   743,   744,
-     745,   744,   746,   746,   746,   746,   746,   746,   746,   746,
-     746,   746,   746,   746,   746,   748,   747,   750,   749,   752,
-     751,   754,   753,   755,   756,   757,   759,   758,   760,   761,
-     761,   761,   762,   762,   764,   765,   766,   763,   767,   767,
-     767,   768,   768,   770,   771,   769,   773,   772,   774,   774,
-     775,   775,   777,   778,   776,   780,   781,   779,   782,   782,
-     784,   783,   785,   785,   787,   786,   789,   788,   791,   790,
-     792,   793,   794,   792,   795,   796,   792,   797,   797,   798,
-     798,   798,   799,   800,   801,   802,   802,   803,   803,   804,
-     805,   806,   806,   808,   807,   809,   809,   809,   810,   810,
-     810,   811,   811,   812,   812,   812,   813,   813,   813,   813,
-     813,   813,   813,   813,   814,   814,   815,   815,   815,   816,
-     816,   816,   816,   816,   817,   817,   818,   818,   818,   819,
-     819,   819,   819,   819,   819,   819,   820,   820,   821,   821,
-     821,   822,   822,   822,   823,   824,   825,   826,   827,   828,
-     828,   828,   829,   830,   831,   832,   833,   834,   835,   836,
-     837,   838,   838,   839,   839,   840,   840,   840,   840,   841,
-     842,   841,   843,   844,   843,   845,   843,   846,   847,   847,
-     849,   848,   850,   852,   851,   853,   854,   855,   854,   854,
-     854,   854,   854,   856,   856,   857,   857,   858,   858,   859,
-     859,   860,   861,   862,   863,   864,   864,   865,   866,   865,
-     867,   865,   868,   868,   869,   870,   871,   871,   872,   872,
-     873,   873,   875,   874,   876,   877,   878,   877,   879,   877,
-     880,   880,   881,   881,   882,   882,   884,   885,   883,   886,
-     886,   887,   887,   888,   888,   889,   889,   891,   890,   892,
-     893,   893,   894,   894,   895,   895,   895,   895,   895,   895,
-     895,   895,   897,   898,   896,   899,   899,   900,   900,   901,
-     901,   902,   902,   903,   903,   904,   904,   905,   906,   906,
-     907,   907,   908,   908,   909,   909,   909,   910,   910,   910,
-     910,   910,   910,   910,   910,   910,   910,   910,   910,   910,
-     910,   910,   910,   910,   910,   910,   911,   910,   910,   910,
-     910,   910,   910,   910,   910,   910,   910,   910,   912,   913,
-     914,   915,   916,   916,   916,   916,   916,   916,   917,   917,
-     917,   918,   918,   919,   919,   919,   919,   920,   921,   921,
-     922,   922,   923,   923,   924,   924,   924,   924,   924,   924,
-     925,   925,   926,   927,   927,   928,   930,   929,   931,   931,
-     931,   931,   931,   931,   931,   931,   931,   931,   931,   931,
-     931,   931,   931,   931,   931,   931,   931,   931,   931,   931,
-     931,   931,   931,   931,   931,   931,   931,   931,   931,   931,
-     931,   931,   931,   932,   931,   933,   931,   931,   931,   934,
-     934,   934,   934,   934,   934,   934,   934,   935,   936,   936,
-     937,   937,   938,   938,   938,   938,   938,   939,   939,   939,
-     939,   939,   940,   940,   940,   941,   941,   941,   942,   943,
-     943,   944,   944,   944,   945,   945,   946,   946,   947,   947,
-     947,   948,   948,   948,   948,   949,   949,   950,   950,   951,
-     951,   952,   952,   953,   953,   953,   953,   953,   953,   953,
-     953,   953,   953,   953,   953,   953,   953,   953,   953,   953,
-     954,   955,   956,   956,   957,   957,   958,   958,   959,   959,
-     960,   960,   961,   961,   962,   962,   963,   964,   964,   965,
-     965,   966,   966,   967,   967,   967,   968,   968,   968,   969,
-     969,   969,   969,   969,   969,   969,   970,   970,   972,   971,
-     973,   973,   974,   975,   975,   975,   975,   976,   977,   978,
-     978,   979,   980,   980,   981,   981,   982,   982,   983,   984,
-     984,   985,   985,   986,   986,   986,   986,   987,   987,   987,
-     987,   987,   988,   988,   988,   988,   988,   989,   990,   990,
-     991,   991,   992,   992,   993,   993,   993,   994,   994,   995,
-     996,   997,   998,   998,   999,   999,  1000,  1000,  1001,  1001,
-    1002,  1002,  1003,  1003,  1004,  1004,  1005,  1005,  1006,  1006,
-    1007,  1007,  1008,  1009,  1009,  1010,  1010,  1010,  1011,  1011,
-    1012,  1012,  1013,  1013,  1014,  1014,  1015,  1015,  1017,  1016,
-    1018,  1016,  1016,  1019,  1016,  1020,  1016,  1021,  1016,  1022,
-    1016,  1023,  1016,  1016,  1016,  1016,  1016,  1016,  1016,  1024,
-    1024,  1025,  1025,  1025,  1025,  1026,  1026,  1027,  1027,  1028,
-    1028,  1029,  1029,  1029,  1029,  1029,  1029,  1029,  1029,  1029,
-    1029,  1030,  1029,  1029,  1031,  1029,  1032,  1029,  1029,  1029,
-    1029,  1029,  1033,  1034,  1034,  1036,  1035,  1037,  1037,  1037,
-    1039,  1038,  1040,  1041,  1040,  1042,  1042,  1043,  1044,  1044,
-    1045,  1046,  1046,  1046,  1047,  1046,  1048,  1049,  1046,  1046,
-    1046,  1046,  1046,  1046,  1046,  1046,  1046,  1046,  1046,  1046,
-    1046,  1046,  1046,  1046,  1050,  1050,  1050,  1050,  1050,  1051,
-    1051,  1052,  1052,  1053,  1053,  1054,  1054,  1055,  1055,  1055,
-    1056,  1056,  1056,  1057,  1057,  1057,  1057,  1059,  1058,  1058,
-    1060,  1061,  1061,  1062,  1062,  1063,  1063,  1063,  1064,  1065,
-    1065,  1066,  1066,  1067,  1067,  1068,  1068,  1069,  1069,  1070,
-    1070,  1071,  1071,  1072,  1072,  1073,  1073,  1073,  1073,  1073,
-    1075,  1074,  1076,  1076,  1076,  1078,  1077,  1079,  1079,  1080,
-    1080,  1081,  1081,  1081,  1083,  1082,  1084,  1086,  1085,  1087,
-    1087,  1088,  1088,  1089,  1089,  1089,  1089,  1089,  1089,  1091,
-    1090,  1092,  1092,  1092,  1094,  1093,  1093,  1095,  1095,  1096,
-    1096,  1097,  1099,  1098,  1100,  1100,  1101,  1101,  1102,  1103,
-    1104,  1104,  1106,  1105,  1107,  1107,  1108,  1108,  1109,  1110,
-    1112,  1111,  1114,  1113,  1115,  1115,  1116,  1116,  1117,  1118,
-    1118,  1119,  1119,  1120,  1120,  1122,  1121,  1124,  1125,  1123,
-    1126,  1126,  1126,  1126,  1126,  1127,  1127,  1128,  1128,  1129,
-    1129,  1130,  1130,  1130,  1131,  1131,  1131,  1132,  1132,  1132,
-    1133,  1133,  1134,  1135,  1136,  1136,  1136,  1136,  1136,  1137,
-    1137,  1138,  1138,  1138,  1138,  1138,  1138,  1138,  1138,  1138,
-    1138,  1138,  1139,  1139,  1139,  1139,  1139,  1139,  1140,  1140,
-    1140,  1140,  1140,  1140,  1140,  1140,  1140,  1140,  1140,  1140,
-    1140,  1140,  1141,  1141,  1141,  1141,  1141,  1141,  1141,  1141,
-    1141,  1141,  1141,  1141,  1141,  1141,  1141,  1142,  1142,  1143,
-    1143,  1144,  1144,  1145,  1145,  1146,  1146,  1146,  1146,  1146,
-    1146,  1147,  1147,  1148,  1148,  1148,  1148,  1148,  1148,  1148,
-    1148,  1148,  1148,  1148,  1148,  1148,  1148,  1148,  1148,  1148,
-    1148,  1148,  1148,  1148,  1148,  1148,  1148,  1148,  1148,  1148,
-    1148,  1148,  1148,  1149,  1149,  1149,  1149,  1149,  1149,  1149,
-    1149,  1149,  1149,  1149,  1149,  1149,  1149,  1149,  1149,  1149,
-    1149,  1149,  1149,  1149,  1149,  1149,  1149,  1149,  1149,  1149,
-    1150,  1150,  1150,  1150,  1150,  1150,  1150,  1150,  1150,  1150,
-    1150,  1150,  1150,  1150,  1150,  1150,  1150,  1150,  1150,  1150,
-    1150,  1150,  1151,  1151,  1151,  1151,  1151,  1151,  1151,  1151,
-    1151,  1151,  1151,  1151,  1151,  1151,  1151,  1151,  1151,  1151,
-    1151,  1151,  1151,  1151,  1151,  1151,  1151,  1152,  1152,  1152,
-    1152,  1152,  1152,  1152,  1152,  1154,  1153,  1153,  1155,  1155,
-    1156,  1156,  1157,  1157,  1158,  1158,  1159,  1159,  1160,  1161,
-    1161,  1161,  1161,  1161,  1161,  1161,  1162,  1163,  1161,  1161,
-    1161,  1161,  1161,  1161,  1161,  1161,  1161,  1161,  1161,  1164,
-    1161,  1166,  1165,  1167,  1167,  1167,  1168,  1168,  1169,  1169,
-    1170,  1171,  1170,  1172,  1172,  1174,  1173,  1175,  1175,  1175,
-    1175,  1175,  1175,  1175,  1175,  1175,  1175,  1175,  1176,  1176,
-    1177,  1177,  1178,  1178,  1179,  1179,  1180,  1180,  1181,  1181,
-    1182,  1182,  1183,  1183,  1184,  1185,  1185,  1186,  1186,  1187,
-    1187,  1188,  1187,  1189,  1187,  1190,  1187,  1187,  1191,  1187,
-    1192,  1187,  1187,  1193,  1187,  1194,  1187,  1187,  1195,  1195,
-    1195,  1196,  1196,  1197,  1199,  1198,  1198,  1198,  1200,  1201,
-    1202,  1200,  1203,  1205,  1206,  1204,  1208,  1207,  1210,  1211,
-    1209,  1212,  1213,  1214,  1214,  1215,  1215,  1215,  1215,  1216,
-    1216,  1218,  1217,  1219,  1217,  1220,  1220,  1221,  1222,  1221,
-    1224,  1223,  1225,  1225,  1226,  1226,  1227,  1227,  1228,  1228,
-    1229,  1229,  1229,  1229,  1229,  1229,  1229,  1229,  1229,  1229,
-    1229,  1229,  1230,  1230,  1230,  1230,  1230,  1230,  1230,  1230,
-    1230,  1231,  1231,  1231,  1231,  1232,  1232,  1232,  1233,  1233,
-    1234,  1234,  1235,  1236,  1235,  1237,  1238,  1237,  1239,  1239,
-    1240,  1240,  1241,  1241,  1242,  1242,  1242,  1243,  1244,  1244,
-    1245,  1246,  1246,  1248,  1247,  1249,  1249,  1250,  1250,  1250,
-    1251,  1251,  1252,  1252,  1253,  1254,  1254,  1254,  1255,  1255,
-    1255,  1255,  1255,  1256,  1256,  1257,  1257,  1257,  1257,  1257,
-    1257,  1258,  1258,  1258,  1258,  1258,  1259,  1259,  1259,  1259,
-    1259,  1260,  1260,  1260,  1260,  1261,  1262,  1262,  1263,  1264,
-    1263,  1265,  1265,  1265,  1266,  1268,  1267,  1269,  1269,  1270,
-    1270,  1272,  1271,  1274,  1275,  1273,  1273,  1273,  1277,  1276,
-    1279,  1278,  1280,  1281,  1278,  1278,  1278,  1278,  1278,  1278,
-    1282,  1278,  1278,  1278,  1278,  1278,  1278,  1283,  1283,  1284,
-    1285,  1286,  1286,  1287,  1288,  1288,  1289,  1289,  1290,  1290,
-    1291,  1291,  1291,  1292,  1292,  1294,  1295,  1293,  1297,  1298,
-    1296,  1299,  1299,  1299,  1299,  1300,  1300,  1301,  1301,  1302,
-    1303,  1303,  1303,  1304,  1303,  1305,  1305,  1306,  1306,  1307,
-    1306,  1308,  1306,  1309,  1309,  1310,  1310,  1311,  1312,  1312,
-    1313,  1313,  1315,  1314,  1316,  1316,  1317,  1317,  1318,  1318,
-    1319,  1320,  1319,  1322,  1323,  1321,  1324,  1324,  1325,  1326,
-    1326,  1327,  1328,  1328,  1330,  1329,  1332,  1331,  1333,  1331,
-    1334,  1331,  1335,  1335,  1336,  1336,  1337,  1337,  1338,  1338,
-    1339,  1339,  1339,  1341,  1340,  1342,  1342,  1343,  1343,  1344,
-    1344,  1345,  1345,  1345,  1345,  1345,  1345,  1345,  1345,  1345,
-    1346,  1346,  1348,  1347,  1349,  1349,  1349,  1349,  1349,  1349,
-    1349,  1349,  1349,  1349,  1349,  1349,  1350,  1349,  1351,  1349,
-    1349,  1349,  1349,  1349,  1349,  1349,  1349,  1349,  1349,  1349,
-    1349,  1349,  1349,  1349,  1349,  1349,  1349,  1349,  1349,  1349,
-    1349,  1349,  1349,  1349,  1349,  1349,  1349,  1349,  1349,  1352,
-    1352,  1352,  1353,  1353,  1354,  1354,  1355,  1355,  1356,  1356,
-    1357,  1357,  1358,  1358,  1359,  1359,  1360,  1360,  1360,  1362,
-    1361,  1363,  1361,  1364,  1364,  1364,  1364,  1364,  1365,  1365,
-    1366,  1366,  1366,  1366,  1367,  1367,  1367,  1369,  1368,  1371,
-    1372,  1370,  1370,  1373,  1373,  1374,  1373,  1375,  1375,  1376,
-    1376,  1376,  1376,  1376,  1376,  1376,  1376,  1376,  1376,  1376,
-    1376,  1376,  1377,  1377,  1379,  1378,  1380,  1380,  1382,  1381,
-    1381,  1381,  1383,  1383,  1385,  1384,  1386,  1387,  1387,  1388,
-    1389,  1389,  1389,  1390,  1392,  1393,  1394,  1395,  1391,  1396,
-    1396,  1397,  1397,  1398,  1398,  1398,  1399,  1399,  1399,  1400,
-    1400,  1401,  1401,  1402,  1402,  1402,  1402,  1403,  1403,  1404,
-    1404,  1405,  1405,  1406,  1406,  1407,  1407,  1408,  1408,  1409,
-    1409,  1409,  1410,  1410,  1411,  1411,  1412,  1412,  1413,  1413,
-    1414,  1415,  1415,  1415,  1415,  1416,  1416,  1416,  1417,  1418,
-    1418,  1418,  1419,  1419,  1419,  1419,  1419,  1419,  1419,  1419,
-    1419,  1419,  1420,  1420,  1420,  1420,  1420,  1421,  1421,  1421,
-    1422,  1422,  1423,  1423,  1424,  1425,  1425,  1426,  1426,  1427,
-    1427,  1427,  1428,  1428,  1428,  1428,  1429,  1429,  1429,  1430,
-    1430,  1431,  1432,  1432,  1433,  1434,  1435,  1436,  1437,  1437,
-    1438,  1438,  1439,  1439,  1439,  1440,  1440,  1440,  1441,  1441,
-    1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,
-    1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,
-    1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,
-    1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,
-    1441,  1441,  1441,  1441,  1441,  1441,  1441,  1441,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,
-    1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1442,  1444,
-    1443,  1446,  1445,  1447,  1445,  1448,  1445,  1450,  1449,  1449,
-    1451,  1451,  1453,  1452,  1454,  1452,  1456,  1455,  1455,  1457,
-    1457,  1457,  1458,  1458,  1458,  1458,  1459,  1459,  1459,  1459,
-    1460,  1462,  1461,  1461,  1461,  1461,  1461,  1461,  1461,  1461,
-    1463,  1463,  1463,  1464,  1464,  1464,  1464,  1465,  1466,  1467,
-    1467,  1468,  1468,  1468,  1468,  1469,  1469,  1469,  1470,  1470,
-    1470,  1470,  1470,  1472,  1471,  1473,  1473,  1474,  1474,  1475,
-    1476,  1476,  1476,  1476,  1478,  1477,  1479,  1479,  1480,  1479,
-    1481,  1481,  1482,  1482,  1483,  1483,  1483,  1483,  1484,  1483,
-    1485,  1485,  1485,  1485,  1485,  1487,  1486,  1488,  1488,  1488,
-    1488,  1488,  1490,  1489,  1491,  1491,  1491,  1491,  1492,  1492,
-    1493,  1493,  1494,  1494,  1495,  1495,  1497,  1496,  1498,  1496,
-    1499,  1496,  1500,  1496,  1496,  1496,  1496,  1496,  1496,  1496,
-    1496,  1496,  1496,  1496,  1496,  1496,  1496,  1496,  1496,  1496,
-    1496,  1496,  1496,  1496,  1496,  1496,  1496,  1496,  1496,  1496,
-    1501,  1501,  1502,  1502,  1503,  1503,  1503,  1504,  1504,  1504,
-    1504,  1505,  1505,  1506,  1506,  1507,  1507,  1507,  1507,  1507,
-    1508,  1508,  1509,  1509,  1510,  1511,  1511,  1511,  1511,  1511,
-    1512,  1512,  1513,  1513,  1514,  1514,  1515,  1515,  1515,  1515,
-    1515,  1517,  1516,  1518,  1518,  1519,  1519,  1519,  1520,  1520,
-    1520,  1521,  1521,  1522,  1523,  1523,  1524,  1525,  1526,  1526,
-    1528,  1527,  1529,  1529,  1529,  1530,  1530,  1532,  1531,  1533,
-    1533,  1534,  1534,  1534,  1535,  1535,  1536,  1537,  1536,  1538,
-    1539,  1540,  1541,  1541,  1542,  1542,  1543,  1543,  1543,  1543,
-    1543,  1543,  1543,  1543,  1544,  1544,  1544,  1545,  1545,  1545,
-    1545,  1545,  1546,  1546,  1546,  1546,  1546,  1546,  1547,  1547,
-    1548,  1549,  1550,  1550,  1550,  1551,  1552,  1552,  1552,  1553,
-    1553,  1553,  1555,  1554,  1556,  1556,  1557,  1557,  1559,  1558,
-    1561,  1560,  1560,  1562,  1562,  1564,  1563,  1565,  1565,  1565,
-    1565,  1567,  1568,  1569,  1566,  1570,  1570,  1572,  1573,  1574,
-    1575,  1576,  1571,  1578,  1579,  1580,  1581,  1577,  1582,  1582,
-    1582,  1582,  1582,  1582,  1583,  1583,  1583,  1584,  1584,  1585,
-    1585,  1585,  1586,  1586,  1587,  1588,  1587,  1589,  1589,  1590,
-    1591
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     1,     0,     4,     2,     0,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     3,     1,     1,     4,     1,     2,     0,     4,
-       0,     2,     3,     1,     2,     0,     3,     0,     5,     1,
-       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
-       3,     3,     3,     3,     3,     3,     3,     3,     3,     5,
-       3,     1,     0,     1,     3,     1,     3,     3,     3,     3,
-       0,     7,     0,     0,    14,     0,     0,    14,     0,     0,
-      14,     0,     6,     0,     3,     4,     4,     3,     2,    10,
-       1,     3,     2,     2,     2,     2,     2,     2,     2,     0,
-      13,     0,     6,     2,     0,     1,     3,     1,     0,     2,
-       0,     2,     0,     1,     3,     4,     0,     2,     0,     2,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     0,     3,     1,     0,     2,     0,     2,
-       2,     2,     2,     2,     3,     3,     1,     1,     1,     2,
-       3,     3,     0,     4,     0,     3,     0,     1,     3,     1,
-       0,     1,     3,     1,     0,     3,     0,     1,     3,     1,
-       4,     0,     1,     1,     1,     0,     3,     2,     3,     0,
-       3,     0,     5,     5,     0,     7,     0,     6,     1,     1,
-       1,     3,     1,     1,     1,     3,     0,     1,     1,     1,
-       1,     2,     1,     3,     1,     1,     0,     1,     0,     2,
-       3,     5,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     3,     4,     0,
-       1,     1,     3,     1,     3,     3,     1,     2,     1,     1,
-       1,     1,     3,     3,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     3,     0,
-       0,     3,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     0,     5,     0,     2,     0,
-       3,     0,     2,     2,     2,     2,     0,     6,     2,     0,
-       2,     1,     1,     3,     0,     0,     0,     7,     0,     2,
-       2,     1,     1,     0,     0,     8,     0,     6,     1,     2,
-       1,     2,     0,     0,     6,     0,     0,     6,     0,     2,
-       0,     5,     0,     1,     0,     5,     0,     2,     0,     5,
-       4,     0,     0,     8,     0,     0,     8,     1,     1,     1,
-       1,     1,     2,     4,     5,     0,     4,     4,     4,     3,
-       3,     2,     2,     0,     2,     1,     2,     3,     1,     1,
-       1,     0,     1,     1,     2,     3,     1,     1,     1,     1,
-       1,     1,     1,     1,     0,     1,     1,     2,     3,     1,
-       1,     1,     1,     1,     0,     1,     1,     2,     3,     1,
-       1,     1,     1,     1,     1,     1,     0,     1,     1,     2,
-       3,     1,     1,     1,     2,     2,     2,     1,     1,     1,
-       1,     2,     3,     3,     3,     3,     3,     3,     3,     3,
-       4,     1,     1,     1,     1,     2,     3,     2,     4,     5,
-       0,     5,     0,     0,     5,     0,     7,     1,     0,     1,
-       0,     4,     0,     0,     3,     5,     6,     0,     4,     2,
-       2,     2,     2,     0,     1,     0,     3,     0,     1,     1,
-       3,     1,     4,     5,     5,     0,     2,     0,     0,     7,
-       0,    10,     1,     3,     1,     1,     0,     2,     0,     3,
-       1,     3,     0,     6,     1,     0,     0,     5,     0,     4,
-       1,     1,     1,     3,     1,     3,     0,     0,     5,     1,
-       3,     1,     1,     0,     3,     1,     3,     0,     4,     1,
-       0,     1,     2,     1,     3,     4,     3,     3,     3,     4,
-       4,     3,     0,     0,     6,     0,     1,     0,     1,     1,
-       2,     1,     1,     0,     1,     1,     2,     1,     0,     3,
-       0,     1,     1,     2,     1,     2,     3,     3,     3,     3,
-       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
-       3,     3,     3,     3,     3,     3,     0,     6,     1,     1,
-       3,     4,     4,     2,     2,     2,     3,     3,     4,     4,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     2,     1,     1,     1,     1,     1,     1,     3,
-       1,     1,     2,     2,     7,     8,     8,     8,     8,     2,
-       0,     1,     4,     0,     1,     2,     0,     4,     3,     3,
-       3,     1,     2,     1,     1,     3,     2,     3,     2,     2,
-       1,     3,     3,     2,     3,     1,     2,     2,     2,     1,
-       2,     1,     1,     1,     2,     3,     2,     3,     2,     2,
-       3,     3,     3,     0,     6,     0,     6,     2,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
-       2,     1,     2,     1,     2,     3,     2,     1,     1,     1,
-       1,     1,     1,     1,     2,     0,     1,     1,     5,     0,
-       3,     0,     2,     3,     0,     1,     2,     1,     1,     1,
-       1,     3,     3,     3,     3,     0,     1,     0,     1,     0,
-       1,     2,     1,     1,     2,     2,     3,     1,     3,     2,
-       1,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     1,     1,     2,     1,     1,     1,     1,     1,
-       0,     2,     1,     1,     1,     1,     1,     0,     2,     1,
-       1,     0,     1,     1,     2,     2,     1,     2,     2,     0,
-       1,     1,     1,     3,     1,     3,     0,     1,     0,     4,
-       1,     1,     1,     0,     1,     2,     1,     1,     2,     1,
-       3,     3,     1,     1,     0,     2,     0,     1,     5,     0,
-       3,     3,     1,     0,     2,     2,     2,     0,     3,     3,
-       6,     6,     1,     1,     2,     2,     2,     1,     2,     2,
-       1,     1,     0,     1,     1,     1,     1,     0,     1,     1,
-       1,     0,     1,     2,     0,     1,     0,     1,     0,     1,
-       1,     2,     1,     2,     1,     2,     2,     2,     3,     2,
-       1,     1,     1,     1,     3,     1,     1,     1,     4,     2,
-       1,     4,     0,     1,     0,     2,     1,     3,     0,     6,
-       0,     5,     7,     0,     5,     0,     5,     0,     5,     0,
-       4,     0,    10,     3,     4,     3,     3,     7,     4,     3,
-       5,     0,     3,     1,     4,     0,     3,     0,     2,     0,
-       1,     0,     2,     2,     2,     2,     1,     1,     1,     3,
-       4,     0,     6,     4,     0,     5,     0,     6,     4,     3,
-       1,     7,     3,     1,     1,     0,     5,     0,     3,     2,
-       0,     5,     0,     0,     6,     1,     3,     1,     1,     3,
-       2,     3,     2,     4,     0,     6,     0,     0,     8,     4,
-       4,     3,     3,     2,     2,     6,     5,     3,     5,     1,
-       1,     1,     1,     1,     0,     1,     1,     2,     2,     3,
-       3,     3,     3,     0,     1,     0,     1,     0,     1,     1,
-       0,     2,     1,     0,     1,     1,     1,     0,     6,     3,
-       3,     0,     1,     1,     3,     3,     2,     2,     4,     0,
-       3,     0,     3,     0,     3,     0,     3,     0,     1,     1,
-       3,     1,     1,     0,     2,     1,     3,     3,     3,     1,
-       0,     5,     0,     1,     1,     0,     6,     0,     1,     1,
-       2,     1,     1,     1,     0,     5,     2,     0,     5,     0,
-       1,     1,     2,     1,     1,     1,     1,     1,     2,     0,
-       5,     0,     1,     1,     0,     4,     4,     3,     5,     1,
-       3,     3,     0,     6,     1,     1,     1,     3,     2,     3,
-       1,     1,     0,     6,     1,     1,     1,     3,     3,     4,
-       0,     6,     0,     2,     0,     4,     0,     2,     1,     2,
-       4,     2,     3,     2,     3,     0,     3,     0,     0,     6,
-       2,     1,     1,     2,     2,     8,     4,     0,     1,     2,
-       1,     1,     1,     1,     0,     2,     4,     3,     1,     1,
-       3,     4,     0,     0,     0,     2,     2,     1,     1,     0,
-       2,     3,     3,     3,     2,     3,     4,     3,     4,     3,
-       4,     1,     3,     4,     3,     3,     6,     1,     5,     6,
-       5,     7,     6,     8,     5,     6,     4,     4,     5,     3,
-       4,     1,     3,     3,     3,     3,     3,     3,     5,     5,
-       3,     3,     3,     3,     3,     3,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     3,     1,
-       1,     1,     1,     3,     2,     2,     2,     2,     3,     3,
-       5,     6,     4,     4,     7,     2,     6,     5,     6,     6,
-       4,     4,     5,     4,     6,     2,     4,     4,     4,    10,
-       6,     8,     6,     4,     4,     6,     4,     4,     4,     6,
-       4,     7,     7,     7,     6,     6,     6,     6,     3,     4,
-       6,     8,     2,     2,     8,     8,     6,     6,     1,     6,
-       6,     8,     8,     6,     8,     6,     2,     8,     8,     2,
-       2,     2,     4,     4,     4,     4,     3,     8,     6,     8,
-       4,     6,     4,     4,     4,     6,     8,     4,     3,     6,
-       4,     6,     5,     8,     7,    10,     1,     6,     4,     4,
-       4,     4,     4,     6,     4,     0,     5,     6,     2,     3,
-       0,     4,     0,     3,     0,     1,     1,     3,     4,     4,
-       5,     4,     4,     4,     5,     4,     0,     0,     7,     4,
-       5,     4,     5,     4,     4,     4,     4,     4,     5,     0,
-       8,     0,     3,     3,     1,     4,     0,     1,     0,     2,
-       0,     0,     4,     4,     2,     0,     3,     2,     3,     2,
-       1,     2,     1,     2,     1,     2,     2,     2,     0,     1,
-       1,     3,     1,     3,     1,     3,     0,     1,     0,     2,
-       4,     5,     1,     1,     1,     1,     4,     1,     3,     3,
-       3,     0,     6,     0,     6,     0,     8,     4,     0,     8,
-       0,    10,     6,     0,     8,     0,    10,     6,     1,     2,
-       2,     0,     1,     5,     0,     5,     3,     5,     2,     0,
-       0,     7,     1,     0,     0,     6,     0,     3,     0,     0,
-       5,     0,     1,     0,     1,     0,     2,     3,     3,     1,
-       1,     0,     7,     0,     7,     1,     2,     0,     0,     2,
-       0,     2,     0,     1,     1,     1,     1,     3,     1,     3,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     0,     1,     1,     0,     2,
-       0,     1,     0,     0,     3,     0,     0,     3,     2,     0,
-       0,     4,     4,     2,     0,     1,     1,     3,     3,     1,
-       2,     0,     1,     0,     4,     4,     2,     0,     1,     1,
-       0,     1,     0,     1,     2,     1,     3,     3,     1,     1,
-       1,     1,     1,     0,     2,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     0,     0,
-       6,     0,     1,     3,     1,     0,     2,     3,     1,     2,
-       1,     0,     3,     0,     0,     7,     2,     1,     0,     3,
-       0,     7,     0,     0,     8,     4,     6,     4,     4,     4,
-       0,     6,     4,     4,     4,     5,     4,     1,     3,     1,
-       2,     1,     3,     1,     0,     2,     0,     1,     0,     1,
-       1,     2,     3,     1,     1,     0,     0,     8,     0,     0,
-       6,     0,     1,     1,     1,     1,     1,     2,     1,     1,
-       1,     3,     4,     0,     3,     3,     1,     2,     2,     0,
-       3,     0,     5,     3,     1,     3,     1,     3,     1,     1,
-       0,     1,     0,     4,     0,     1,     3,     1,     1,     1,
-       0,     0,     6,     0,     0,    11,     3,     1,     3,     3,
-       1,     3,     0,     1,     0,     4,     0,     7,     0,     5,
-       0,     6,     1,     3,     2,     4,     0,     2,     0,     2,
-       1,     1,     1,     0,     4,     0,     1,     0,     1,     1,
-       3,     1,     1,     2,     2,     2,     1,     1,     1,     1,
-       0,     3,     0,     3,     2,     4,     4,     3,     4,     4,
-       1,     3,     3,     6,     2,     2,     0,     6,     0,     6,
-       5,     2,     1,     5,     5,     2,     2,     1,     4,     3,
-       2,     3,     2,     2,     1,     3,     4,     3,     3,     2,
-       2,     3,     3,     3,     3,     3,     3,     3,     3,     1,
-       1,     1,     1,     1,     0,     1,     0,     2,     0,     1,
-       1,     1,     0,     2,     0,     2,     0,     2,     2,     0,
-       4,     0,     4,     1,     1,     1,     1,     1,     1,     1,
-       0,     1,     1,     3,     0,     1,     1,     0,     4,     0,
-       0,     5,     1,     0,     3,     0,     3,     3,     1,     2,
-       2,     2,     2,     2,     2,     2,     1,     1,     1,     1,
-       1,     1,     0,     1,     0,     3,     3,     1,     0,     3,
-       1,     2,     0,     1,     0,     3,     3,     2,     2,     3,
-       0,     1,     1,     2,     0,     0,     0,     0,    22,     1,
-       1,     0,     1,     0,     1,     1,     0,     1,     1,     0,
-       2,     2,     1,     3,     4,     3,     3,     0,     2,     2,
-       1,     3,     3,     0,     4,     0,     3,     1,     1,     0,
-       3,     2,     3,     1,     1,     2,     0,     2,     3,     1,
-       5,     1,     1,     2,     2,     1,     1,     1,     1,     1,
-       2,     2,     1,     1,     1,     1,     1,     1,     1,     1,
-       2,     2,     1,     1,     1,     1,     1,     2,     2,     2,
-       1,     1,     3,     5,     1,     1,     1,     1,     1,     3,
-       4,     5,     1,     5,     3,     2,     1,     3,     2,     2,
-       4,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     3,     2,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     0,
-       3,     0,     3,     0,     3,     0,     3,     0,     3,     2,
-       0,     2,     0,     2,     0,     4,     0,     3,     1,     1,
-       1,     1,     0,     1,     1,     1,     0,     2,     2,     2,
-       3,     0,     4,     4,     6,     2,     3,     3,     3,     5,
-       1,     3,     3,     1,     1,     3,     3,     1,     3,     2,
-       2,     2,     2,     2,     1,     1,     4,     4,     1,     1,
-       1,     1,     1,     0,     4,     1,     1,     1,     3,     3,
-       1,     1,     2,     2,     0,     3,     4,     3,     0,     7,
-       1,     2,     1,     1,     1,     1,     1,     1,     0,     5,
-       1,     1,     1,     1,     1,     0,     4,     6,     6,     6,
-       7,     5,     0,     4,     8,     8,     8,     6,     0,     1,
-       1,     2,     0,     1,     1,     3,     0,     3,     0,     3,
-       0,     3,     0,     3,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     2,     2,     1,     3,     2,
-       2,     2,     2,     2,     2,     2,     2,     1,     1,     2,
-       0,     1,     3,     1,     2,     2,     2,     1,     3,     3,
-       1,     1,     3,     1,     3,     4,     5,     4,     6,     1,
-       0,     3,     3,     1,     1,     0,     2,     2,     2,     2,
-       0,     2,     0,     3,     2,     1,     2,     2,     2,     2,
-       2,     0,     3,     0,     1,     0,     3,     2,     0,     1,
-       2,     0,     1,     4,     4,     5,     2,     3,     0,     1,
-       0,     4,     0,     1,     1,     0,     1,     0,     2,     2,
-       1,     0,     1,     1,     2,     3,     2,     0,     6,     3,
-       0,     0,     0,     1,     2,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     2,     2,     3,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       0,     3,     1,     2,     1,     2,     3,     3,     3,     0,
-       3,     3,     0,     7,     0,     3,     1,     3,     0,     3,
-       0,     3,     4,     1,     3,     0,     3,     0,     3,     4,
-       4,     0,     0,     0,    16,     8,     7,     0,     0,     0,
-       0,     0,    15,     0,     0,     0,     0,    12,     4,     4,
-       3,     4,     3,     2,     1,     3,     5,     1,     1,     0,
-       1,     1,     0,     2,     0,     0,     3,     0,     2,     5,
-       3
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint16 yydefact[] =
-{
-       0,  2600,  1081,  2531,     0,     0,     0,     0,     0,     0,
-    2533,   123,    63,  1704,  1818,  1819,  1608,  1636,     2,     0,
-    1081,   269,   173,     0,    75,  1645,     0,  1870,     0,     0,
-    1081,   483,     0,  1864,     0,     0,  1081,  1648,  1854,   246,
-     173,  2533,     0,  1127,  2339,  1742,     0,     0,     0,  1725,
-       0,  2414,  1693,     0,     0,     0,     0,     3,     8,    19,
-       0,    39,    24,    29,    14,    18,    13,    52,    46,    26,
-      37,    10,    54,    55,    16,    43,    11,    12,    15,    35,
-      42,    36,    38,    50,  1118,    22,    23,    30,    44,    59,
-      20,    56,    53,    21,  1820,    25,    45,    40,    32,    60,
-      33,    51,    34,    58,    28,    47,    27,     9,    17,    48,
-      49,    41,    61,    31,    57,     0,   929,     0,     0,  1006,
-       0,     0,     0,     0,   173,     0,   909,  2598,  2599,  2600,
-    1083,  1082,     0,  2533,  1975,  1066,  1092,  2038,  2039,  2040,
-    2041,  2042,  2043,  2044,  2045,  1989,  2046,  2048,  2047,  2049,
-    2050,  1990,  1991,  2051,  2052,  2053,  2055,  2054,  2056,  1992,
-    1993,  2057,  2058,  2059,  2060,  1994,  1995,  2061,  2063,  2062,
-    1996,  2064,  2065,  2066,  2069,  2068,  2067,  1997,  2070,  1998,
-    2071,  2072,  2073,  2074,  2075,  2076,  2077,  2079,  2078,  1999,
-    2080,  2081,  2082,  2083,  2084,  2086,  2085,  2087,  2088,  2089,
-    2000,  2090,  2091,  2092,  2093,  2094,  2095,  2096,  2097,  2098,
-    2001,  2099,  2100,  2101,  2121,  2002,  2102,  2105,  2104,  2103,
-    2106,  2107,  2108,  2110,  2109,  2111,  2112,  2003,  2113,  2114,
-    2115,  2116,  2117,  2119,  2118,  2123,  2124,  2125,  2004,  2005,
-    2120,  2122,  2319,  2126,  2128,  2127,  2129,  2131,  2130,  2006,
-    2132,  2007,  2008,  2133,  2134,  1972,  2135,  1973,  2136,  2138,
-    2139,  2140,  2145,  2009,  2137,  2141,  2142,  2143,  2144,  2146,
-    2010,  2147,  2148,  2149,  2150,  2151,  2152,  2153,  2154,  2155,
-    2156,  2178,  2167,  2169,  2160,  2162,  2163,  2165,  2161,  2168,
-    2166,  2172,  2171,  2173,  2174,  2175,  2176,  2177,  2170,  2158,
-    2164,  2159,  2179,  2180,  2157,  2181,  2182,  2183,  2184,  2185,
-    2186,  2187,  2188,  2189,  2190,  2191,  2193,  2192,  2194,  2195,
-    2196,  2197,  2198,  2199,  2201,  2200,  2202,  2203,  2204,  2206,
-    2205,  2208,  2209,  2011,  2207,  2210,  2211,  2212,  2213,  2214,
-    2215,  2012,  2013,  2014,  2216,  2217,  2015,  2218,  2220,  2219,
-    2221,  2222,  2223,  2224,  2225,  2226,  2227,  2016,  2017,  2228,
-    2229,  2230,  2231,  2232,  2233,  2234,  2235,  2236,  2237,  2238,
-    2239,  2240,  2241,  2243,  2242,  2244,  2245,  2246,  2247,  2248,
-    2249,  2250,  2018,  2251,  2019,  2252,  2253,  2020,  2254,  2021,
-    2255,  2256,  2257,  2258,  2022,  2259,  2260,  2261,  2263,  2264,
-    2262,  2265,  2023,  2266,  2267,  2268,  2024,  2270,  2269,  2271,
-    2025,  2273,  2274,  2026,  2272,  2028,  2275,  2276,  2027,  2029,
-    2277,  2278,  2279,  2280,  2281,  2283,  2282,  2284,  2285,  2286,
-    2030,  2287,  2288,  2289,  2290,  2031,  2291,  2292,  2293,  2294,
-    2295,  2297,  2296,  2298,  2299,  2300,  2301,  2303,  2305,  2304,
-    2302,  2306,  2307,  2308,  2309,  2312,  2313,  2314,  2315,  2310,
-    2311,  2032,  2316,  2317,  2318,  2320,  2321,  2323,  2322,  2033,
-    2034,  2324,  2325,  2037,  2326,  2327,  2330,  2328,  2329,  2332,
-    2331,  2333,  2335,  2334,  2035,  2336,  2036,  2337,  2338,   192,
-    1978,   175,  1979,  1988,     0,  2406,  2405,  1050,  1067,  2534,
-    2535,   578,   859,     0,     0,   860,     0,   577,   858,   173,
-    2600,   128,     0,   574,   575,     0,     0,     0,  1718,     0,
-    1634,  1634,  1634,     0,     0,  1634,  1634,     0,  1637,  1634,
-     173,  1634,     0,    68,  1827,   270,     0,  2442,     0,     0,
-       0,  1971,     0,  1651,     0,  1871,  1872,     0,  1879,     0,
-    1880,  1874,  2403,     0,     0,     0,     0,     0,   173,  1084,
-       0,  1702,     0,   236,   245,   247,   248,   244,  2435,  2535,
-    2546,  1119,  1125,  1137,     0,  1798,   248,  1037,  1021,  1037,
-    1726,  1723,     0,     0,  1702,  1873,  2657,     0,     0,     0,
-    2653,     0,  2658,     0,  1127,     0,     0,     1,     5,     0,
-       0,  2116,  2005,  2220,  1811,  1809,  1966,     0,   900,   930,
-       0,   905,     0,   903,  1984,  1983,  1982,     0,   916,   915,
-     913,     0,   447,     0,     0,     0,  2609,   907,  1064,  2532,
-       0,   194,     0,    77,     0,     0,     0,  2538,     0,     0,
-       0,     0,   127,     0,     0,     0,   124,  1152,  1152,  2600,
-    2602,  2604,   578,   576,     0,     0,     0,  1722,  1721,  1720,
-       0,  1718,  2039,  1989,  2050,     0,  1939,     0,     0,     0,
-    1406,     0,  1994,     0,  2064,  2066,  1999,     0,     0,  1159,
-    1159,   731,     0,     0,     0,  2088,  2089,  1945,     0,     0,
-       0,  1936,  1946,  2005,  2128,  2129,     0,  1938,  2134,     0,
-       0,     0,     0,  2151,  1943,     0,     0,  2188,  2190,     0,
-       0,  2194,  2195,  2196,  2197,  1922,  1214,     0,   731,  1935,
-    1942,  2213,  1928,  2221,  2226,  2227,     0,  2236,     0,     0,
-    2258,     0,  2264,  2262,  2268,     0,     0,  2294,     0,     0,
-     731,  1921,  2312,  2313,  2314,  2315,     0,  1937,  2032,  1944,
-       0,  2326,  1159,   731,   731,     0,     0,     0,  2333,  2335,
-    2338,     0,     0,     0,  2570,  1213,     0,  1371,     0,  1288,
-    1400,  1171,  1177,  1191,     0,  1206,  1224,  1225,  1227,  1326,
-    1226,  1232,  1231,  1609,  1932,  1230,  1229,  1933,  1934,  1223,
-    1956,  1978,  1955,     0,     0,     0,     0,     0,     0,     0,
-       0,  1638,     0,     0,  1620,  1634,    70,     0,     0,     0,
-    1968,  1515,  2417,  2418,     0,    76,  1653,  1654,  1652,  1005,
-       0,  1869,     0,  1883,     0,  1079,   493,   484,     0,  1793,
-    1792,     0,  1865,  2547,     0,     0,  1055,  1656,  1703,     0,
-    1655,  1860,     0,  1858,  1855,  1857,   237,     0,     0,   267,
-       0,  2541,  2538,  2548,  2583,  2578,  2577,  2580,  2581,  1143,
-    2582,  1142,  2579,  2576,  1152,  1138,  1140,  1141,   775,     0,
-       0,  2359,  2360,  2201,  2221,  2361,  2310,     0,     0,  2380,
-    2340,  2345,  2341,     0,     0,   775,  1806,     0,     0,  1806,
-       0,  1550,  1796,  1799,     0,  2363,  1774,   856,   855,   854,
-    2364,  1792,     0,  1750,  1762,     0,  1727,  1767,     0,  2365,
-       0,  1795,     0,  1550,  1806,     0,  1743,     0,     0,     0,
-       0,   243,  1042,  1041,  1017,  1038,  1039,     0,     0,  1020,
-    1022,  1023,  1019,     0,  2670,  2415,  1005,  1927,  1926,  1976,
-    2654,  1925,  2662,  2664,  2650,  2652,  2659,  1121,     0,  2552,
-       6,    62,     0,     0,  1824,  2607,  2608,  2606,   791,     0,
-    1159,  1985,  2601,   176,   914,     0,   448,   176,     0,     0,
-       0,     0,     0,   449,   450,   382,   918,     0,   898,   911,
-       0,     0,   910,  2609,     0,     0,  1094,  1096,  1095,  1112,
-     196,   193,   174,     0,  1052,  1627,  1629,  1069,  2537,     0,
-       0,  2539,  2543,  1212,  1211,     0,   121,   126,     0,     0,
-       0,  2509,   125,  2503,  2605,  1152,  1152,  1152,  2597,     0,
-    2585,  2592,  2593,  2596,  2595,  2594,  2591,     0,  2584,  2587,
-    2588,  2590,  2589,  2609,  2603,     0,   861,   861,   861,     0,
-    1705,  1708,  1712,  1716,  1719,     0,     0,  1520,  1245,  1520,
-    1520,  1520,  1407,     0,     0,     0,     0,     0,     0,     0,
-       0,  1520,     0,  1282,  1255,     0,  1283,     0,     0,     0,
-    1947,     0,     0,     0,  2570,     0,     0,     0,     0,  1376,
-       0,     0,     0,  2570,     0,     0,     0,     0,     0,  1402,
-    1404,  1955,  1520,     0,     0,  1520,     0,     0,     0,     0,
-       0,  1164,   771,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,  1520,  1520,     0,     0,
-    1520,  1296,  1949,     0,     0,     0,  1948,     0,     0,     0,
-    1941,  1940,  1923,     0,  1299,  1301,  1300,     0,  1520,  1520,
-       0,     0,     0,  1235,  1234,  1236,     0,     0,     0,     0,
-       0,     0,  1210,  1209,  1208,  1207,     0,     0,     0,  1215,
-       0,  1216,  1217,     0,  1218,  1219,  1220,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,  1237,     0,     0,     0,
-    1924,  1335,     0,  1635,  1615,  1622,  1617,     0,  1638,  1618,
-    1626,   462,   461,  1643,  1644,  1624,  1639,  1640,     0,  1623,
-    2501,  1619,     0,  1610,     0,    69,     0,  1850,     0,     0,
-       0,  1846,  1848,  1847,     0,     0,  1851,     0,  1849,  1828,
-    1832,  1838,  1829,     0,     0,   268,   271,   273,     0,   276,
-    2452,  2467,  2468,  2464,  2469,  2487,  2470,  2474,     0,  2466,
-    2458,     0,  2473,     0,  2462,  2471,     0,  2456,     0,  2472,
-    2477,  2488,  2460,  2465,  2443,     0,  2450,  2454,  1516,  1517,
-       0,  2416,     0,  1967,     0,     0,  1102,  1884,  1885,  1881,
-    1515,  2404,  2407,     0,   494,     0,     0,   505,     0,     0,
-      65,    66,     0,  1086,     0,  1085,  1089,     0,     0,     0,
-    1659,  1649,  1658,  1441,  1861,  1862,     0,   235,   260,   255,
-     263,   257,   259,   258,   264,   265,   266,   261,   256,   262,
-     249,     0,  2452,     0,  2436,     0,  2542,     0,  2544,  2561,
-    1126,  2549,  1149,  1128,  1148,     0,  1139,   774,     0,   777,
-     779,  1678,  1679,   778,   787,     0,   776,     0,     0,     0,
-    2366,     0,   783,   785,   784,  2375,   782,     0,     0,  2350,
-    2371,  1802,     0,     0,  1773,     0,   578,     0,     0,     0,
-       0,     0,     0,  1744,     0,     0,   621,     0,  1766,  1551,
-    1800,  1801,  1806,     0,     0,  1806,     0,  1779,  1796,     0,
-    1806,  1739,     0,     0,  1731,  1736,  1732,     0,  1738,  1737,
-    1740,  1728,  1729,  1802,  1755,  1780,  1796,  1765,  1772,     0,
-    1754,  1761,     0,  1770,  1796,  1796,  1806,  1806,  1043,     0,
-    1026,  1027,     0,     0,  1724,  1444,     0,     0,  2651,  2665,
-    2649,  2660,  2661,  2648,  1122,  2553,  1120,  2554,     0,     7,
-       4,  1823,  1813,  1814,  1815,  1816,  1817,  1812,  1810,  1825,
-    1826,   792,   791,   569,   572,   571,     0,     0,  1987,     0,
-     906,     0,   436,   904,     0,     0,   414,   393,   414,   451,
-       0,     0,   791,   921,     0,     0,   908,  1065,     0,     0,
-     482,  1112,  1098,  1114,     0,   197,   199,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,    78,    79,   101,  1054,  1053,     0,  1051,  1077,  1076,
-    1074,     0,  1075,  1073,  1068,  1070,  1071,  2536,  2540,   579,
-     791,   424,     0,   385,     0,     0,     0,     0,     0,   578,
-       0,     0,  2586,   110,   862,     0,     0,     0,  1710,  1631,
-    1441,  1633,  1966,     0,     0,     0,  1714,     0,     0,  1521,
-    1520,     0,  1385,     0,     0,     0,     0,  1408,     0,     0,
-       0,     0,     0,     0,     0,  1356,     0,  1385,  1160,     0,
-     732,  1306,     0,     0,     0,     0,     0,     0,  1491,  1492,
-    1493,  1494,  1502,  1495,  1496,  1497,  1504,  1509,  1498,  1499,
-    1505,  1506,  1507,  1500,  1508,  1503,  1501,  1510,     0,  1490,
-       0,     0,  1514,  1511,  1513,  1512,     0,  1377,  1369,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    1520,     0,     0,     0,  1520,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,  1318,     0,     0,     0,     0,     0,  1520,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,  1278,
-       0,  1958,  1957,     0,     0,     0,   824,     0,  1239,     0,
-    1238,  1453,     0,  2555,  2571,     0,  2366,  1372,  1374,     0,
-    1162,  1161,  1163,  1174,  1167,  1172,  1165,  1169,     0,  1221,
-    2045,  1175,     0,     0,  1203,  2570,  1529,  1204,  1189,  1194,
-    1195,     0,  1192,  1193,     0,  1197,     0,  1196,  1200,  1201,
-    1202,  1205,     0,     0,     0,     0,  1228,  1233,  1401,  1152,
-    1959,     0,  1612,  1625,  1794,  1641,  1680,     0,  1007,     0,
-       0,    71,    73,  1843,  1840,  1839,  1841,  1845,  1844,  1842,
-       0,  1852,  2088,  2312,  2315,   280,     0,   253,   252,   254,
-     277,     0,     0,  2453,  2451,  2485,  2484,  2489,     0,  2486,
-    2482,  2475,  2510,  2479,     0,  2510,  2481,  2480,  2510,  2476,
-    2483,  2510,  2448,     0,  1519,  2124,  2205,     0,  1522,  2420,
-    1646,  2669,     0,  1882,     0,     0,     0,  1080,     0,  1152,
-     492,   491,   490,   489,     0,   507,   487,   495,    67,     0,
-       0,  1866,     0,     0,     0,     0,  1057,  1657,     0,     0,
-    1630,  1442,  1863,  1859,  1856,     0,     0,  2451,     0,  2448,
-    2545,  2563,  2562,  2550,  1152,  1541,  1153,  1153,  1955,  2382,
-       0,  2377,  2376,     0,     0,     0,  2395,  2378,     0,     0,
-    2344,  2383,  2384,  2387,     0,     0,     0,     0,     0,  2381,
-    2310,  2346,  2347,     0,  2352,  2342,     0,     0,  1804,  1807,
-    1808,     0,     0,  1788,  1782,  1781,  1777,  1783,  1778,  1791,
-    1790,  1789,  1752,  1751,  1561,  1562,  1560,  1554,  1555,  1559,
-    1558,  1747,  1797,  1787,  1785,  1775,  1806,  1786,  1784,  1733,
-    1734,  1735,     0,  1550,     0,  1804,  1806,  1796,     0,  1806,
-    1806,  1769,  1771,     0,  1029,  1040,  1025,  1024,  1462,  1461,
-       0,  1415,     0,  1417,  1414,  1413,  1412,     0,  1461,  2655,
-    2663,  2667,     0,  1550,  2560,  2558,   570,  1680,  1680,     0,
-    1986,     0,     0,     0,     0,     0,     0,     0,   177,   186,
-       0,     0,   391,   392,  1680,   390,   437,   438,   441,   442,
-     443,     0,     0,     0,     0,     0,     0,     0,     0,   130,
-     444,  1680,  1680,   387,   415,   416,   419,   420,   421,   422,
-     423,   383,     0,   388,     0,   919,  1003,  1680,  1003,     0,
-    1680,  1680,  1003,  1680,     0,     0,  1680,  1680,     0,     0,
-    1680,     0,     0,  1003,     0,  1680,     0,   990,     0,     0,
-    1680,  1680,  1680,  1680,  1680,  1003,     0,     0,  1680,   482,
-    1680,     0,     0,  1013,     0,     0,  1680,  1680,  1680,  1680,
-       0,     0,  1680,     0,  1680,   937,   989,   582,   608,   609,
-     899,   936,   938,   950,   478,     0,   968,   992,   993,   991,
-       0,   923,   925,  2610,  2611,  2612,  1101,  1093,  1100,  1097,
-    1112,  1110,  1099,   851,   850,     0,  1113,   195,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,  1628,  1078,  1072,   122,   791,  1680,
-    1680,  1680,  1680,   389,   425,   426,   429,   430,   431,   432,
-     435,   433,   434,     0,     0,   401,     0,     0,  2504,     0,
-    2643,     0,     0,     0,   175,   580,     0,     0,   863,     0,
-       0,     0,     0,     0,  1706,     0,  1969,  1713,  1444,  1717,
-    1716,     0,  1302,     0,  1349,     0,  1351,  1352,  1353,     0,
-       0,     0,     0,     0,  1303,     0,  1253,  1304,  1305,     0,
-       0,     0,     0,  1355,     0,   733,     0,     0,  1256,  1257,
-    1250,  1242,     0,     0,  1328,     0,     0,  1258,     0,     0,
-       0,     0,     0,  1329,  1403,     0,  1405,  1959,     0,  1361,
-    1310,  1263,     0,  1359,     0,  1264,  1330,  1331,  1332,  1312,
-    1313,     0,  1334,     0,  1314,     0,     0,  1317,     0,     0,
-    1266,  1365,  1363,     0,     0,     0,     0,  1367,  1268,     0,
-       0,     0,  1267,     0,     0,     0,     0,     0,     0,     0,
-    1270,     0,  1251,  1364,  1366,  1320,     0,     0,     0,     0,
-       0,  1279,     0,  2564,  1452,  2572,  1453,     0,     0,  2566,
-    2556,  2561,  2569,  1243,     0,     0,  1960,  1168,  1173,  1166,
-    1170,  2570,     0,     0,     0,     0,  1187,  1186,     0,     0,
-       0,  2570,  1529,  1190,     0,     0,  1345,  1346,  1398,     0,
-    1616,  1613,  1642,  1681,     0,  2502,  1009,  1008,  1621,  1007,
-      74,     0,  1837,  1853,  1830,     0,   272,   281,   274,   278,
-     279,   275,  2478,     0,  2459,     0,  2463,  2457,  2461,     0,
-       0,  2449,     0,  2455,  2430,  2424,  2431,  2433,  2427,  2432,
-    2434,  2425,  2426,  2421,  2428,  1523,  1552,     0,  1103,  1105,
-    1106,  1104,  1112,     0,     0,  2410,  2411,  2409,  2408,   497,
-       0,  1586,  1587,  1572,  1573,  1571,  1574,   506,  1575,  1585,
-       0,   518,     0,     0,     0,  1868,  1867,     0,  1087,  1090,
-    1091,  1062,  1061,  1063,  1056,  1058,  1059,   562,  1663,     0,
-       0,     0,  1669,  1650,  1660,     0,     0,   250,     0,     0,
-       0,     0,     0,     0,  1147,  1444,  1601,  1144,  1132,  1552,
-    1542,  1131,  1154,  1150,     0,   790,   789,   788,   786,     0,
-       0,     0,     0,  2389,  2390,     0,     0,  2367,  2368,  2369,
-       0,  2373,  2349,  2350,     0,  2351,     0,  2401,  2402,  2399,
-    2400,  2398,  2372,  1803,     0,  1756,     0,  1776,     0,     0,
-    1749,     0,  1768,  1730,  1758,  1748,  1522,  1796,  1745,  1746,
-       0,  1049,     0,  1045,  1044,     0,  1018,  1031,  1461,  1444,
-       0,     0,  1438,  1463,     0,  1463,  1444,  1444,     0,  1444,
-    1441,  1458,     0,     0,  2666,  1543,  2559,     0,     0,   902,
-     180,   183,   181,     0,   182,     0,     0,   446,   445,     0,
-    1794,   439,   134,   133,   135,   136,  1569,  1570,  1566,  1567,
-    1565,  1568,   138,   137,   132,   917,     0,     0,     0,  1794,
-     417,   394,   395,   398,   399,   400,     0,  1004,   892,  1081,
-     972,     0,   654,   892,   847,   852,   852,   970,     0,     0,
-    1081,     0,     0,     0,     0,     0,  1081,     0,     0,     0,
-    1680,     0,   983,   932,     0,     0,     0,     0,     0,   984,
-       0,     0,   933,  1680,     0,     0,     0,     0,     0,     0,
-    1081,     0,     0,   480,     0,  1081,   482,  1016,  1015,  1014,
-       0,  1081,  1081,     0,     0,     0,     0,   614,   615,   613,
-       0,     0,   606,   583,   791,   934,   479,   935,   653,     0,
-    1010,   650,   656,  1962,     0,     0,     0,   144,  2614,     0,
-    1482,   198,   102,   100,    82,  1974,    86,    88,    81,   106,
-    1579,  1580,  1578,  1576,  1577,   107,    84,    85,    87,    91,
-      90,    92,    93,    96,    97,    94,    89,    95,    83,    98,
-     108,   109,    80,     0,     0,     0,     0,  1794,   427,     0,
-       0,  1680,   384,   402,   403,   406,   407,   408,   409,   410,
-     413,   411,   412,     0,  2505,  2507,     0,     0,   378,   377,
-       0,   139,  2637,     0,     0,   653,   111,   478,   581,   584,
-     885,   887,   886,   877,   876,   112,   115,   118,  1632,  1716,
-    1444,  1522,  1967,  1522,     0,  1715,     0,     0,  1350,  1386,
-       0,  1409,     0,  1247,   745,   745,   729,  1394,   725,   745,
-    1390,   729,  1392,     0,     0,     0,     0,     0,  1357,  1354,
-       0,     0,     0,     0,     0,  1380,     0,     0,     0,  1252,
-       0,  1340,  1362,  1360,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,  1368,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     813,   819,   822,   823,   825,   817,     0,  1322,  1240,  1152,
-    2573,  2575,  1123,     0,  2565,  2567,   894,  1373,     0,  1184,
-    1180,     0,  1178,  1528,  1199,  1198,     0,     0,     0,  1188,
-    1153,  1336,  1152,     0,  1399,  1961,   994,   460,   620,  1611,
-      72,  1833,     0,     0,  2514,     0,  2513,     0,  2497,  2500,
-    1966,     0,     0,     0,     0,     0,  2419,  1553,  1690,     0,
-    1112,  1116,  1977,  1875,  2412,  2413,     0,   498,   499,   501,
-    1153,   515,   493,     0,   485,   488,     0,   497,     0,  1060,
-    1137,     0,  1682,  1667,  1674,  1668,     0,     0,     0,  1666,
-    1951,  1950,  1957,  2548,     0,  1488,     0,     0,     0,     0,
-       0,     0,  2551,  1522,  1522,  1595,     0,     0,  1129,  1134,
-    1130,  1133,     0,  1151,  1158,  1157,  1952,  1959,  2379,     0,
-       0,     0,     0,  2394,  2388,  2385,  2386,     0,  2348,  2370,
-    2354,  2353,  2356,  2358,  1805,  1550,  1764,  1763,  1557,  1556,
-    1741,  1550,  1760,  1806,     0,     0,     0,     0,     0,  1033,
-       0,  2555,  1456,     0,  1440,  1439,  1464,     0,  1444,  1463,
-    1463,     0,  1420,  1419,  1694,  1697,     0,  1418,  1515,  1446,
-    1137,  2656,  2668,     0,   619,   618,   185,   184,   190,   191,
-    1583,  1581,  1582,   452,   463,  1584,   464,   440,   131,   453,
-     454,   418,     0,   396,   920,   655,   893,   955,     0,     0,
-       0,   852,   649,   892,   861,   853,   892,   892,   999,  1000,
-       0,     0,   593,   590,   974,   602,   953,   944,   954,   965,
-     967,     0,   592,   616,     0,     0,   604,     0,   939,   981,
-     982,  1007,   587,     0,     0,   629,   630,   628,   610,   617,
-    1001,  1002,   588,   589,   976,     0,  1537,  1539,  1547,   595,
-     594,     0,   591,     0,   952,   987,   960,     0,   627,   625,
-     622,   624,   623,   626,   605,   597,   596,   599,   598,   601,
-     600,   603,   949,     0,  1003,  1003,   969,     0,   637,   638,
-     640,   641,  1965,     0,  1012,   971,     0,   642,   651,   643,
-       0,     0,     0,   154,     0,     0,   922,     0,   147,   145,
-     156,     0,     0,     0,  1485,     0,  1486,  1483,  1484,     0,
-     103,   105,   459,   458,   457,   456,   428,     0,     0,     0,
-    1794,   404,  2506,     0,     0,  2644,   381,   379,   380,     0,
-       0,   200,   635,   636,   634,   633,     0,   467,     0,   465,
-       0,   477,     0,  1886,   791,   585,     0,     0,     0,     0,
-    1522,  1541,  1970,  1709,     0,  1280,  1410,     0,     0,   746,
-    1387,   799,     0,  1396,     0,  1397,   727,   726,  1389,  1391,
-    1395,  1393,  1246,  1254,  1327,  1249,  1248,     0,     0,     0,
-    1286,  1308,     0,  1287,     0,  1378,     0,     0,  1260,     0,
-    1262,     0,     0,  1342,  1311,  1333,  1289,  1315,     0,  1265,
-    1241,     0,  1290,     0,  1295,  1293,     0,  1269,     0,     0,
-    1276,     0,  1274,     0,  1275,     0,  1277,  1319,  1321,     0,
-       0,   824,   810,   811,   812,     0,   814,   816,   818,     0,
-       0,  1454,  2574,  1124,     0,     0,  1375,  1176,     0,  1185,
-    1182,     0,  1179,  1154,  1347,  1337,  1614,   996,   995,  1835,
-       0,  1831,   289,   284,   292,   286,   288,   287,   293,   294,
-     295,   296,   290,   285,   291,   283,   282,  2511,     0,  2522,
-       0,     0,     0,     0,     0,     0,  1524,     0,  1647,  1107,
-    1112,  1116,     0,  1108,  1886,   502,     0,     0,     0,   522,
-       0,   520,   496,     0,  1088,  1152,  1664,  1676,     0,  1684,
-       0,     0,  1661,  1671,     0,     0,     0,  1670,   482,     0,
-     251,     0,  2441,     0,     0,     0,  1552,  1530,     0,     0,
-    1607,     0,  1602,  1145,     0,  1156,  1155,     0,  2397,  2396,
-    2392,  2391,  2393,  2374,     0,     0,  1757,  1759,  1753,  1048,
-    1047,  1046,  1030,     0,     0,  1035,  2561,  1515,  1448,  1444,
-    1416,  1444,  1427,     0,     0,  1444,  1423,  1421,  1425,     0,
-    1522,     0,  1480,  1152,  1954,  1544,  1547,   397,   957,     0,
-     892,   848,   849,   861,     0,   861,   861,     0,     0,   943,
-       0,  1069,     0,   948,   787,   611,   980,   979,     0,   612,
-       0,   941,     0,  1548,  1549,  1540,   481,   940,   962,   946,
-    1852,   973,   653,  1011,   829,   721,   670,   661,   745,   664,
-     663,   707,   729,   675,   725,   723,   693,   725,   725,   700,
-     699,   717,   703,   683,   799,   799,   682,   720,   799,   704,
-     702,   706,     0,   708,   725,   713,   701,   705,   722,   698,
-     695,   719,   745,   729,   729,   679,   718,   799,     0,   711,
-     745,   749,   681,   799,   806,     0,     0,   745,   747,  1964,
-     155,   143,     0,     0,   924,   926,     0,     0,   927,  2616,
-       0,  2618,     0,  1115,     0,    99,     0,     0,   386,   455,
-     405,  2508,     0,   211,  1152,     0,     0,   201,   203,   204,
-       0,     0,     0,   580,  1888,  1887,   466,   565,   586,     0,
-       0,     0,  1716,  1711,  1563,     0,  1411,     0,     0,     0,
-       0,   793,   804,   802,   796,     0,   800,   801,  1388,     0,
-       0,  1358,     0,     0,     0,  1381,     0,     0,     0,     0,
-       0,     0,     0,  1244,     0,  1338,     0,     0,     0,     0,
-       0,     0,  1273,  1271,  1272,   808,  1324,     0,   821,   815,
-     813,   820,     0,  1552,  2555,   895,  1181,     0,  1348,   998,
-     997,     0,     0,  2512,     0,  2447,  2499,  2498,  2515,  2515,
-    2515,  1689,  1688,     0,  1687,  1691,  1109,  1117,     0,   500,
-     503,     0,   495,     0,   519,     0,   486,   563,     0,     0,
-       0,  1685,  1673,  2552,  1662,  1665,  1959,  1443,  1489,     0,
-    2438,  2439,  2437,  1136,     0,  1525,  1606,  1603,     0,  1596,
-    1598,  1600,     0,  1953,  2355,  2357,  1032,     0,     0,  1028,
-    1449,  1447,  1457,     0,  1412,  1444,  1444,     0,  1412,     0,
-       0,     0,  1696,  1541,  1698,  1445,  1477,  1459,     0,  1546,
-       0,     0,   956,     0,     0,     0,     0,     0,     0,   986,
-       0,  1010,   945,   966,   988,     0,   749,  1081,  1538,   961,
-     963,  1057,     0,   639,     0,   833,   669,   662,   680,   678,
-     734,   724,     0,   734,   734,   689,   707,   684,     0,   799,
-     697,   688,   709,   712,   714,   716,   734,     0,   799,   677,
-     676,   686,   673,   734,   757,     0,     0,     0,     0,   753,
-       0,   827,     0,     0,   760,   657,   750,   752,     0,     0,
-     710,   799,   666,   807,   806,   668,   799,   806,   734,     0,
-     748,   734,     0,   141,   146,   157,   158,   912,  2615,     0,
-    2613,     0,  1111,  1487,   104,     0,     0,   214,   212,   213,
-       0,   207,   209,   204,  2631,     0,  2638,     0,     0,  2636,
-     468,   470,   478,   566,     0,     0,  1547,   890,     0,     0,
-       0,  1707,  1281,   743,   741,   744,   742,   795,   794,   798,
-       0,   797,   806,   730,     0,  1284,  1285,  1309,     0,  1379,
-    1370,  1307,     0,  1261,  1339,     0,     0,  1316,  1291,  1294,
-    1292,  1297,  1298,     0,  1323,     0,  1144,  1144,   631,  2568,
-    1183,  1836,  1834,     0,     0,  2520,  2520,  2520,  2429,     0,
-       0,     0,  1152,   508,     0,   525,   524,   521,  1552,  1675,
-    1677,  1683,  1672,  2440,     0,  1526,  1541,   780,  1599,     0,
-    1146,  1034,     0,     0,  1428,     0,  1432,  1437,  1433,     0,
-    1424,  1422,     0,  1563,  1481,     0,  1552,  1547,   959,     0,
-     652,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   985,  1929,   975,   482,   977,   942,     0,   947,   607,
-       0,   832,     0,   837,   738,   739,   740,   690,   735,   737,
-       0,   692,   660,   685,   715,   691,     0,   687,   674,   763,
-     764,   766,   765,   762,   772,   755,   773,     0,     0,   767,
-     768,   769,   761,   751,   759,   754,   665,   667,   671,   672,
-     658,     0,   659,  1963,   148,   928,   317,  2617,  2625,     0,
-    2627,  2620,   129,  2635,  2645,   211,     0,     0,   152,     0,
-     202,   787,   205,  2552,  1886,     0,   473,   864,     0,   889,
-       0,   866,   868,  1564,   805,   803,     0,  1382,  1547,     0,
-    1341,  1343,   809,     0,  1455,   632,  2523,     0,     0,  2519,
-    2517,     0,  2518,  2516,  2490,     0,  2445,  2446,  2444,  1686,
-       0,     0,     0,   516,     0,     0,   550,   564,  1534,  1547,
-       0,  1552,     0,  1604,  1597,  1036,  1450,     0,     0,     0,
-       0,     0,  1695,  1469,  1470,     0,     0,  1475,  1479,  1460,
-    1545,   958,     0,     0,   864,     0,     0,  1931,  1930,   951,
-    1010,     0,   830,     0,   834,   835,   836,     0,   828,   736,
-       0,   896,     0,   756,   758,     0,   150,   343,     0,   329,
-     315,     0,     0,     0,   319,   159,   162,   160,     0,   161,
-     167,     0,   168,   169,   170,   171,   172,   163,   341,   342,
-     166,   164,   165,     0,  1980,     0,  1981,  1127,     0,     0,
-    2623,     0,  2619,  2548,   178,   208,     0,     0,   144,   153,
-    2639,   770,   471,   469,     0,  2548,     0,  1680,   113,   865,
-     881,   880,   870,  1547,     0,     0,   116,   867,   883,   874,
-     119,   869,   882,   872,   728,     0,  1384,  1259,  1325,  2496,
-    2495,  2494,  2491,     0,     0,     0,     0,     0,     0,  2521,
-    2525,     0,  1441,  1153,     0,   509,     0,   512,   514,   528,
-       0,  1680,     0,     0,  1680,  1680,  1680,  1680,   543,   551,
-     553,     0,  1535,  1536,     0,  1531,  1533,  1527,  1588,   781,
-    1889,  2555,  1429,     0,  1434,     0,  1426,  1465,  1465,  1476,
-       0,   864,   644,   866,   868,   978,     0,   831,     0,     0,
-     799,     0,   799,   149,     0,   142,     0,     0,   328,   331,
-       0,     0,   334,   324,   323,   325,     0,   318,   317,   317,
-     371,   322,   368,   367,   360,  2626,     0,  2552,     0,     0,
-       0,  2621,  2646,   210,  1152,   156,     0,   475,   474,   879,
-       0,   994,   871,   888,   891,     0,   994,   875,   994,   873,
-    1547,  2492,  2526,  2529,  2527,  2528,  2530,  2524,  1692,  1700,
-       0,  1876,     0,   517,   510,     0,     0,   526,     0,  1680,
-    1680,     0,     0,     0,     0,     0,   523,   552,  1680,  1547,
-       0,  1135,     0,  1897,  1451,     0,     0,     0,  1473,  1471,
-     648,   647,   645,   646,     0,   843,     0,   842,     0,   839,
-     838,   694,   897,   696,   151,   344,   355,   358,   350,   330,
-       0,     0,     0,   320,   317,     0,   304,   302,   303,   309,
-     310,   311,   312,   313,   314,   305,   308,   306,   307,   317,
-       0,   219,     0,     0,  2624,  2622,     0,  2628,     0,   188,
-     187,   179,     0,   317,  2632,     0,  2640,  2552,   878,   114,
-     884,   117,   120,  1383,     0,     0,   780,   504,   516,   513,
-     536,   529,   532,     0,   561,     0,     0,   557,   558,   556,
-     554,   547,     0,   545,     0,  1532,  1589,     0,     0,     0,
-       0,  1890,  1892,     0,  1605,  1431,  1436,     0,  1466,     0,
-       0,     0,   964,   845,   846,   844,     0,     0,     0,     0,
-     317,   351,     0,   326,     0,   335,     0,     0,   217,   374,
-     372,   215,   362,   362,  2629,  2630,   189,  2647,     0,   158,
-     178,   476,  1699,  1701,  1877,   511,   536,     0,   534,     0,
-     530,   527,   531,   559,   560,     0,   544,     0,   555,     0,
-       0,     0,     0,     0,  1891,     0,     0,  1898,  1900,  1468,
-    1467,  1482,     0,     0,     0,   352,   358,   348,   356,   317,
-       0,     0,   316,     0,   370,   218,     0,     0,     0,   317,
-       0,   361,   363,   365,     0,   140,  2641,  1903,   533,     0,
-     541,   537,   539,   542,   550,   549,   546,  1591,  1895,  1896,
-       0,  1893,     0,     0,  1899,     0,     0,   841,   840,     0,
-     349,     0,     0,   347,   327,   332,   317,   375,   317,   229,
-     228,     0,   221,   297,   369,     0,   220,  2633,   317,     0,
-    1889,   535,     0,     0,   548,  1594,     0,  1592,  1894,  1902,
-    1901,  1474,  1472,   353,     0,   317,     0,   317,     0,   317,
-       0,     0,     0,     0,     0,   216,   317,  2642,     0,  1897,
-     540,   538,  1590,     0,     0,   345,   317,   333,   338,     0,
-       0,   224,   298,   299,     0,   226,  2634,     0,  1905,  1593,
-     317,   317,   334,   337,   376,   373,     0,   300,   222,   223,
-     234,   233,     0,  1904,     0,  1909,   317,   317,   339,   242,
-     240,   317,   230,   238,   232,     0,   239,     0,   227,     0,
-       0,  1916,     0,   225,   241,   301,  1907,  1908,  1906,  1911,
-       0,     0,  1913,  1914,     0,  1878,   231,  1915,  1910,     0,
-    1917,  1919,     0,  1912,     0,  1152,  1918,     0,  1153,  1920
-};
-
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int16 yydefgoto[] =
-{
-      -1,    56,   599,  1440,    57,    58,    59,    60,    61,  1290,
-      62,   806,  1215,  1741,  1742,    63,   542,    64,   993,  1511,
-    1512,  3049,  3050,  1513,    65,  2125,  3086,  4141,  3087,  4146,
-    3088,  4148,  1530,   510,   511,  1968,  1969,  1018,  3070,  3036,
-    3854,  3040,  3966,  4105,  4008,  2051,  3408,  3855,  3856,  3975,
-     537,  2123,  1460,  4132,  1948,  4241,  1949,    66,   631,   991,
-    1484,  1485,  3426,  3427,  3688,  3428,  3680,  3681,  3682,  3683,
-    4369,  4214,  4311,  4370,  4442,  4476,  4482,  4411,  4491,  4492,
-    4493,  4480,   847,  4494,    67,   565,   566,   849,  1320,  1755,
-    1321,    68,    69,   536,  1235,  1236,  1237,  1238,  2301,  1756,
-    2296,  2297,  3205,  4412,  4478,  4497,  4215,  4216,  4112,  4217,
-    3978,  4218,  4116,  4219,  3981,  4220,  4221,  4222,  4223,  4361,
-    4224,  4111,  4404,  4211,  4212,  4363,  4458,  4473,  4225,  3988,
-    4106,  4298,  3989,  4107,  4356,  4207,  4357,  4399,  4454,  4208,
-    4299,  4402,  4302,  4226,  4232,  4371,  4227,  4233,  4228,  3993,
-    4123,  4231,  4121,  4230,  4367,  4366,  4438,  2650,  3069,   618,
-     619,   642,  2115,   620,  1007,   964,  1462,  1981,  1982,  2501,
-    2502,  2632,  2633,  2634,  1973,  1974,  1975,  2103,  2104,  2105,
-    1955,  1956,  1957,  1466,  1952,  1953,   621,   965,   975,  1976,
-    1977,  1978,  2638,  2107,  2108,  2109,  2110,  1203,  1204,  2923,
-    2656,  3079,  3873,  3436,  4015,  4247,  3080,  3081,  2576,  2991,
-    2061,    70,   554,   827,  1287,  2352,  1288,  2354,  2806,  2807,
-    2808,  1800,  1801,  3753,  1805,  2351,  3913,  4258,  4056,  4057,
-    2810,  4055,  2814,  3230,  3231,  3523,  3755,  3916,  4263,  4166,
-    4331,  4261,  4327,  4262,  4329,  4423,  4381,  4382,  4176,  4272,
-    4273,  4335,  4384,  4068,  4069,  4070,  2372,  2820,  3758,  3694,
-    2097,  1452,  1453,   512,   513,   514,   639,  2657,  2036,  2658,
-    2659,  3013,  2038,  2039,  2777,  1375,  3004,  2978,  3736,  3076,
-    3017,  3018,  3019,  3020,  3021,  3027,  2942,  2511,  2512,  2581,
-    3030,  3871,  3612,  3627,  3392,  3393,  3394,  3395,  3396,  3397,
-    3398,  3105,  3106,  3103,  1066,  3817,  3818,  3819,  3099,  3100,
-    3661,  3645,  3646,  3647,  3872,   769,  3835,  3455,  1343,  1344,
-    3923,  1354,  1355,  2396,  1841,  2397,  1456,  3456,  3457,  3458,
-    3655,  3160,  3733,  3166,  3167,  3168,  2740,  2741,  2742,  2743,
-    2744,  2240,  3648,  3029,  3605,  3810,  3813,  3958,  4199,  2513,
-    2943,  2514,  2946,   915,   515,  2515,  2516,  1544,  1545,  4018,
-    4026,  4030,  4019,  4031,  4027,  4020,  4021,  4022,  4033,  4029,
-    2663,  3695,  3696,  2935,  3176,  3960,    71,  1472,   958,   967,
-     963,   983,   626,  1473,   976,  2052,  2587,  3667,   608,  2040,
-    3597,  3321,  3601,  2041,  2957,  2042,  3308,  3582,  2043,  3338,
-    3599,  3807,  2958,  2959,  2044,  2045,  2046,  3320,  3330,  3950,
-    3186,  3187,  3188,  2517,   125,  2288,  3025,  2560,    72,  1418,
-      73,   929,   930,   931,  2446,  2447,  2889,  3285,  3559,   924,
-     925,   926,  1914,  2444,    74,   634,  1517,    75,  1298,  2364,
-    2365,  2366,    76,   984,    77,    78,   635,  1524,  1525,  1526,
-      79,  1283,   132,    80,   835,  1293,  1295,  1296,    81,   630,
-     985,   986,   987,   988,  2057,    82,  1792,  2328,  2329,  2330,
-    2331,  1481,  2589,  1482,  1483,  2066,  3223,    83,    84,   596,
-    2248,   571,   853,   572,   573,  1835,  2387,  3737,   864,   865,
-     866,  2848,  1333,  1334,  1335,  2392,  2853,  1063,   770,   771,
-     772,   773,  1157,  1158,  3649,   774,  1167,  1702,   775,   776,
-     777,   778,   779,   780,  1729,  3132,  3133,  3475,  2275,  2276,
-    2277,   781,  2162,  3117,  2176,   782,  1150,  1687,  1618,  3467,
-    3125,  3718,  3887,  1561,  2145,  2693,  2773,  2242,  1088,  1089,
-    1053,  2152,  1567,  1921,  1922,  1923,  1924,  1925,  3570,  3569,
-    3571,  3927,  3775,  3929,  3779,  2457,  1820,  1821,  1926,  1927,
-    2890,  3773,  4081,  2243,  2244,  2245,  3493,  2891,  3289,  2909,
-    2910,  3786,  2448,  1928,  2897,  4188,  3936,  3937,  4291,  4290,
-    3938,  3784,  3785,  3575,  3576,  3045,  3046,  3047,  2834,  1608,
-    1609,  1616,  1270,  1271,  1562,  2326,  2795,  3766,  3920,  2266,
-    3545,  3918,  4075,  2049,  2986,  2987,  2389,  2390,  2913,  3305,
-    3335,  1378,  3738,  2797,  1887,  1888,  3701,  4481,  2745,  2605,
-    2924,  2348,  2349,  4181,  4339,  4426,  4427,  3260,  3261,  3549,
-    3550,  2391,  2845,  3262,  3767,  4080,    85,   519,    86,  1739,
-    2281,  2776,  1212,  2293,   995,  1300,  1548,  1549,   794,   532,
-    1205,  1206,  1207,    87,   543,  2327,    88,   561,  1818,   819,
-     839,  1301,  1302,  2373,  2821,  2828,  2374,  2833,  3533,  2823,
-    3236,  3237,  2283,  2284,  2824,  3239,  3530,  3513,  3514,  3218,
-    3750,    89,   584,  3300,  2904,  2905,  4158,  4159,   840,    90,
-     518,  1040,  2671,  1554,  2133,  1041,  1042,  2136,   660,   661,
-      91,   933,   581,  1400,  1401,  1402,  1903,    92,   575,   916,
-    2875,  2881,  1882,   831,  1208,  1382,   919,  1383,  1868,  2425,
-    1364,    93,   954,   953,  1447,    94,   604,  1448,    95,   807,
-    1229,  1751,  2781,  3191,  3501,  1230,  1231,  2294,    96,   562,
-     844,   845,  1305,  1823,    97,   556,   832,  1811,    98,   547,
-      99,   100,   823,  3224,  4256,  4377,   551,  1794,  1279,  3437,
-    4183,  4281,  4282,  4284,  4347,  4348,  4420,  4485,  4508,  4501,
-    4511,  4512,  4515,  4520,  4521,   784,   940,   785,  3801,   786,
-     787,   788,  2829,  2830,  3306,   789,  2831,   790,  2936,   996,
-    1551,   540,   490,  2594,   615,   941,  2803,   792,  3995,   961,
-    1011,   492,   493,   101,   574,   880,  1359,  1349,  1358,  1861,
-    2413,  1865,  2415,  2416,  3274,  2871,  3275,  2872,   920,  1857,
-    1862,  2873,  1866,   883,  1850,  1851,  1852,  1853,  2864,  1847,
-    2422,   102,   824,   497,  1281,  1282,  2337,   103,   583,   104,
-    1272,  1788,  1789,  2323,  2794,  2324,   105,   850,  1324,   106,
-     809,  1264,  2312,  1265,  1764,  1266,  1267,  1778,  1772,  1781,
-    1775,  4043,  3903,  3904,  2791,  1211,  1012,  1013,  2304,  2785,
-    2786,  3745,  3906,  3505,  4049,  4050,   107,   133,   500,   637,
-    1002,  1327,   108,   109,   110,   111,  1330,  1435,  2383,  1436,
-    2249,  1437,  1438,  1935,  1833,  1683,  1684,  3174,  1147,  1148,
-    2252,  2749,  2750,   867,   646,  1028,  1020,   126,   127,   128,
-     649,   650,   129,   981,   982,  2588,  3042,  3410,  3670,  3671,
-    3860,  4003,  3999,  4000,  3997,  4002,  1022,  3867,  4318,  4446,
-    1023,  1024,  3071,  3869,  4136,  4320,  4418,  1025,  2647,  3423,
-    4004,  4243,   112,   942,   593,  1433,  1428,  1430,  1931,  2464,
-     113,   114
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -3874
-static const int yypact[] =
-{
-    4741,   193,    87, -3874,   402,   788, 47577,   815,  1304,  1304,
-     536,  2482, -3874, -3874, -3874, -3874, -3874,  3329, -3874, 47577,
-      87,  1137, -3874, 23644, -3874, -3874,   776,   186,   179,  1304,
-      87, -3874, 47577, -3874,   786,  -143,    87, -3874, -3874, 41447,
-   -3874,   536, 47577, -3874, -3874, -3874, 41447,  -108,   812,   743,
-    1028, -3874, -3874, 47577,  1834,  -155,  1461,  1339, -3874, -3874,
-    1042, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, 24260, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874,  1341, 47577,  1464, 47577, -3874,
-    1439, 47577, 39608, 47577, -3874,  1130,  1489, -3874, -3874,  1569,
-   -3874, -3874,  1304,   536, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874,  1074, -3874, -3874,  1160, -3874, -3874, -3874, -3874, -3874,
-    1715,  1538, -3874,  1572, 39608, -3874, 47577, -3874, -3874, -3874,
-    1206, -3874,  1239, -3874,  1283,  1573,  1591,  1604,   155, 11131,
-    1638,  1638,  1638, 47577,  1668,  1638,  1638, 47577, -3874,  1638,
-   -3874,  1638,  1304, -3874, -3874, -3874,  1742, -3874, 47577,  1507,
-     505,   624, 39608,  1497, 47577, -3874, -3874, 11131, -3874,  1653,
-   -3874, -3874, -3874,  1304,  1862,  1733,   887, 47577, -3874, -3874,
-    1304,  1246,   719,  1347, -3874, -3874,  1457, -3874, -3874,   162,
-   -3874, -3874, -3874,  2130, 26108,  6178,  1457,   -70,  -124,   -70,
-   -3874, -3874, 47577,  1304,  1675, -3874, -3874,   276,   276,   276,
-   -3874,   276, -3874,   276, -3874,  -155,  1326, -3874, -3874,  1323,
-   47577,   777,  1818,  2011, -3874, -3874,  1344,   858, -3874,  1410,
-   36543, -3874, 47577, -3874, -3874, -3874, -3874,  1631, -3874, -3874,
-   -3874,  2049, -3874, 36543, 23644, 47577,  1490, -3874, -3874, -3874,
-   23644,  1390, 47577, -3874, 23644, 23644,   192,    13,  1587, 47577,
-   47577,  1824, -3874,  2025, 36543,  1574, -3874,   166,   -97,  1569,
-    2032, -3874,  1538, -3874, 47577, 47577, 47577, -3874, -3874, -3874,
-   42060,   155,  1406,  1417,  1419, 15569, -3874,  1424,  1448,  1450,
-   11131,  1466,  1470,  1472,  1478,  1491,  1505,  1517,  1522,  1525,
-    1525,  1543,  1547,  1563,  1565,  -165,  1567, -3874,  1595,  1605,
-    1636, -3874, -3874,  1642,  1649,  1660,  1677, -3874,  1691,  1697,
-    1704, 11765,  1721,  1730, -3874, 20555,  1738,  1782,  1791,  1798,
-    1806,  1823,  1833,  1835,  1837, -3874, -3874, 11131,  1543, -3874,
-   -3874,  1840, -3874,  1852,  1860,  1869,  1871,  1891,  1900,  1903,
-    1906,  1911,  1923,  1936,  1939,  1944,  1964,  1976,  1980,  1988,
-    1543, -3874,   877,  1992,  1997,  1076,  2001, -3874,  2015, -3874,
-     287,  2017,  1525,  1543,  1543,  2021,  2026,  2029,  2037,  2041,
-    2050, 15569, 15569, 15569, 11131, -3874, 47577, -3874, 47577, -3874,
-    1544,  3167, -3874,  2117, 15569,   901, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,  1437,  1531, -3874, -3874, -3874, -3874, -3874,
-   -3874,  2059,  1453,  1928, 47577, 47577, 47577,  1750, 47577, 47577,
-   39608,    54, 47577, 36543, -3874,  1638,  1545,  3242, 29183,  2746,
-   -3874,   140, -3874, -3874, 47577, -3874, -3874, -3874, -3874,  1993,
-    1731,  1544,  2235,   197, 23644, -3874,   783, -3874,   834, -3874,
-   -3874,  2019, -3874, -3874, 36543, 23644, -3874, -3874, -3874, 21173,
-   -3874, -3874,  2251, -3874,  1673, -3874, -3874,  1531,  3565, -3874,
-    3810,  1870,    13,  1769, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874,  1752,  2130, -3874, -3874,   314,  1941,
-    1781,   321,   397, 34091,    94,   484,    96, 26723, 34704,  1786,
-   -3874, -3874, -3874,   841,  2315, -3874,   273,  2064,  2282,   273,
-   37156,  2229,  1576, -3874,   151, -3874,  2310, -3874, -3874, -3874,
-   -3874,  2187,  2125, -3874, -3874,   290,  2515, -3874,  2559, -3874,
-     681, -3874,  2206,  2229,   273,  1576, -3874,  2457,  2581,   486,
-     957, -3874, -3874, -3874, -3874,  2122, -3874,   712,  2677, -3874,
-    2134, -3874, -3874, 23644, -3874, -3874,  1993, -3874, -3874, -3874,
-    2146, -3874,  2397,  2248, -3874, -3874,    40, -3874,  2152,    26,
-    2635, -3874, 39608,  2071, 37769, -3874, -3874, -3874,  2669,  2693,
-    1525,  2170, -3874, -3874, -3874,  2803, -3874, -3874,  2183,  2711,
-    2711,  2711,  2815, -3874, -3874, -3874,  2199,  2448, -3874, -3874,
-    2376,  2245, -3874,  1490, 23644,  2619,  2228, -3874, -3874,  2476,
-   11131, -3874, -3874,  4162,    49, -3874, -3874,  1405, -3874,  2810,
-    2435, -3874, -3874, -3874, -3874,  2701, -3874, -3874,  2803,  2762,
-    2711,  2651,  2241, -3874, -3874, -3874, -3874, -3874, -3874,   233,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874,   244, -3874, -3874,
-   -3874, -3874, -3874,  1490, -3874, 23644, -3874, -3874, -3874, 23644,
-   -3874,  2242, -3874,  2237, -3874, 11131, 11131,   316,  2809,  2869,
-    2869,  2869,  1544,  2278, 11131, 11131, 11131, 11131, 11131, 11131,
-   11131,  1298,  2256, -3874, -3874,   678, -3874,  2257, 11131, 11131,
-   -3874, 11131, 11131, 24876, -3874,  3961, 11131, 11131,  1030,  2754,
-   11131, 11131, 11131, 11131,  3139, 11131, 11131, 24876,  2884,  2262,
-   -3874,  2260,  1374, 11131, 11131,  1420, 11131, 11131, 11131, 11131,
-   11131, -3874, -3874, 11131, 11131, 11131, 11131, 15569, 11131, 11131,
-   11131, 11131, 11131, 11131,  2268, 11131,  2869,  2869, 11131, 11131,
-    1513, -3874, -3874, 11131,  2764,  2764, -3874, 11131,  7961, 11131,
-   -3874, -3874, -3874,  2275, -3874, -3874, -3874, 24876,  2869,  2869,
-   11131, 11131, 11131,  2809,  2809,  2809,   265,  2276,  -133, 11131,
-   27338,  2274, -3874, -3874, -3874, -3874, 11131, 11131, 11131, -3874,
-   15569, -3874, -3874,  2449, -3874, -3874, -3874, 12399, 15569, 15569,
-    2292, 15569, 15569, 15569, 15569, 15569,  2664, 15569, 15569, 16203,
-   16837, 15569, 15569, 15569, 15569,   178,  2809, 39608, 15569, 11131,
-   -3874, -3874, 47577, -3874, -3874, -3874,  2289, 23644,    54, -3874,
-   -3874, -3874, -3874, -3874, -3874,  2297,    54, -3874,  2781, -3874,
-   -3874,  2306, 23644, -3874,  2302, -3874,  2670, -3874,  2675,  2676,
-    2686, -3874, -3874, -3874,  2914,  2689, -3874,  2690, -3874, -3874,
-    2335, -3874, -3874, 17471, 39608, -3874,  2338, -3874,  2814, -3874,
-    2563,  2516,  1674, -3874, -3874, -3874, -3874, -3874,  2604, -3874,
-   -3874,  2439, -3874,  2620, -3874, -3874,   362, -3874,   106, -3874,
-   -3874, -3874, -3874, -3874, -3874,  2625,  2351, -3874, -3874, -3874,
-   47577, -3874, 48190, -3874, 21173,   402, -3874, -3874, -3874,  2727,
-     172,  2368, -3874, 23644, -3874,    93,    93,  2616,  1532, 39608,
-   -3874, -3874,   157,  2371,  2450,  2377, -3874,  2454, 23644, 23644,
-   -3874, -3874, -3874,  2628, -3874,  3002,   719, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-    2391,  2873,  2563,  2665, -3874,  2672, -3874, 47577, -3874,  1527,
-   -3874, -3874, -3874,  2401, -3874, 11131, -3874, -3874, 47577, -3874,
-   -3874, -3874, -3874, -3874,  2966, 11131, -3874, 36543,   -62,  1138,
-     977,   841, -3874, -3874, -3874, -3874, -3874, 47577, 42673,  2406,
-   -3874,  2801,   402, 11131, -3874,  2415,  1538, 47577, 47577, 47577,
-   23644, 47577, 23644, -3874,   966,   966, -3874, 35317, -3874, -3874,
-   -3874, -3874,   273, 47577, 47577,   273, 36543, -3874,  1576, 47577,
-     273, -3874,  2800,  2511, -3874, -3874, -3874,  2874, -3874, -3874,
-    2865,  2422, -3874,  2801, -3874, -3874,  1576, -3874, -3874, 23644,
-   -3874, -3874,  1576, -3874,  1576,  1576,   273,   273,  2474,   -70,
-   -3874, -3874,  2571,  -124, -3874,  1069,   276,  2674, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,   105, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874,   116, -3874, -3874, -3874,  1970,  2930, -3874, 39608,
-    2420,  -103,   673,  2420,  1892,   402,  1680, -3874,  1680, -3874,
-   36543,  2905,  3793,  2715,   212, 23644, -3874,  2452, 43286, 23644,
-   -3874, -3874, -3874,  1404,  2459,  2461,  1544,  2939,  2940,  2943,
-    2945,  2947,  2949,  2953,  2957,  2959,  2960,  2961,  2962,  2965,
-    2967,  2968,  2969,  2973,  2977,  2982,  2985,  2986,  2987,  2992,
-    2993,  2489, -3874, -3874, -3874, -3874, 23644, -3874, -3874, -3874,
-   -3874,  2566, -3874, -3874, -3874, -3874,  2031, -3874, -3874, -3874,
-     199,  2246,  2540,  2572,    76, 36543,  2971, 47577, 47577,  1538,
-   47577, 47577, -3874, -3874,   935,  2789,  2794,  2812,  2535, -3874,
-    2628, -3874,  1288, 47577,  2994, 31026, -3874,   308,   478, -3874,
-    2869,  2550, -3874,  2553,  2556,  2557, 11131,    47,  1639,   547,
-    1429,  1455,  1009,   345,   322, -3874,  2558,  2565, -3874,  2560,
-   -3874, -3874,   347,   474,  1063,  1070,  2561,  2569, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,  3012, -3874,
-     517,  1500, -3874, -3874, -3874, -3874,  2579, -3874, -3874,  1110,
-     531,   533,   336,  2589,   543,  1548,  1568,  2573, 24876, 47577,
-    2869,  2584,  1112,  1122,  2869,  2588,   644,  1166,  1620,  1645,
-    1694,  1168,  1213,   648,  1712,  2716,  1215,   770,   838,  1238,
-     843,   861, -3874,  1256,  2590,  2593,   869,   241,  2869,  2594,
-     349,  2597,  2602,  1262,  9229,  9863, 10497,   326,   895, -3874,
-    2595, -3874,  2260,  2605,  2606,   386,   313,  1272, -3874, 11131,
-   -3874, -3874,   529,  1141,  2657,   138,   977, -3874,  2761, 47577,
-    2333,   121, -3874, -3874, -3874, -3874, -3874, -3874,   762, -3874,
-    2611, -3874,  2626,  1770,  2618, 11131,   215,  2618,  2293,  1353,
-    1353, 15569,  3049,  3073, 11765,  1359, 11765,  1359,  2618,  2618,
-    2618, -3874, 15569,  2629, 15569, 15569, -3874,  2809,  1544,  2632,
-    1044, 47577, -3874,  2297,   698, -3874,   841, 36543,   258, 23644,
-   39608,  2633, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-    3855, 23644,  2719,  2725,  2728, -3874, 29798, -3874, -3874, -3874,
-   -3874, 29798,   741, -3874, -3874, -3874, -3874, -3874,  2731, -3874,
-   -3874, -3874,  2630, -3874, 36543,  2630, -3874, -3874,  2630, -3874,
-   -3874,  2630,   797,  3756, -3874,   732,   831,  3638,  2666, -3874,
-   -3874, -3874, 23644, -3874,  3052,   -32, 23644,  2452,  2652, -3874,
-   -3874, -3874, -3874, -3874,  2691,  2753, -3874,  3276, -3874, 11131,
-     402, -3874, 36543, 36543, 23644, 23644,   822, -3874,  1260,  2658,
-   -3874, -3874, -3874, -3874, -3874,  3565, 17471,  2660, 36543,   941,
-   -3874, -3874, -3874, -3874, -3874,  1223,  1544, -3874,  2656, -3874,
-   38382, -3874,  1544,   841,  2667,  2668, -3874, -3874,  3030,   733,
-   -3874,  2663,  2673, -3874,  2661,  2680,  2681, 43899, 11131, -3874,
-    1138, -3874, -3874,   841, -3874, -3874,  8595,   402,  3107, -3874,
-    1544,  2679, 47577, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,   628, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874,   273, -3874, -3874, -3874,
-   -3874, -3874,  2890,  2229,  2515,  3107,   273,  1576, 23644,   273,
-     273, -3874, -3874,  2857,  2723, -3874, -3874, -3874, -3874, -3874,
-   47577,  2342,  2835, -3874,  2683, -3874, -3874, 23644, -3874,  2688,
-   -3874,  3121,  3266,  2229, -3874, -3874, -3874,   841,   841,  2974,
-   -3874,   402,  2817,  2819,  2821,  2823,  2825,  2868, -3874, -3874,
-     402,   402, -3874, -3874,   841, -3874,  1365, -3874, -3874, -3874,
-   -3874,   402,   402,   402,   402,  2722,   402,   402,  1722, -3874,
-   -3874,   841,   841, -3874,  2104, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874,   252, -3874,  2963, -3874,  2685,   841,  3277,  2964,
-     841,   841,  3277,   841,  2976,  2978,   841,   841,  2806,  3233,
-     841,  3117,  2829,  2831,  3126,   841,  2984, -3874,  2838,  3245,
-     841,   841,   841,   841,   841,  3277,  2996,  3332,   841, -3874,
-     841,  3000,  3001,   214,  3004,  3005,   841,   841,   841,   841,
-     156, 47577,   841,  3009,   841, -3874, -3874,  6242, -3874, -3874,
-   -3874, -3874, -3874, -3874,   -78, 21789, -3874, -3874, -3874, -3874,
-     438, -3874,  2975, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874,  2749, -3874, -3874, 11131,  2757,
-    2722,   402,  2722,  2722,   402,   402,   846,   402,  2722,  2722,
-     402,   402,   402,   402,   402,   402,   402,  2722,  2722,   402,
-     892,   402,  2722,  4162, -3874, -3874, -3874, -3874,   203,   841,
-     841,   841,   841, -3874,  2136, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, 39608,  3124,  2129,  1134, 39608, -3874, 47577,
-   -3874,   383, 47577,  2768,  -116,  5337,   835,   835, -3874, 23644,
-   23644, 23644, 47577,  2824, -3874, 31026, -3874, -3874,  1069, -3874,
-    2767, 13033, -3874,  2771, -3874, 11131, -3874, -3874, -3874,  1482,
-   11131, 11131,  3264,  2108, -3874, 38995, -3874, -3874, -3874, 11131,
-   38995,  2108, 11131, -3874,  2786, -3874,  3184,  3185, -3874, -3874,
-   -3874, -3874, 11131, 11131, -3874, 11131, 11131, -3874, 11131, 11131,
-   11131, 11131, 11131, -3874, -3874, 15569, -3874,  2782,  2793, -3874,
-   -3874, -3874,  2795, -3874, 11131, -3874, -3874, -3874, -3874, -3874,
-   -3874, 11131, -3874, 11131, -3874, 11131, 11131, -3874, 11131, 11131,
-   -3874, -3874, -3874, 13667, 11131, 11131,  2796, -3874, -3874, 11131,
-   11131, 11131, -3874, 11131,  1553, 11131,  1702, 11131,  1747, 11131,
-   -3874, 11131, -3874, -3874, -3874, -3874, 11131,   356,  2691,  2722,
-    2797, -3874,  1735, -3874, -3874,  1789, -3874,   529,  2799, -3874,
-   -3874,  1527, -3874, -3874, 39608, 11131, -3874, -3874, -3874, -3874,
-   -3874, -3874, 15569,   407,  2813, 15569, -3874,  2293,  3139,  3139,
-    1954, 11131,   215,  2293, 11131,  2820,  2805, -3874, 11131, 47577,
-   -3874, -3874, -3874, -3874, 39608, -3874, -3874, -3874, -3874,   258,
-   -3874,  2302, -3874,  2452, -3874,  3270,  2808, -3874, -3874, -3874,
-   -3874, -3874, -3874, 47577, -3874,  2885, -3874, -3874, -3874, 22407,
-   22407, -3874, 22407, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874,  2229,  1260, -3874,  2811,
-   -3874, -3874,  2476,  2900,  2842,  3187, -3874, -3874, -3874, 47577,
-   15569, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-    3411,  2828,  2836,  3310,  2837,  1544, -3874,  2913, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874,   745, -3874, -3874,  2840,
-    2840, 19321, -3874, -3874, -3874, 47577,  3318, -3874,  3274,  3286,
-   22407, 22407, 22407,   622, -3874,   538, -3874,   195,  3241,  2229,
-   -3874,  3289, 40221, -3874, 31639, -3874, -3874, -3874, -3874,   -62,
-    2936,  2937,  1289, -3874, -3874,  3239,  3068, -3874, -3874, -3874,
-     841,  1544, -3874,  2406,  8595,  2853, 27953, -3874, 15569,  1595,
-   -3874,  1544, -3874, -3874,   846, -3874,    84, -3874, 35317, 35317,
-   -3874,  3128, -3874, -3874, -3874, -3874,  2666,  1576, -3874, -3874,
-    3333, -3874,  3335, -3874,  2855,  3337, -3874,  3105, -3874,   886,
-    3247,  3249, -3874,  3122,   945,  3122,   886,   886, 24876,  1069,
-    2628, -3874,  2722,  3175, -3874, -3874, -3874, 38382, 35930, -3874,
-   -3874, -3874, -3874,  3394, -3874,  3395,   236, -3874, -3874,  2369,
-    1340, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874,  1892,  2369,  2369,  1484,
-   -3874,   132, -3874, -3874, -3874, -3874,  3341, -3874, 25492,    87,
-   -3874,   286, -3874, 25492, -3874,  1404,  1404, -3874, 44512, 25492,
-      87,   846,  2722, 25492,  2722, 45125,    87,   402,   402,  2312,
-     841,  2722, -3874, -3874,  3254, 47577,  3263, 25492, 25492, -3874,
-   39608, 47577, -3874,   841,  1235,  2722, 45738,   846,   846, 25492,
-      87, 24876,  2337, -3874,   402,    87, -3874, -3874, -3874, -3874,
-   23644,    87,    87,  1717,  2601,  2615,  2724, -3874, -3874, -3874,
-    2722, 45125, -3874, -3874,  5955, -3874, -3874, -3874, 18705, 47577,
-     301,   796, -3874,  2877,    30,  1060,  2970,  1469,  2888,  2889,
-   46351,  1544,  2722, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,   402,  2691,  2369,  2369,  2341, -3874,  3151,
-    3322,   841, -3874,  1391, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,  2989, -3874,  3511,  3083,  2906, -3874, -3874,
-     261, -3874, -3874,  1348, 23644, 18089, -3874,  3150, -3874,  3051,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,  2901,
-    1069,  2666,  1434,  2666,  2915, -3874, 11765,  1278, -3874,  1544,
-   11131,  1544,  1883, -3874,  2908,  2908,  2911, -3874,  2917,  2908,
-    3308,  2911,  3309,  2920,  2938,  1296,  2944,  2948,  1437, -3874,
-   11131, 11131,  1300,   429,  1306,   671,   925,   933,   437, -3874,
-    1317,  2935, -3874, -3874,  1377,  1379,  1401,  1409,   939,  1440,
-    1758, 11765,  1475,  1104,   465, -3874,  1487,   983,   985,  1503,
-   11131,  1529, 11131,  1577, 11131,  1581,  1588,  1590,  2918,  2918,
-     218, -3874,  2942, -3874, -3874, -3874,  2950, -3874, -3874,  1752,
-    1789, -3874, -3874,  2955, -3874, -3874,  2932,  1544,  2956, -3874,
-   -3874, 11131, -3874,   901, -3874, -3874, 15569,   472,  2972, -3874,
-    1544, -3874, -3874,  2979,  1437, -3874,   253, -3874, -3874, -3874,
-   -3874,   163,  3510, 29798, -3874,  1771, -3874, 36543,  2933, -3874,
-    2946,  3020,  3025,  3034,  2988, 11131, -3874, -3874,  3204, 23644,
-   -3874,  3371, -3874, -3874, -3874, -3874,  2981,  2983, -3874, -3874,
-   -3874,  2293,  3330,  3208, -3874, -3874,  2691, 47577, 36543, -3874,
-    2130, 24876, -3874,  2998, -3874,  2998,  1196,  2990,  1808, -3874,
-   -3874, -3874,  2995,  1769,  1810, -3874, 17471,  3231, 36543,  3417,
-    3419,  3420, -3874,  2666,  2666,   908,  3035,  3378, -3874, -3874,
-   -3874, -3874, 46964, -3874, -3874, -3874, -3874,  1175, -3874,  3003,
-    3006,   256,  3209, -3874, -3874, -3874, -3874,  8595, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874,  2229, -3874, -3874, -3874, -3874,
-   -3874,  2229, -3874,   273,   402,   402,  1655,   402,  3465,  3503,
-     482,  1141, -3874,  2094, -3874, -3874, -3874,  3379,   886,  3122,
-    3122,  3384,  3271,  1088,  3007, -3874,   841, -3874,  2456, -3874,
-    2130, -3874, -3874, 11131, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874,   252, -3874, -3874, -3874, -3874, -3874,  3010,  3386,
-    3391,  1404, -3874, 25492, -3874, -3874, 25492, 25492, -3874, -3874,
-     139, 45125, -3874, -3874, -3874, -3874, -3874, -3874,  3015, -3874,
-   -3874,  2691, -3874, -3874, 35930,   402, -3874, 25492,  3015, -3874,
-   -3874,   174, -3874,  3041,   402, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, 45125,  3022, -3874,  1618, -3874,
-   -3874,  1862, -3874, 45125, -3874, -3874, -3874, 45125, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,  3027,  2603,  2264, -3874,  3029,  3033, -3874,
-   -3874, -3874, -3874, 47577, -3874, -3874, 23644, -3874, -3874, -3874,
-    5639, 47577,  3262, -3874, 11131, 11131,  3298, 47577,  3305, -3874,
-    3596, 47577,  3659, 45125, -3874,  3048, -3874,  3050, -3874,  1815,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874,  3054, 47577,  2369,
-    2189, -3874, -3874,   402,  1348, -3874, -3874, -3874, -3874,  3316,
-    3321, 47577, -3874, -3874, -3874, -3874,  3196, -3874, 23644, -3874,
-    3221, -3874,  3059,  1000,  3197, -3874,  3061,  3062,  3063, 31026,
-    2666,  3334, -3874, -3874,  3139, -3874,  1544, 11131,   948, -3874,
-   -3874,   239,  3344, -3874,  1170, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874,  3064,  3139,  3139,
-   -3874, -3874, 11131, -3874,  3657,  3235, 11131, 11131, -3874, 11131,
-   -3874,   856,  3075,  3101, -3874, -3874, -3874, -3874, 11131, -3874,
-   -3874,  3139, -3874, 11131, -3874, -3874, 11131, -3874, 11131, 11131,
-   -3874,  1592, -3874,  1616, -3874,  1629, -3874, -3874, -3874,  2691,
-    3084,  3454, -3874, -3874, -3874,  2691,  3265, -3874, -3874,  2691,
-    2722,  2401, -3874, -3874,  -133, 47577, -3874, -3874,  1856, -3874,
-   -3874, 11131, -3874, 40221, -3874, -3874, -3874,  3445,  3708, -3874,
-    3304, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, 47577,  1192,
-    3096, 32252, 36543, 36543, 36543, 14301,  1544,  3580, -3874, -3874,
-   -3874,  3371,  3467, -3874,    72, -3874, 47577,  3093,  1585, -3874,
-    1872, -3874, -3874,  3094, -3874,  1752,  3098, -3874,   841, 14301,
-    2840,  3221, -3874, -3874,  1196, 24876, 31639, -3874, -3874, 47577,
-   -3874,  3539,  2241, 36543, 36543, 36543,  2229,  3529,  2900,  2900,
-   -3874, 28568, -3874, -3874,  3255, -3874, -3874, 32865, -3874, -3874,
-   -3874, -3874, -3874, -3874, 27953, 43899, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,   402,  3585,  3345,  1527,  2871, -3874,  1069,
-   -3874,   886, -3874,  3494,  3496,   886, -3874, -3874, -3874, 24876,
-    2666, 14301, -3874,  1752,  1544,  3112,  1618, -3874,  -123, 11131,
-   25492, -3874, -3874, -3874,  3115, -3874, -3874,  3626,  3627, -3874,
-   25492,  2031, 47577, -3874,  2966, -3874, -3874, -3874,  3211, -3874,
-    5639, -3874, 24876, -3874, -3874, -3874, -3874, -3874, 47577, -3874,
-   23644, -3874, 18705, -3874,  3118, -3874,  2908,  2908,  2908, -3874,
-   -3874, -3874,  2911, -3874,  2917,  3354, -3874,  2917,  2917, -3874,
-   -3874, -3874, -3874, -3874,   239,  1515, -3874, -3874,   239, -3874,
-   -3874, -3874,   136,  1426,  2917, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874,  2908,  2911,  2911, -3874, -3874,   239,  2908, -3874,
-    2908,  2641, -3874,   400,   127,  2908,  2908,  2908,  3123,  3114,
-   -3874,  1544,  3139,  3676, -3874, -3874,  3269,   402,  3622, -3874,
-    1874, -3874,  3130, -3874, 46351, -3874,  2722,  1892, -3874, -3874,
-   -3874, -3874,  3273,   754, -3874,  3299,  3134,  3136, -3874, -3874,
-     402,  3135,  3140,  6242, -3874, -3874, -3874,  3751, -3874, 47577,
-   47577, 47577,  2767, -3874,  3509,  -223,  1544,  3143,  3148,  3149,
-    3152,  3754,   278, -3874,  3759, 38995, -3874, -3874, -3874,  3153,
-    1884, -3874,  3163,  3164,  1644, -3874,   276,  3166,  1669,   995,
-    1917,  3470,  3548, -3874,  3390, -3874,  1681,  1225,  1698,  1707,
-    1787,  1794, -3874, -3874, -3874, -3874, -3874,  3174, -3874, -3874,
-     436, -3874,  3177,  1446,  1141, -3874, -3874,  1929, -3874, -3874,
-   -3874,  3637,  3538, -3874,  3611, -3874, -3874, -3874,   615,   615,
-     615,  1595,  1544,  1959, -3874, -3874, -3874, -3874,  3578, -3874,
-   -3874,  3186,  3276, 47577, -3874,  3208, -3874,  2401, 24876, 14301,
-    3189,  3183, -3874,    26, -3874, -3874,  3188, -3874, -3874, 36543,
-    2241,  2241,  2241, -3874,  3775,  3617, -3874, -3874, 39608,  3193,
-   -3874, -3874,  3499, -3874, -3874, -3874, -3874,   402,  3673, -3874,
-   -3874, -3874,  2683,  3214,  3244,   886,   886,  3385,  3246, 11131,
-   11131,  3199, -3874,  3334, -3874, -3874,   167,  2401, 11131, -3874,
-    2691,  3208, -3874,  1864,  3203,  3205, 47577,  3206,  3207, -3874,
-    3433,   301, -3874, -3874, -3874, 23644,  2641,    87, -3874, -3874,
-    3015,   745,  3210, -3874, 47577,  3535, -3874, -3874, -3874, -3874,
-     944, -3874,  3213,   944,   944, -3874,  1941, -3874,  3248,   239,
-   -3874, -3874,  3250, -3874, -3874, -3874,   944,  3215,   239, -3874,
-   -3874, -3874, -3874,   944, -3874, 39608,   257,   402,  2445, -3874,
-    3275, -3874,  3724,  1021,  3601, -3874,  2641, -3874,  3602,  3498,
-   -3874,   239, -3874, -3874,  3823, -3874,   239,  3823,   944,  3500,
-   -3874,   944, 47577, -3874, -3874, -3874, -3874, -3874, -3874, 47577,
-   -3874,   938, -3874, -3874, -3874,  1967,   402, -3874, -3874, -3874,
-    3232,  3230, -3874, -3874, -3874,  1060, -3874, 47577,  5639, -3874,
-   -3874, -3874,  3150, -3874,   953,  1971,  1618,  3234,  1981,  1989,
-   35317, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   38995, -3874,  3823, -3874,  3512, -3874, -3874, -3874, 11131, -3874,
-   -3874, -3874, 11131, -3874, -3874,  3540,  3701, -3874, -3874, -3874,
-   -3874, -3874, -3874,  3243, -3874,  2722,   195,   195, -3874, -3874,
-   -3874, -3874, -3874,  3506,  1358,  3278,  3278,  3278, -3874, 14301,
-    3628,  3338, -3874, -3874,  3252,  3287, -3874, -3874,  1446, -3874,
-   -3874, -3874, -3874,  2241, 11131, -3874,  3334,  2312, -3874, 28568,
-   -3874, -3874,   402,  -133, -3874,  3295, -3874, -3874, -3874,  3302,
-    1544,  1544, 47577,  3509, -3874,   288,  1446,  1618, -3874,  2007,
-   -3874, 47577, 47577,  2012, 47577, 47577,  2719,  2725,  2728,   892,
-     892, -3874, -3874, -3874, -3874, -3874, -3874,  3652, -3874, -3874,
-    2038, -3874,  1032,  3532, -3874, -3874, -3874, -3874,   944, -3874,
-     276, -3874, -3874, -3874, -3874, -3874,   276, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874,  3544,  3300, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874,  3268, -3874, -3874,  3389, -3874, 53707, -3874, -3874,  1013,
-    3290, -3874, -3874, -3874, -3874,  1292, 47577, 23644,  3298,  3457,
-   -3874,  2966, -3874,    26,  1000,  3221, -3874,   344, 47577, -3874,
-    3545,    92,  1078, -3874, -3874, -3874,  3279,  3283,  1618,  1866,
-   -3874, -3874, -3874,  3280, -3874, -3874, -3874,  3364,  3375, -3874,
-   -3874,  3382, -3874, -3874,   133,  1663, -3874, -3874, -3874, -3874,
-    3342, 23644, 15569,  3396, 47577,   169,  2509, -3874,  -212,  1618,
-   11131,  2229, 35930, -3874, -3874, -3874, -3874, 11131,  3301, 11131,
-    3303,  2044, -3874, -3874, -3874,  1404,  1404, -3874,   288, -3874,
-   -3874, -3874,  2047,  2061,   344,  2066,  2068, -3874, -3874, -3874,
-     301,  3306, -3874, 47577, -3874, -3874, -3874,   254, -3874, -3874,
-    2080, -3874,  2085, -3874, -3874, 11131,  3778,  3325, 47577,  1185,
-   -3874, 54933, 54933, 47577, -3874, -3874, -3874, -3874,  4838, -3874,
-   -3874,   728, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,  3907, -3874,  3311, -3874, -3874,  1013,  3312,
-   -3874,  1383, -3874,  1769, -3874, -3874,  5639,  3753,  1469, -3874,
-   -3874, -3874, -3874, -3874,  3314,  1769,   402,   841, -3874,   344,
-   -3874, -3874, -3874,  1618,  3320,  3558, -3874,    92, -3874, -3874,
-   -3874,  1078, -3874, -3874, -3874, 11131, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,   165,  3572,  2722,  2722,  2722,  2722,  1663,
-   -3874, 24876,  2628, -3874,  2691, -3874,  2116, -3874, -3874, -3874,
-    3405,   841,  3822,  3824,   841,   841,   841,   841,  3324,  2509,
-   -3874,  3806, -3874, -3874, 11131, -3874, -3874,  1544,  3557, -3874,
-    3891,  1141,  1544, 47577,  1544, 47577, -3874,  3777,  3777, -3874,
-    3541,   344, -3874,    92,  1078, -3874,  3208, -3874,   965,   965,
-     239,   276,   239,  1544, 11131, -3874, 11131,  3359, -3874, -3874,
-    3779, 47577, -3874, -3874, -3874, -3874, 11131, -3874, 53707, 53707,
-   -3874, -3874, -3874, -3874,  3936, -3874,  3339,    26,  3908,  3603,
-    3918, -3874,  3294, -3874, -3874,  3596,  5639, -3874, -3874, -3874,
-    2722,   253, -3874, -3874, -3874,  1232,   253, -3874,   253, -3874,
-    1618, -3874, -3874, -3874, -3874, -3874, -3874, -3874,  3348, -3874,
-     841, -3874,  3353, -3874, -3874, 47577,  3361, -3874,   402,   841,
-     841,  1228,  1228,  2691, 39608,  3461, -3874, -3874,   841,  1618,
-    3979, -3874,    86,  3729, -3874,  2119,  2121,  1266, -3874, -3874,
-   -3874, -3874, -3874, -3874,  2133, -3874,  3991, -3874,   950,  3633,
-    3634, -3874, -3874, -3874,  1544,  1544, -3874,    67, -3874, -3874,
-    3766,  3853, 11131,  1544, 50642,  3368, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, 54320,
-   11131, -3874,   728,  3907, -3874, -3874,  3635, -3874,  3636, -3874,
-   -3874, -3874,  3878, 53707, -3874,  3873, -3874,    26, -3874, -3874,
-   -3874, -3874, -3874, -3874, 24876, 14301,  2312, -3874,  3396, -3874,
-    3383, -3874, -3874,   -47, -3874,   402,   402, -3874, -3874, -3874,
-   -3874, -3874,  2139, -3874, 39608, -3874, -3874,  3968,  3969,  3869,
-    3973,    86, -3874,   -84, -3874, -3874, -3874,  3974, -3874,  3975,
-    3392,  3393, -3874, -3874, -3874, -3874,  3442,  3901,  3422, 11131,
-   53707, -3874,  3881, -3874,  3811,  1544,  3757,  3397, -3874,  3398,
-    1544,  3913, 54933, 54933, -3874, -3874, -3874, -3874,  3899, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874,  2144, -3874, 14935,
-   -3874, -3874, -3874, -3874, -3874, 39608, -3874,  3461, -3874,  3416,
-     276,   276,  4001,   276, -3874,  4002,  4004,   -84, -3874, -3874,
-   -3874, 46351, 46351,   965,   965, -3874,   176, -3874,  1544, 51255,
-    4000, 47577, -3874,  3505, -3874, -3874, 11131,  3916, 40834, 51868,
-    3423, -3874, -3874, -3874,  3599, -3874,  3294,  3598, -3874,  3383,
-   -3874,  3428, -3874,  2293,  2509, -3874, -3874,  3703, -3874, -3874,
-     276, -3874,   276,   276, -3874,  3431,  2160, -3874, -3874, 11131,
-   -3874,  3914,  3518, -3874,  3436, -3874, 53707,  1544, 53707, -3874,
-   -3874,  3864,  3438,  1851, -3874,  3435, -3874, -3874, 53707,  3860,
-    3891, -3874, 14935,  3449, -3874, -3874,  3450,  3451, -3874, -3874,
-   -3874, -3874, -3874,  1544,  4032, 53707, 47577, 48803,  3937, 52481,
-    3902, 47577,  5639,  3904,  3905, -3874, 53707, -3874,  4039,  3729,
-   -3874, -3874, -3874,  3703,  3547, -3874, 49416, -3874,  2378,  3649,
-    3485, -3874, -3874,  3976,  2328, -3874, -3874,   276,  3872, -3874,
-   53707, 53707, -3874, -3874, -3874, -3874, 33478, -3874, -3874, -3874,
-   -3874, -3874,   622, -3874,  3739,  3468, 50029, 53094, -3874, -3874,
-   -3874, 30413, -3874, -3874, -3874,  3912, -3874, 11131, -3874,    45,
-   19937,  3631, 33478, -3874, -3874,  1544, -3874, -3874, -3874, -3874,
-   39608,  2173, -3874, -3874, 24876, -3874, -3874, -3874, -3874, 23026,
-    3471, -3874,   841, -3874, 24876, -3874, -3874, 14301, -3874, -3874
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int16 yypgoto[] =
-{
-   -3874, -3874, -3874, -3874, -3874,   124, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874,  1813, -3874, -3874, -3874, -3874, -3874,
-    2016, -3874,   692, -1823, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874,   693,  1615,  3464, -3874,   428,
-   -3874,   107, -3874, -3874, -3874, -2942,   -21,  -203, -3874, -3874,
-     501,    21,  3154,  -202, -3095, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874,   439,   433, -3874, -3874,   259, -3874,
-   -3874, -1305, -3874, -3874, -3874, -3874, -3874, -3874, -3874,  -377,
-    -338,  1846, -3874, -3874, -3874,  4081, -3874,  3552, -3874, -1743,
-    2307, -3874, -3874, -3874, -3874, -3874,  2370, -1671, -3874, -3874,
-   -3874,  1350, -3874, -3874, -3874, -3874,  -447,   279, -3874,   280,
-   -3874,   281, -3874,   282, -3874,   283,   289,   298,   299, -3874,
-     306, -3874, -3874,  -329, -3874, -3874, -3874, -3874,   307, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874,  -222, -3874, -3874,   -50,
-   -3874, -3874,  -191,   311, -3874,  -144,   315, -3874,   323, -3874,
-     -63, -3874,   -60, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874,  3176, -3874, -3874, -3874,
-   -2257, -3874, -3874, -2250,  2714, -3874, -1763, -3874, -3874, -1924,
-   -3874, -3874, -1771,  1274, -3874, -3874,   -93,  -328, -3874, -1290,
-   -1890, -1889, -3874, -3874, -3874, -2028, -2012, -1364, -1285, -2309,
-   -3874, -3874, -3874,   309, -3874, -3874, -2587,  2141,  2717, -3874,
-   -1977, -3874, -3874,  1195, -3874, -3874,  1375,   672,  1378, -3874,
-     971,  2912, -1209, -3874, -3874, -3874, -3874, -3874, -3874,    34,
-     292,   -58, -3874, -3359,   676, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3873, -3874, -3874, -3874,  -220, -3874, -3874,
-    -132, -3874, -3874,  -178, -3874,   141, -2303, -3874, -3874, -3874,
-   -3874,  2678, -1299, -3874,  3693, -3874,  -563,   778,  2172, -2462,
-   -1401, -3874,  -886,  -872, -2494, -3874, -3874, -3874, -2612,  1149,
-    1560, -3874,   874,  2174, -1904, -3874,  1640, -3874, -3874,   897,
-   -3874, -2123, -3874, -3874, -3874,   855, -3874,   857, -3874, -3874,
-   -3874, -1044,   825, -2578,  1397,  -416, -3874,   412, -2423, -2521,
-   -3874,   635, -3874,   586, -3763, -3338, -3874,  -568, -2099, -2411,
-     -23, -3874, -3874,   600, -3159,  1772, -3874, -3874, -3874, -3114,
-   -1710,  1501, -3874, -3874,  1075, -3874, -2054,  1067, -3874, -3874,
-   -3874,  1082, -3874,   154, -3874, -3874, -3874, -3874, -3830, -3874,
-   -3874, -1464, -2264, -3874, -3874,  4234,  4235, -1007, -2670, -2496,
-     159,   153, -3874, -3874, -3874,  2705,  -900,   234,   223,   228,
-    2131,  -656,   378, -2416, -3874,   434, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,  2215,  -426, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -2439, -2441, -3874, -3874,  1687, -3874, -3874, -3874,
-   -2310, -1421, -1418, -1908,  -474, -2188, -3352, -3874, -3874, -3874,
-   -3874, -3874, -3874,  2839, -3874, -3874, -3874, -3874, -3874,  3685,
-   -3874,  2846, -3874, -3874, -3874, -3874, -3874, -3874, -3874,   666,
-    1904, -3874, -3874, -3874, -3874, -3874, -3874,   951,  2745, -3874,
-   -3874, -3874,     2, -3874, -3874, -3874, -3874,  2460, -3874, -3874,
-   -3874, -3874,  2798, -3874, -3874, -3874, -3874, -3874, -3874,  1474,
-   -3874,  1943, -3874, -1428, -3874, -3874,  1055,  -945,  1896,  3688,
-    2033, -3874, -3874,  -590, -3874, -3874, -3874, -1657, -2446, -3874,
-    3424, -1011, -2588,  2462,  -645, -1826,  1105,   324,  3593, -3874,
-   -1101, -1049, -3874, -3874,  -637, -3874, -3874, -3874,  -616, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-    1518, -3874, -3874, -3874, -3874, -1170, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,  1267, -3874,  2137, -3874,  -499, -3874,  3216,
-   -3874, -3874, -3874, -2358, -1954,  1836,  1008, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -1532, -3874, -2378, -3874,
-   -3874, -3874, -3874, -3874,  2054, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -1723, -3874, -2268,   213, -3874,   364, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874,   -46,   890,   -41, -2710, -1060,
-    1713, -3874, -3874, -1241,  3251, -2325, -3874, -3874, -3874,  2034,
-   -3874, -3874, -3874, -3874, -3874,   981, -2982,  2879, -3874, -3874,
-   -3192,  -869, -2262,  -848, -3874, -2353,   532, -1817, -1759,  -409,
-   -1349, -2424, -3874, -3874, -3874, -3874,  -135, -3874, -3874, -3874,
-     550,  1932, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874,  -483,  -760, -3874, -3874,  2190,  2426, -3874,
-    3125, -3874, -1024,  3372, -3874, -3874,  3373, -3874, -3874, -3874,
-   -3874,  3047,  3028,  2004, -3874, -3874, -2388, -3874, -3874,  1958,
-   -3874,   804,  -858, -1797,  1084, -3874, -3874,  1095, -3241, -3874,
-   -3874,  3399, -3874, -3874, -3874,  1036, -3874,    82,  3755,  3400,
-   -3874, -3874, -3874, -3874, -3874, -3874,  2784, -1015,  3682, -3874,
-   -3874, -3874, -3874, -3874, -3874,  2440, -3874, -3874, -3874, -3874,
-   -3874, -3874,  2999,  3772,  -570, -1244, -3874,  -717,  2951,  2443,
-    -808, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874,  2599,  1010, -3874, -3874,
-   -3874,  3045, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,  1135,
-     -59, -3874,    77,   -89, -3874,    16, -3874, -3874, -3874, -3874,
-   -3874,  -154, -3874, -3874,  -160, -3874,  -940, -1354,   730, -1212,
-   -2038, -3874,  1128,  3040, -2460,  -668, -1108, -1128, -1896,    27,
-   -3874, -3874,  3429,  2067,   101,  -392,  -410,    -6, -2215,  -110,
-    -575, -3874, -2541, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874,  1963, -3874, -3874, -3874,  1103, -3874,  3804, -3874,  2694,
-    1106,  3805, -3874, -1317,  2522,  1977,  1982, -3874, -3874,  1986,
-   -2208, -3874, -3874,   285, -3874,  2592, -3874, -3874, -3874, -3874,
-   -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874,  2562,  3536,  3067, -3874,  2607, -3874, -3874, -3874,
-   -3874, -3874,   350, -3874,  -217, -3874, -2669,  2860,   459, -3874,
-    1188,  -659,  -891, -3874, -3874,   348, -3874, -3874,  1584,  3829,
-    3549, -3874, -3874, -3874, -3874, -3874, -2764,  -843, -3874, -3425,
-   -2824, -1649, -3874, -3874, -2172, -3031, -3874, -3874, -1012, -3874,
-   -3874, -3874, -3874, -2005, -3874, -3874, -3874,    90,  3889,  3892,
-   -3874, -3874,   670, -3874,  -119, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874,   405,   734, -3874, -3874,  3758, -3874, -3874, -3874,
-   -3874,  3760, -3874, -3874, -3874, -3874, -3874,  3761, -3874, -3874,
-   -3874, -3874, -3874,  1867, -3874, -3874, -3874, -3874, -3874, -3874,
-   -3874, -3874
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -2610
-static const yytype_int16 yytable[] =
-{
-     491,  1005,  1019,  1027,   947,   918,   878,   914,  1442,  1671,
-    1331,  2393,   617,   533,  1449,  1345,  1348,   541,  2134,  2065,
-     783,  1758,   534,  1889,  1623,  1360,   555,   489,  1556,  1670,
-    1546,  1547,   553,   567,  2250,   962,   570,  1090,   560,  1795,
-     567,  1863,  2553,  1379,  1407,  2347,  2972,   585,   977,  1048,
-     539,  2047,  2619,  2062,  2048,  2925,  2694,  2915,  1645,  1693,
-    3574,  2696,  1587,  1757,  2796,  1379,  1701,  3288,  2827,  3247,
-    3083,  2037,  1454,  2925,  2925,  2878,  2879,  1803,  2902,  2755,
-    2519,  1373,  2510,  2377,  2523,  2295,  1455,  2639,   606,  1035,
-    2443,  2893,  2504,  2505,  3404,  2538,  2968,  2944,  1959,  2903,
-    2973,  2779,  1979,  2640,  1979,   135,  1408,  2549,  3762,  3444,
-     609,  2882,   491,  3110,  3579,   491,   616,   622,  3209,  1703,
-    1704,   605,  2116,  1707,  1708,  1709,  1710,  2850,  1712,  1713,
-    1715,  1717,  1718,  1719,  1720,  1721,  1185,  1152,  1153,   611,
-    2467,  2468,   613,  3494,  1896,  1143,  1144,  1145,  2492,  2582,
-    4042,   994,   997,  1936,  1152,  1153,  1971,  2479,  1186,  1268,
-    3653,  3171,  1906,  1798,  3101,  3594,  4016,  2111,  3108,  3252,
-    1909,  1910,  1958,  1424,  2497,  2498,  1015,  1960,  2388,   636,
-    2628,  1980,  1735,  1980,  2673,  2481,  1809,  2901,  2929,  2930,
-    2518,  1268,  2150,  2521,  2522,  3622,  2524,  3085,  1409,  2527,
-    2528,  2925,  2925,  2531,   115,  2461,  2869, -1794,  2540,  1722,
-    1779,  2500,  4300,  2544,  2545,  2546,  2547,  2548,  1384,   627,
-    1514,  2552,  3789,  2554,  2286,  2636,  2637,  3897,  1210,  2563,
-    2564,  2565,  2566,  2557,  4277,  2570,  1451,  2572,  3162,  3803,
-    2751,  2106,  2876,  4133,  2933,  4278,  2112,   998,  2334,  1341,
-    3615,  3620,  2947,  2593,  3621,  2596,  2597,  1152,  1153,  1294,
-    3451,  2607,  2608,  3580,  1987,  3107,  4330,  -901,   545,  4200,
-    2616,  2617,  3452,  3631,  3314,  2621,  1971,  1277,  3317,  3652,
-    1347,  1152,  1153,  1187, -2493,   548,  3453,  1431,  3760, -2557,
-    2567, -1518,   927,  3434,   498,  1269,   116,   885,   869,  3708,
-    3834,  1844,  2623,  2624,  2625,  2626,  1016,  2019,  2286,  3023,
-    4506,   937,  1008,   594,   552,   117,  3054,  3055,  1950,  1451,
-     559,  4300,  1130,  1451,  1152,  1153,  1845,  1269,  1559,  1152,
-    1153,  3270,  2237,  2653,  2053,  1681,   885,   869,  1152,  1153,
-   -2343,  4017,  1152,  1153,  3163,  1274,  3091,  2938,  3093,  3189,
-    -567, -1478,  1152,  1153,  -568,  2022,   130,  1389,  2918,  1954,
-     922,  1152,  1153,  1152,  1153,  1152,  1153,  1000,  1377,  2558,
-    1536,  1537,  1538,  4246,  3235,  2265,   657,  3830,   577,  4098,
-    1070,  2846,  3032,  3061,  2335,   118,  3066,  4328, -1478,  2738,
-    4332,  2648,  1190,   495,   641,  1539,   496,  4072,  4073, -2557,
-    3831,  2181,  1152,  1153,   549,  1586,  1539,  4059,  3702,  1201,
-    3898,   980,  2649,   643,   119,  2739,  1723,   628,  4016,  1090,
-    4074,  3451,  2746,  1152,  1153,  1540,  1776,  4345,  4060,  3033,
-    2214,  2844,   815,  3452,   801,   658,  1541,  3832,  3242,   923,
-    1724,  1972,   558,   131,  1001,  1152,  1153,  3453,  4012,  2054,
-     578,  1560, -1518,  1152,  1153,  1307,  3162,  4279,   885,   869,
-    4346,  1515,  1425,  1017,  3303,  1071,   120,  2847,  1951, -1994,
-    1198,  2939,  3933,  2919,  2568,   595, -2131,  1278,  1932,  1954,
-    3024,  1152,  1153,  1846,   928,   938,  1929,  1432,  1152,  1153,
-    1152,  1153,  3067,  1858,  1152,  1153,  1131,  1682,   616,  3963,
-     622,  1477,  4507, -2609,  3879,  3823,  4421,  3581,  3909,  3934,
-    1154,  3435, -2343,  1155,  3827,  2229,  2584,   797,  3256,  3257,
-    3292,   622,   632,  4397,  4398,  2012,  1698,  3313,  1021,  1029,
-    3315,  3316,   810,  1152,  1153,  1362,   616,  3846,   820,  2537,
-    2410,   568,  3848,  3508,  3509,  3510,   999,  1152,  1153,  1152,
-    1153,   833, -2153,  3324,  2574,  1706,  1412,  1570,  1571,  1152,
-    1153,  1972,  3163,  1152,  1153,  1759,  1454,   659,   879,  1016,
-     812,  1342,  1727,  2238,  1891,   911,   934,  1894,  1611,  2994,
-    1455,  2336,  1898,  4326,  3540,  3541,  3542,  1625, -1518,  1188,
-    1934,  3783,  1959,  4017,   951,  3940,   121,   546,  4095,  1638,
-    1639,  1640,  1329,  1725,   616,  2639,   966,  1644,  1911,  1912,
-    1979,  2504,  2505,  1154,  1758,  3318,  1155,   616,   606,   491,
-    2287,  2640,  3438,  2950,   606,   623,   992,  2954,   606,   606,
-    4280,  3293,  3294,  1006,   966,  2925,  2037,  1154,   616, -2271,
-    1155,  2970,  2971,  3585,  1454,  2911,   979,  3527,  1036,  1037,
-    1038,   978,  2151,  2984,  1043,  1202,  1757,   989,  1455,  3273,
-    1152,  1153,  2267,  2436,  1152,  1153,  1958,   122,  1385,  3164,
-    3739,  1960,  4206,  2270,   980,  3307,  2273,  3312,  2843,  4463,
-    1154,  1516,  2582,  1155,  2117,  1154,  2877,  2940,  1155,  1980,
-    1200,  3901,  2503,  2264,  1154,  1908,  4036,  1155,  1154,  1091,
-    4025,  1155,  4235,  3056,  2287,  2953,  1780,  2955,  1154,  2927,
-    2282,  1155,  4011,  1810,  2966,  3577,  3090,  1154,   851,  1154,
-    1155,  1154,  1155,  1799,  1155,  2892,  1017,  4076,  2979,  1738,
-     123,  3623, -1005,  2965,  2851,  2990,  2931,  4194,  1156,  1033,
-    2111, -2493,  3926,  2636,  2637,  3172,  2974,  3006,  3008,  3010,
-    3419,  2641,  -901,  3011, -1478,  1156,  2094,  3098,  1154,  2582,
-    1149,  1155,  1151,  1346,  2932,  3443, -2609,  1351,  1356, -2493,
-    2559,  3190,  1843,  2253,  3609,  3051, -1518,  3432,   124,  1154,
-    1376,  4355,  1155,  3327,  3921, -1518,  1152,  1153,  1194,   491,
-    1196, -1994,   966,   491,   616,   550,   491,   616, -2131,  1936,
-    1797,  1154,  1239,  1872,  1155,  3629,  3630,  1390,  1273,  1154,
-    3420,  1895,  1155,  3454,  2106,  1816,  1195,   805,   606,  2112,
-    1199,   939,  4321,  1209,  3271,  2635, -1794,  3608,   616,   606,
-    2642,  4143,  1132,   606,  3059,  -567,  4099,  1154,   825,  -568,
-    1155,  3165,  1441,  3068,  1154,   836,  1154,  1155,  1777,  1155,
-    1154,  1280,  3709,  1155,  1152,  1153,  3534,  2938,  1156,  1152,
-    1153,  3628,  1297,  2941,  1476,  3053,  1303,   616,   935,  3633,
-    3763,   616,   616,  2215, -2153,  3935,  3658,  1152,  1153,  1363,
-    2660,  3593,  1156, -2422,   616,  1152,  1153,  3164,  1938,  1154,
-    1516,  1413,  1155,  1404,  3584,  1984,  1678,  1679,  3471,  3600,
-    1954,  2585, -1821,  1154,  2801,  1154,  1155,  3391,  1155,  2126,
-    2160,  1152,  1153,  3564,  1542,  1154,  2361,  3568,  1155,  1154,
-     829,   813,  1155,  3606,  3607,  1156,  4009,   606,  2908,  1291,
-    1156,  3107,  2127,  3563,  3107,  3107,  2257,  3567,  2827,  1156,
-    2141,  1152,  1153,  1156,  3183,  2239,   616,   134,  1450,  1152,
-    1153,  3107, -1994,  1156,  2161,  1152,  1153,  2230,  4253, -2131,
-    2186, -2271,  1156,  2600,  1156,  3632,  1156,  1678,  2180,  1187,
-    3651,  3654,  3656,  3657,  3454,  3573,  2122,  2159,   606,  2166,
-    2218,  2219, -2423,  3677,  3227,  2399,  4201,  4275,  4203,  2309,
-    2428, -1966,  3678,  2361,  3543, -2422,  1341,  2246,  3650,  1152,
-    1153,  1152,  1153,  1156,  1064,  2414,  1918,  4118, -1821,   687,
-     644,  1152,  1153,   136,  4323,  4195,  1154,  2235,  2236,  1155,
-    1154,   841,  1414,  1155,  1156,  1152,  1153,  2601,  1201,   606,
-    3098,   803,  2639,  1552,  2432, -2153,  1579,  4240,  2760,  2761,
-    1688,  2661,  2504,  2505,  3124,  1415,  1156,  1284,  2640,  3258,
-    1285,  2945,  2945,  1201,  1156,  1379,  3744,  3232,  3286,   834,
-    3121,  3122,  1543,  3281,  2466,  3447,  1550,  1091,  3128,  3129,
-    4294,  3326,  3931,   692,  1889,  1889,  1134,  1726,  1420,  1152,
-    1153,  1091,  1156,  3034,  2274,  1379,  1152,  1153,  2430,  1156,
-      43,  1156,  1232,  3250, -2423,  1156,  3145,  3146,  2435,  2403,
-    2299,  2438,  2439,  3180,  3181,  3874,  2167,  2538,  2272,  2142,
-    2510,  3488,  2295,  3287,  3560,  3490,  1959,   494,  3787,  2258,
-    1152,  1153, -2271,  2602,  1760,  2675,  1152,  1153,  1152,  1153,
-     842,  1672,  3679,  2380,  1156,  1979,  2711,  1612,  1152,  1153,
-    1613,  3839,  1154,  2815,   616,  1155,  3917,   499,  1156,  2173,
-    1156,  -472,  4016,  2047,  2340,  3840,  2048,  2362,  1759,  2247,
-    1156,  2759,  2285,  2178,  1156,  2179,  4119,   544,  1919,   704,
-    2636,  2637,  1920,  2037,  3939,  2182,  1854,   955,  2154,  1808,
-     651,   616,  1152,  1153,  1152,  1153,  1730,  3776,  3777,   830,
-    1958,   606,  2898,  2883,   911,  1960,  1286,  3472,  1405,  2305,
-    2310,  2300,  3323,  2899,  2603,   843,   606,  3596,  2764,  2765,
-    1154,  2503,  1454,  1155,  1980,  1154, -1821,   115,  1155,   911,
-    3026,  3434,  3954,  3035,  1732,  3448,  1455,  1091,   616,  1152,
-    1153,  1152,  1153,  1154,  2362,   535,  1155,  2357,  2358,  4131,
-    1879,  1154,  2250,  1671,  1155, -1821,  1855,  1535,   557,  2758,
-     720,  4138,    55,  2379,  1152,  1153,  2289,  4184,  3888,  2768,
-    2429,  1156,   814,  2111,  1784,  1156,  1787,  1154,   606,  2641,
-    1155,  3537,  1152,  1153,  1202,  1188,  2194,   606,  1152,  1153,
-    2201,  4240,   580,   616,  1458,  3259,  4528,  3447,  1152,  1153,
-    3143,  2811,   606,   606,  1152,  1153,  2662,  1154,   579,  1202,
-    1155,  1303,  1880,  1189,  3919,  1154,  3449,  4295,  1155,  1580,
-    1559,  1154,  1152,  1153,  1155,  3996,  1152,  1153,  1342,  4196,
-    1034,  1830,  1152,  1153,  2259,  1421,  1303,  4017,   117,  1838,
-    1671,  2363,  1839,  1152,  1153,  4120,  2311,  2106, -2422,  3841,
-    2260,   616,  2112,  2635,  2381,  2341,  2404,  3883,  2642,  1940,
-    2906,  1859,   879,  3492,  1918,  1154,  3712,  1154,  1155, -1821,
-    1155,   491,   491,   491,   606,   491,   606,  1154, -2422,   837,
-    1155,  1890,  3221,  4185,  4109,  4186,  1791,  1892,   491,   134,
-     616,  1154,  1848,   491,  1155,  -206,  1559,  1156,  1873,  1874,
-    1875,  3876,  1877,  1152,  1153,  1152,  1153,  1876,  2900,  1878,
-    3485,   956,  2205,   606, -2557,  1893,  3858, -1821,  2363,  2342,
-    1897,  4197,  2385,  2604,  2975,  1971,  3955,  1152,  1153,   582,
-    3897,  2367,  1122,  1671,  2582,  1152,  1153,   957,  3814,  2454,
-    3996,  3996,  1559,  1575,  4128,  1154,  1907, -2423,  1155,  3435,
-     600,  4198,  1154,  2988,  4129,  1155,  2582,  3448,  4092,   255,
-    1856,   257,  3297,   616,  1516,  1156,  1152,  1153,  2386,   749,
-    1156,   597,  1518,  1869,   616,  2099,  3072, -2423,  4287,   606,
-    2206,  1289,  2058,   606,  1416,  2208,  1154,  2945,  1156,  1155,
-    2311,  3858,  1154,  1881,  1154,  1155,  1156,  1155,  2976,  1169,
-     598,  1152,  1153,  2209,  1154,  1169,   607,  1155,  1152,  1153,
-    2126,  2213,  2055,  1152,  1153,  2920,  2060,  1123,  1971,  1630,
-     606,  4079,  1156,  4288, -2557,  3450,  1919,  3956, -1794,  1152,
-    1153,  3677,  2643,  2127,  3815,  1559,   838,  2231,  3460,   616,
-    3678,   491,   491,  4110,  2124,   491,  3451,  1918,  1154,  1831,
-    1154,  1155,  1156,  1155, -1794,  1152,  1153,  1043,  3452,  2140,
-    1156,  2537,  2867,  1417,  1849,  1634,  1156,  3126,  2120,  2121,
-    1152,  1153,  3453,  2631,  3816,  3127,  1970,  1954,  3859,  1152,
-    1153,  3138,  4014,   885,  3616,  4150,  1519,  3996,  3996,  1614,
-    1520,   645,  1615,  3875,  3073,  1154,  2921,  1154,  1155,  2977,
-    1155,  1521,  1954,  1152,  1153,  4191,  1932,  1152,  1153,  3051,
-    1156,  3038,  1156,  3898,  1152,  1153,  1152,  1153,  1152,  1153,
-    1154,  3884,  1156,  1155,  4179,  3148,  3039,  3149,  1954,   610,
-     816,  1126,  1091,  2187,  1758,   569,  1156,  3722,  1154,  2063,
-    2290,  1155,  1152,  1153,  1154,  2385,  -472,  1155,  3333,  4289,
-    2158,   612,  2503,  3998,  1154,  1152,  1153,  1155,  1658,  2763,
-    1154,   625,  4130,  1155,  2064,  1152,  1153,  3092,  2153,  4078,
-    1152,  1153,  1832,  2698,  2367,  3179,  1757,  3302,  1154,   624,
-    3679,  1155,  1154,  3996,  2278,  1155,  3298,  2705,  1154,  2644,
-    1156,  1155,  2279,  2256,  1172,  1152,  1153,  1156,  3996,  1154,
-    1172,   117,  1155,  1671,  2168,  1201,  2641,  1152,  1153,  1919,
-    1972,  2169,  3996,  1920,  1971,  2861,  1127,   817,  3899,  1377,
-    2720,  1954,   632,  3238,  1152,  1153,   633,   629,  1152,  1153,
-    1201,  1156,  1522,  1152,  1153,  2280,  2862,  1156,  2367,  1156,
-    2398,   616,   636,   606,   616,  3144,  2368,  3450,  1806,  1156,
-    2100,  2177,  2730,  2190,  3334,   606,  1201,  2925,  2925,  1154,
-    1239,  1154,  1155,  2191,  1155,  1239,  4113,  4114,   638,  3996,
-    2863,  3947,  3948,  1152,  1153,  1380,  3074,  3500,   616,  3499,
-    2635,  3996,  3996,  1154,   640,  2642,  1155,   818,   652,  2774,
-    4338,  1154,  1807,  1156,  1155,  1156,   606,  2262,  2369,  2370,
-     606,  3521,  2801,  1972,  2998,  2922,  2999,  2195,   654,  2199,
-    3504,   854,  1048,  1152,  1153,  2278,   616,   616,   606,   606,
-    1152,  1153,  1154,  3267,  1381,  1155,   655,  1523,  3996,  2332,
-    1091,  3788,   616,  1280,  1535,   507,  3241,  3949,  3996,   656,
-    1156,  4249,  1156, -1794,   616,  3522,  4251,  3000,  4252,  1201,
-     495,  1297,  2360,   496,  2200,  2250,  2204,  1154,   878,  2181,
-    1155,   879,  2369,  2370,  1154,  1156,  3728,  1155,   793,  1154,
-    3001,   911,  1155,  4044,   586,  3996,  2427,  3996,  3900,  2207,
-     798,  3075,   808,  1156,   811,  1154, -1716,  3996,  1155,  1156,
-    1152,  1153,  1152,  1153,  3901,   564,   911,  2210,   822,  1156,
-    2371,  2732,   564,  2222,  3996,  1156,  3996,  3002,  3996,  1152,
-    1153,  1154,   606,  2241,  1155,  3996,  1169,  1954,   826,  3095,
-     587,  2356,   911,  1156,  2449,  3996,  1154,  1156,  3893,  1155,
-   -1716,   606,   828,  1156,   855,  1154,  2135,  3114,  1155,  3996,
-    3996,  3120,  4443,   848,  1156,  2437,  2734,  3123,  1003,  1004,
-     846,  1202,  1493,  1494,  3847,  3996,  3996,  3849,  3130,  1154,
-    3996,  4444,  1155,  1154,  2460,   838,  1155,   949,  1863,   950,
-    1154,  2964,  1154,  1155,  1154,  1155,  1202,  1155,  2423,  4045,
-    4046,  2766,  3902,   952,  4047,  4048,  1179,  1180,  1181,  1182,
-    1183,  1184,   814,   588,  1181,  1182,  1183,  1184,  1154,  1972,
-    1331,  1155,  1202,   959,  1156,  1961,  1156,  2480,   980,   856,
-     968,  1154,  3885,  2629,  1155,   911,  3276,  2645,  3134,  1009,
-    3135,  1154,  3277,  1014,  1155,  2874,  1154,  2155,  1156,  1155,
-     990,  3624, -1716,  3060,  3625,  2569,  1156,  1379,   885,   869,
-    2680,  1010,  3136,  1379,  3445,  1201,  1045,  1516,  1937,  2583,
-    3137,  1154,  2470,   115,  1155,  1346,  3561,  1046,  3301,  1047,
-    1346,  2477,  2478,  1154,  1049,   969,  1155,  1156,  3462,  3463,
-    2156,  1189,  2482,  2483,  2484,  2485, -1716,  2493,  2494,  1189,
-    1154,  3139,  2674,  1155,  1154,  3278,   939,  1155,  1050,  1154,
-    1051,  3477,  1155,  1509,  1510,  1202,  2157,  1189,  1518,  3454,
-    1169,  1192,  1156,  2792,  1193,  2793,  1054,  4372,  4372,  1156,
-    1055,  1172,  1056,  1962,  1156,   970,  3142,   616,  1057,  3617,
-    3389,   616,  2952,  2646,  1197,  1102,   491,  1671,  3147,  1154,
-    1156,  1058,  1155,   606,   606,   606,  2669,  2274,  1971,  2672,
-    1766,  2174,  1189,  1214,  3150,  1059, -1822,  1121,  2982,  2983,
-    3003,  2684,   854,  2651,  2756,  3012,  1156,  1060,  1168,   616,
-    1135,  1136,  1061,  1971,   616,  1062,  2665,  2666,  2667,  1154,
-    3152,  1156,  1155,  2839,  2840,  2841,  1154,  2685,  1759,  1155,
-    1156,  1671,  2595,  1065,  2778,  2595,  2595,  1067,  2595,  2183,
-    1189,  2595,  2595,  2595,  2595,  2595,  2595,  2595,   971,  2450,
-    2595,  2906,  2595,  1068,  1156,  1069,    13,  1072,  1156,  2184,
-    1628,   911,  1519,  2099,  1671,  1156,  1520,  1156,  3154,  1156,
-    2099,  1767,  3156,  1971,   119,  2686,  1768,  1521,  2687,  3157,
-    4140,  3158,  1275,  3482,  2988,  1073,  2688,  4162,  4153,  4154,
-    4155,  4156,   589,  1156,  2306,  1074,  1154,  2307,  1154,  1155,
-    2308,  1155, -1822,  3234,  1467,  1468,  1156,  3483,   616,  1174,
-    1175,  2196,  1189,  1169,   590,  1154,  1156, -1794,  1155,  1769,
-    3484,  1156,  3178,  2099,  4168,   855,  1075,  4171,  4172,  4173,
-    4174,  1963,  1076,  2775,  1770,  3717,  2197,  1189,   616,  1077,
-    1964,  1202, -1794,  1276,  1533,  1172,  1156,  1965,   591, -1794,
-    1078,   857,   858,  1292,   860,  4163,   862,  2784,  1156,  1304,
-    3721,  2631,    25,  2790,  2790,  1306,  2790,  1079,  3587,  3588,
-    3610,   863,  3727,  3613,  3614,  1156,  1563,  1564,  1565,  1156,
-    2099,  1080,  2451,  4248,  1156,  2198,  1189,  1081,  1576,  3729,
-    3626,  1954,  1326,  2809,  1082,  2507,  2789,  2789,  3730,  2789,
-     856,  2452,  3663,  2202,  1189,  1329,  1889,   592,  1522,  1152,
-    1153,  1085,  2453,  2495,  2496,  1170,  1954,  2398,  1346,  1631,
-    1086,  2631,  1635,  1954,  1156,  2832,  2748,  1189,  1092,  2835,
-     885,   869,  4265,  4266,  2790,  2790,  2790,  1332,  3802,  1171,
-    3529,  4274,  1966,  1654,  1655,  1366,  2855,  1659,  2857,  3140,
-    1189,  1177,  1178,  1179,  1180,  1181,  1182,  1183,  1184, -1794,
-    1671,   972,  3207,  3208,  1156,  1673,  1674,  2789,  2789,  2789,
-     879,  1156,  1093,  1972,  4269,  2099,  1954,  1337,  3731,  1338,
-    3238,  1094,  1890,  1890,  1357,  3732,  3802,  3092,  1095,  1169,
-    2778,  3097,  2250,  1174,  1175,  2454,  1096,  2450,  1972,  3244,
-    3245,  3248,  3249,  1523,  1367,  2486,  3415,  3416,  1172,  2534,
-   -1822,  2689,  1672,  1097,  2486,   943,   944,  2989,   945,  1201,
-     946,   616,   616,  1098,   973,  1099,   974,  1100,  1003,  1004,
-    1103,  4087,  4088,  1954,  1368,  1268,  1361,  1967,  2100, -1822,
-     666,  1156,  1104,  1156,  1201,  2100,  2341,  3496,  1189,  2063,
-    1105,  1201,  1377,  2854,  1941,  3790,  1386,  4037,  1972,  1106,
-    1156,  1107,  2583,  3524,  3525,  3668,  3669,  2583,  1942,  2487,
-      37,  2937,  2949,  2583,  2064,  3705,  3714,  2583,  2487,  2960,
-    4161,  1108,  2951,  4471,  4472,  3319,  3719,  1391,  2961,  2960,
-    1109,  2583,  2583,  1110,   616,  2960,  1111,  2488,  2100,    43,
-    2981,  1112,  1173,  2583,  1201,  1672,  2488,  2455,  3723,  1189,
-    2342, -1518,  2985,  1113,   606,  3796,  1392,  2993,  2101,  3331,
-    3740,  1189,   687,  2996,  2997,  2960,  1114,  3337,  1954,  1115,
-    2451,  3339,  2583,  3022,  1116,  1177,  1178,  1179,  1180,  1181,
-    1182,  1183,  1184,  4061,  3048,   501,   255,  2995,   257,  2452,
-    3748,  3749,  2690, -1822,  1117,  2100,  1174,  1175,  3862,  2496,
-    2453,  1201,  3877,  3878,  1393,  2489,  1118, -1518,  1394,  1176,
-    1119,  1269,  3881,  3878,  2489,  4062,  2456,  3412,  1120,   691,
-    3882,  3878,  1124,  1694,  1172,   911,   692,  1125,  2962,  2963,
-    3470,  1128,   857,   858,   859,   860,   861,   862,  3941,  3525,
-   -1518, -1822, -1518,  3944,  3878,  1129,  2920,  1133,   606,  2583,
-     911,  1137,   863,    52,   697,  2992,  1138,   911, -1518,  1139,
-    2691,  1388, -1794, -1518,  -653,  2536,  3634,  1140,  2101,  3952,
-    3953,  1141,  1943,   502,  2507,  4086,  3249, -1518,  4090,  3878,
-    1142,  3077,  3497,  2454, -1518,  1369,  2490,  2508,  2692,  1191,
-    2100, -1518,  4091,  3878,  1365,  2490,  1201,  4093,  3878,  4094,
-    3878,    55,  4529, -1518,  1387,  1202,   878,  -857,  2102,  3635,
-     911,  4100,  4101,  3636, -1518,  3637,  4102,  4101,  2486, -1518,
-    1403,  3005,   704,  1406,  3052,  3894,  3895,  2921, -1518,  3290,
-    1202,  1410,  2486,  1411,  4063,  3007,  2499,  1202,  1177,  1178,
-    1179,  1180,  1181,  1182,  1183,  1184,  -653,  4164,  4165,  1944,
-    4285,  3249,  4286,  3249,  1419,   503,  2507,  1395,  1240,  1241,
-    1422,  3638,  1427,  2101,  4292,  3525,  1423,   911,  2627,  2508,
-    4336,  4337,  1174,  1175,  1945,  4378,  4379,  1239,  1426,  3684,
-    1429,   616,  2487,  1434,  3698,  3699,  1439,   715,  -653,  1451,
-    1202,  4432,  3414,   606,   502,  2455,  2487, -1518,   718,  1457,
-    1003,  1004,   719,   720,  4518,  4519,  1695,  1459,  2341,  1461,
-    2488,  2809,   616,  1464,  4229,  1672,  1465,  4064,  2102,  1469,
-   -1518,  1370,  4267,  4268,  2488,   563,  3220,  2143,  2063, -1518,
-    1091,  1470,   616,  1396,  1946,  4065,  1471,  1661,  1662,  2486,
-    1242,  2486,  1371,  1474,  3009,  1475,  3266,  1202,  3546,  3547,
-    3746,  3747,  1169,  2064,  1346,  3907,  3908,  1478,  4066, -1518,
-    1479,  1480,   911,  2811,  2456,  1527,  1528,  1529,  1532,  1534,
-    -653,  1243,  2342,  1535,  1553,  1555,   502,  1187,  2489,  1592,
-    3961,  1559,  1372,  1566,  3710,  1244,  3961,  1578,  1581,  1617,
-    1268,  -826,  2489,  1627,  1628,  2491,  1397,  2188,  1629,  1652,
-    2343,  2192,  2507,  2487,  2491,  2487,  1669,  1680,  1245, -1518,
-    2063,  1246,  1689,  2102,  1177,  1178,  1179,  1180,  1181,  1182,
-    1183,  1184,  1705,  1671,  1247,  2216,  1711,  1731,  1947,  1734,
-    3793,  2488, -1518,  2488,  1736,  2064,  2922,  2583,  1737,  1740,
-    2583,  2583,  1202,  4160,  1743,  2960,  1248,   795,   796,  1744,
-    1745,   799,   800,  3265,  2203,   802,   504,   804,   616,  2490,
-    1746,  2583,  1747,  1748,  1749,  1763, -1518,  1750,  2344,  1762,
-    1761,  1249,  1765,  2490,  1771,  1773,   505,  1250, -1518,  2960,
-    1596,  4028,  4032,  1783,  1774,  3279,  3280,  2960,  3282,  1782,
-     741,  2960,  1003,  1004,  3797,  4359,  1793,  3798,  3639,  2489,
-    1796,  2489,  1804,  1812,  -653,  3640,  1813,   747,  1398,  1814,
-    1815,  1696,   749,  1819,  1822,   750,  2534,  3343,  1251,   506,
-     606,  -573, -1518,  1825,   507,  3399,  1269,  1697,  1826,  1828,
-     911,   491, -1518,  1834,  1840,  3409,  1829,  2960,  1864,  1867,
-    1871,  1899,  3641, -1518, -1518,  1900,  4067,  1172,  1399,  2345,
-    1901,  1902,  3418,  3344,  1904,  1913,  2063, -1518,  3405,   508,
-    1916,  1939, -1518,  1930, -1518,  3429,  3325,   509,  3799,  3800,
-    2509,  1169,   606, -1518,  1985,  3329,  1990,  1991, -1518,  2050,
-    2490,  2064,  2490,  3442,  1516,  1597,  -653, -1518, -1518,  1600,
-    2067, -1518, -1518,  2068,  2069,  2070,  1601,   505,  2071, -1518,
-    2072,  4437,  2073,  4439,  2074,  3431, -1518,  3912,  2075,  -791,
-    -791,  1993,  2076,  3642,  2077,  2078,  2079,  2080, -1518,  -791,
-    2081,  2093,  2082,  2083,  2084,  1996,  1671,  4028,  2085, -1518,
-    4456,  4032,  2086,  1997, -1518,  3942,  3943,  2087,  3945,  3946,
-    2088,  2089,  2090, -1518,  1493,  1494,  4160,  2091,  2092,  2095,
-    1252,  3551,  2113,  2129,  1253,  1152,  1153,  1999,  2130,  2114,
-    1331,  4202,  3643,  2119,  3421,  4486,  4487,  2132,  2491,  3495,
-    1254,  1451,  1331,  3131,  1602,  2000,  2131,  2855,  1255,   505,
-    -653,  2144,  2491,  2138,  2146,  1169,  1256,  2147,  2148,  2163,
-    2164,  2165,  2170,  4028,  4032,  1174,  1175,  3821,  3822,  3922,
-    2171,  2172,  2784,  2185,  2005,  1273,   616,   616,   616,  1169,
-    3825,  2175, -1518,  2181,  1257,  2189,  2535,  3828,  3644,  2193,
-    2809,  2211,  1990,  1991,  2212,  2217,  2232,  1258,  1259,  2220,
-    1604,  1213,  2536,  2251,  2221, -1518,  2233,  2234,  2255,  2832,
-    3536, -1222,  3850,  3538, -1518,  3852,  1184,   616,   616,   616,
-    1588,  1589,  1590,  1591,  1592,   616,  2261,  1993,  2346,  2271,
-    2303,  2775,  -653, -1344,  1070,  2291,  1172,  2302,   879,   879,
-    1122,  1996,  2325,  1126, -1518,  1216,  2009,  1260,  2333,  1997,
-    4383,  2350,  2339,  2010,  2854,  1509,  1510,  2353,  2375,  2491,
-    2402,  2491,  2378,  1672,  2394,  2405,  2424,  2400,  2401,  2407,
-    2011,  2431,  4255,  1999,  2583,  2406,  1261,  2463,  2445,  2450,
-    2426,  2458,  2465,  2469,  2583,  2459,  2960,  1451,  2408,  2409,
-    2462,  2000,  1159,  1160, -1518,  2471,  1672,  2472,  1262,  2473,
-    1263,  2474,  2960,  2475,   606,  2476,  2583,  1177,  1178,  1179,
-    1180,  1181,  1182,  1183,  1184,  1346,  4071, -1518,  2507,  2520,
-    2005,  2506,  1593,  1594,  1595,  1596,  2440,  2441,  2442,  2013,
-    1161,  2525,  2529,  2526,  2530,  2532,  2533,  1605,  1941,  2541,
-    1217,  1162,  1671,  4383,  2539,  2542,  2543,  2014,  2551,  2590,
-    1172,  2550,  1942,  1607,  3556,  2555,  1671,  2592,  2556,  2561,
-    2562,  1671,  4513, -1518,  2571,  1218,  1671,  2630,  2652,  1219,
-    4388,  4389,  2678,  4391,  1172,  2674,  4522,  4125,  3048,  2586,
-    1163,  4513,  2670,  2683,  1174,  1175,  4522,  2699,  2700,  2701,
-    2279,  1164,  2009,  4239,  2712,  2782,  2713,  2725,  2747,  2010,
-    2754,  2018,   520,  3697,  3697,  3697,  1220,  2772,  3768,  2020,
-    2783,  2787,  2451,  2799,  2762,  2802,  2011, -1518,  1165,   616,
-    4428,  2771,  4429,  4430,  1221,  2804,  2805,  2812,  2813, -1518,
-    1597,  2452,  1598,  1599,  1600,  2816,  1799,  2817,   666,  2818,
-    2822,  1601,  2453,  2836,  2837,  2838,  2386, -1518,  2385, -1518,
-    2450,  2859,  2860,  1848,  1849,  2870,  2880,  2886,  2884,  4244,
-    2885,   521,  2887,  2888,  2894,  4242,  2895,  2912,  2896,  4071,
-    2916,  2917, -1518, -1518,  2967,  2013, -1518, -1518,  3665,  2026,
-    2934,  1154,  1166,  2969,  1155,  3031,  1222,  3756,  3041,  3043,
-    3057,   522,  1672,  2014,  3058,  2398,  3037,  4483,  1174,  1175,
-    3063,  3689,  3064,   616,  3062,  2019,  3065,  4498,  3098,  3089,
-    2139,  3102,   616,  3796,  3109,  3111,  1943,  3104,  3159,  1602,
-     687,  3112,  1174,  1175,   523,  2454,  1177,  1178,  1179,  1180,
-    1181,  1182,  1183,  1184,  3192,  2027,  2028,  2029,  3217,  3113,
-    3175,  3210,  2030,  3193,  3169,  3115,  3212,  2018,  3774,  3116,
-    3697,  3213,  3170,  3194,  3211,  2020,  3173,  3177,  2031,   606,
-    3214,  2032,  3222,  3229,  1284,  3195,  3196,  3197,  3811,  3806,
-    1346,  3251,   524,  3182,  1603,  1604,  3253,   691,  3254,  3255,
-    3185,  3198,  3225,  2451,   692,  3226,  3264,  3263,  3215,  1308,
-    3283,  3243,  3804,  1944,  3284,  3272,  3291,  2034,  1309,   616,
-    3240,  3295,  2452,  3246,  3268,  3296,  3310,  3269,  1310,  3299,
-    3309,  3311,   697,  2453,  1223,  1003,  1004,  3322,  1945,  3328,
-    1311,  1312,  1313,  1224,  3332,  2026,  3853,  3340,  3771,  3551,
-    3341,  3400,  3403,  3857,  4525,  3342,  1314,  2455,  1225,  3406,
-    3407,  1178,  1179,  1180,  1181,  1182,  1183,  1184,  3411,  3413,
-    3424,  3429,  3414,  3084,  3417,  3425,  1226,  3430,  3922,  2367,
-    3433,  3439,  3440,  3441,  1890,  3461,  1179,  1180,  1181,  1182,
-    1183,  1184,  3459,  3465,   616,  3466,  3473,  1932,  1946,  3474,
-     704,  2027,  2028,  2029,  2238,  3486,  3164,  2012,  2030,  1987,
-    3502,  3506,  3515,  3517,  3520,  3526,  2454,   -64,  3539,  1227,
-    3528,  3544,   525,  3552,  2031,  3558,  2456,  2032,  3833,  4242,
-    3557,  3565,  1605,  3566,  3578,  3586,  3589,  3590,  3604,  3778,
-    3595,  3611,  3662,  3659,  2584,  3664,  1156,  1606,  1607,  1228,
-    3666,  3672,  3685,   616,  3676,  3686,  3690,  4307,  3687,  1241,
-    3693,  3691,  3700,  2034,  3703,   715,  2835,  3863,   495,  3704,
-    3705,   496,  4307,  3706,  3713,  3697,  3697,  3707,  3697,  3697,
-     719,   720,  3711,  2314,  3715,  3716,  4317,  3720,  3724,  1986,
-    3725,  3726,  1947,   526,  1987,  3734,  1988,  3741,  1989,  3735,
-    3742,  3743,  1346,  3751,  4071,  3749,  3752,  2315,  1990,  1991,
-    3761,  3764,  1322,  1241,  3765,  3769,  3267,  3770,  3772,  3782,
-    3199,  2316, -1430,  3791, -1435,  3792,  3794,  3795,  2455,  4495,
-    3812,  3809,  2317,  3820,  3838,  3826,  3650,  3200,  3824,  1992,
-    1242,  3842,  3844,  1993,  1994,  3845,  3653,  3837,  3851,  1995,
-    4006,   606,  3865,  3864,  3880,  4495,   527,  1996,  3890,  3891,
-    3886,   528,  3697,  3925,  3892,  1997,  3896,  3911,  3910,  3915,
-    4527,  1243,  3914,  3928,  1998,  1315,  3905,  3951,  1216,   529,
-    3930,  2318,  2319,  3964,  4007,  1244,  3957,   718,  4001,  1999,
-    3714,  3965,  1316,  4024,  1242,   606,  4010,  2456,  4058,  4039,
-    4034,  4038,  4307,  1451,   530,  4035,   616,  2000,  1245,  2320,
-    4040,  1246,  4415,  4054,  4051,  2001,  2002,  4041,  4104,   531,
-    -346,  4083,  2003,  4085,  1247,  1243,  4096,  4122,  4052,  4134,
-    2004,  4145,  4152,  4127,  -931,  4137,  2005,  4097,   791,  1244,
-    4124,  4144,  4167,  4169,  4175,  4170,  1248,  2006,  3201,  4178,
-    4180,  4182,  4108,  4187,  4206,  3026,  -364,  4115,  4209,  4236,
-    4234,  4447,  1245,  4237,  3202,  1246,   791,  2007,   741,  4238,
-    4254,  1249,  3797,  1217,  4257,  3798,  2321,  1250,  1247,  4271,
-    4307,  4260,  4307,  4276,  4283,   747,  4293,  4296,  4297,  4466,
-     749,  4303,  4304,   750,  4308,  4314,  4315,  4316,  1218,  4307,
-    1248,  4319,  1219,  4326,  4340,  4341,  2008,  4342,  2009,  4343,
-    4349,  4350,  4351,  4352,  4353,  2010,  4354,  4355,  1251,  1317,
-    4360,  4362,  4368,  4365,  3203,  1249,  4364, -2325,  2322,  4307,
-    4307,  1250,  2011,  4374,  4503,  1672,  4387,  4390,  4392,  1220,
-    4393,  3204,  4403,  4406,  4408,  4419,  3799,  3800,  4417,  4416,
-    4422,  4425,  4431,  4434,  4270,  2012,  4435,  1221,  4436,  4440,
-    4441,  4445,  1588,  1589,  1590,  1591,  1592,  2835,  4448,  2835,
-    4451,  4452,  1251,  4453,  4455,  4467,  4459,  4474,  4461,  1318,
-    4464,  4465,  4475,  4484,   791,  4470,  4477,  4499,  4500,   791,
-    4504,  2013,  4117,  4524,  2780,  4210,  1319,  4514,  3674,  2622,
-    3675,  2928,  1026,  3868,  4245,  4135,  4375,  4139,  4376,  2014,
-    3870,  1463,  3866,  2015,  4005,  4516,  4479,   576,   921,  1222,
-     791,  2298,  2376,  3206,  4400,  3976,  3977,  3979,  3980,  3982,
-     821,  2598,  2599,  4488,  2606,  3983,   791,  2609,  2610,  2611,
-    2612,  2613,  2614,  2615,  3984,  3985,  2618,  4301,  2620,  4058,
-    1252,  2016,  3986,  3987,  2778,  4401,  2017,  3990,   616,  4373,
-    4313,  3991,  4312,  2018,  1593,  1594,  1595,  1596,  2019,  3992,
-    1254,  2020,  1983,  4013,  1531,  2575,  3336,  3228,  1255,  2035,
-     791,   791,   791,   791,  3754,  3233,  1256,  3519,  1802,  4259,
-    4325,  3757,  4450,   791,  4053,  4386,  4424,   653,  2098,  2573,
-    4177,  3692,  2021,  3422,  1252,  3082,  3603,  3591,  1323,  2580,
-    3618,  3028,  3619,  3660,  1257,  4385,  2022,  2023,  2024,  2025,
-    3959,  3805,  3843,  4324,  1254,  3829,  3491,  1258,  1259,  2914,
-    3161,  3489,  1255,  3487,  4190,   516,   517,  4193,  1672,  2128,
-    1256,  2026,  4192,  4142,  4149,  4147,  4023,  1223,  2664,  2577,
-    3962,  3016,  1917,  1052,   932,  1915,  1224,  3808,   616,  4264,
-    2819,  2096,  3592,  3219,  2359,  2800,  3516,  2059,  1257,  2842,
-    2753,  1225,  1597,   948,  1598,  1599,  1600,  1260,  3498,  1336,
-    3184,  1258,  1259,  1601,  1084,  2907,  2384,  3562,  2697,  1226,
-    2752,  4189,  4089,  1626,  3673,  4395,  2769,  2027,  2028,  2029,
-    1101,  4396,  1577,  3598,  2030,  3932,  1261,  1933,  4469,  3924,
-    2849,  1790,  2668,  1733,  3532,  1443,  1444,  1817,  2825,   616,
-    2031,  2798,  3759,  2032,  3531,  3572,  4322,  2137,  1262,   936,
-    1263,  1260,  1227,  1044,  2433,  3048,  3048,   917,  2434,  2292,
-    3602,  1824,  1445,  1446,  1905,  4405,  2033,  1146,  4344,  3518,
-    4468,  4449,  4413,  4394,  4526,  4523,  4333,  4334,  3836,  2034,
-    1261,  1602,  1228,  3535,  1883,  1837,  2868,  3554,   881,   882,
-    2254,  3555,  2412,  2866,  1487,  2858,  1325,  2865,  2338,  1827,
-    2313,  2382,  1262,  4151,  1263,  2118,  3503,  4157,   852,   647,
-    4517,  1328,   648,  4126,     0,  3861,  1030,     0,  1031,  1032,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,   791,
-       0,     0,     0,     0,     0,     0,  1603,  1604,     0,  -931,
-    4457,     0,     0,     0,     0,  4462,     0,     0,     0,     0,
-       0,     0,     0,     0,  1488,  1489,  1490,  1491,  1492,  1493,
-    1494,  1495,  1496,  1497,     0,  1498,  1499,  1500,  1501,  1502,
-    1503,  1504,  1505,  1506,     0,  1507,  1508,     0,     0,     0,
-    4496,     0,     0,     0,   791,   791,     0,     0,     0,     0,
-       0,     0,     0,   791,   791,   791,   791,   791,   791,   791,
-       0,     0,     0,     0,  1672,     0,  4496,   791,   791,     0,
-     791,   791,     0,     0,   616,   791,   791,     0,  1672,   791,
-     791,   791,   791,  1672,   791,   791,     0,     0,  1672,     0,
-       0,     0,   791,   791,     0,   791,   791,   791,   791,   791,
-       0,     0,   791,   791,   791,   791,   791,   791,   791,   791,
-     791,   791,   791,     0,   791,     0,     0,   791,   791,     0,
-       0,     0,   791,     0,     0,     0,   791,   791,   791,     0,
-       0,     0,     0,     0,  1605,     0,     0,     0,     0,   791,
-     791,   791,     0,     0,     0,     0,     0,     0,   791,  1606,
-    1607,     0,     0,  1486,     0,   791,   791,   791,     0,   791,
-    1509,  1510,     0,     0,     0,     0,   791,   791,   791,     0,
-     791,   791,   791,   791,   791,     0,   791,   791,   791,   791,
-     791,   791,   791,   791,     0,     0,     0,   791,   791,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,  1557,  1558,
-       0,     0,     0,     0,     0,     0,     0,  1568,  1569,     0,
-       0,  1572,  1573,  1574,     0,     0,     0,     0,     0,     0,
-       0,  1582,  1583,     0,  1584,  1585,     0,     0,     0,  1610,
-       0,     0,     0,  1619,  1620,  1621,  1622,     0,  1624,     0,
-       0,     0,     0,     0,     0,     0,  1632,  1633,     0,  1636,
-    1637,     0,     0,     0,     0,     0,  1641,  1642,  1643,     0,
-       0,  1646,  1647,  1648,  1649,  1650,  1651,     0,  1653,     0,
-       0,  1656,  1657,     0,     0,     0,  1660,     0,     0,     0,
-    1663,  1667,  1668,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,  1675,  1676,  1677,     0,     0,     0,     0,
-       0,     0,  1685,     0,     0,     0,     0,     0,     0,  1690,
-    1691,  1692,     0,     0,     1,     0,     2,     0,     0,     0,
-       0,     0,     0,     0,   791,     0,     0,     0,     0,     0,
-       0,     3,     0,     0,   791,     4,     0,     0,     0,     0,
-       0,     0,  1728,     0,     0,     0,     0,     0,     0,     5,
-       6,     0,   791,     0,     0,     0,     0,     7,     0,     0,
-       0,     8,     9,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,    10,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,    11,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     1,     0,     2,     0,     0,     0,    12,     0,     0,
-       0,     0,     0,     0,     0,     0,    13,    14,    15,     0,
-       0,     0,     4,     0,     0,     0,     0,     0,     0,    16,
-      17,     0,     0,     0,     0,     0,     5,     6,     0,     0,
-       0,     0,    18,     0,     7,     0,     0,     0,     8,     9,
-       0,     0,     0,     0,     0,     0,    19,     0,     0,     0,
-       0,     0,     0,     0,    10,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,    20,     0,     0,     0,  1836,     0,
-       0,     0,    11,     0,     0,     0,     0,     0,  1842,    21,
-       0,    22,     0,     0,     0,     0,    23,     0,     0,    24,
-       0,     0,     0,     0,    12,     0,  1870,     0,     0,     0,
-       0,     0,     0,    13,    14,    15,     0,     0,     0,     0,
-       0,     0,    25,     0,    26,     0,    16,    17,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,    27,     0,     0,   791,     0,     0,     0,     0,
-       0,     0,     0,    19,     0,     0,     0,     0,     0,    28,
-       0,     0,     0,    29,     0,     0,     0,     0,     0,     0,
-       0,    20,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,    21,     0,    22,     0,
-       0,     0,     0,    23,     0,     0,    24,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,    25,
-       0,    26,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,    27,
-       0,     0,     0,   791,   791,   791,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,    28,     0,   791,    30,
-      29,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,    31,     0,     0,     0,
-       0,     0,     0,     0,   791,     0,     0,     0,     0,    32,
-     791,     0,     0,   791,     0,   791,     0,     0,     0,     0,
-      33,   791,     0,   791,   791,     0,     0,     0,     0,  2149,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,    34,     0,     0,    35,     0,    36,     0,     0,
-      37,     0,     0,    38,    39,     0,     0,     0,     0,     0,
-       0,     0,     0,    40,     0,    41,     0,     0,     0,     0,
-       0,     0,     0,    42,     0,     0,    30,     0,     0,    43,
-       0,     0,     0,     0,     0,     0,     0,    44,     0,     0,
-       0,     0,    45,    31,    46,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,    32,     0,   791,     0,
-       0,     0,     0,     0,     0,     0,     0,    33,     0,     0,
-       0,     0,     0,     0,    47,     0,     0,  2224,  2226,  2228,
-       0,    48,     0,     0,     0,     0,     0,     0,     0,    34,
-       0,     0,    35,     0,    36,     0,     0,    37,     0,     0,
-      38,    39,     0,     0,     0,     0,     0,   791,     0,     0,
-      40,     0,    41,     0,     0,   791,     0,     0,  2263,     0,
-      42,     0,     0,     0,    49,     0,    43,  2268,     0,  2269,
-       0,     0,     0,     0,    44,     0,    50,     0,     0,    45,
-      51,    46,     0,    52,     0,     0,     0,     0,    53,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,    47,     0,     0,     0,     0,    54,     0,    48,     0,
-       0,     0,  1990,  1991,     0,     0,     0,     0,     0,     0,
-       0,    55,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,  -791,  -791,  1993,     0,     0,
-       0,    49,  2355,     0,     0,  -791,     0,     0,     0,     0,
-       0,  1996,     0,    50,     0,     0,     0,    51,     0,  1997,
-      52,     0,     0,     0,     0,    53,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,  1999,     0,     0,     0,     0,     0,     0,
-       0,  2411,     0,    54,     0,     0,     0,  1451,     0,  2421,
-       0,  2000,     0,     0,     0,     0,     0,     0,    55,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    2005,     0,     0,     0,     0,     0,     0,   791,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,  2009,     0,     0,     0,     0,     0,     0,  2010,
-     791,     0,     0,     0,   791,     0,     0,     0,     0,   791,
-     791,     0,     0,     0,     0,     0,  2011,     0,   791,     0,
-       0,   791,     0,     0,     0,     0,     0,     0,     0,  2654,
-       0,   791,   791,     0,   791,   791,     0,   791,   791,   791,
-     791,   791,     0,     0,   791,     0,     0,     0,     0,     0,
-       0,     0,     0,   791,     0,     0,     0,     0,     0,     0,
-     791,     0,   791,     0,   791,   791,     0,   791,   791,     0,
-       0,     0,   791,   791,   791,  2013,     0,     0,   791,   791,
-     791,     0,   791,     0,   791,     0,   791,     0,   791,     0,
-     791,  2591,     0,  2014,     0,   791,     0,     0,     0,     0,
-       0,  3345,  3346,     0,     0,     0,     0,  3347,     0,  3348,
-       0,  3349,  3350,     0,   791,     0,     0,     0,     0,     0,
-       0,   791,     0,     0,   791,     0,     0,     0,  3351,     0,
-     791,     0,     0,   791,     0,     0,     0,   791,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,  2018,     0,     0,
-       0,     0,     0,     0,     0,  2020,     0,     0,     0,     0,
-       0,     0,     0,     0,  2677,     0,     0,     0,  2679,     0,
-       0,     0,     0,  2681,  2682,     0,  3352,     0,     0,  3353,
-       0,     0,  2695,     0,     0,     0,     0,  3354,     0,     0,
-       0,     0,     0,     0,     0,  2702,  2703,     0,  2704,   791,
-       0,  2706,  2707,  2708,  2709,  2710,  3355,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,  2714,     0,     0,
-       0,     0,     0,  3356,  2715,  2026,  2716,     0,  2717,  2718,
-       0,  2719,     0,     0,     0,     0,  2722,  2723,  2724,     0,
-       0,     0,  2726,  2727,  2728,     0,  2729,     0,  2731,  3357,
-    2733,  3358,  2735,     0,  2736,     0,     0,     0,     0,  2737,
-       0,     0,     0,     0,  3359,  3360,     0,     0,     0,     0,
-       0,     0,     0,   791,     0,     0,     0,   791,  2757,     0,
-       0,  2027,  2028,  2029,     0,     0,     0,     0,  2030,     0,
-       0,     0,     0,     0,  2767,     0,     0,  2770,     0,     0,
-       0,     0,     0,     0,  2031,  3361,     0,  2032,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,  3362,     0,     0,  2926,     0,
-       0,     0,     0,  2034,  3363,  3364,     0,  3365,     0,     0,
-       0,     0,     0,     0,     0,     0,  2926,  2926,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,  3366,  3367,  3368,     0,     0,     0,     0,
-       0,  3014,     0,     0,     0,     0,  1987,  2655,  1988,     0,
-       0,     0,  3369,  3370,  3371,     0,     0,     0,     0,  3372,
-    1990,  1991,  3373,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,  3374,
-    3375,     0,     0,     0,     0,     0,     0,  2421,     0,     0,
-       0,  1992,     0,     0,     0,  1993,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,  1996,
-       0,     0,  3376,  3377,     0,     0,     0,  1997,     0,     0,
-       0,     0,     0,     0,     0,     0,  1998,     0,     0,     0,
-       0,     0,     0,     0,  2926,  2926,     0,  3378,     0,     0,
-       0,  1999,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,  1451,     0,     0,     0,  2000,
-       0,     0,     0,     0,     0,     0,     0,  2001,     0,     0,
-       0,     0,     0,     0,  3015,     0,     0,     0,     0,     0,
-       0,     0,  2004,     0,     0,   791,     0,     0,  2005,   791,
-       0,  3379,     0,     0,     0,  3380,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,  3381,     0,   791,
-     791,     0,     0,     0,     0,     0,     0,     0,     0,  2007,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     791,     0,     0,     0,     0,     0,     0,     0,     0,   791,
-       0,   791,     0,   791,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    2009,     0,     0,     0,     0,  3382,     0,  2010,  3383,     0,
-     791,  3384,  3385,  3386,  3387,   791,     0,     0,     0,     0,
-       0,     0,     0,     0,  2011,     0,     0,     0,     0,     0,
-       0,   829,   884,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   791,     0,     0,  2012,     0,     0,
-       0,     0,     0,  3388,  3389,     0,   885,   869,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   886,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,  3390,     0,
-       0,     0,     0,  2013,     0,     0,     0,  1990,  1991,  3094,
-     887,     0,   888,  3096,     0,     0,     0,     0,     0,     0,
-       0,  2014,   889,     0,     0,  2015,     0,     0,     0,     0,
-       0,     0,     0,  3118,  3119,     0,   791,     0,     0,     0,
-    -791,  -791,  1993,     0,     0,     0,     0,     0,     0,     0,
-    -791,     0,     0,     0,  3141,     0,  1996,     0,     0,     0,
-       0,     0,     0,  3151,  1997,  3153,     0,  3155,  2017,     0,
-   -1794,   890,     0,     0,     0,  2018,   891,     0,     0,   892,
-       0,     0,   791,  2020,     0,     0,     0,     0,  1999,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,  1451,     0,     0,     0,  2000,     0,   893,     0,
-     894,     0,     0,     0,     0,     0,     0,   895,     0,   896,
-       0,     0,     0,     0,     0,     0,     0,     0,  3216,  2023,
-       0,     0,     0,     0,     0,  2005,     0,     0,     0,     0,
-       0,     0,   897,   898,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,  2026,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   899,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   900,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    2421,     0,     0,   791,   791,     0,     0,  2009,     0,  2027,
-    2028,  2029,     0,     0,  2010,     0,  2030,     0,     0,     0,
-     901,     0,     0,     0,     0,     0,     0,     0,  2926,     0,
-       0,  2011,  2031,     0,     0,  2032,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,  3304,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   791,     0,     0,     0,
-       0,  2034,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   902,     0,     0,     0,     0,
-    2013,   791,     0,     0,     0,   791,   791,     0,   791,     0,
-       0,     0,     0,     0,     0,     0,     0,   791,  2014,     0,
-     903,     0,   791,     0,     0,   791,     0,   791,   791,     0,
-     904,   905,     0,     0,   906,   907,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   908,     0,     0,     0,     0,
-     791,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,  2018,     0,     0,     0,     0,  3401,  3402,     0,
-    2020,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   791,     0,     0,     0,     0,     0,
-       0,   909,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   910,     0,     0,     0,   791,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    3446,     0,     0,     0,     0, -2362,     0,     0,     0,   911,
-    2026,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,  3464,     0,   912,     0,  3468,
-    3469,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     791,  3476,     0,     0,     0,     0,  3478,     0,   791,  3479,
-       0,  3480,  3481,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,  2027,  2028,  2029,     0,
-       0,     0,     0,  2030,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0, -2362,     0,     0,     0,     0,  2031,
-     913,     0,  2032,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,  3512,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,  2034,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,  3512,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,  3512,     0,     0,     0,     0,     0,
-       0,     0,  3583,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   791,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   791,   791,
-       0,     0,     0,     0,     0,     0,     0,   791,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,  3512,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   791,     0,     0,
-       0,   791,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,  3780,  3781,     0,     0,     0,     0,     0,     0,
-       0,  3304,     0,     0,     0,     0,     0,     0,   791,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   791,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,  3994,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,  3304,     0,     0,     0,  3889,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   791,  3512,     0,     0,     0,     0,     0,     0,   791,
-       0,     0,     0,     0,     0,     0,   791,  3304,   791,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   791,     0,     0,     0,     0,     0,
-    3994,  3994,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   791,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   791,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,  4077,     0,     0,     0,     0,     0,     0,
-    4082,     0,  4084,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   791,     0,   791,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   791,     0,  3994,  3994,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,  4103,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,  4250,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,  3304,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   791,     0,  3994,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,  3994,   791,
-       0,     0,     0,     0,     0,     0,     0,  3304,     0,     0,
-       0,     0,  3994,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   791,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,  4204,     0,  4205,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,  4213,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   791,  3994,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,  3994,  3994,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   791,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,  3994,     0,
-       0,     0,     0,     0,     0,   791,     0,     0,  3994,     0,
-       0,     0,     0,     0,     0,  4305,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,  4310,     0,     0,     0,     0,   791,     0,
-       0,     0,     0,     0,     0,  3994,     0,  3994,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,  3994,  3512,     0,
-       0,   791,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,  3994,     0,  3994,     0,  3994,     0,
-       0,     0,     0,     0,     0,  3994,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,  3994,     0,     0,     0,     0,
-       0,     0,  4358,     0,     0,     0,     0,     0,     0,  3994,
-    3994,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,  3994,  3994,     0,     0,     0,
-    3994,     0,     0,     0,     0,     0,   791,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   791,     0,     0,  4407,
-       0,     0,     0,     0,     0,     0,   137,     0,   662,   139,
-     140,   141,   142,     0,     0,   143,     0,     0,     0,   144,
-       0,     0,   663,     0,   146,   147,   148,   149,   664,   151,
-       0,   152,  4433,     0,   665,   153,   666,   667,   668,   154,
-     669,     0,   155,   156,   157,  1664,   158,     0,   159,   160,
-       0,     0,   161,   670,   671,   162,   163,     0,   164,   672,
-     673,   166,     0,   167,   168,   169,   170,   674,   172,     0,
-     675,   174,     0,   175,   176,   177,   178,   179,   180,   181,
-     182,   183,     0,   184,   185,     0,   186,   187,   188,   676,
-     190,     0,   677,   678,   191,     0,     0,   192,   679,   193,
-     680,     0,   194,   681,   682,     0,   195,   196,   197,   683,
-     684,   685,     0,     0,     0,     0,   686,   200,   687,     0,
-       0,   688,   201,   202,     0,   203,     0,     0,     0,   204,
-    4505,   205,   206,   207,   208,   209,     0,     0,     0,   210,
-       0,     0,   211,   212,   213,     0,     0,     0,   214,     0,
-     215,   216,     0,   217,   218,   219,     0,     0,   220,   221,
-    3512,   222,   223,   224,   225,   226,   227,   689,     0,   228,
-     229,   230,   231,   232,   690,   691,   233,   234,     0,   235,
-     236,   237,   692,     0,   238,     0,     0,     0,   693,   240,
-       0,   241,     0,   242,     0,   243,   694,   245,   695,     0,
-     247,     0,   248,     0,   696,     0,   249,   250,     0,   251,
-     697,     0,   252,   253,     0,     0,     0,   698,   255,   256,
-     257,   699,     0,   258,   259,   260,     0,     0,   261,     0,
-       0,     0,   700,   262,   263,   701,     0,     0,   264,     0,
-       0,     0,   265,   266,     0,   267,   268,     0,     0,     0,
-     269,     0,     0,   270,   271,     0,  1665,   272,     0,   702,
-     273,   274,     0,     0,     0,     0,     0,   703,   276,     0,
-     277,     0,   278,     0,   279,   280,     0,     0,   704,     0,
-       0,     0,     0,   281,     0,   282,   283,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,     0,   299,   300,   301,   705,   302,   303,   304,
-     305,   706,   306,   307,     0,     0,     0,     0,   308,   309,
-     310,   311,   707,   313,     0,     0,   708,   315,   709,   316,
-       0,   317,   710,   711,   712,   713,   714,   322,   323,   324,
-     325,   326,     0,   715,   327,   328,     0,     0,   329,   330,
-     331,   332,   716,   717,   718,   333,   334,     0,   719,   720,
-     335,     0,   336,   337,   721,     0,   339,   340,   341,     0,
-     342,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     343,   344,   345,   722,   346,   347,     0,   348,   349,   723,
-     351,   352,   353,   354,   724,   725,   357,   726,     0,   358,
-     359,   360,     0,   361,     0,   362,   363,   364,   365,   366,
-       0,   727,   368,   369,     0,     0,   370,     0,     0,     0,
-     371,   372,   373,   374,   375,     0,     0,   376,   377,   378,
-     379,   380,     0,   381,   382,     0,   383,   384,   385,   728,
-     729,   386,     0,   387,     0,   388,   389,     0,   390,   391,
-     392,     0,   730,     0,   731,   394,   395,   396,   397,   398,
-     732,   733,   401,   402,   403,   404,     0,   734,   406,     0,
-       0,     0,   407,   408,   409,   410,     0,     0,     0,   411,
-       0,     0,     0,   412,     0,   413,   414,   415,   416,     0,
-     417,   418,   419,   420,   421,     0,     0,     0,     0,     0,
-     422,   423,   424,     0,   425,   426,     0,   427,     0,     0,
-     428,     0,     0,   429,   430,   431,   432,   433,   434,   735,
-     736,   435,   436,     0,   437,   438,   737,   440,   441,   442,
-     738,   739,   443,   444,   445,   446,   740,   447,   448,     0,
-       0,   449,   450,   451,   452,     0,   741,   453,   454,     0,
-     742,   743,   744,   745,     0,     0,     0,     0,  1666,   459,
-     460,     0,   746,   747,   748,   462,   463,   464,   749,   465,
-     466,   750,   467,   468,     0,   469,   470,     0,     0,   471,
-       0,     0,   472,     0,   473,     0,   751,   475,     0,     0,
-     752,   753,   754,   755,   476,     0,     0,   477,   756,     0,
-     757,   478,   479,   480,   758,   759,     0,     0,     0,     0,
-       0,     0,   483,   484,     0,   485,   486,   487,     0,     0,
-     760,     0,     0,     0,   761,   762,     0,     0,     0,     0,
-     763,   764,     0,     0,   765,   766,     0,     0,   767,   768,
-     137,     0,   662,   139,   140,   141,   142,  2417,     0,   143,
-       0,     0,     0,   144,     0,     0,   663,     0,   146,   147,
-     148,   149,   664,   151,     0,   152,     0,     0,  2418,   153,
-     666,   667,   668,   154,   669,     0,   155,   156,   157,     0,
-     158,     0,   159,   160,     0,     0,   161,   670,   671,   162,
-     163,     0,   164,   672,   673,   166,     0,   167,   168,   169,
-     170,   674,   172,     0,   675,   174,     0,   175,   176,   177,
-     178,   179,   180,   181,   182,   183,     0,   184,   185,     0,
-     186,   187,   188,   676,   190,     0,   677,   678,   191,     0,
-       0,   192,   679,   193,   680,     0,   194,   681,   682,     0,
-     195,   196,   197,   683,   684,   685,     0,     0,     0,     0,
-     686,   200,   687,     0,     0,  2419,   201,   202,     0,   203,
-       0,     0,     0,   204,     0,   205,   206,   207,   208,   209,
-       0,     0,     0,   210,     0,     0,   211,   212,   213,     0,
-       0,     0,   214,     0,   215,   216,     0,   217,   218,   219,
-       0,     0,   220,   221,     0,   222,   223,   224,   225,   226,
-     227,   689,     0,   228,   229,   230,   231,   232,   690,   691,
-     233,   234,     0,   235,   236,   237,   692,     0,   238,     0,
-       0,     0,   693,   240,     0,   241,     0,   242,     0,   243,
-     694,   245,   695,     0,   247,     0,   248,     0,   696,     0,
-     249,   250,     0,   251,   697,     0,   252,   253,     0,     0,
-       0,   698,   255,   256,   257,   699,     0,   258,   259,   260,
-       0,     0,   261,     0,     0,     0,   700,   262,   263,   701,
-       0,     0,   264,     0,     0,     0,   265,   266,     0,   267,
-     268,     0,     0,     0,   269,     0,     0,   270,   271,     0,
-       0,   272,     0,   702,   273,   274,     0,     0,     0,     0,
-       0,   703,   276,     0,   277,     0,   278,     0,   279,   280,
-       0,     0,   704,     0,     0,     0,     0,   281,     0,   282,
-     283,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,     0,   299,   300,   301,
-     705,   302,   303,   304,   305,   706,   306,   307,     0,     0,
-       0,     0,   308,   309,   310,   311,   707,   313,     0,     0,
-     708,   315,   709,   316,     0,   317,   710,   711,   712,   713,
-     714,   322,   323,   324,   325,   326,     0,   715,   327,   328,
-       0,     0,   329,   330,   331,   332,   716,   717,   718,   333,
-     334,     0,   719,   720,   335,     0,   336,   337,   721,  2420,
-     339,   340,   341,     0,   342,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   343,   344,   345,   722,   346,   347,
-       0,   348,   349,   723,   351,   352,   353,   354,   724,   725,
-     357,   726,     0,   358,   359,   360,     0,   361,     0,   362,
-     363,   364,   365,   366,     0,   727,   368,   369,     0,     0,
-     370,     0,     0,     0,   371,   372,   373,   374,   375,     0,
-       0,   376,   377,   378,   379,   380,     0,   381,   382,     0,
-     383,   384,   385,   728,   729,   386,     0,   387,     0,   388,
-     389,     0,   390,   391,   392,     0,   730,     0,   731,   394,
-     395,   396,   397,   398,   732,   733,   401,   402,   403,   404,
-       0,   734,   406,     0,     0,     0,   407,   408,   409,   410,
-       0,     0,     0,   411,     0,     0,     0,   412,     0,   413,
-     414,   415,   416,     0,   417,   418,   419,   420,   421,     0,
-       0,     0,     0,     0,   422,   423,   424,     0,   425,   426,
-       0,   427,     0,     0,   428,     0,     0,   429,   430,   431,
-     432,   433,   434,   735,   736,   435,   436,     0,   437,   438,
-     737,   440,   441,   442,   738,   739,   443,   444,   445,   446,
-     740,   447,   448,     0,     0,   449,   450,   451,   452,     0,
-     741,   453,   454,     0,   742,   743,   744,   745,     0,     0,
-       0,     0,     0,   459,   460,     0,   746,   747,   748,   462,
-     463,   464,   749,   465,   466,   750,   467,   468,     0,   469,
-     470,     0,     0,   471,     0,     0,   472,     0,   473,     0,
-     751,   475,     0,     0,   752,   753,   754,   755,   476,     0,
-       0,   477,   756,     0,   757,   478,   479,   480,   758,   759,
-       0,     0,     0,     0,     0,     0,   483,   484,     0,   485,
-     486,   487,     0,     0,   760,     0,     0,     0,   761,   762,
-       0,     0,     0,     0,   763,   764,     0,     0,   765,   766,
-       0,     0,   767,   768,   137,     0,   662,   139,   140,   141,
-     142,     0,     0,   143,     0,     0,     0,   144,     0,     0,
-     663,     0,   146,   147,   148,   149,   664,   151,     0,   152,
-       0,     0,   665,   153,   666,   667,   668,   154,   669,     0,
-     155,   156,   157,     0,   158,     0,   159,   160,     0,     0,
-     161,   670,   671,   162,   163,     0,   164,   672,   673,   166,
-       0,   167,   168,   169,   170,   674,   172,     0,   675,   174,
-       0,   175,   176,   177,   178,   179,   180,   181,   182,   183,
-       0,   184,   185,     0,   186,   187,   188,   676,   190,     0,
-     677,   678,   191,     0,     0,   192,   679,   193,   680,     0,
-     194,   681,   682,     0,   195,   196,   197,   683,   684,   685,
-       0,     0,     0,     0,   686,   200,   687,     0,     0,   688,
-     201,   202,     0,   203,     0,     0,     0,   204,     0,   205,
-     206,   207,   208,   209,     0,     0,     0,   210,     0,     0,
-     211,   212,   213,     0,     0,     0,   214,     0,   215,   216,
-       0,   217,   218,   219,     0,     0,   220,   221,     0,   222,
-     223,   224,   225,   226,   227,   689,     0,   228,   229,   230,
-     231,   232,   690,   691,   233,   234,     0,   235,   236,   237,
-     692,     0,   238,     0,     0,     0,   693,   240,  2223,   241,
-       0,   242,     0,   243,   694,   245,   695,     0,   247,     0,
-     248,     0,   696,     0,   249,   250,     0,   251,   697,     0,
-     252,   253,     0,     0,     0,   698,   255,   256,   257,   699,
-       0,   258,   259,   260,     0,     0,   261,     0,     0,     0,
-     700,   262,   263,   701,     0,     0,   264,     0,     0,     0,
-     265,   266,     0,   267,   268,     0,     0,     0,   269,     0,
-       0,   270,   271,     0,     0,   272,     0,   702,   273,   274,
-       0,     0,     0,     0,     0,   703,   276,     0,   277,     0,
-     278,     0,   279,   280,     0,     0,   704,     0,     0,     0,
-       0,   281,     0,   282,   283,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,   705,   302,   303,   304,   305,   706,
-     306,   307,     0,     0,     0,     0,   308,   309,   310,   311,
-     707,   313,     0,     0,   708,   315,   709,   316,     0,   317,
-     710,   711,   712,   713,   714,   322,   323,   324,   325,   326,
-       0,   715,   327,   328,     0,     0,   329,   330,   331,   332,
-     716,   717,   718,   333,   334,     0,   719,   720,   335,     0,
-     336,   337,   721,     0,   339,   340,   341,     0,   342,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   343,   344,
-     345,   722,   346,   347,     0,   348,   349,   723,   351,   352,
-     353,   354,   724,   725,   357,   726,     0,   358,   359,   360,
-       0,   361,     0,   362,   363,   364,   365,   366,     0,   727,
-     368,   369,     0,     0,   370,     0,     0,     0,   371,   372,
-     373,   374,   375,     0,     0,   376,   377,   378,   379,   380,
-       0,   381,   382,     0,   383,   384,   385,   728,   729,   386,
-       0,   387,     0,   388,   389,     0,   390,   391,   392,     0,
-     730,     0,   731,   394,   395,   396,   397,   398,   732,   733,
-     401,   402,   403,   404,     0,   734,   406,     0,     0,     0,
-     407,   408,   409,   410,     0,     0,     0,   411,     0,     0,
-       0,   412,     0,   413,   414,   415,   416,     0,   417,   418,
-     419,   420,   421,     0,     0,     0,     0,     0,   422,   423,
-     424,     0,   425,   426,     0,   427,     0,     0,   428,     0,
-       0,   429,   430,   431,   432,   433,   434,   735,   736,   435,
-     436,     0,   437,   438,   737,   440,   441,   442,   738,   739,
-     443,   444,   445,   446,   740,   447,   448,     0,     0,   449,
-     450,   451,   452,     0,   741,   453,   454,     0,   742,   743,
-     744,   745,     0,     0,     0,     0,     0,   459,   460,     0,
-     746,   747,   748,   462,   463,   464,   749,   465,   466,   750,
-     467,   468,     0,   469,   470,     0,     0,   471,     0,     0,
-     472,     0,   473,     0,   751,   475,     0,     0,   752,   753,
-     754,   755,   476,     0,     0,   477,   756,     0,   757,   478,
-     479,   480,   758,   759,     0,     0,     0,     0,     0,     0,
-     483,   484,     0,   485,   486,   487,     0,     0,   760,     0,
-       0,     0,   761,   762,     0,     0,     0,     0,   763,   764,
-       0,     0,   765,   766,     0,     0,   767,   768,   137,     0,
-     662,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,   663,     0,   146,   147,   148,   149,
-     664,   151,     0,   152,     0,     0,   665,   153,   666,   667,
-     668,   154,   669,     0,   155,   156,   157,     0,   158,     0,
-     159,   160,     0,     0,   161,   670,   671,   162,   163,     0,
-     164,   672,   673,   166,     0,   167,   168,   169,   170,   674,
-     172,     0,   675,   174,     0,   175,   176,   177,   178,   179,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,   676,   190,     0,   677,   678,   191,     0,     0,   192,
-     679,   193,   680,     0,   194,   681,   682,     0,   195,   196,
-     197,   683,   684,   685,     0,     0,     0,     0,   686,   200,
-     687,     0,     0,   688,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,   210,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,   215,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,   227,   689,
-       0,   228,   229,   230,   231,   232,   690,   691,   233,   234,
-       0,   235,   236,   237,   692,     0,   238,     0,     0,     0,
-     693,   240,  2225,   241,     0,   242,     0,   243,   694,   245,
-     695,     0,   247,     0,   248,     0,   696,     0,   249,   250,
-       0,   251,   697,     0,   252,   253,     0,     0,     0,   698,
-     255,   256,   257,   699,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,   700,   262,   263,   701,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,   270,   271,     0,     0,   272,
-       0,   702,   273,   274,     0,     0,     0,     0,     0,   703,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-     704,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,   705,   302,
-     303,   304,   305,   706,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   707,   313,     0,     0,   708,   315,
-     709,   316,     0,   317,   710,   711,   712,   713,   714,   322,
-     323,   324,   325,   326,     0,   715,   327,   328,     0,     0,
-     329,   330,   331,   332,   716,   717,   718,   333,   334,     0,
-     719,   720,   335,     0,   336,   337,   721,     0,   339,   340,
-     341,     0,   342,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   343,   344,   345,   722,   346,   347,     0,   348,
-     349,   723,   351,   352,   353,   354,   724,   725,   357,   726,
-       0,   358,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   727,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,   382,     0,   383,   384,
-     385,   728,   729,   386,     0,   387,     0,   388,   389,     0,
-     390,   391,   392,     0,   730,     0,   731,   394,   395,   396,
-     397,   398,   732,   733,   401,   402,   403,   404,     0,   734,
-     406,     0,     0,     0,   407,   408,   409,   410,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,   413,   414,   415,
-     416,     0,   417,   418,   419,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,   430,   431,   432,   433,
-     434,   735,   736,   435,   436,     0,   437,   438,   737,   440,
-     441,   442,   738,   739,   443,   444,   445,   446,   740,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,   741,   453,
-     454,     0,   742,   743,   744,   745,     0,     0,     0,     0,
-       0,   459,   460,     0,   746,   747,   748,   462,   463,   464,
-     749,   465,   466,   750,   467,   468,     0,   469,   470,     0,
-       0,   471,     0,     0,   472,     0,   473,     0,   751,   475,
-       0,     0,   752,   753,   754,   755,   476,     0,     0,   477,
-     756,     0,   757,   478,   479,   480,   758,   759,     0,     0,
-       0,     0,     0,     0,   483,   484,     0,   485,   486,   487,
-       0,     0,   760,     0,     0,     0,   761,   762,     0,     0,
-       0,     0,   763,   764,     0,     0,   765,   766,     0,     0,
-     767,   768,   137,     0,   662,   139,   140,   141,   142,     0,
-       0,   143,     0,     0,     0,   144,     0,     0,   663,     0,
-     146,   147,   148,   149,   664,   151,     0,   152,     0,     0,
-     665,   153,   666,   667,   668,   154,   669,     0,   155,   156,
-     157,     0,   158,     0,   159,   160,     0,     0,   161,   670,
-     671,   162,   163,     0,   164,   672,   673,   166,     0,   167,
-     168,   169,   170,   674,   172,     0,   675,   174,     0,   175,
-     176,   177,   178,   179,   180,   181,   182,   183,     0,   184,
-     185,     0,   186,   187,   188,   676,   190,     0,   677,   678,
-     191,     0,     0,   192,   679,   193,   680,     0,   194,   681,
-     682,     0,   195,   196,   197,   683,   684,   685,     0,     0,
-       0,     0,   686,   200,   687,     0,     0,   688,   201,   202,
-       0,   203,     0,     0,     0,   204,     0,   205,   206,   207,
-     208,   209,     0,     0,     0,   210,     0,     0,   211,   212,
-     213,     0,     0,     0,   214,     0,   215,   216,     0,   217,
-     218,   219,     0,     0,   220,   221,     0,   222,   223,   224,
-     225,   226,   227,   689,     0,   228,   229,   230,   231,   232,
-     690,   691,   233,   234,     0,   235,   236,   237,   692,     0,
-     238,     0,     0,     0,   693,   240,  2227,   241,     0,   242,
-       0,   243,   694,   245,   695,     0,   247,     0,   248,     0,
-     696,     0,   249,   250,     0,   251,   697,     0,   252,   253,
-       0,     0,     0,   698,   255,   256,   257,   699,     0,   258,
-     259,   260,     0,     0,   261,     0,     0,     0,   700,   262,
-     263,   701,     0,     0,   264,     0,     0,     0,   265,   266,
-       0,   267,   268,     0,     0,     0,   269,     0,     0,   270,
-     271,     0,     0,   272,     0,   702,   273,   274,     0,     0,
-       0,     0,     0,   703,   276,     0,   277,     0,   278,     0,
-     279,   280,     0,     0,   704,     0,     0,     0,     0,   281,
-       0,   282,   283,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,     0,   299,
-     300,   301,   705,   302,   303,   304,   305,   706,   306,   307,
-       0,     0,     0,     0,   308,   309,   310,   311,   707,   313,
-       0,     0,   708,   315,   709,   316,     0,   317,   710,   711,
-     712,   713,   714,   322,   323,   324,   325,   326,     0,   715,
-     327,   328,     0,     0,   329,   330,   331,   332,   716,   717,
-     718,   333,   334,     0,   719,   720,   335,     0,   336,   337,
-     721,     0,   339,   340,   341,     0,   342,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   343,   344,   345,   722,
-     346,   347,     0,   348,   349,   723,   351,   352,   353,   354,
-     724,   725,   357,   726,     0,   358,   359,   360,     0,   361,
-       0,   362,   363,   364,   365,   366,     0,   727,   368,   369,
-       0,     0,   370,     0,     0,     0,   371,   372,   373,   374,
-     375,     0,     0,   376,   377,   378,   379,   380,     0,   381,
-     382,     0,   383,   384,   385,   728,   729,   386,     0,   387,
-       0,   388,   389,     0,   390,   391,   392,     0,   730,     0,
-     731,   394,   395,   396,   397,   398,   732,   733,   401,   402,
-     403,   404,     0,   734,   406,     0,     0,     0,   407,   408,
-     409,   410,     0,     0,     0,   411,     0,     0,     0,   412,
-       0,   413,   414,   415,   416,     0,   417,   418,   419,   420,
-     421,     0,     0,     0,     0,     0,   422,   423,   424,     0,
-     425,   426,     0,   427,     0,     0,   428,     0,     0,   429,
-     430,   431,   432,   433,   434,   735,   736,   435,   436,     0,
-     437,   438,   737,   440,   441,   442,   738,   739,   443,   444,
-     445,   446,   740,   447,   448,     0,     0,   449,   450,   451,
-     452,     0,   741,   453,   454,     0,   742,   743,   744,   745,
-       0,     0,     0,     0,     0,   459,   460,     0,   746,   747,
-     748,   462,   463,   464,   749,   465,   466,   750,   467,   468,
-       0,   469,   470,     0,     0,   471,     0,     0,   472,     0,
-     473,     0,   751,   475,     0,     0,   752,   753,   754,   755,
-     476,     0,     0,   477,   756,     0,   757,   478,   479,   480,
-     758,   759,     0,     0,     0,     0,     0,     0,   483,   484,
-       0,   485,   486,   487,     0,     0,   760,     0,     0,     0,
-     761,   762,     0,     0,     0,     0,   763,   764,     0,     0,
-     765,   766,     0,     0,   767,   768,   137,     0,   662,   139,
-     140,   141,   142,     0,     0,   143,     0,     0,     0,   144,
-       0,     0,   663,     0,   146,   147,   148,   149,   664,   151,
-       0,   152,     0,     0,   665,   153,   666,   667,   668,   154,
-     669,     0,   155,   156,   157,     0,   158,     0,   159,   160,
-       0,     0,   161,   670,   671,   162,   163,     0,   164,   672,
-     673,   166,     0,   167,   168,   169,   170,   674,   172,     0,
-     675,   174,     0,   175,   176,   177,   178,   179,   180,   181,
-     182,   183,     0,   184,   185,     0,   186,   187,   188,   676,
-     190,     0,   677,   678,   191,     0,     0,   192,   679,   193,
-     680,     0,   194,   681,   682,     0,   195,   196,   197,   683,
-     684,   685,     0,     0,     0,     0,   686,   200,   687,     0,
-       0,   688,   201,   202,     0,   203,     0,     0,     0,   204,
-       0,   205,   206,   207,   208,   209,     0,     0,     0,   210,
-       0,     0,   211,   212,   213,     0,     0,     0,   214,     0,
-     215,   216,     0,   217,   218,   219,     0,     0,   220,   221,
-       0,   222,   223,   224,   225,   226,   227,   689,     0,   228,
-     229,   230,   231,   232,   690,   691,   233,   234,     0,   235,
-     236,   237,   692,     0,   238,     0,     0,     0,   693,   240,
-       0,   241,     0,   242,     0,   243,   694,   245,   695,     0,
-     247,     0,   248,     0,   696,     0,   249,   250,     0,   251,
-     697,     0,   252,   253,     0,     0,     0,   698,   255,   256,
-     257,   699,     0,   258,   259,   260,     0,     0,   261,     0,
-       0,     0,   700,   262,   263,   701,     0,     0,   264,     0,
-       0,     0,   265,   266,     0,   267,   268,     0,     0,     0,
-     269,     0,     0,   270,   271,     0,     0,   272,     0,   702,
-     273,   274,     0,     0,     0,     0,     0,   703,   276,     0,
-     277,     0,   278,     0,   279,   280,     0,     0,   704,     0,
-       0,     0,     0,   281,     0,   282,   283,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,     0,   299,   300,   301,   705,   302,   303,   304,
-     305,   706,   306,   307,     0,     0,     0,     0,   308,   309,
-     310,   311,   707,   313,     0,     0,   708,   315,   709,   316,
-       0,   317,   710,   711,   712,   713,   714,   322,   323,   324,
-     325,   326,     0,   715,   327,   328,     0,     0,   329,   330,
-     331,   332,   716,   717,   718,   333,   334,     0,   719,   720,
-     335,     0,   336,   337,   721,     0,   339,   340,   341,     0,
-     342,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     343,   344,   345,   722,   346,   347,     0,   348,   349,   723,
-     351,   352,   353,   354,   724,   725,   357,   726,     0,   358,
-     359,   360,     0,   361,     0,   362,   363,   364,   365,   366,
-       0,   727,   368,   369,     0,     0,   370,     0,     0,     0,
-     371,   372,   373,   374,   375,     0,     0,   376,   377,   378,
-     379,   380,     0,   381,   382,     0,   383,   384,   385,   728,
-     729,   386,     0,   387,     0,   388,   389,     0,   390,   391,
-     392,     0,   730,     0,   731,   394,   395,   396,   397,   398,
-     732,   733,   401,   402,   403,   404,     0,   734,   406,     0,
-       0,     0,   407,   408,   409,   410,     0,     0,     0,   411,
-       0,     0,     0,   412,     0,   413,   414,   415,   416,     0,
-     417,   418,   419,   420,   421,     0,     0,     0,     0,     0,
-     422,   423,   424,     0,   425,   426,     0,   427,     0,     0,
-     428,     0,     0,   429,   430,   431,   432,   433,   434,   735,
-     736,   435,   436,     0,   437,   438,   737,   440,   441,   442,
-     738,   739,   443,   444,   445,   446,   740,   447,   448,     0,
-       0,   449,   450,   451,   452,     0,   741,   453,   454,     0,
-     742,   743,   744,   745,     0,     0,     0,     0,     0,   459,
-     460,     0,   746,   747,   748,   462,   463,   464,   749,   465,
-     466,   750,   467,   468,     0,   469,   470,     0,     0,   471,
-       0,     0,   472,     0,   473,     0,   751,   475,     0,     0,
-     752,   753,   754,   755,   476,     0,     0,   477,   756,     0,
-     757,   478,   479,   480,   758,   759,     0,     0,     0,     0,
-       0,     0,   483,   484,     0,   485,   486,   487,     0,     0,
-     760,     0,     0,     0,   761,   762,     0,     0,     0,     0,
-     763,   764,     0,     0,   765,   766,     0,     0,   767,   768,
-     137,     0,   662,   139,   140,   141,   142,     0,     0,   143,
-       0,     0,     0,   144,     0,     0,   663,     0,   146,   147,
-     148,   149,   664,   151,     0,   152,     0,     0,   665,   153,
-     666,   667,   668,   154,   669,     0,   155,   156,   157,     0,
-     158,     0,   159,   160,     0,     0,   161,   670,   671,   162,
-     163,     0,   164,   672,   673,   166,     0,   167,   168,   169,
-     170,   674,   172,     0,   675,   174,     0,   175,   176,   177,
-     178,   179,   180,   181,   182,   183,     0,   184,   185,     0,
-     186,   187,   188,   676,   190,     0,   677,   678,   191,     0,
-       0,   192,   679,   193,   680,     0,   194,   681,   682,     0,
-     195,   196,   197,   683,   684,   685,     0,     0,     0,     0,
-     686,   200,   687,     0,     0,   688,   201,   202,     0,   203,
-       0,     0,     0,   204,     0,   205,   206,   207,   208,   209,
-       0,     0,     0,   210,     0,     0,   211,   212,   213,     0,
-       0,     0,   214,     0,   215,   216,     0,   217,   218,   219,
-       0,     0,   220,   221,     0,   222,   223,   224,   225,   226,
-     227,   689,     0,   228,   229,   230,   231,   232,   690,   691,
-     233,   234,     0,   235,   236,   237,   692,     0,   238,     0,
-       0,     0,   693,   240,     0,   241,     0,   242,     0,   243,
-     694,   245,   695,     0,   247,     0,   248,     0,   696,     0,
-     249,   250,     0,   251,   697,     0,   252,   253,     0,     0,
-       0,   698,   255,   256,   257,   699,     0,   258,   259,   260,
-       0,     0,   261,     0,     0,     0,   700,   262,   263,   701,
-       0,     0,   264,     0,     0,     0,   265,   266,     0,   267,
-     268,     0,     0,     0,   269,     0,     0,   270,   271,     0,
-       0,   272,     0,   702,   273,   274,     0,     0,     0,     0,
-       0,   703,   276,     0,   277,     0,   278,     0,   279,   280,
-       0,     0,   704,     0,     0,     0,     0,   281,     0,   282,
-     283,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,     0,   299,   300,   301,
-     705,   302,   303,   304,   305,   706,   306,   307,     0,     0,
-       0,     0,   308,   309,   310,   311,   707,   313,     0,     0,
-     708,   315,   709,   316,     0,   317,   710,   711,   712,   713,
-     714,   322,   323,   324,   325,   326,     0,   715,   327,   328,
-       0,     0,   329,   330,   331,   332,   716,   717,   718,   333,
-     334,     0,   719,   720,   335,     0,   336,   337,   721,     0,
-     339,   340,   341,     0,   342,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   343,   344,   345,   722,   346,   347,
-       0,   348,   349,   723,   351,   352,   353,   354,   724,   725,
-     357,   726,     0,   358,   359,   360,     0,   361,     0,   362,
-     363,   364,   365,   366,     0,   727,   368,   369,     0,     0,
-     370,     0,     0,     0,   371,   372,   373,   374,   375,     0,
-       0,   376,   377,   378,   379,   380,     0,   381,   382,     0,
-     383,   384,   385,   728,   729,   386,     0,   387,     0,   388,
-     389,     0,   390,   391,   392,     0,   730,     0,   731,   394,
-     395,   396,   397,   398,   732,   733,   401,   402,   403,   404,
-       0,   734,   406,     0,     0,     0,   407,   408,   409,   410,
-       0,     0,     0,   411,     0,     0,     0,   412,     0,   413,
-     414,   415,   416,     0,   417,   418,   419,   420,   421,     0,
-       0,     0,     0,     0,   422,   423,   424,     0,   425,   426,
-       0,   427,     0,     0,   428,     0,     0,   429,   430,   431,
-     432,   433,   434,   735,   736,   435,   436,     0,   437,   438,
-     737,   440,   441,   442,   738,   739,   443,   444,   445,   446,
-     740,   447,   448,     0,     0,   449,   450,   451,   452,     0,
-     741,   453,   454,     0,   742,   743,   744,   745,     0,     0,
-       0,     0,     0,   459,   460,     0,   746,   747,   748,   462,
-     463,   464,   749,   465,   466,   750,   467,   468,     0,   469,
-     470,     0,     0,   471,     0,     0,   472,     0,   473,     0,
-     751,   475,     0,     0,   752,   753,   754,   755,   476,     0,
-       0,   477,   756,     0,   757,   478,   479,   480,   758,   759,
-       0,     0,     0,     0,     0,     0,   483,   484,     0,   485,
-     486,   487,     0,     0,   760,     0,     0,     0,   761,   762,
-       0,     0,     0,     0,   763,  1083,     0,     0,   765,   766,
-       0,     0,   767,   768,   137,     0,   662,   139,   140,   141,
-     142,  1699,     0,   143,     0,     0,     0,  1700,     0,     0,
-     663,     0,   146,   147,   148,   149,   664,   151,     0,   152,
-       0,     0,   665,   153,   666,   667,   668,   154,   669,     0,
-     155,   156,   157,     0,   158,     0,   159,   160,     0,     0,
-     161,   670,   671,   162,   163,     0,   164,   672,   673,   166,
-       0,   167,   168,   169,   170,   674,   172,     0,   675,   174,
-       0,   175,   176,   177,   178,   179,   180,   181,   182,   183,
-       0,   184,   185,     0,   186,   187,   188,   676,   190,     0,
-     677,   678,   191,     0,     0,   192,   679,   193,   680,     0,
-     194,   681,   682,     0,   195,   196,   197,   683,   684,   685,
-       0,     0,     0,     0,   686,   200,   687,     0,     0,   688,
-     201,   202,     0,   203,     0,     0,     0,   204,     0,   205,
-     206,   207,   208,   209,     0,     0,     0,   210,     0,     0,
-     211,   212,   213,     0,     0,     0,   214,     0,   215,   216,
-       0,   217,   218,   219,     0,     0,   220,   221,     0,   222,
-     223,   224,   225,   226,   227,   689,     0,   228,   229,   230,
-     231,   232,   690,   691,   233,   234,     0,   235,   236,   237,
-     692,     0,   238,     0,     0,     0,   693,   240,     0,   241,
-       0,   242,     0,   243,   694,   245,   695,     0,   247,     0,
-     248,     0,   696,     0,   249,   250,     0,   251,   697,     0,
-     252,   253,     0,     0,     0,   698,   255,   256,   257,   699,
-       0,   258,   259,   260,     0,     0,   261,     0,     0,     0,
-     700,   262,   263,   701,     0,     0,   264,     0,     0,     0,
-     265,   266,     0,   267,   268,     0,     0,     0,   269,     0,
-       0,   270,   271,     0,     0,   272,     0,   702,   273,   274,
-       0,     0,     0,     0,     0,   703,   276,     0,   277,     0,
-     278,     0,   279,   280,     0,     0,   704,     0,     0,     0,
-       0,   281,     0,   282,   283,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,   705,   302,   303,   304,   305,   706,
-     306,   307,     0,     0,     0,     0,   308,   309,   310,   311,
-     707,   313,     0,     0,   708,   315,   709,   316,     0,   317,
-     710,   711,   712,   713,   714,   322,   323,   324,   325,   326,
-       0,   715,   327,   328,     0,     0,   329,   330,   331,   332,
-     716,     0,   718,   333,   334,     0,   719,   720,   335,     0,
-     336,   337,   721,     0,   339,   340,   341,     0,   342,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   343,   344,
-     345,   722,   346,   347,     0,   348,   349,   723,   351,   352,
-     353,   354,   724,   725,   357,   726,     0,   358,   359,   360,
-       0,   361,     0,   362,   363,   364,   365,   366,     0,   727,
-     368,   369,     0,     0,   370,     0,     0,     0,   371,   372,
-     373,   374,   375,     0,     0,   376,   377,   378,   379,   380,
-       0,   381,   382,     0,   383,   384,   385,   728,   729,   386,
-       0,   387,     0,   388,   389,     0,   390,   391,   392,     0,
-     730,     0,   731,   394,   395,   396,   397,   398,   732,   733,
-     401,   402,   403,   404,     0,   734,   406,     0,     0,     0,
-     407,   408,   409,   410,     0,     0,     0,   411,     0,     0,
-       0,   412,     0,   413,   414,   415,   416,     0,   417,   418,
-     419,   420,   421,     0,     0,     0,     0,     0,   422,   423,
-     424,     0,   425,   426,     0,   427,     0,     0,   428,     0,
-       0,   429,   430,   431,   432,   433,   434,   735,   736,   435,
-     436,     0,   437,   438,   737,   440,   441,   442,   738,   739,
-     443,   444,   445,   446,   740,   447,   448,     0,     0,   449,
-     450,   451,   452,     0,   741,   453,   454,     0,   742,   743,
-     744,   745,     0,     0,     0,     0,     0,   459,   460,     0,
-     746,   747,   748,   462,   463,   464,   749,   465,   466,   750,
-     467,   468,     0,   469,   470,     0,     0,   471,     0,     0,
-     472,     0,   473,     0,   751,   475,     0,     0,   752,   753,
-     754,   755,   476,     0,     0,   477,   756,     0,   757,   478,
-     479,   480,   758,   759,     0,     0,     0,     0,     0,     0,
-     483,   484,     0,   485,   486,   487,     0,     0,   760,     0,
-       0,     0,   761,   762,     0,     0,     0,     0,   763,   764,
-       0,     0,   765,   766,     0,     0,   767,   768,   137,     0,
-     662,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,   663,     0,   146,   147,   148,   149,
-     664,   151,     0,   152,     0,     0,   665,   153,   666,   667,
-     668,   154,   669,     0,   155,   156,   157,     0,   158,     0,
-     159,   160,     0,     0,   161,   670,   671,   162,   163,     0,
-     164,   672,   673,   166,     0,   167,   168,   169,   170,   674,
-     172,     0,   675,   174,     0,   175,   176,   177,   178,   179,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,   676,   190,     0,   677,   678,   191,     0,     0,   192,
-     679,   193,   680,     0,   194,   681,   682,     0,   195,   196,
-     197,   683,   684,   685,     0,     0,     0,     0,   686,   200,
-     687,     0,     0,   688,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,   210,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,   215,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,   227,   689,
-       0,   228,   229,   230,   231,   232,   690,   691,   233,   234,
-       0,   235,   236,   237,   692,     0,   238,     0,     0,     0,
-     693,   240,     0,   241,     0,   242,     0,   243,   694,   245,
-     695,     0,   247,     0,   248,     0,   696,     0,   249,   250,
-       0,   251,   697,     0,   252,   253,     0,     0,     0,   698,
-     255,   256,   257,   699,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,   700,   262,   263,  2676,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,   270,   271,     0,     0,   272,
-       0,   702,   273,   274,     0,     0,     0,     0,     0,   703,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-     704,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,   705,   302,
-     303,   304,   305,   706,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   707,   313,     0,     0,   708,   315,
-     709,   316,     0,   317,   710,   711,   712,   713,   714,   322,
-     323,   324,   325,   326,     0,   715,   327,   328,     0,     0,
-     329,   330,   331,   332,   716,   717,   718,   333,   334,     0,
-     719,   720,   335,     0,   336,   337,   721,     0,   339,   340,
-     341,     0,   342,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   343,   344,   345,   722,   346,   347,     0,   348,
-     349,   723,   351,   352,   353,   354,   724,   725,   357,   726,
-       0,   358,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   727,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,   382,     0,   383,   384,
-     385,   728,   729,   386,     0,   387,     0,   388,   389,     0,
-     390,   391,   392,     0,   730,     0,   731,   394,   395,   396,
-     397,   398,   732,   733,   401,   402,   403,   404,     0,   734,
-     406,     0,     0,     0,   407,   408,   409,   410,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,   413,   414,   415,
-     416,     0,   417,   418,   419,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,   430,   431,   432,   433,
-     434,   735,   736,   435,   436,     0,   437,   438,   737,   440,
-     441,   442,   738,   739,   443,   444,   445,   446,   740,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,   741,   453,
-     454,     0,   742,   743,   744,   745,     0,     0,     0,     0,
-       0,   459,   460,     0,   746,   747,   748,   462,   463,   464,
-     749,   465,   466,   750,   467,   468,     0,   469,   470,     0,
-       0,   471,     0,     0,   472,     0,   473,     0,   751,   475,
-       0,     0,   752,   753,   754,   755,   476,     0,     0,   477,
-     756,     0,   757,   478,   479,   480,   758,   759,     0,     0,
-       0,     0,     0,     0,   483,   484,     0,   485,   486,   487,
-       0,     0,   760,     0,     0,     0,   761,   762,     0,     0,
-       0,     0,   763,   764,     0,     0,   765,   766,     0,     0,
-     767,   768,   137,     0,   662,   139,   140,   141,   142,     0,
-       0,   143,     0,     0,     0,   144,     0,     0,   663,     0,
-     146,   147,   148,   149,   664,   151,     0,   152,     0,     0,
-     665,   153,   666,   667,   668,   154,   669,     0,   155,   156,
-     157,     0,   158,     0,   159,   160,     0,     0,   161,   670,
-     671,   162,   163,     0,   164,   672,   673,   166,     0,   167,
-     168,   169,   170,   674,   172,     0,   675,   174,     0,   175,
-     176,   177,   178,   179,   180,   181,   182,   183,     0,   184,
-     185,     0,   186,   187,   188,   676,   190,     0,   677,   678,
-     191,     0,     0,   192,   679,   193,   680,     0,   194,   681,
-     682,     0,   195,   196,   197,   683,   684,   685,     0,     0,
-       0,     0,   686,   200,   687,     0,     0,   688,   201,   202,
-       0,   203,     0,     0,     0,   204,     0,   205,   206,   207,
-     208,   209,     0,     0,     0,   210,     0,     0,   211,   212,
-     213,     0,     0,     0,   214,     0,   215,   216,     0,   217,
-     218,   219,     0,     0,   220,   221,     0,   222,   223,   224,
-     225,   226,   227,   689,     0,   228,   229,   230,   231,   232,
-     690,   691,   233,   234,     0,   235,   236,   237,   692,     0,
-     238,     0,     0,     0,   693,   240,     0,   241,     0,   242,
-       0,   243,   694,   245,   695,     0,   247,     0,   248,     0,
-     696,     0,   249,   250,     0,   251,   697,     0,   252,   253,
-       0,     0,     0,   698,   255,   256,   257,   699,     0,   258,
-     259,   260,     0,     0,   261,     0,     0,     0,   700,   262,
-     263,  2721,     0,     0,   264,     0,     0,     0,   265,   266,
-       0,   267,   268,     0,     0,     0,   269,     0,     0,   270,
-     271,     0,     0,   272,     0,   702,   273,   274,     0,     0,
-       0,     0,     0,   703,   276,     0,   277,     0,   278,     0,
-     279,   280,     0,     0,   704,     0,     0,     0,     0,   281,
-       0,   282,   283,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,     0,   299,
-     300,   301,   705,   302,   303,   304,   305,   706,   306,   307,
-       0,     0,     0,     0,   308,   309,   310,   311,   707,   313,
-       0,     0,   708,   315,   709,   316,     0,   317,   710,   711,
-     712,   713,   714,   322,   323,   324,   325,   326,     0,   715,
-     327,   328,     0,     0,   329,   330,   331,   332,   716,   717,
-     718,   333,   334,     0,   719,   720,   335,     0,   336,   337,
-     721,     0,   339,   340,   341,     0,   342,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   343,   344,   345,   722,
-     346,   347,     0,   348,   349,   723,   351,   352,   353,   354,
-     724,   725,   357,   726,     0,   358,   359,   360,     0,   361,
-       0,   362,   363,   364,   365,   366,     0,   727,   368,   369,
-       0,     0,   370,     0,     0,     0,   371,   372,   373,   374,
-     375,     0,     0,   376,   377,   378,   379,   380,     0,   381,
-     382,     0,   383,   384,   385,   728,   729,   386,     0,   387,
-       0,   388,   389,     0,   390,   391,   392,     0,   730,     0,
-     731,   394,   395,   396,   397,   398,   732,   733,   401,   402,
-     403,   404,     0,   734,   406,     0,     0,     0,   407,   408,
-     409,   410,     0,     0,     0,   411,     0,     0,     0,   412,
-       0,   413,   414,   415,   416,     0,   417,   418,   419,   420,
-     421,     0,     0,     0,     0,     0,   422,   423,   424,     0,
-     425,   426,     0,   427,     0,     0,   428,     0,     0,   429,
-     430,   431,   432,   433,   434,   735,   736,   435,   436,     0,
-     437,   438,   737,   440,   441,   442,   738,   739,   443,   444,
-     445,   446,   740,   447,   448,     0,     0,   449,   450,   451,
-     452,     0,   741,   453,   454,     0,   742,   743,   744,   745,
-       0,     0,     0,     0,     0,   459,   460,     0,   746,   747,
-     748,   462,   463,   464,   749,   465,   466,   750,   467,   468,
-       0,   469,   470,     0,     0,   471,     0,     0,   472,     0,
-     473,     0,   751,   475,     0,     0,   752,   753,   754,   755,
-     476,     0,     0,   477,   756,     0,   757,   478,   479,   480,
-     758,   759,     0,     0,     0,     0,     0,     0,   483,   484,
-       0,   485,   486,   487,     0,     0,   760,     0,     0,     0,
-     761,   762,     0,     0,     0,     0,   763,   764,     0,     0,
-     765,   766,     0,     0,   767,   768,   137,     0,   662,   139,
-     140,   141,   142,     0,     0,   143,     0,     0,     0,   144,
-       0,     0,   663,     0,   146,   147,   148,   149,   664,   151,
-       0,   152,     0,     0,   665,   153,   666,   667,   668,   154,
-     669,     0,   155,   156,   157,     0,   158,     0,   159,   160,
-       0,     0,   161,   670,   671,   162,   163,     0,   164,   672,
-     673,   166,     0,   167,   168,   169,   170,   674,   172,     0,
-     675,   174,     0,   175,   176,   177,   178,   179,   180,   181,
-     182,   183,     0,   184,   185,     0,   186,   187,   188,   676,
-     190,     0,   677,   678,   191,     0,     0,   192,   679,   193,
-     680,     0,   194,   681,   682,     0,   195,   196,   197,   683,
-     684,   685,     0,     0,     0,     0,   686,   200,   687,     0,
-       0,  3511,   201,   202,     0,   203,     0,     0,     0,   204,
-       0,   205,   206,   207,   208,   209,     0,     0,     0,   210,
-       0,     0,   211,   212,   213,     0,     0,     0,   214,     0,
-     215,   216,     0,   217,   218,   219,     0,     0,   220,   221,
-       0,   222,   223,   224,   225,   226,   227,   689,     0,   228,
-     229,   230,   231,   232,   690,   691,   233,   234,     0,   235,
-     236,   237,   692,     0,   238,     0,     0,     0,   693,   240,
-       0,   241,     0,   242,     0,   243,   694,   245,   695,     0,
-     247,     0,   248,     0,   696,     0,   249,   250,     0,   251,
-     697,     0,   252,   253,     0,     0,     0,   698,   255,   256,
-     257,   699,     0,   258,   259,   260,     0,     0,   261,     0,
-       0,     0,   700,   262,   263,   701,     0,     0,   264,     0,
-       0,     0,   265,   266,     0,   267,   268,     0,     0,     0,
-     269,     0,     0,   270,   271,     0,     0,   272,     0,   702,
-     273,   274,     0,     0,     0,     0,     0,   703,   276,     0,
-     277,     0,   278,     0,   279,   280,     0,     0,   704,     0,
-       0,     0,     0,   281,     0,   282,   283,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,     0,   299,   300,   301,   705,   302,   303,   304,
-     305,   706,   306,   307,     0,     0,     0,     0,   308,   309,
-     310,   311,   707,   313,     0,     0,   708,   315,   709,   316,
-       0,   317,   710,   711,   712,   713,   714,   322,   323,   324,
-     325,   326,     0,   715,   327,   328,     0,     0,   329,   330,
-     331,   332,   716,   717,   718,   333,   334,     0,   719,   720,
-     335,     0,   336,   337,   721,     0,   339,   340,   341,     0,
-     342,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     343,   344,   345,   722,   346,   347,     0,   348,   349,   723,
-     351,   352,   353,   354,   724,   725,   357,   726,     0,   358,
-     359,   360,     0,   361,     0,   362,   363,   364,   365,   366,
-       0,   727,   368,   369,     0,     0,   370,     0,     0,     0,
-     371,   372,   373,   374,   375,     0,     0,   376,   377,   378,
-     379,   380,     0,   381,   382,     0,   383,   384,   385,   728,
-     729,   386,     0,   387,     0,   388,   389,     0,   390,   391,
-     392,     0,   730,     0,   731,   394,   395,   396,   397,   398,
-     732,   733,   401,   402,   403,   404,     0,   734,   406,     0,
-       0,     0,   407,   408,   409,   410,     0,     0,     0,   411,
-       0,     0,     0,   412,     0,   413,   414,   415,   416,     0,
-     417,   418,   419,   420,   421,     0,     0,     0,     0,     0,
-     422,   423,   424,     0,   425,   426,     0,   427,     0,     0,
-     428,     0,     0,   429,   430,   431,   432,   433,   434,   735,
-     736,   435,   436,     0,   437,   438,   737,   440,   441,   442,
-     738,   739,   443,   444,   445,   446,   740,   447,   448,     0,
-       0,   449,   450,   451,   452,     0,   741,   453,   454,     0,
-     742,   743,   744,   745,     0,     0,     0,     0,     0,   459,
-     460,     0,   746,   747,   748,   462,   463,   464,   749,   465,
-     466,   750,   467,   468,     0,   469,   470,     0,     0,   471,
-       0,     0,   472,     0,   473,     0,   751,   475,     0,     0,
-     752,   753,   754,   755,   476,     0,     0,   477,   756,     0,
-     757,   478,   479,   480,   758,   759,     0,     0,     0,     0,
-       0,     0,   483,   484,     0,   485,   486,   487,     0,     0,
-     760,     0,     0,     0,   761,   762,     0,     0,     0,     0,
-     763,   764,     0,     0,   765,   766,     0,     0,   767,   768,
-     137,     0,   662,   139,   140,   141,   142,     0,     0,   143,
-       0,     0,     0,   144,     0,     0,   663,     0,   146,   147,
-     148,   149,   664,   151,     0,   152,     0,     0,   665,   153,
-     666,   667,   668,   154,   669,     0,   155,   156,   157,     0,
-     158,     0,   159,   160,     0,     0,   161,   670,   671,   162,
-     163,     0,   164,   672,   673,   166,     0,   167,   168,   169,
-     170,   674,   172,     0,   675,   174,     0,   175,   176,   177,
-     178,   179,   180,   181,   182,   183,     0,   184,   185,     0,
-     186,   187,   188,   676,   190,     0,   677,   678,   191,     0,
-       0,   192,   679,   193,   680,     0,   194,   681,   682,     0,
-     195,   196,   197,   683,   684,   685,     0,     0,     0,     0,
-     686,   200,   687,     0,     0,   688,   201,   202,     0,   203,
-       0,     0,     0,   204,     0,   205,   206,   207,   208,   209,
-       0,     0,     0,   210,     0,     0,   211,   212,   213,     0,
-       0,     0,   214,     0,   215,   216,     0,   217,   218,   219,
-       0,     0,   220,   221,     0,   222,   223,   224,   225,   226,
-     227,   689,     0,   228,   229,   230,   231,   232,   690,   691,
-     233,   234,     0,   235,   236,   237,   692,     0,   238,     0,
-       0,     0,   693,   240,     0,   241,     0,   242,     0,   243,
-     694,   245,   695,     0,   247,     0,   248,     0,   696,     0,
-     249,   250,     0,   251,   697,     0,   252,   253,     0,     0,
-       0,   698,   255,   256,   257,   699,     0,   258,   259,   260,
-       0,     0,   261,     0,     0,     0,   700,   262,   263,   701,
-       0,     0,   264,     0,     0,     0,   265,   266,     0,   267,
-     268,     0,     0,     0,   269,     0,     0,   270,   271,     0,
-       0,   272,     0,   702,   273,   274,     0,     0,     0,     0,
-       0,   703,   276,     0,   277,     0,   278,     0,   279,   280,
-       0,     0,   704,     0,     0,     0,     0,   281,     0,   282,
-     283,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,     0,   299,   300,   301,
-     705,   302,   303,   304,   305,   706,   306,   307,  4380,     0,
-       0,     0,   308,   309,   310,   311,   707,   313,     0,     0,
-     708,   315,   709,   316,     0,   317,   710,   711,   712,   713,
-     714,   322,   323,   324,   325,   326,     0,   715,   327,   328,
-       0,     0,   329,   330,   331,   332,   716,     0,   718,   333,
-     334,     0,   719,   720,   335,     0,   336,   337,   721,     0,
-     339,   340,   341,     0,   342,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   343,   344,   345,   722,   346,   347,
-       0,   348,   349,   723,   351,   352,   353,   354,   724,   725,
-     357,   726,     0,   358,   359,   360,     0,   361,     0,   362,
-     363,   364,   365,   366,     0,   727,   368,   369,     0,     0,
-     370,     0,     0,     0,   371,   372,   373,   374,   375,     0,
-       0,   376,   377,   378,   379,   380,     0,   381,   382,     0,
-     383,   384,   385,   728,   729,   386,     0,   387,     0,   388,
-     389,     0,   390,   391,   392,     0,   730,     0,   731,   394,
-     395,   396,   397,   398,   732,   733,   401,   402,   403,   404,
-       0,   734,   406,     0,     0,     0,   407,   408,   409,   410,
-       0,     0,     0,   411,     0,     0,     0,   412,     0,   413,
-     414,   415,   416,     0,   417,   418,   419,   420,   421,     0,
-       0,     0,     0,     0,   422,   423,   424,     0,   425,   426,
-       0,   427,     0,     0,   428,     0,     0,   429,   430,   431,
-     432,   433,   434,   735,   736,   435,   436,     0,   437,   438,
-     737,   440,   441,   442,   738,   739,   443,   444,   445,   446,
-     740,   447,   448,     0,     0,   449,   450,   451,   452,     0,
-     741,   453,   454,     0,   742,   743,   744,   745,     0,     0,
-       0,     0,     0,   459,   460,     0,   746,   747,   748,   462,
-     463,   464,   749,   465,   466,   750,   467,   468,     0,   469,
-     470,     0,     0,   471,     0,     0,   472,     0,   473,     0,
-     751,   475,     0,     0,   752,   753,   754,   755,   476,     0,
-       0,   477,   756,     0,   757,   478,   479,   480,   758,   759,
-       0,     0,     0,     0,     0,     0,   483,   484,     0,   485,
-     486,   487,     0,     0,   760,     0,     0,     0,   761,   762,
-       0,     0,     0,     0,   763,   764,     0,     0,   765,   766,
-       0,     0,   767,   768,   137,     0,   662,   139,   140,   141,
-     142,     0,     0,   143,     0,     0,     0,   144,     0,     0,
-     663,     0,   146,   147,   148,   149,   664,   151,     0,   152,
-       0,     0,   665,   153,   666,   667,   668,   154,   669,     0,
-     155,   156,   157,     0,   158,     0,   159,   160,     0,     0,
-     161,   670,   671,   162,   163,     0,   164,   672,   673,   166,
-       0,   167,   168,   169,   170,   674,   172,     0,   675,   174,
-       0,   175,   176,   177,   178,   179,   180,   181,   182,   183,
-       0,   184,   185,     0,   186,   187,   188,   676,   190,     0,
-     677,   678,   191,     0,     0,   192,   679,   193,   680,     0,
-     194,   681,   682,     0,   195,   196,   197,   683,   684,   685,
-       0,     0,     0,     0,   686,   200,   687,     0,     0,   688,
-     201,   202,     0,   203,     0,     0,     0,   204,     0,   205,
-     206,   207,   208,   209,     0,     0,     0,   210,     0,     0,
-     211,   212,   213,     0,     0,     0,   214,     0,   215,   216,
-       0,   217,   218,   219,     0,     0,   220,   221,     0,   222,
-     223,   224,   225,   226,   227,   689,     0,   228,   229,   230,
-     231,   232,   690,   691,   233,   234,     0,   235,   236,   237,
-     692,     0,   238,     0,     0,     0,   693,   240,     0,   241,
-       0,   242,     0,   243,   694,   245,   695,     0,   247,     0,
-     248,     0,   696,     0,   249,   250,     0,   251,   697,     0,
-     252,   253,     0,     0,     0,   698,   255,   256,   257,   699,
-       0,   258,   259,   260,     0,     0,   261,     0,     0,     0,
-     700,   262,   263,   701,     0,     0,   264,     0,     0,     0,
-     265,   266,     0,   267,   268,     0,     0,     0,   269,     0,
-       0,   270,   271,     0,     0,   272,     0,   702,   273,   274,
-       0,     0,     0,     0,     0,   703,   276,     0,   277,     0,
-     278,     0,   279,   280,     0,     0,   704,     0,     0,     0,
-       0,   281,     0,   282,   283,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,   705,   302,   303,   304,   305,   706,
-     306,   307,     0,     0,     0,     0,   308,   309,   310,   311,
-     707,   313,     0,     0,   708,   315,   709,   316,     0,   317,
-     710,   711,   712,   713,   714,   322,   323,   324,   325,   326,
-       0,   715,   327,   328,     0,     0,   329,   330,   331,   332,
-     716,     0,   718,   333,   334,     0,   719,   720,   335,     0,
-     336,   337,   721,     0,   339,   340,   341,     0,   342,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   343,   344,
-     345,   722,   346,   347,     0,   348,   349,   723,   351,   352,
-     353,   354,   724,   725,   357,   726,     0,   358,   359,   360,
-       0,   361,     0,   362,   363,   364,   365,   366,     0,   727,
-     368,   369,     0,     0,   370,     0,     0,     0,   371,   372,
-     373,   374,   375,     0,     0,   376,   377,   378,   379,   380,
-       0,   381,   382,     0,   383,   384,   385,   728,   729,   386,
-       0,   387,     0,   388,   389,     0,   390,   391,   392,     0,
-     730,     0,   731,   394,   395,   396,   397,   398,   732,   733,
-     401,   402,   403,   404,     0,   734,   406,     0,     0,     0,
-     407,   408,   409,   410,     0,     0,     0,   411,     0,     0,
-       0,   412,     0,   413,   414,   415,   416,     0,   417,   418,
-     419,   420,   421,     0,     0,     0,     0,     0,   422,   423,
-     424,     0,   425,   426,     0,   427,     0,     0,   428,     0,
-       0,   429,   430,   431,   432,   433,   434,   735,   736,   435,
-     436,     0,   437,   438,   737,   440,   441,   442,   738,   739,
-     443,   444,   445,   446,   740,   447,   448,     0,     0,   449,
-     450,   451,   452,     0,   741,   453,   454,     0,   742,   743,
-     744,   745,     0,     0,     0,     0,     0,   459,   460,     0,
-     746,   747,   748,   462,   463,   464,   749,   465,   466,   750,
-     467,   468,     0,   469,   470,     0,     0,   471,     0,     0,
-     472,     0,   473,     0,   751,   475,     0,     0,   752,   753,
-     754,   755,   476,     0,     0,   477,   756,     0,   757,   478,
-     479,   480,   758,   759,     0,     0,     0,     0,     0,     0,
-     483,   484,     0,   485,   486,   487,     0,     0,   760,     0,
-       0,     0,   761,   762,     0,     0,     0,     0,   763,   764,
-       0,     0,   765,   766,     0,     0,   767,   768,   137,     0,
-     662,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,   663,     0,   146,   147,   148,   149,
-     664,   151,     0,   152,     0,     0,   665,   153,   666,   667,
-     668,   154,   669,     0,   155,   156,   157,     0,   158,     0,
-     159,   160,     0,     0,   161,   670,   671,   162,   163,     0,
-     164,   672,   673,   166,     0,   167,   168,   169,   170,   674,
-     172,     0,   675,   174,     0,   175,   176,   177,   178,   179,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,   676,   190,     0,   677,   678,   191,     0,     0,   192,
-     679,   193,   680,     0,   194,   681,   682,     0,   195,   196,
-     197,   683,   684,   685,     0,     0,     0,     0,   686,   200,
-     687,     0,     0,   688,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,   210,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,   215,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,   227,   689,
-       0,   228,   229,   230,   231,   232,   690,   691,   233,   234,
-       0,   235,   236,   237,   692,     0,   238,     0,     0,     0,
-     693,   240,     0,   241,     0,   242,     0,   243,   694,   245,
-     695,     0,   247,     0,   248,     0,   696,     0,   249,   250,
-       0,   251,   697,     0,   252,   253,     0,     0,     0,   698,
-     255,   256,   257,   699,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,   700,   262,   263,  1714,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,   270,   271,     0,     0,   272,
-       0,   702,   273,   274,     0,     0,     0,     0,     0,   703,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-     704,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,   705,   302,
-     303,   304,   305,   706,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   707,   313,     0,     0,   708,   315,
-     709,   316,     0,   317,   710,   711,   712,   713,   714,   322,
-     323,   324,   325,   326,     0,   715,   327,   328,     0,     0,
-     329,   330,   331,   332,   716,     0,   718,   333,   334,     0,
-     719,   720,   335,     0,   336,   337,   721,     0,   339,   340,
-     341,     0,   342,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   343,   344,   345,   722,   346,   347,     0,   348,
-     349,   723,   351,   352,   353,   354,   724,   725,   357,   726,
-       0,   358,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   727,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,   382,     0,   383,   384,
-     385,   728,   729,   386,     0,   387,     0,   388,   389,     0,
-     390,   391,   392,     0,   730,     0,   731,   394,   395,   396,
-     397,   398,   732,   733,   401,   402,   403,   404,     0,   734,
-     406,     0,     0,     0,   407,   408,   409,   410,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,   413,   414,   415,
-     416,     0,   417,   418,   419,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,   430,   431,   432,   433,
-     434,   735,   736,   435,   436,     0,   437,   438,   737,   440,
-     441,   442,   738,   739,   443,   444,   445,   446,   740,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,   741,   453,
-     454,     0,   742,   743,   744,   745,     0,     0,     0,     0,
-       0,   459,   460,     0,   746,   747,   748,   462,   463,   464,
-     749,   465,   466,   750,   467,   468,     0,   469,   470,     0,
-       0,   471,     0,     0,   472,     0,   473,     0,   751,   475,
-       0,     0,   752,   753,   754,   755,   476,     0,     0,   477,
-     756,     0,   757,   478,   479,   480,   758,   759,     0,     0,
-       0,     0,     0,     0,   483,   484,     0,   485,   486,   487,
-       0,     0,   760,     0,     0,     0,   761,   762,     0,     0,
-       0,     0,   763,   764,     0,     0,   765,   766,     0,     0,
-     767,   768,   137,     0,   662,   139,   140,   141,   142,     0,
-       0,   143,     0,     0,     0,   144,     0,     0,   663,     0,
-     146,   147,   148,   149,   664,   151,     0,   152,     0,     0,
-     665,   153,   666,   667,   668,   154,   669,     0,   155,   156,
-     157,     0,   158,     0,   159,   160,     0,     0,   161,   670,
-     671,   162,   163,     0,   164,   672,   673,   166,     0,   167,
-     168,   169,   170,   674,   172,     0,   675,   174,     0,   175,
-     176,   177,   178,   179,   180,   181,   182,   183,     0,   184,
-     185,     0,   186,   187,   188,   676,   190,     0,   677,   678,
-     191,     0,     0,   192,   679,   193,   680,     0,   194,   681,
-     682,     0,   195,   196,   197,   683,   684,   685,     0,     0,
-       0,     0,   686,   200,   687,     0,     0,   688,   201,   202,
-       0,   203,     0,     0,     0,   204,     0,   205,   206,   207,
-     208,   209,     0,     0,     0,   210,     0,     0,   211,   212,
-     213,     0,     0,     0,   214,     0,   215,   216,     0,   217,
-     218,   219,     0,     0,   220,   221,     0,   222,   223,   224,
-     225,   226,   227,   689,     0,   228,   229,   230,   231,   232,
-     690,   691,   233,   234,     0,   235,   236,   237,   692,     0,
-     238,     0,     0,     0,   693,   240,     0,   241,     0,   242,
-       0,   243,   694,   245,   695,     0,   247,     0,   248,     0,
-     696,     0,   249,   250,     0,   251,   697,     0,   252,   253,
-       0,     0,     0,   698,   255,   256,   257,   699,     0,   258,
-     259,   260,     0,     0,   261,     0,     0,     0,   700,   262,
-     263,  1716,     0,     0,   264,     0,     0,     0,   265,   266,
-       0,   267,   268,     0,     0,     0,   269,     0,     0,   270,
-     271,     0,     0,   272,     0,   702,   273,   274,     0,     0,
-       0,     0,     0,   703,   276,     0,   277,     0,   278,     0,
-     279,   280,     0,     0,   704,     0,     0,     0,     0,   281,
-       0,   282,   283,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,     0,   299,
-     300,   301,   705,   302,   303,   304,   305,   706,   306,   307,
-       0,     0,     0,     0,   308,   309,   310,   311,   707,   313,
-       0,     0,   708,   315,   709,   316,     0,   317,   710,   711,
-     712,   713,   714,   322,   323,   324,   325,   326,     0,   715,
-     327,   328,     0,     0,   329,   330,   331,   332,   716,     0,
-     718,   333,   334,     0,   719,   720,   335,     0,   336,   337,
-     721,     0,   339,   340,   341,     0,   342,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   343,   344,   345,   722,
-     346,   347,     0,   348,   349,   723,   351,   352,   353,   354,
-     724,   725,   357,   726,     0,   358,   359,   360,     0,   361,
-       0,   362,   363,   364,   365,   366,     0,   727,   368,   369,
-       0,     0,   370,     0,     0,     0,   371,   372,   373,   374,
-     375,     0,     0,   376,   377,   378,   379,   380,     0,   381,
-     382,     0,   383,   384,   385,   728,   729,   386,     0,   387,
-       0,   388,   389,     0,   390,   391,   392,     0,   730,     0,
-     731,   394,   395,   396,   397,   398,   732,   733,   401,   402,
-     403,   404,     0,   734,   406,     0,     0,     0,   407,   408,
-     409,   410,     0,     0,     0,   411,     0,     0,     0,   412,
-       0,   413,   414,   415,   416,     0,   417,   418,   419,   420,
-     421,     0,     0,     0,     0,     0,   422,   423,   424,     0,
-     425,   426,     0,   427,     0,     0,   428,     0,     0,   429,
-     430,   431,   432,   433,   434,   735,   736,   435,   436,     0,
-     437,   438,   737,   440,   441,   442,   738,   739,   443,   444,
-     445,   446,   740,   447,   448,     0,     0,   449,   450,   451,
-     452,     0,   741,   453,   454,     0,   742,   743,   744,   745,
-       0,     0,     0,     0,     0,   459,   460,     0,   746,   747,
-     748,   462,   463,   464,   749,   465,   466,   750,   467,   468,
-       0,   469,   470,     0,     0,   471,     0,     0,   472,     0,
-     473,     0,   751,   475,     0,     0,   752,   753,   754,   755,
-     476,     0,     0,   477,   756,     0,   757,   478,   479,   480,
-     758,   759,     0,     0,     0,     0,     0,     0,   483,   484,
-       0,   485,   486,   487,     0,     0,   760,     0,     0,     0,
-     761,   762,     0,     0,     0,     0,   763,   764,     0,     0,
-     765,   766,     0,     0,   767,   768,   137,     0,   138,   139,
-     140,   141,   142,     0,     0,   143,     0,     0,     0,   144,
-       0,     0,   145,     0,   146,   147,   148,   149,   150,   151,
-       0,   152,     0,     0,     0,   153,   666,     0,     0,   154,
-       0,     0,   155,   156,   157,     0,   158,     0,   159,   160,
-       0,     0,   161,     0,     0,   162,   163,     0,   164,   165,
-       0,   166,     0,   167,   168,   169,   170,   171,   172,     0,
-     173,   174,     0,   175,   176,   177,   178,   179,   180,   181,
-     182,   183,     0,   184,   185,     0,   186,   187,   188,   189,
-     190,     0,     0,     0,   191,     0,     0,   192,     0,   193,
-       0,     0,   194,     0,     0,     0,   195,   196,   197,     0,
-       0,  1752,     0,     0,     0,     0,   199,   200,   687,     0,
-       0,     0,   201,   202,     0,   203,     0,     0,     0,   204,
-       0,   205,   206,   207,   208,   209,     0,     0,     0,   210,
-       0,     0,   211,   212,   213,     0,     0,     0,   214,     0,
-     215,   216,     0,   217,   218,   219,     0,     0,   220,   221,
-       0,   222,   223,   224,   225,   226,   227,     0,     0,   228,
-     229,   230,   231,   232,     0,   691,   233,   234,     0,   235,
-     236,   237,   692,     0,   238,     0,     0,     0,   239,   240,
-       0,   241,     0,   242,     0,   243,   244,   245,   246,     0,
-     247,     0,   248,     0,     0,     0,   249,   250,     0,   251,
-     697,     0,   252,   253,     0,     0,     0,   254,   255,   256,
-     257,     0,     0,   258,   259,   260,     0,     0,   261,     0,
-       0,     0,     0,   262,   263,     0,     0,     0,   264,     0,
-       0,     0,   265,   266,     0,   267,   268,     0,     0,     0,
-     269,     0,     0,   270,   271,     0,     0,   272,     0,     0,
-     273,   274,     0,     0,     0,     0,     0,   275,   276,     0,
-     277,     0,   278,     0,   279,   280,     0,     0,   704,     0,
-       0,     0,     0,   281,     0,   282,   283,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,     0,   299,   300,   301,     0,   302,   303,   304,
-     305,     0,   306,   307,     0,     0,     0,     0,   308,   309,
-     310,   311,   312,   313,     0,     0,   314,   315,     0,   316,
-       0,   317,     0,   318,   319,   320,   321,   322,   323,   324,
-     325,   326,     0,   715,   327,   328,     0,     0,   329,   330,
-     331,   332,     0,     0,     0,   333,   334,     0,   719,   720,
-     335,     0,   336,   337,   338,     0,   339,   340,   341,     0,
-     342,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     343,   344,   345,     0,   346,   347,     0,   348,   349,   350,
-     351,   352,   353,   354,   355,   356,   357,     0,     0,   358,
-     359,   360,     0,   361,     0,   362,   363,   364,   365,   366,
-       0,   367,   368,   369,     0,     0,   370,     0,     0,     0,
-     371,   372,   373,   374,   375,     0,     0,   376,   377,   378,
-     379,   380,     0,   381,   382,     0,   383,   384,   385,     0,
-       0,   386,     0,   387,     0,   388,   389,     0,   390,   391,
-     392,     0,   393,     0,     0,   394,   395,   396,   397,   398,
-     399,   400,   401,   402,   403,   404,     0,   405,   406,     0,
-       0,     0,   407,   408,   409,   410,     0,     0,     0,   411,
-       0,     0,     0,   412,     0,   413,   414,   415,   416,     0,
-     417,   418,   419,   420,   421,     0,     0,     0,     0,     0,
-     422,   423,   424,     0,   425,   426,     0,   427,     0,     0,
-     428,     0,     0,   429,   430,   431,   432,   433,   434,     0,
-       0,   435,   436,     0,   437,   438,   439,   440,   441,   442,
-       0,     0,   443,   444,   445,   446,     0,   447,   448,     0,
-       0,   449,   450,   451,   452,     0,   741,   453,   454,     0,
-    1753,   456,   457,  1754,     0,     0,     0,     0,     0,   459,
-     460,     0,     0,   747,   461,   462,   463,   464,   749,   465,
-     466,   750,   467,   468,     0,   469,   470,     0,     0,   471,
-       0,     0,   472,     0,   473,     0,   474,   475,     0,     0,
-       0,     0,     0,     0,   476,     0,     0,   477,     0,     0,
-       0,   478,   479,   480,   481,   482,     0,     0,     0,     0,
-       0,     0,   483,   484,     0,   485,   486,   487,     0,     0,
-     488,     0,     0,     0,   137,     0,   138,   139,   140,   141,
-     142,     0,     0,   143,     0,     0,     0,   144,   767,   768,
-     145,     0,   146,   147,   148,   149,   150,   151,     0,   152,
-       0,     0,     0,   153,     0,     0,     0,   154,     0,     0,
-     155,   156,   157,     0,   158,     0,   159,   160,     0,     0,
-     161,     0,     0,   162,   163,     0,   164,   165,     0,   166,
-       0,   167,   168,   169,   170,   171,   172,     0,   173,   174,
-       0,   175,   176,   177,   178,   179,   180,   181,   182,   183,
-       0,   184,   185,  2508,   186,   187,   188,   189,   190,     0,
-       0,     0,   191,     0,     0,   192,     0,   193,     0,     0,
-     194,     0,     0,     0,   195,   196,   197,     0,     0,   198,
-       0,     0,     0,     0,   199,   200,     0,     0,     0,     0,
-     201,   202,     0,   203,     0,     0,     0,   204,     0,   205,
-     206,   207,   208,   209,     0,     0,     0,   210,     0,     0,
-     211,   212,   213,     0,     0,     0,   214,     0,   215,   216,
-       0,   217,   218,   219,     0,     0,   220,   221,     0,   222,
-     223,   224,   225,   226,   227,     0,     0,   228,   229,   230,
-     231,   232,     0,     0,   233,   234,     0,   235,   236,   237,
-       0,     0,   238,     0,     0,     0,   239,   240,     0,   241,
-     502,   242,     0,   243,   244,   245,   246,     0,   247,     0,
-     248,     0,     0,     0,   249,   250,     0,   251,     0,     0,
-     252,   253,     0,     0,     0,   254,   255,   256,   257,     0,
-       0,   258,   259,   260,  2063,     0,   261,     0,     0,     0,
-       0,   262,   263,     0,     0,     0,   264,     0,     0,     0,
-     265,   266,     0,   267,   268,     0,     0,     0,   269,  2064,
-       0,   270,   271,     0,     0,   272,     0,     0,   273,   274,
-       0,  3078,     0,     0,     0,   275,   276,     0,   277,     0,
-     278,     0,   279,   280,     0,     0,     0,     0,     0,     0,
-       0,   281,     0,   282,   283,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,     0,   302,   303,   304,   305,     0,
-     306,   307,     0,     0,     0,     0,   308,   309,   310,   311,
-     312,   313,     0,     0,   314,   315,     0,   316,     0,   317,
-       0,   318,   319,   320,   321,   322,   323,   324,   325,   326,
-       0,     0,   327,   328,     0,     0,   329,   330,   331,   332,
-       0,     0,     0,   333,   334,     0,     0,     0,   335,     0,
-     336,   337,   338,     0,   339,   340,   341,     0,   342,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   343,   344,
-     345,     0,   346,   347,  2019,   348,   349,   350,   351,   352,
-     353,   354,   355,   356,   357,     0,     0,   358,   359,   360,
-       0,   361,     0,   362,   363,   364,   365,   366,     0,   367,
-     368,   369,     0,     0,   370,     0,     0,     0,   371,   372,
-     373,   374,   375,     0,     0,   376,   377,   378,   379,   380,
-       0,   381,   382,     0,   383,   384,   385,     0,     0,   386,
-       0,   387,     0,   388,   389,     0,   390,   391,   392,     0,
-     393,     0,     0,   394,   395,   396,   397,   398,   399,   400,
-     401,   402,   403,   404,     0,   405,   406,  -478,     0,     0,
-     407,   408,   409,   410,     0,     0,     0,   411,     0,     0,
-       0,   412,     0,   413,   414,   415,   416,     0,   417,   418,
-     419,   420,   421,   505,     0,     0,     0,     0,   422,   423,
-     424,     0,   425,   426,     0,   427,     0,     0,   428,     0,
-       0,   429,   430,   431,   432,   433,   434,     0,     0,   435,
-     436,     0,   437,   438,   439,   440,   441,   442,     0,     0,
-     443,   444,   445,   446,     0,   447,   448,     0,     0,   449,
-     450,   451,   452,     0,     0,   453,   454,     0,   455,   456,
-     457,   458,     0,     0,     0,     0,     0,   459,   460,     0,
-       0,     0,   461,   462,   463,   464,     0,   465,   466,     0,
-     467,   468,     0,   469,   470,     0,     0,   471,     0,     0,
-     472,     0,   473,     0,   474,   475,     0,     0,     0,     0,
-       0,     0,   476,     0,     0,   477,     0,     0,     0,   478,
-     479,   480,   481,   482,     0,     0,     0,     0,     0,     0,
-     483,   484,     0,   485,   486,   487,     0,     0,   488,     0,
-     137,     0,   138,   139,   140,   141,   142,     0,     0,   143,
-       0,     0,     0,   144,     0,     0,   145,  2579,   146,   147,
-     148,   149,   150,   151,     0,   152,     0,     0,     0,   153,
-       0,     0,     0,   154,     0,     0,   155,   156,   157,     0,
-     158,     0,   159,   160,     0,     0,   161,     0,     0,   162,
-     163,     0,   164,   165,     0,   166,     0,   167,   168,   169,
-     170,   171,   172,     0,   173,   174,     0,   175,   176,   177,
-     178,   179,   180,   181,   182,   183,     0,   184,   185,  2508,
-     186,   187,   188,   189,   190,     0,     0,     0,   191,     0,
-       0,   192,     0,   193,     0,     0,   194,     0,     0,     0,
-     195,   196,   197,     0,     0,   198,     0,     0,     0,     0,
-     199,   200,     0,     0,     0,     0,   201,   202,     0,   203,
-       0,     0,     0,   204,     0,   205,   206,   207,   208,   209,
-       0,     0,     0,   210,     0,     0,   211,   212,   213,     0,
-       0,     0,   214,     0,   215,   216,     0,   217,   218,   219,
-       0,     0,   220,   221,     0,   222,   223,   224,   225,   226,
-     227,     0,     0,   228,   229,   230,   231,   232,     0,     0,
-     233,   234,     0,   235,   236,   237,     0,     0,   238,     0,
-       0,     0,   239,   240,     0,   241,   502,   242,     0,   243,
-     244,   245,   246,     0,   247,     0,   248,     0,     0,     0,
-     249,   250,     0,   251,     0,     0,   252,   253,     0,     0,
-       0,   254,   255,   256,   257,     0,     0,   258,   259,   260,
-    2063,     0,   261,     0,     0,     0,     0,   262,   263,     0,
-       0,     0,   264,     0,     0,     0,   265,   266,     0,   267,
-     268,     0,     0,     0,   269,  2064,     0,   270,   271,     0,
-       0,   272,     0,     0,   273,   274,     0,     0,     0,     0,
-       0,   275,   276,     0,   277,     0,   278,     0,   279,   280,
-       0,     0,     0,     0,     0,     0,     0,   281,     0,   282,
-     283,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,     0,   299,   300,   301,
-       0,   302,   303,   304,   305,     0,   306,   307,     0,     0,
-       0,     0,   308,   309,   310,   311,   312,   313,     0,     0,
-     314,   315,     0,   316,     0,   317,     0,   318,   319,   320,
-     321,   322,   323,   324,   325,   326,     0,     0,   327,   328,
-       0,     0,   329,   330,   331,   332,     0,     0,     0,   333,
-     334,     0,     0,     0,   335,     0,   336,   337,   338,     0,
-     339,   340,   341,     0,   342,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   343,   344,   345,     0,   346,   347,
-       0,   348,   349,   350,   351,   352,   353,   354,   355,   356,
-     357,     0,     0,   358,   359,   360,     0,   361,     0,   362,
-     363,   364,   365,   366,     0,   367,   368,   369,     0,     0,
-     370,     0,     0,     0,   371,   372,   373,   374,   375,     0,
-       0,   376,   377,   378,   379,   380,     0,   381,   382,     0,
-     383,   384,   385,     0,     0,   386,     0,   387,     0,   388,
-     389,     0,   390,   391,   392,     0,   393,     0,     0,   394,
-     395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
-       0,   405,   406,     0,     0,     0,   407,   408,   409,   410,
-       0,     0,     0,   411,     0,     0,     0,   412,     0,   413,
-     414,   415,   416,     0,   417,   418,   419,   420,   421,   505,
-       0,     0,     0,     0,   422,   423,   424,     0,   425,   426,
-       0,   427,     0,     0,   428,     0,     0,   429,   430,   431,
-     432,   433,   434,     0,     0,   435,   436,     0,   437,   438,
-     439,   440,   441,   442,     0,     0,   443,   444,   445,   446,
-       0,   447,   448,     0,     0,   449,   450,   451,   452,     0,
-       0,   453,   454,     0,   455,   456,   457,   458,     0,     0,
-       0,     0,     0,   459,   460,     0,     0,     0,   461,   462,
-     463,   464,     0,   465,   466,     0,   467,   468,     0,   469,
-     470,     0,     0,   471,     0,     0,   472,     0,   473,     0,
-     474,   475,     0,     0,     0,     0,     0,     0,   476,     0,
-       0,   477,     0,     0,     0,   478,   479,   480,   481,   482,
-       0,     0,     0,     0,     0,     0,   483,   484,     0,   485,
-     486,   487,     0,     0,   488,     0,   137,     0,   138,   139,
-     140,   141,   142,     0,     0,   143,     0,     0,     0,   144,
-       0,     0,   145,  2579,   146,   147,   148,   149,   150,   151,
-       0,   152,     0,     0,     0,   153,     0,     0,     0,   154,
-       0,     0,   155,   156,   157,     0,   158,     0,   159,   160,
-       0,     0,   161,     0,     0,   162,   163,     0,   164,   165,
-       0,   166,     0,   167,   168,   169,   170,   171,   172,     0,
-     173,   174,     0,   175,   176,   177,   178,   179,   180,   181,
-     182,   183,     0,   184,   185,     0,   186,   187,   188,   189,
-     190,     0,     0,     0,   191,     0,     0,   192,     0,   193,
-       0,     0,   194,     0,     0,     0,   195,   196,   197,     0,
-       0,   198,     0,     0,     0,     0,   199,   200,     0,     0,
-       0,     0,   201,   202,     0,   203,     0,     0,     0,   204,
-       0,   205,   206,   207,   208,   209,     0,     0,     0,   210,
-       0,     0,   211,   212,   213,     0,     0,     0,   214,     0,
-     215,   216,     0,   217,   218,   219,     0,     0,   220,   221,
-       0,   222,   223,   224,   225,   226,   227,     0,     0,   228,
-     229,   230,   231,   232,     0,     0,   233,   234,     0,   235,
-     236,   237,     0,     0,   238,     0,     0,     0,   239,   240,
-       0,   241,     0,   242,     0,   243,   244,   245,   246,     0,
-     247,     0,   248,     0,     0,     0,   249,   250,     0,   251,
-       0,     0,   252,   253,     0,     0,     0,   254,   255,   256,
-     257,     0,     0,   258,   259,   260,     0,     0,   261,     0,
-       0,     0,     0,   262,   263,     0,     0,     0,   264,     0,
-       0,     0,   265,   266,     0,   267,   268,     0,     0,     0,
-     269,     0,     0,   270,   271,     0,     0,   272,     0,     0,
-     273,   274,     0,     0,     0,     0,     0,   275,   276,     0,
-     277,     0,   278,     0,   279,   280,     0,     0,     0,     0,
-       0,     0,     0,   281,     0,   282,   283,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,     0,   299,   300,   301,     0,   302,   303,   304,
-     305,     0,   306,   307,     0,     0,     0,     0,   308,   309,
-     310,   311,   312,   313,     0,     0,   314,   315,     0,   316,
-       0,   317,     0,   318,   319,   320,   321,   322,   323,   324,
-     325,   326,     0,     0,   327,   328,     0,     0,   329,   330,
-     331,   332,     0,     0,     0,   333,   334,     0,     0,     0,
-     335,     0,   336,   337,   338,     0,   339,   340,   341,     0,
-     342,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     343,   344,   345,     0,   346,   347,     0,   348,   349,   350,
-     351,   352,   353,   354,   355,   356,   357,     0,     0,   358,
-     359,   360,     0,   361,     0,   362,   363,   364,   365,   366,
-       0,   367,   368,   369,     0,     0,   370,     0,     0,     0,
-     371,   372,   373,   374,   375,     0,     0,   376,   377,   378,
-     379,   380,     0,   381,   382,     0,   383,   384,   385,     0,
-       0,   386,     0,   387,     0,   388,   389,     0,   390,   391,
-     392,     0,   393,     0,     0,   394,   395,   396,   397,   398,
-     399,   400,   401,   402,   403,   404,     0,   405,   406,  2367,
-       0,     0,   407,   408,   409,   410,     0,     0,     0,   411,
-       0,     0,     0,   412,     0,   413,   414,   415,   416,     0,
-     417,   418,   419,   420,   421,     0,     0,     0,     0,     0,
-     422,   423,   424,     0,   425,   426,     0,   427,     0,     0,
-     428,     0,     0,   429,   430,   431,   432,   433,   434,     0,
-       0,   435,   436,     0,   437,   438,   439,   440,   441,   442,
-       0,     0,   443,   444,   445,   446,     0,   447,   448,     0,
-       0,   449,   450,   451,   452,     0,     0,   453,   454,     0,
-     455,   456,   457,   458,     0,     0,     0,     0,     0,   459,
-     460,     0,     0,     0,   461,   462,   463,   464,     0,   465,
-     466,     0,   467,   468,     0,   469,   470,     0,     0,   471,
-       0,     0,   472,     0,   473,     0,   474,   475,     0,     0,
-       0,     0,     0,     0,   476,     0,     0,   477,     0,     0,
-       0,   478,   479,   480,   481,   482,     0,     0,     0,     0,
-       0,     0,   483,   484,     0,   485,   486,   487,     0,     0,
-     488,     0,   137,     0,   138,   139,   140,   141,   142,     0,
-       0,   143,  2826,     0,     0,   144,     0,     0,   145,   768,
-     146,   147,   148,   149,   150,   151,     0,   152,     0,     0,
-       0,   153,     0,     0,     0,   154,     0,     0,   155,   156,
-     157,     0,   158,     0,   159,   160,     0,     0,   161,     0,
-       0,   162,   163,     0,   164,   165,     0,   166,     0,   167,
-     168,   169,   170,   171,   172,     0,   173,   174,     0,   175,
-     176,   177,   178,   179,   180,   181,   182,   183,     0,   184,
-     185,     0,   186,   187,   188,   189,   190,     0,     0,     0,
-     191,     0,     0,   192,     0,   193,     0,     0,   194,     0,
-       0,     0,   195,   196,   197,     0,     0,   198,     0,     0,
-       0,     0,   199,   200,     0,     0,     0,     0,   201,   202,
-       0,   203,     0,     0,     0,   204,     0,   205,   206,   207,
-     208,   209,     0,     0,     0,   210,     0,     0,   211,   212,
-     213,     0,     0,     0,   214,     0,   215,   216,     0,   217,
-     218,   219,     0,     0,   220,   221,     0,   222,   223,   224,
-     225,   226,   227,     0,     0,   228,   229,   230,   231,   232,
-       0,     0,   233,   234,     0,   235,   236,   237,     0,     0,
-     238,     0,     0,     0,   239,   240,     0,   241,     0,   242,
-       0,   243,   244,   245,   246,     0,   247,     0,   248,     0,
-       0,     0,   249,   250,     0,   251,     0,     0,   252,   253,
-       0,     0,     0,   254,   255,   256,   257,     0,     0,   258,
-     259,   260,     0,     0,   261,     0,     0,     0,     0,   262,
-     263,     0,     0,     0,   264,     0,     0,     0,   265,   266,
-       0,   267,   268,     0,     0,     0,   269,     0,     0,   270,
-     271,     0,     0,   272,     0,     0,   273,   274,     0,     0,
-       0,     0,     0,   275,   276,     0,   277,     0,   278,     0,
-     279,   280,     0,     0,     0,     0,     0,     0,     0,   281,
-       0,   282,   283,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,     0,   299,
-     300,   301,     0,   302,   303,   304,   305,     0,   306,   307,
-       0,     0,     0,     0,   308,   309,   310,   311,   312,   313,
-       0,     0,   314,   315,     0,   316,     0,   317,     0,   318,
-     319,   320,   321,   322,   323,   324,   325,   326,     0,     0,
-     327,   328,     0,     0,   329,   330,   331,   332,     0,     0,
-       0,   333,   334,     0,     0,     0,   335,     0,   336,   337,
-     338,     0,   339,   340,   341,     0,   342,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   343,   344,   345,     0,
-     346,   347,     0,   348,   349,   350,   351,   352,   353,   354,
-     355,   356,   357,     0,     0,   358,   359,   360,     0,   361,
-       0,   362,   363,   364,   365,   366,     0,   367,   368,   369,
-       0,     0,   370,     0,     0,     0,   371,   372,   373,   374,
-     375,     0,     0,   376,   377,   378,   379,   380,     0,   381,
-     382,     0,   383,   384,   385,     0,     0,   386,     0,   387,
-       0,   388,   389,     0,   390,   391,   392,     0,   393,     0,
-       0,   394,   395,   396,   397,   398,   399,   400,   401,   402,
-     403,   404,     0,   405,   406,     0,     0,     0,   407,   408,
-     409,   410,     0,     0,     0,   411,     0,     0,     0,   412,
-       0,   413,   414,   415,   416,     0,   417,   418,   419,   420,
-     421,     0,     0,     0,     0,     0,   422,   423,   424,     0,
-     425,   426,     0,   427,     0,     0,   428,     0,     0,   429,
-     430,   431,   432,   433,   434,     0,     0,   435,   436,     0,
-     437,   438,   439,   440,   441,   442,     0,     0,   443,   444,
-     445,   446,     0,   447,   448,     0,     0,   449,   450,   451,
-     452,     0,     0,   453,   454,     0,   455,   456,   457,   458,
-       0,     0,     0,     0,     0,   459,   460,     0,     0,     0,
-     461,   462,   463,   464,     0,   465,   466,     0,   467,   468,
-       0,   469,   470,     0,     0,   471,     0,     0,   472,     0,
-     473,     0,   474,   475,     0,     0,     0,     0,     0,     0,
-     476,     0,     0,   477,     0,     0,     0,   478,   479,   480,
-     481,   482,     0,     0,     0,     0,     0,     0,   483,   484,
-       0,   485,   486,   487,     0,     0,   488,     0,     0,     0,
-     137,     0,   138,   139,   140,   141,   142,     0,  4509,   143,
-       0,     0,     0,   144,  4510,   768,   145,     0,   146,   147,
-     148,   149,   150,   151,     0,   152,     0,     0,     0,   153,
-       0,     0,     0,   154,     0,     0,   155,   156,   157,     0,
-     158,     0,   159,   160,     0,     0,   161,     0,     0,   162,
-     163,     0,   164,   165,     0,   166,     0,   167,   168,   169,
-     170,   171,   172,     0,   173,   174,     0,   175,   176,   177,
-     178,   179,   180,   181,   182,   183,     0,   184,   185,     0,
-     186,   187,   188,   189,   190,     0,     0,     0,   191,     0,
-       0,   192,     0,   193,     0,     0,   194,     0,     0,     0,
-     195,   196,   197,     0,     0,   198,     0,     0,     0,     0,
-     199,   200,     0,     0,     0,     0,   201,   202,     0,   203,
-       0,     0,     0,   204,     0,   205,   206,   207,   208,   209,
-       0,     0,     0,   210,     0,     0,   211,   212,   213,     0,
-       0,     0,   214,     0,   215,   216,     0,   217,   218,   219,
-       0,     0,   220,   221,     0,   222,   223,   224,   225,   226,
-     227,     0,     0,   228,   229,   230,   231,   232,     0,     0,
-     233,   234,     0,   235,   236,   237,     0,     0,   238,     0,
-       0,     0,   239,   240,     0,   241,     0,   242,     0,   243,
-     244,   245,   246,     0,   247,     0,   248,     0,     0,     0,
-     249,   250,     0,   251,     0,     0,   252,   253,     0,     0,
-       0,   254,   255,   256,   257,     0,     0,   258,   259,   260,
-       0,     0,   261,     0,     0,     0,     0,   262,   263,     0,
-       0,     0,   264,     0,     0,     0,   265,   266,     0,   267,
-     268,     0,     0,     0,   269,     0,     0,   270,   271,     0,
-       0,   272,     0,     0,   273,   274,     0,     0,     0,     0,
-       0,   275,   276,     0,   277,     0,   278,     0,   279,   280,
-       0,     0,     0,     0,     0,     0,     0,   281,     0,   282,
-     283,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,     0,   299,   300,   301,
-       0,   302,   303,   304,   305,     0,   306,   307,     0,     0,
-       0,     0,   308,   309,   310,   311,   312,   313,     0,     0,
-     314,   315,     0,   316,     0,   317,     0,   318,   319,   320,
-     321,   322,   323,   324,   325,   326,     0,     0,   327,   328,
-       0,     0,   329,   330,   331,   332,     0,     0,     0,   333,
-     334,     0,     0,     0,   335,     0,   336,   337,   338,     0,
-     339,   340,   341,     0,   342,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   343,   344,   345,     0,   346,   347,
-       0,   348,   349,   350,   351,   352,   353,   354,   355,   356,
-     357,     0,     0,   358,   359,   360,     0,   361,     0,   362,
-     363,   364,   365,   366,     0,   367,   368,   369,     0,     0,
-     370,     0,     0,     0,   371,   372,   373,   374,   375,     0,
-       0,   376,   377,   378,   379,   380,     0,   381,   382,     0,
-     383,   384,   385,     0,     0,   386,     0,   387,     0,   388,
-     389,     0,   390,   391,   392,     0,   393,     0,     0,   394,
-     395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
-       0,   405,   406,     0,     0,     0,   407,   408,   409,   410,
-       0,     0,     0,   411,     0,     0,     0,   412,     0,   413,
-     414,   415,   416,     0,   417,   418,   419,   420,   421,     0,
-       0,     0,     0,     0,   422,   423,   424,     0,   425,   426,
-       0,   427,     0,     0,   428,     0,     0,   429,   430,   431,
-     432,   433,   434,     0,     0,   435,   436,     0,   437,   438,
-     439,   440,   441,   442,     0,     0,   443,   444,   445,   446,
-       0,   447,   448,     0,     0,   449,   450,   451,   452,     0,
-       0,   453,   454,     0,   455,   456,   457,   458,     0,     0,
-       0,     0,     0,   459,   460,     0,     0,     0,   461,   462,
-     463,   464,     0,   465,   466,     0,   467,   468,     0,   469,
-     470,     0,     0,   471,     0,     0,   472,     0,   473,     0,
-     474,   475,     0,     0,     0,     0,     0,     0,   476,     0,
-       0,   477,     0,     0,     0,   478,   479,   480,   481,   482,
-       0,     0,     0,     0,     0,     0,   483,   484,     0,   485,
-     486,   487,     0,     0,   488,     0,     0,     0,   137,     0,
-     138,   139,   140,   141,   142,  1087,     0,   143,     0,     0,
-       0,   144,     0,   768,   145,     0,   146,   147,   148,   149,
-     150,   151,     0,   152,     0,     0,     0,   153,     0,     0,
-       0,   154,     0,     0,   155,   156,   157,     0,   158,     0,
-     159,   160,     0,     0,   161,     0,     0,   162,   163,     0,
-     164,   165,     0,   166,     0,   167,   168,   169,   170,   171,
-     172,     0,   173,   174,     0,   175,   176,   177,   178,   179,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,   189,   190,     0,     0,     0,   191,     0,     0,   192,
-       0,   193,     0,     0,   194,     0,     0,     0,   195,   196,
-     197,     0,     0,   198,     0,     0,     0,     0,   199,   200,
-       0,     0,     0,     0,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,   210,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,   215,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,   227,     0,
-       0,   228,   229,   230,   231,   232,     0,     0,   233,   234,
-       0,   235,   236,   237,     0,     0,   238,     0,     0,     0,
-     239,   240,     0,   241,     0,   242,     0,   243,   244,   245,
-     246,     0,   247,     0,   248,     0,     0,     0,   249,   250,
-       0,   251,     0,     0,   252,   253,     0,     0,     0,   254,
-     255,   256,   257,     0,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,     0,   262,   263,     0,  1299,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,   270,   271,     0,     0,   272,
-       0,     0,   273,   274,     0,     0,     0,     0,     0,   275,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-       0,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,     0,   302,
-     303,   304,   305,     0,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   312,   313,     0,     0,   314,   315,
-       0,   316,     0,   317,     0,   318,   319,   320,   321,   322,
-     323,   324,   325,   326,     0,     0,   327,   328,     0,     0,
-     329,   330,   331,   332,     0,     0,     0,   333,   334,     0,
-       0,     0,   335,     0,   336,   337,   338,     0,   339,   340,
-     341,     0,   342,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   343,   344,   345,     0,   346,   347,     0,   348,
-     349,   350,   351,   352,   353,   354,   355,   356,   357,     0,
-       0,   358,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   367,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,   382,     0,   383,   384,
-     385,     0,     0,   386,     0,   387,     0,   388,   389,     0,
-     390,   391,   392,     0,   393,     0,     0,   394,   395,   396,
-     397,   398,   399,   400,   401,   402,   403,   404,     0,   405,
-     406,     0,     0,     0,   407,   408,   409,   410,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,   413,   414,   415,
-     416,     0,   417,   418,   419,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,   430,   431,   432,   433,
-     434,     0,     0,   435,   436,     0,   437,   438,   439,   440,
-     441,   442,     0,     0,   443,   444,   445,   446,     0,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,     0,   453,
-     454,     0,   455,   456,   457,   458,     0,     0,     0,     0,
-       0,   459,   460,     0,     0,     0,   461,   462,   463,   464,
-       0,   465,   466,     0,   467,   468,     0,   469,   470,     0,
-       0,   471,     0,     0,   472,     0,   473,     0,   474,   475,
-       0,     0,     0,     0,     0,     0,   476,     0,     0,   477,
-       0,     0,     0,   478,   479,   480,   481,   482,     0,     0,
-       0,     0,     0,     0,   483,   484,     0,   485,   486,   487,
-       0,     0,   488,     0,   137,     0,   138,   139,   140,   141,
-     142,     0,     0,   143,     0,     0,     0,   144,     0,     0,
-     145,   538,   146,   147,   148,   149,   150,   151,     0,   152,
-       0,     0,     0,   153,     0,     0,     0,   154,     0,     0,
-     155,   156,   157,     0,   158,     0,   159,   160,     0,     0,
-     161,     0,     0,   162,   163,     0,   164,   165,     0,   166,
-       0,   167,   168,   169,   170,   171,   172,     0,   173,   174,
-       0,   175,   176,   177,   178,   179,   180,   181,   182,   183,
-       0,   184,   185,     0,   186,   187,   188,   189,   190,     0,
-       0,     0,   191,     0,     0,   192,     0,   193,     0,     0,
-     194,     0,     0,     0,   195,   196,   197,     0,     0,   198,
-       0,     0,     0,     0,   199,   200,     0,     0,     0,     0,
-     201,   202,     0,   203,     0,     0,     0,   204,     0,   205,
-     206,   207,   208,   209,     0,     0,     0,   210,     0,     0,
-     211,   212,   213,     0,     0,     0,   214,     0,   215,   216,
-       0,   217,   218,   219,     0,     0,   220,   221,     0,   222,
-     223,   224,   225,   226,   227,     0,     0,   228,   229,   230,
-     231,   232,     0,     0,   233,   234,     0,   235,   236,   237,
-       0,     0,   238,     0,     0,     0,   239,   240,     0,   241,
-       0,   242,     0,   243,   244,   245,   246,     0,   247,     0,
-     248,     0,     0,     0,   249,   250,     0,   251,     0,     0,
-     252,   253,     0,     0,     0,   254,   255,   256,   257,     0,
-       0,   258,   259,   260,     0,     0,   261,     0,     0,     0,
-       0,   262,   263,     0,     0,     0,   264,     0,     0,     0,
-     265,   266,     0,   267,   268,     0,     0,     0,   269,     0,
-       0,   270,   271,     0,     0,   272,     0,     0,   273,   274,
-       0,     0,     0,     0,     0,   275,   276,     0,   277,     0,
-     278,     0,   279,   280,     0,     0,     0,     0,     0,     0,
-       0,   281,     0,   282,   283,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,     0,   302,   303,   304,   305,     0,
-     306,   307,     0,     0,     0,     0,   308,   309,   310,   311,
-     312,   313,     0,     0,   314,   315,     0,   316,     0,   317,
-       0,   318,   319,   320,   321,   322,   323,   324,   325,   326,
-       0,     0,   327,   328,     0,     0,   329,   330,   331,   332,
-       0,     0,     0,   333,   334,     0,     0,     0,   335,     0,
-     336,   337,   338,     0,   339,   340,   341,     0,   342,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   343,   344,
-     345,     0,   346,   347,     0,   348,   349,   350,   351,   352,
-     353,   354,   355,   356,   357,     0,     0,   358,   359,   360,
-       0,   361,     0,   362,   363,   364,   365,   366,     0,   367,
-     368,   369,     0,     0,   370,     0,     0,     0,   371,   372,
-     373,   374,   375,     0,     0,   376,   377,   378,   379,   380,
-       0,   381,   382,     0,   383,   384,   385,     0,     0,   386,
-       0,   387,     0,   388,   389,     0,   390,   391,   392,     0,
-     393,     0,     0,   394,   395,   396,   397,   398,   399,   400,
-     401,   402,   403,   404,     0,   405,   406,     0,     0,     0,
-     407,   408,   409,   410,     0,     0,     0,   411,     0,     0,
-       0,   412,     0,   413,   414,   415,   416,     0,   417,   418,
-     419,   420,   421,     0,     0,     0,     0,     0,   422,   423,
-     424,     0,   425,   426,     0,   427,     0,     0,   428,     0,
-       0,   429,   430,   431,   432,   433,   434,     0,     0,   435,
-     436,     0,   437,   438,   439,   440,   441,   442,     0,     0,
-     443,   444,   445,   446,     0,   447,   448,     0,     0,   449,
-     450,   451,   452,     0,     0,   453,   454,     0,   455,   456,
-     457,   458,     0,     0,     0,     0,     0,   459,   460,     0,
-       0,     0,   461,   462,   463,   464,     0,   465,   466,     0,
-     467,   468,     0,   469,   470,     0,     0,   471,     0,     0,
-     472,     0,   473,     0,   474,   475,     0,     0,     0,     0,
-       0,     0,   476,     0,     0,   477,     0,     0,     0,   478,
-     479,   480,   481,   482,     0,     0,     0,     0,     0,     0,
-     483,   484,     0,   485,   486,   487,     0,     0,   488,     0,
-       0,     0,   137,     0,   138,   139,   140,   141,   142,  2578,
-       0,   143,     0,     0,     0,   144,     0,  2579,   145,     0,
-     146,   147,   148,   149,   150,   151,     0,   152,     0,     0,
-       0,   153,     0,     0,     0,   154,     0,     0,   155,   156,
-     157,     0,   158,     0,   159,   160,     0,     0,   161,     0,
-       0,   162,   163,     0,   164,   165,     0,   166,     0,   167,
-     168,   169,   170,   171,   172,     0,   173,   174,     0,   175,
-     176,   177,   178,   179,   180,   181,   182,   183,     0,   184,
-     185,     0,   186,   187,   188,   189,   190,     0,     0,     0,
-     191,     0,     0,   192,     0,   193,     0,     0,   194,     0,
-       0,     0,   195,   196,   197,     0,     0,   198,     0,     0,
-       0,     0,   199,   200,     0,     0,     0,     0,   201,   202,
-       0,   203,     0,     0,     0,   204,     0,   205,   206,   207,
-     208,   209,     0,     0,     0,   210,     0,     0,   211,   212,
-     213,     0,     0,     0,   214,     0,   215,   216,     0,   217,
-     218,   219,     0,     0,   220,   221,     0,   222,   223,   224,
-     225,   226,   227,     0,     0,   228,   229,   230,   231,   232,
-       0,     0,   233,   234,     0,   235,   236,   237,     0,     0,
-     238,     0,     0,     0,   239,   240,     0,   241,     0,   242,
-       0,   243,   244,   245,   246,     0,   247,     0,   248,     0,
-       0,     0,   249,   250,     0,   251,     0,     0,   252,   253,
-       0,     0,     0,   254,   255,   256,   257,     0,     0,   258,
-     259,   260,     0,     0,   261,     0,     0,     0,     0,   262,
-     263,     0,     0,     0,   264,     0,     0,     0,   265,   266,
-       0,   267,   268,     0,     0,     0,   269,     0,     0,   270,
-     271,     0,     0,   272,     0,     0,   273,   274,     0,     0,
-       0,     0,     0,   275,   276,     0,   277,     0,   278,     0,
-     279,   280,     0,     0,     0,     0,     0,     0,     0,   281,
-       0,   282,   283,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,     0,   299,
-     300,   301,     0,   302,   303,   304,   305,     0,   306,   307,
-       0,     0,     0,     0,   308,   309,   310,   311,   312,   313,
-       0,     0,   314,   315,     0,   316,     0,   317,     0,   318,
-     319,   320,   321,   322,   323,   324,   325,   326,     0,     0,
-     327,   328,     0,     0,   329,   330,   331,   332,     0,     0,
-       0,   333,   334,     0,     0,     0,   335,     0,   336,   337,
-     338,     0,   339,   340,   341,     0,   342,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   343,   344,   345,     0,
-     346,   347,     0,   348,   349,   350,   351,   352,   353,   354,
-     355,   356,   357,     0,     0,   358,   359,   360,     0,   361,
-       0,   362,   363,   364,   365,   366,     0,   367,   368,   369,
-       0,     0,   370,     0,     0,     0,   371,   372,   373,   374,
-     375,     0,     0,   376,   377,   378,   379,   380,     0,   381,
-     382,     0,   383,   384,   385,     0,     0,   386,     0,   387,
-       0,   388,   389,     0,   390,   391,   392,     0,   393,     0,
-       0,   394,   395,   396,   397,   398,   399,   400,   401,   402,
-     403,   404,     0,   405,   406,     0,     0,     0,   407,   408,
-     409,   410,     0,     0,     0,   411,     0,     0,     0,   412,
-       0,   413,   414,   415,   416,     0,   417,   418,   419,   420,
-     421,     0,     0,     0,     0,     0,   422,   423,   424,     0,
-     425,   426,     0,   427,     0,     0,   428,     0,     0,   429,
-     430,   431,   432,   433,   434,     0,     0,   435,   436,     0,
-     437,   438,   439,   440,   441,   442,     0,     0,   443,   444,
-     445,   446,     0,   447,   448,     0,     0,   449,   450,   451,
-     452,     0,     0,   453,   454,     0,   455,   456,   457,   458,
-       0,     0,     0,     0,     0,   459,   460,     0,     0,     0,
-     461,   462,   463,   464,     0,   465,   466,     0,   467,   468,
-       0,   469,   470,     0,     0,   471,     0,     0,   472,     0,
-     473,     0,   474,   475,     0,     0,     0,     0,     0,     0,
-     476,     0,     0,   477,     0,     0,     0,   478,   479,   480,
-     481,   482,     0,     0,     0,     0,     0,     0,   483,   484,
-       0,   485,   486,   487,     0,     0,   488,     0,     0,     0,
-       0,   137,  2788,   138,   139,   140,   141,   142,     0,     0,
-     143,     0,     0,     0,   144,   538,     0,   145,     0,   146,
-     147,   148,   149,   150,   151,     0,   152,     0,     0,     0,
-     153,     0,     0,     0,   154,     0,     0,   155,   156,   157,
-       0,   158,     0,   159,   160,     0,     0,   161,     0,     0,
-     162,   163,     0,   164,   165,     0,   166,     0,   167,   168,
-     169,   170,   171,   172,     0,   173,   174,     0,   175,   176,
-     177,   178,   179,   180,   181,   182,   183,     0,   184,   185,
-       0,   186,   187,   188,   189,   190,     0,     0,     0,   191,
-       0,     0,   192,     0,   193,     0,     0,   194,     0,     0,
-       0,   195,   196,   197,     0,     0,   198,     0,     0,     0,
-       0,   199,   200,     0,     0,     0,     0,   201,   202,     0,
-     203,     0,     0,     0,   204,     0,   205,   206,   207,   208,
-     209,     0,     0,     0,   210,     0,     0,   211,   212,   213,
-       0,     0,     0,   214,     0,   215,   216,     0,   217,   218,
-     219,     0,     0,   220,   221,     0,   222,   223,   224,   225,
-     226,   227,     0,     0,   228,   229,   230,   231,   232,     0,
-       0,   233,   234,     0,   235,   236,   237,     0,     0,   238,
-       0,     0,     0,   239,   240,     0,   241,     0,   242,     0,
-     243,   244,   245,   246,     0,   247,     0,   248,     0,     0,
-       0,   249,   250,     0,   251,     0,     0,   252,   253,     0,
-       0,     0,   254,   255,   256,   257,     0,     0,   258,   259,
-     260,     0,     0,   261,     0,     0,     0,     0,   262,   263,
-       0,     0,     0,   264,     0,     0,     0,   265,   266,     0,
-     267,   268,     0,     0,     0,   269,     0,     0,   270,   271,
-       0,     0,   272,     0,     0,   273,   274,     0,     0,     0,
-       0,     0,   275,   276,     0,   277,     0,   278,     0,   279,
-     280,     0,     0,     0,     0,     0,     0,     0,   281,     0,
-     282,   283,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,     0,   299,   300,
-     301,     0,   302,   303,   304,   305,     0,   306,   307,     0,
-       0,     0,     0,   308,   309,   310,   311,   312,   313,     0,
-       0,   314,   315,     0,   316,     0,   317,     0,   318,   319,
-     320,   321,   322,   323,   324,   325,   326,     0,     0,   327,
-     328,     0,     0,   329,   330,   331,   332,     0,     0,     0,
-     333,   334,     0,     0,     0,   335,     0,   336,   337,   338,
-       0,   339,   340,   341,     0,   342,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   343,   344,   345,     0,   346,
-     347,     0,   348,   349,   350,   351,   352,   353,   354,   355,
-     356,   357,     0,     0,   358,   359,   360,     0,   361,     0,
-     362,   363,   364,   365,   366,     0,   367,   368,   369,     0,
-       0,   370,     0,     0,     0,   371,   372,   373,   374,   375,
-       0,     0,   376,   377,   378,   379,   380,     0,   381,   382,
-       0,   383,   384,   385,     0,     0,   386,     0,   387,     0,
-     388,   389,     0,   390,   391,   392,     0,   393,     0,     0,
-     394,   395,   396,   397,   398,   399,   400,   401,   402,   403,
-     404,     0,   405,   406,     0,     0,     0,   407,   408,   409,
-     410,     0,     0,     0,   411,     0,     0,     0,   412,     0,
-     413,   414,   415,   416,     0,   417,   418,   419,   420,   421,
-       0,     0,     0,     0,     0,   422,   423,   424,     0,   425,
-     426,     0,   427,     0,     0,   428,     0,     0,   429,   430,
-     431,   432,   433,   434,     0,     0,   435,   436,     0,   437,
-     438,   439,   440,   441,   442,     0,     0,   443,   444,   445,
-     446,     0,   447,   448,     0,     0,   449,   450,   451,   452,
-       0,     0,   453,   454,     0,   455,   456,   457,   458,     0,
-       0,     0,     0,     0,   459,   460,     0,     0,     0,   461,
-     462,   463,   464,     0,   465,   466,     0,   467,   468,     0,
-     469,   470,     0,     0,   471,     0,     0,   472,     0,   473,
-       0,   474,   475,     0,     0,     0,     0,     0,     0,   476,
-       0,     0,   477,     0,     0,     0,   478,   479,   480,   481,
-     482,     0,     0,     0,     0,     0,     0,   483,   484,     0,
-     485,   486,   487,     0,     0,   488,     0,     0,     0,   137,
-       0,   138,   139,   140,   141,   142,     0,     0,   143,     0,
-       0,     0,   144,  4510,   768,   145,     0,   146,   147,   148,
-     149,   150,   151,     0,   152,     0,     0,     0,   153,     0,
-       0,     0,   154,     0,     0,   155,   156,   157,     0,   158,
-       0,   159,   160,     0,     0,   161,     0,     0,   162,   163,
-       0,   164,   165,     0,   166,     0,   167,   168,   169,   170,
-     171,   172,     0,   173,   174,     0,   175,   176,   177,   178,
-     179,   180,   181,   182,   183,     0,   184,   185,     0,   186,
-     187,   188,   189,   190,     0,     0,     0,   191,     0,     0,
-     192,     0,   193,     0,     0,   194,     0,     0,     0,   195,
-     196,   197,     0,     0,   198,     0,     0,     0,     0,   199,
-     200,     0,     0,     0,     0,   201,   202,     0,   203,     0,
-       0,     0,   204,     0,   205,   206,   207,   208,   209,     0,
-       0,     0,   210,     0,     0,   211,   212,   213,     0,     0,
-       0,   214,     0,   215,   216,     0,   217,   218,   219,     0,
-       0,   220,   221,     0,   222,   223,   224,   225,   226,   227,
-       0,     0,   228,   229,   230,   231,   232,     0,     0,   233,
-     234,     0,   235,   236,   237,     0,     0,   238,     0,     0,
-       0,   239,   240,     0,   241,     0,   242,     0,   243,   244,
-     245,   246,     0,   247,     0,   248,     0,     0,     0,   249,
-     250,     0,   251,     0,     0,   252,   253,     0,     0,     0,
-     254,   255,   256,   257,     0,     0,   258,   259,   260,     0,
-       0,   261,     0,     0,     0,     0,   262,   263,     0,     0,
-       0,   264,     0,     0,     0,   265,   266,     0,   267,   268,
-       0,     0,     0,   269,     0,     0,   270,   271,     0,     0,
-     272,     0,     0,   273,   274,     0,     0,     0,     0,     0,
-     275,   276,     0,   277,     0,   278,     0,   279,   280,     0,
-       0,     0,     0,     0,     0,     0,   281,     0,   282,   283,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,     0,   299,   300,   301,     0,
-     302,   303,   304,   305,     0,   306,   307,     0,     0,     0,
-       0,   308,   309,   310,   311,   312,   313,     0,     0,   314,
-     315,     0,   316,     0,   317,     0,   318,   319,   320,   321,
-     322,   323,   324,   325,   326,     0,     0,   327,   328,     0,
-       0,   329,   330,   331,   332,     0,     0,     0,   333,   334,
-       0,     0,     0,   335,     0,   336,   337,   338,     0,   339,
-     340,   341,     0,   342,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   343,   344,   345,     0,   346,   347,     0,
-     348,   349,   350,   351,   352,   353,   354,   355,   356,   357,
-       0,     0,   358,   359,   360,     0,   361,     0,   362,   363,
-     364,   365,   366,     0,   367,   368,   369,     0,     0,   370,
-       0,     0,     0,   371,   372,   373,   374,   375,     0,     0,
-     376,   377,   378,   379,   380,     0,   381,   382,     0,   383,
-     384,   385,     0,     0,   386,     0,   387,     0,   388,   389,
-       0,   390,   391,   392,     0,   393,     0,     0,   394,   395,
-     396,   397,   398,   399,   400,   401,   402,   403,   404,     0,
-     405,   406,     0,     0,     0,   407,   408,   409,   410,     0,
-       0,     0,   411,     0,     0,     0,   412,     0,   413,   414,
-     415,   416,     0,   417,   418,   419,   420,   421,     0,     0,
-       0,     0,     0,   422,   423,   424,     0,   425,   426,     0,
-     427,     0,     0,   428,     0,     0,   429,   430,   431,   432,
-     433,   434,     0,     0,   435,   436,     0,   437,   438,   439,
-     440,   441,   442,     0,     0,   443,   444,   445,   446,     0,
-     447,   448,     0,     0,   449,   450,   451,   452,     0,     0,
-     453,   454,     0,   455,   456,   457,   458,     0,     0,     0,
-       0,     0,   459,   460,     0,     0,     0,   461,   462,   463,
-     464,     0,   465,   466,     0,   467,   468,     0,   469,   470,
-       0,     0,   471,     0,     0,   472,     0,   473,     0,   474,
-     475,     0,     0,     0,     0,     0,     0,   476,     0,     0,
-     477,     0,     0,     0,   478,   479,   480,   481,   482,     0,
-       0,     0,     0,     0,     0,   483,   484,     0,   485,   486,
-     487,     0,     0,   488,     0,   137,     0,   138,   139,   140,
-     141,   142,     0,     0,   143,     0,     0,     0,   144,     0,
-       0,   145,   538,   146,   147,   148,   149,   150,   151,     0,
-     152,     0,     0,     0,   153,     0,     0,     0,   154,     0,
-       0,   155,   156,   157,     0,   158,     0,   159,   160,     0,
-       0,   161,     0,     0,   162,   163,     0,   164,   165,     0,
-     166,     0,   167,   168,   169,   170,   171,   172,     0,   173,
-     174,     0,   175,   176,   177,   178,   179,   180,   181,   182,
-     183,     0,   184,   185,     0,   186,   187,   188,   189,   190,
-       0,     0,     0,   191,     0,     0,   192,     0,   193,     0,
-       0,   194,     0,     0,     0,   195,   196,   197,     0,     0,
-     198,     0,     0,     0,     0,   199,   200,     0,     0,     0,
-       0,   201,   202,     0,   203,     0,     0,     0,   204,     0,
-     205,   206,   207,   208,   209,     0,     0,     0,   210,     0,
-       0,   211,   212,   213,     0,     0,     0,   214,     0,   215,
-     216,     0,   217,   218,   219,     0,     0,   220,   221,     0,
-     222,   223,   224,   225,   226,   227,     0,     0,   228,   229,
-     230,   601,   232,     0,     0,   233,   234,     0,   235,   236,
-     237,     0,     0,   238,     0,     0,     0,   602,   240,     0,
-     241,     0,   242,     0,   243,   244,   245,   246,     0,   247,
-       0,   248,     0,     0,     0,   249,   250,     0,   251,     0,
-       0,   252,   253,     0,     0,     0,   254,   255,   256,   257,
-       0,     0,   258,   259,   260,     0,     0,   261,     0,     0,
-       0,     0,   262,   263,     0,     0,     0,   264,     0,     0,
-       0,   265,   266,     0,   267,   268,     0,     0,     0,   269,
-       0,     0,   270,   271,     0,     0,   272,     0,     0,   273,
-     274,     0,     0,     0,     0,     0,   275,   276,     0,   277,
-       0,   278,     0,   279,   280,     0,     0,     0,     0,     0,
-       0,     0,   281,     0,   282,   283,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,     0,   299,   300,   301,     0,   302,   303,   304,   305,
-       0,   306,   307,     0,     0,     0,     0,   308,   309,   310,
-     311,   312,   313,     0,     0,   314,   315,     0,   316,     0,
-     317,     0,   318,   319,   320,   321,   322,   323,   324,   325,
-     326,     0,     0,   327,   328,     0,     0,   329,   330,   331,
-     332,     0,     0,     0,   333,   334,     0,     0,     0,   335,
-       0,   336,   337,   338,     0,   339,   340,   341,     0,   342,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,   343,
-     344,   345,     0,   346,   347,     0,   603,   349,   350,   351,
-     352,   353,   354,   355,   356,   357,     0,     0,   358,   359,
-     360,     0,   361,     0,   362,   363,   364,   365,   366,     0,
-     367,   368,   369,     0,     0,   370,     0,     0,     0,   371,
-     372,   373,   374,   375,     0,     0,   376,   377,   378,   379,
-     380,     0,   381,   382,     0,   383,   384,   385,     0,     0,
-     386,     0,   387,     0,   388,   389,     0,   390,   391,   392,
-       0,   393,     0,     0,   394,   395,   396,   397,   398,   399,
-     400,   401,   402,   403,   404,     0,   405,   406,     0,     0,
-       0,   407,   408,   409,   410,     0,     0,     0,   411,     0,
-       0,     0,   412,     0,   413,   414,   415,   416,     0,   417,
-     418,   419,   420,   421,     0,     0,     0,     0,     0,   422,
-     423,   424,     0,   425,   426,     0,   427,     0,     0,   428,
-       0,     0,   429,   430,   431,   432,   433,   434,     0,     0,
-     435,   436,     0,   437,   438,   439,   440,   441,   442,     0,
-       0,   443,   444,   445,   446,     0,   447,   448,     0,     0,
-     449,   450,   451,   452,     0,     0,   453,   454,     0,   455,
-     456,   457,   458,     0,     0,     0,     0,     0,   459,   460,
-       0,     0,     0,   461,   462,   463,   464,     0,   465,   466,
-       0,   467,   468,     0,   469,   470,     0,     0,   471,     0,
-       0,   472,     0,   473,     0,   474,   475,     0,     0,     0,
-       0,     0,     0,   476,     0,     0,   477,     0,     0,     0,
-     478,   479,   480,   481,   482,     0,     0,     0,     0,     0,
-       0,   483,   484,     0,   485,   486,   487,     0,     0,   488,
-       0,   137,     0,   138,   139,   140,   141,   142,     0,     0,
-     143,     0,     0,     0,   144,     0,     0,   145,   538,   146,
-     147,   148,   149,   150,   151,     0,   152,     0,     0,     0,
-     153,     0,     0,     0,   154,     0,     0,   155,   156,   157,
-       0,   158,     0,   159,   160,     0,     0,   161,     0,     0,
-     162,   163,     0,   164,   165,     0,   166,     0,   167,   168,
-     169,   170,   171,   172,     0,   173,   174,     0,   175,   176,
-     177,   178,   179,   180,   181,   182,   183,     0,   184,   185,
-       0,   186,   187,   188,   189,   190,     0,     0,     0,   191,
-       0,     0,   192,     0,   193,     0,     0,   194,     0,     0,
-       0,   195,   196,   197,     0,     0,   198,     0,     0,     0,
-       0,   199,   200,     0,     0,     0,     0,   201,   202,     0,
-     203,     0,     0,     0,   204,     0,   205,   206,   207,   208,
-     209,     0,     0,     0,   210,     0,     0,   211,   212,   213,
-       0,     0,     0,   214,     0,   215,   216,     0,   217,   218,
-     219,     0,     0,   220,   221,     0,   222,   223,   224,   225,
-     226,   227,     0,     0,   228,   229,   230,   231,   232,     0,
-       0,   233,   234,     0,   235,   236,   237,     0,     0,   238,
-       0,     0,     0,   239,   240,     0,   241,     0,   242,     0,
-     243,   244,   245,   246,     0,   247,     0,   248,     0,     0,
-       0,   249,   250,     0,   251,     0,     0,   252,   253,     0,
-       0,     0,   254,   255,   256,   257,     0,     0,   258,   259,
-     260,     0,     0,   261,     0,     0,     0,     0,   262,   263,
-       0,     0,     0,   264,     0,     0,     0,   265,   266,     0,
-     267,   268,     0,     0,     0,   269,     0,     0,   270,   271,
-       0,     0,   272,     0,     0,   273,   274,     0,     0,     0,
-       0,     0,   275,   276,     0,   277,     0,   278,     0,   279,
-     280,     0,     0,     0,     0,     0,     0,     0,   281,     0,
-     282,   283,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,     0,   299,   300,
-     301,     0,   302,   303,   304,   305,     0,   306,   307,     0,
-       0,     0,     0,   308,   309,   310,   311,   312,   313,     0,
-       0,   314,   315,     0,   316,     0,   317,     0,   318,   319,
-     320,   321,   322,   323,   324,   325,   326,     0,     0,   327,
-     328,     0,     0,   329,   330,   331,   332,     0,     0,     0,
-     333,   334,     0,     0,     0,   335,     0,   336,   337,   338,
-       0,   339,   340,   341,     0,   342,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   343,   344,   345,     0,   346,
-     347,     0,   348,   349,   350,   351,   352,   353,   354,   355,
-     356,   357,     0,     0,   358,   359,   360,     0,   361,     0,
-     362,   363,   364,   365,   366,     0,   367,   368,   369,     0,
-       0,   370,     0,     0,     0,   371,   372,   373,   374,   375,
-       0,     0,   376,   377,   378,   379,   380,     0,   381,   382,
-       0,   383,   384,   385,     0,     0,   386,     0,   387,     0,
-     388,   389,     0,   390,   391,   392,     0,   393,     0,     0,
-     394,   395,   396,   397,   398,   399,   400,   401,   402,   403,
-     404,     0,   405,   406,     0,     0,     0,   407,   408,   409,
-     410,     0,     0,     0,   411,     0,     0,     0,   412,     0,
-     413,   414,   415,   416,     0,   417,   418,   419,   420,   421,
-       0,     0,     0,     0,     0,   422,   423,   424,     0,   425,
-     426,     0,   427,     0,     0,   428,     0,     0,   429,   430,
-     431,   432,   433,   434,     0,     0,   435,   436,     0,   437,
-     438,   439,   440,   441,   442,     0,     0,   443,   444,   445,
-     446,     0,   447,   448,     0,     0,   449,   450,   451,   452,
-       0,     0,   453,   454,     0,   455,   456,   457,   458,     0,
-       0,     0,     0,     0,   459,   460,     0,     0,     0,   461,
-     462,   463,   464,     0,   465,   466,     0,   467,   468,     0,
-     469,   470,     0,     0,   471,     0,     0,   472,     0,   473,
-       0,   474,   475,     0,     0,     0,     0,     0,     0,   476,
-       0,     0,   477,     0,     0,     0,   478,   479,   480,   481,
-     482,     0,     0,     0,     0,     0,     0,   483,   484,     0,
-     485,   486,   487,     0,     0,   488,     0,   137,     0,   138,
-     139,   140,   141,   142,     0,     0,   143,     0,     0,     0,
-     144,     0,     0,   145,   768,   146,   147,   148,   149,   150,
-     151,     0,   152,     0,     0,     0,   153,     0,     0,     0,
-     154,     0,     0,   155,   156,   157,     0,   158,     0,   159,
-     160,     0,     0,   161,     0,     0,   162,   163,     0,   164,
-     165,     0,   166,     0,   167,   168,   169,   170,   171,   172,
-       0,   173,   174,     0,   175,   176,   177,   178,   179,   180,
-     181,   182,   183,     0,   184,   185,     0,   186,   187,   188,
-     189,   190,     0,     0,     0,   191,     0,     0,   192,     0,
-     193,     0,     0,   194,     0,     0,     0,   195,   196,   197,
-       0,     0,   198,     0,     0,     0,     0,   199,   200,     0,
-       0,     0,     0,   201,   202,     0,   203,     0,     0,     0,
-     204,     0,   205,   206,   207,   208,   209,     0,     0,     0,
-     210,     0,     0,   211,   212,   213,     0,     0,     0,   214,
-       0,   215,   216,     0,   217,   218,   219,     0,     0,   220,
-     221,     0,   222,   223,   224,   225,   226,   227,     0,     0,
-     228,   229,   230,   231,   232,     0,     0,   233,   234,     0,
-     235,   236,   237,     0,     0,   238,     0,     0,     0,   239,
-     240,     0,   241,     0,   242,     0,   243,   244,   245,   246,
-       0,   247,     0,   248,     0,     0,     0,   249,   250,     0,
-     251,     0,     0,   252,   253,     0,     0,     0,   254,   255,
-     256,   257,     0,     0,   258,   259,   260,     0,     0,   261,
-       0,     0,     0,     0,   262,   263,     0,     0,     0,   264,
-       0,     0,     0,   265,   266,     0,   267,   268,     0,     0,
-       0,   269,     0,     0,   270,   271,     0,     0,   272,     0,
-       0,   273,   274,     0,     0,     0,     0,     0,   275,   276,
-       0,   277,     0,   278,     0,   279,   280,     0,     0,     0,
-       0,     0,     0,     0,   281,     0,   282,   283,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,     0,   299,   300,   301,     0,   302,   303,
-     304,   305,     0,   306,   307,     0,     0,     0,     0,   308,
-     309,   310,   311,   312,   313,     0,     0,   314,   315,     0,
-     316,     0,   317,     0,   318,   319,   320,   321,   322,   323,
-     324,   325,   326,     0,     0,   327,   328,     0,     0,   329,
-     330,   331,   332,     0,     0,     0,   333,   334,     0,     0,
-       0,   335,     0,   336,   337,   338,     0,   339,   340,   341,
-       0,   342,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   343,   344,   345,     0,   346,   347,     0,   348,   349,
-     350,   351,   352,   353,   354,   355,   356,   357,     0,     0,
-     358,   359,   360,     0,   361,     0,   362,   363,   364,   365,
-     366,     0,   367,   368,   369,     0,     0,   370,     0,     0,
-       0,   371,   372,   373,   374,   375,     0,     0,   376,   377,
-     378,   379,   380,     0,   381,   382,     0,   383,   384,   385,
-       0,     0,   386,     0,   387,     0,   388,   389,     0,   390,
-     391,   392,     0,   393,     0,     0,   394,   395,   396,   397,
-     398,   399,   400,   401,   402,   403,   404,     0,   405,   406,
-       0,     0,     0,   407,   408,   409,   410,     0,     0,     0,
-     411,     0,     0,     0,   412,     0,   413,   414,   415,   416,
-       0,   417,   418,   419,   420,   421,     0,     0,     0,     0,
-       0,   422,   423,   424,     0,   425,   426,     0,   427,     0,
-       0,   428,     0,     0,   429,   430,   431,   432,   433,   434,
-       0,     0,   435,   436,     0,   437,   438,   439,   440,   441,
-     442,     0,     0,   443,   444,   445,   446,     0,   447,   448,
-       0,     0,   449,   450,   451,   452,     0,     0,   453,   454,
-       0,   455,   456,   457,   458,     0,     0,     0,     0,     0,
-     459,   460,     0,     0,     0,   461,   462,   463,   464,     0,
-     465,   466,     0,   467,   468,     0,   469,   470,     0,     0,
-     471,     0,     0,   472,     0,   473,     0,   474,   475,     0,
-       0,     0,     0,     0,     0,   476,     0,     0,   477,     0,
-       0,     0,   478,   479,   480,   481,   482,     0,     0,     0,
-       0,     0,     0,   483,   484,     0,   485,   486,   487,     0,
-       0,   488,     0,   137,     0,   138,   139,   140,   141,   142,
-       0,     0,   143,     0,     0,     0,   144,     0,     0,   145,
-    2579,   146,   147,   148,   149,   150,   151,     0,   152,     0,
-       0,     0,   153,     0,     0,     0,   154,     0,     0,   155,
-     156,   157,     0,   158,     0,   159,   160,     0,     0,   161,
-       0,     0,   162,   163,     0,   164,   868,   869,   166,     0,
-     167,   168,   169,   170,   171,   172,     0,   173,   174,     0,
-     175,   176,   177,   178,   179,   180,   181,   182,   183,     0,
-     184,   185,     0,   186,   187,   188,   189,   190,     0,     0,
-       0,   191,     0,     0,   192,     0,   193,     0,     0,   194,
-       0,     0,     0,   195,   196,   197,     0,     0,   198,     0,
-       0,     0,     0,   199,   200,     0,     0,     0,   870,   201,
-     202,     0,   203,     0,     0,     0,   204,     0,   205,   206,
-     207,   208,   209,     0,     0,     0,   210,     0,     0,   211,
-     212,   213,     0,     0,     0,   214,     0,   215,   216,     0,
-     217,   218,   219,     0,     0,   220,   221,     0,   222,   223,
-     224,   225,   226,   227,     0,     0,   228,   229,   230,   231,
-     232,     0,     0,   233,   234,     0,   235,   236,   237,     0,
-       0,   238,     0,     0,     0,   239,   240,     0,   241,     0,
-     242,     0,   243,   244,   245,   246,     0,   871,     0,   248,
-       0,     0,     0,   249,   250,     0,   251,     0,     0,   252,
-     253,     0,     0,     0,   254,   255,   256,   257,     0,     0,
-     258,   259,   260,     0,     0,   261,     0,     0,     0,     0,
-     262,   263,     0,     0,     0,   264,     0,     0,     0,   265,
-     266,     0,   267,   268,     0,     0,     0,   269,     0,     0,
-     270,   271,     0,     0,   272,     0,     0,   273,   274,     0,
-       0,     0,     0,     0,   275,   276,     0,   872,     0,   278,
-       0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     281,     0,   282,   283,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,     0,
-     299,   300,   301,     0,   302,   303,   304,   305,     0,   306,
-     307,     0,     0,     0,     0,   308,   309,   310,   311,   312,
-     313,     0,     0,   314,   315,     0,   316,     0,   317,     0,
-     318,   319,   320,   321,   322,   323,   873,   325,   326,     0,
-       0,   327,   328,     0,     0,   329,   330,   331,   332,     0,
-       0,     0,   333,   334,     0,     0,     0,   335,     0,   336,
-     337,   338,     0,   339,   340,   341,     0,   342,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   343,   344,   345,
-       0,   346,   347,     0,   348,   349,   874,   351,   352,   353,
-     354,   355,   356,   357,     0,     0,   358,   359,   360,     0,
-     361,     0,   362,   363,   364,   365,   366,     0,   367,   368,
-     369,     0,     0,   370,     0,     0,     0,   371,   372,   373,
-     374,   375,     0,     0,   376,   377,   378,   379,   380,     0,
-     381,   382,     0,   383,   384,   385,     0,     0,   386,     0,
-     387,     0,   388,   389,     0,   390,   391,   392,     0,   393,
-       0,     0,   394,   395,   396,   397,   398,   399,   400,   401,
-     402,   403,   404,     0,   405,   406,     0,     0,     0,   407,
-     408,   875,   410,     0,     0,     0,   411,     0,     0,     0,
-     412,     0,   413,   414,   415,   416,     0,   417,   418,   419,
-     420,   421,     0,     0,     0,     0,     0,   422,   423,   424,
-       0,   425,   426,     0,   427,     0,     0,   428,     0,     0,
-     429,   430,   431,   432,   433,   434,     0,     0,   435,   436,
-       0,   437,   438,   439,   440,   441,   442,     0,     0,   443,
-     444,   445,   446,     0,   447,   448,     0,     0,   449,   450,
-     451,   452,     0,     0,   453,   454,     0,   455,   456,   457,
-     458,     0,     0,     0,     0,     0,   876,   460,     0,     0,
-       0,   461,   462,   463,   464,     0,   465,   466,     0,   467,
-     468,     0,   469,   470,     0,     0,   471,     0,     0,   472,
-       0,   473,     0,   474,   475,     0,     0,     0,     0,     0,
-       0,   476,     0,     0,   477,     0,     0,     0,   478,   479,
-     480,   481,   482,     0,     0,     0,     0,     0,     0,   483,
-     484,     0,   485,   486,   487,     0,     0,   488,   137,     0,
-     138,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,   145,   877,   146,   147,   148,   149,
-     150,   151,     0,   152,     0,     0,     0,   153,     0,     0,
-       0,   154,     0,     0,   155,   156,   157,     0,   158,     0,
-     159,   160,     0,     0,   161,     0,     0,   162,   163,     0,
-     164,   165,     0,   166,     0,   167,   168,   169,   170,   171,
-     172,     0,   173,   174,     0,   175,   176,   177,   178,   179,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,   189,   190,     0,     0,     0,   191,     0,     0,   192,
-       0,   193,     0,     0,   194,     0,     0,     0,   195,   196,
-     197,     0,     0,   198,     0,     0,     0,     0,   199,   200,
-       0,     0,     0,     0,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,   210,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,   215,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,   227,     0,
-       0,   228,   229,   230,   231,   232,     0,     0,   233,   234,
-       0,   235,   236,   237,     0,     0,   238,     0,     0,     0,
-     239,   240,     0,   241,     0,   242,     0,   243,   244,   245,
-     246,     0,   247,     0,   248,     0,     0,     0,   249,   250,
-       0,   251,     0,     0,   252,   253,     0,     0,     0,   254,
-     255,   256,   257,     0,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,     0,   262,   263,     0,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,   270,   271,     0,     0,   272,
-       0,     0,   273,   274,   614,     0,     0,     0,     0,   275,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-       0,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,     0,   302,
-     303,   304,   305,     0,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   312,   313,     0,     0,   314,   315,
-       0,   316,     0,   317,     0,   318,   319,   320,   321,   322,
-     323,   324,   325,   326,     0,     0,   327,   328,     0,     0,
-     329,   330,   331,   332,     0,     0,     0,   333,   334,     0,
-       0,     0,   335,     0,   336,   337,   338,     0,   339,   340,
-     341,     0,   342,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   343,   344,   345,     0,   346,   347,     0,   348,
-     349,   350,   351,   352,   353,   354,   355,   356,   357,     0,
-       0,   358,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   367,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,   382,     0,   383,   384,
-     385,     0,     0,   386,     0,   387,     0,   388,   389,     0,
-     390,   391,   392,     0,   393,     0,     0,   394,   395,   396,
-     397,   398,   399,   400,   401,   402,   403,   404,     0,   405,
-     406,     0,     0,     0,   407,   408,   409,   410,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,   413,   414,   415,
-     416,     0,   417,   418,   419,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,   430,   431,   432,   433,
-     434,     0,     0,   435,   436,     0,   437,   438,   439,   440,
-     441,   442,     0,     0,   443,   444,   445,   446,     0,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,   134,   453,
-     454,     0,   455,   456,   457,   458,     0,     0,     0,     0,
-       0,   459,   460,     0,     0,     0,   461,   462,   463,   464,
-       0,   465,   466,     0,   467,   468,     0,   469,   470,     0,
-       0,   471,     0,     0,   472,     0,   473,     0,   474,   475,
-       0,     0,     0,     0,     0,     0,   476,     0,     0,   477,
-       0,     0,     0,   478,   479,   480,   481,   482,     0,     0,
-       0,     0,     0,     0,   483,   484,     0,   485,   486,   487,
-       0,     0,   488,   137,     0,   138,   139,   140,   141,   142,
-       0,     0,   143,     0,     0,     0,   144,     0,     0,   145,
-    1350,   146,   147,   148,   149,   150,   151,     0,   152,     0,
-       0,     0,   153,     0,     0,     0,   154,     0,     0,   155,
-     156,   157,     0,   158,     0,   159,   160,     0,     0,   161,
-       0,     0,   162,   163,     0,   164,   165,     0,   166,     0,
-     167,   168,   169,   170,   171,   172,     0,   173,   174,     0,
-     175,   176,   177,   178,   179,   180,   181,   182,   183,     0,
-     184,   185,     0,   186,   187,   188,   189,   190,     0,     0,
-       0,   191,     0,     0,   192,     0,   193,     0,     0,   194,
-       0,     0,     0,   195,   196,   197,     0,     0,   198,     0,
-       0,     0,     0,   199,   200,     0,     0,     0,     0,   201,
-     202,     0,   203,     0,     0,     0,   204,     0,   205,   206,
-     207,   208,   209,     0,     0,     0,   210,     0,     0,   211,
-     212,   213,     0,     0,     0,   214,     0,   215,   216,     0,
-     217,   218,   219,     0,     0,   220,   221,     0,   222,   223,
-     224,   225,   226,   227,     0,     0,   228,   229,   230,   231,
-     232,     0,     0,   233,   234,     0,   235,   236,   237,     0,
-       0,   238,     0,     0,     0,   239,   240,     0,   241,     0,
-     242,     0,   243,   244,   245,   246,     0,   247,     0,   248,
-       0,     0,     0,   249,   250,     0,   251,     0,     0,   252,
-     253,     0,     0,     0,   254,   255,   256,   257,     0,     0,
-     258,   259,   260,     0,     0,   261,     0,     0,     0,     0,
-     262,   263,     0,     0,     0,   264,     0,     0,     0,   265,
-     266,     0,   267,   268,     0,     0,     0,   269,     0,     0,
-     270,   271,     0,     0,   272,     0,     0,   273,   274,   614,
-       0,     0,     0,     0,   275,   276,     0,   277,     0,   278,
-       0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     281,     0,   282,   283,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,     0,
-     299,   300,   301,     0,   302,   303,   304,   305,     0,   306,
-     307,     0,     0,     0,     0,   308,   309,   310,   311,   312,
-     313,     0,     0,   314,   315,     0,   316,     0,   317,     0,
-     318,   319,   320,   321,   322,   323,   324,   325,   326,     0,
-       0,   327,   328,     0,     0,   329,   330,   331,   332,     0,
-       0,     0,   333,   334,     0,     0,     0,   335,     0,   336,
-     337,   338,     0,   339,   340,   341,     0,   342,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   343,   344,   345,
-       0,   346,   347,     0,   348,   349,   350,   351,   352,   353,
-     354,   355,   356,   357,     0,     0,   358,   359,   360,     0,
-     361,     0,   362,   363,   364,   365,   366,     0,   367,   368,
-     369,     0,     0,   370,     0,     0,     0,   371,   372,   373,
-     374,   375,     0,     0,   376,   377,   378,   379,   380,     0,
-     381,   382,     0,   383,   384,   385,     0,     0,   386,     0,
-     387,     0,   388,   389,     0,   390,   391,   392,     0,   393,
-       0,     0,   394,   395,   396,   397,   398,   399,   400,   401,
-     402,   403,   404,     0,   405,   406,     0,     0,     0,   407,
-     408,   409,   410,     0,     0,     0,   411,     0,     0,     0,
-     412,     0,   413,   414,   415,   416,     0,   417,   418,   419,
-     420,   421,     0,     0,     0,     0,     0,   422,   423,   424,
-       0,   425,   426,     0,   427,     0,     0,   428,     0,     0,
-     429,   430,   431,   432,   433,   434,     0,     0,   435,   436,
-       0,   437,   438,   439,   440,   441,   442,     0,     0,   443,
-     444,   445,   446,     0,   447,   448,     0,     0,   449,   450,
-     451,   452,     0,   134,   453,   454,     0,   455,   456,   457,
-     458,     0,     0,     0,     0,     0,   459,   460,     0,     0,
-       0,   461,   462,   463,   464,     0,   465,   466,     0,   467,
-     468,     0,   469,   470,     0,     0,   471,     0,     0,   472,
-       0,   473,     0,   474,   475,     0,     0,     0,     0,     0,
-       0,   476,     0,     0,   477,     0,     0,     0,   478,   479,
-     480,   481,   482,     0,     0,     0,     0,     0,     0,   483,
-     484,     0,   485,   486,   487,     0,     0,   488,   137,     0,
-     138,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,   145,  1686,   146,   147,   148,   149,
-     150,   151,     0,   152,     0,     0,     0,   153,     0,     0,
-       0,   154,     0,     0,   155,   156,   157,     0,   158,     0,
-     159,   160,     0,     0,   161,     0,     0,   162,   163,     0,
-     164,   868,   869,   166,     0,   167,   168,   169,   170,   171,
-     172,     0,   173,   174,     0,   175,   176,   177,   178,   179,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,   189,   190,     0,     0,     0,   191,     0,     0,   192,
-       0,   193,     0,     0,   194,     0,     0,     0,   195,   196,
-     197,     0,     0,   198,     0,     0,     0,     0,   199,   200,
-       0,     0,     0,   870,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,   210,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,   215,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,   227,     0,
-       0,   228,   229,   230,   231,   232,     0,     0,   233,   234,
-       0,   235,   236,   237,     0,     0,   238,     0,     0,     0,
-     239,   240,     0,   241,     0,   242,     0,   243,   244,   245,
-     246,     0,   871,     0,   248,     0,     0,     0,   249,   250,
-       0,   251,     0,     0,   252,   253,     0,     0,     0,   254,
-     255,   256,   257,     0,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,     0,   262,   263,     0,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,   270,   271,     0,     0,   272,
-       0,     0,   273,   274,     0,     0,     0,     0,     0,   275,
-     276,     0,   872,     0,   278,     0,   279,   280,     0,     0,
-       0,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,     0,   302,
-     303,   304,   305,     0,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   312,   313,     0,     0,   314,   315,
-       0,   316,     0,   317,     0,   318,   319,   320,   321,   322,
-     323,   873,   325,   326,     0,     0,   327,   328,     0,     0,
-     329,   330,   331,   332,     0,     0,     0,   333,   334,     0,
-       0,     0,   335,     0,   336,   337,   338,     0,   339,   340,
-     341,     0,   342,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   343,   344,   345,     0,   346,   347,     0,   348,
-     349,   874,   351,   352,   353,   354,   355,   356,   357,     0,
-       0,   358,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   367,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,   382,     0,   383,   384,
-     385,     0,     0,   386,     0,   387,     0,   388,   389,     0,
-     390,   391,   392,     0,   393,     0,     0,   394,   395,   396,
-     397,   398,   399,   400,   401,   402,   403,   404,     0,   405,
-     406,     0,     0,     0,   407,   408,   875,   410,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,   413,   414,   415,
-     416,     0,   417,   418,   419,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,   430,   431,   432,   433,
-     434,     0,     0,   435,   436,     0,   437,   438,   439,   440,
-     441,   442,     0,     0,   443,   444,   445,   446,     0,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,     0,   453,
-     454,     0,   455,   456,   457,   458,     0,     0,     0,     0,
-       0,   459,   460,     0,     0,     0,   461,   462,   463,   464,
-       0,   465,   466,     0,   467,   468,     0,   469,   470,     0,
-       0,   471,     0,     0,   472,     0,   473,     0,   474,   475,
-       0,     0,     0,     0,     0,     0,   476,     0,     0,   477,
-       0,     0,     0,   478,   479,   480,   481,   482,     0,     0,
-       0,     0,     0,     0,   483,   484,     0,   485,   486,   487,
-       0,     0,   488,   137,     0,   138,   139,   140,   141,   142,
-       0,     0,   143,     0,     0,     0,   144,     0,     0,   145,
-     877,   146,   147,   148,   149,   150,   151,     0,   152,     0,
-       0,     0,   153,     0,     0,     0,   154,     0,     0,   155,
-     156,   157,     0,   158,     0,   159,   160,     0,     0,   161,
-       0,     0,   162,   163,     0,   164,   165,     0,   166,     0,
-     167,   168,   169,   170,   171,   172,     0,   173,   174,     0,
-     175,   176,   177,   178,   179,   180,   181,   182,   183,     0,
-     184,   185,     0,   186,   187,   188,   189,   190,     0,     0,
-       0,   191,     0,     0,   192,     0,   193,     0,     0,   194,
-       0,     0,     0,   195,   196,   197,     0,     0,   198,     0,
-       0,     0,     0,   199,   200,     0,     0,     0,     0,   201,
-     202,     0,   203,     0,     0,     0,   204,     0,   205,   206,
-     207,   208,   209,     0,     0,     0,   210,     0,     0,   211,
-     212,   213,     0,     0,     0,   214,     0,   215,   216,     0,
-     217,   218,   219,     0,     0,   220,   221,     0,   222,   223,
-     224,   225,   226,   227,     0,     0,   228,   229,   230,   231,
-     232,     0,     0,   233,   234,     0,   235,   236,   237,     0,
-       0,   238,     0,     0,     0,   239,   240,     0,   241,     0,
-     242,     0,   243,   244,   245,   246,     0,   247,     0,   248,
-       0,     0,     0,   249,   250,     0,   251,     0,     0,   252,
-     253,     0,     0,     0,   254,   255,   256,   257,     0,     0,
-     258,   259,   260,     0,     0,   261,     0,     0,     0,     0,
-     262,   263,     0,     0,     0,   264,     0,     0,     0,   265,
-     266,     0,   267,   268,     0,     0,     0,   269,     0,     0,
-     270,   271,     0,     0,   272,     0,     0,   273,   274,   614,
-       0,     0,     0,     0,   275,   276,     0,   277,     0,   278,
-       0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     281,     0,   282,   283,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,     0,
-     299,   300,   301,     0,   302,   303,   304,   305,     0,   306,
-     307,     0,     0,     0,     0,   308,   309,   310,   311,   312,
-     313,     0,     0,   314,   315,     0,   316,     0,   317,     0,
-     318,   319,   320,   321,   322,   323,   324,   325,   326,     0,
-       0,   327,   328,     0,     0,   329,   330,   331,   332,     0,
-       0,     0,   333,   334,     0,     0,     0,   335,     0,   336,
-     337,   338,     0,   339,   340,   341,     0,   342,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   343,   344,   345,
-       0,   346,   347,     0,   348,   349,   350,   351,   352,   353,
-     354,   355,   356,   357,     0,     0,   358,   359,   360,     0,
-     361,     0,   362,   363,   364,   365,   366,     0,   367,   368,
-     369,     0,     0,   370,     0,     0,     0,   371,   372,   373,
-     374,   375,     0,     0,   376,   377,   378,   379,   380,     0,
-     381,   382,     0,   383,   384,   385,     0,     0,   386,     0,
-     387,     0,   388,   389,     0,   390,   391,   392,     0,   393,
-       0,     0,   394,   395,   396,   397,   398,   399,   400,   401,
-     402,   403,   404,     0,   405,   406,     0,     0,     0,   407,
-     408,   409,   410,     0,     0,     0,   411,     0,     0,     0,
-     412,     0,   413,   414,   415,   416,     0,   417,   418,   419,
-     420,   421,     0,     0,     0,     0,     0,   422,   423,   424,
-       0,   425,   426,     0,   427,     0,     0,   428,     0,     0,
-     429,   430,   431,   432,   433,   434,     0,     0,   435,   436,
-       0,   437,   438,   439,   440,   441,   442,     0,     0,   443,
-     444,   445,   446,     0,   447,   448,     0,     0,   449,   450,
-     451,   452,     0,   134,   453,   454,     0,   455,   456,   457,
-     458,     0,     0,     0,     0,     0,   459,   460,     0,     0,
-       0,   461,   462,   463,   464,     0,   465,   466,     0,   467,
-     468,     0,   469,   470,     0,     0,   471,     0,     0,   472,
-       0,   473,     0,   474,   475,     0,     0,     0,     0,     0,
-       0,   476,     0,     0,   477,     0,     0,     0,   478,   479,
-     480,   481,   482,     0,     0,     0,     0,     0,     0,   483,
-     484,     0,   485,   486,   487,     0,     0,   488,   137,     0,
-     138,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,   145,  3548,   146,   147,   148,   149,
-     150,   151,     0,   152,     0,     0,     0,   153,     0,     0,
-       0,   154,     0,     0,   155,   156,   157,     0,   158,     0,
-     159,   160,     0,     0,   161,     0,     0,   162,   163,     0,
-     164,   165,     0,   166,     0,   167,   168,   169,   170,   171,
-     172,     0,   173,   174,     0,   175,   176,   177,   178,   179,
-     180,   181,   182,   183,  1233,   184,   185,     0,   186,   187,
-     188,   189,   190,     0,     0,     0,   191,     0,     0,   192,
-       0,   193,     0,     0,   194,     0,     0,     0,   195,   196,
-     197,     0,     0,   198,     0,     0,     0,     0,   199,   200,
-       0,     0,     0,     0,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,   210,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,   215,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,   227,     0,
-       0,   228,   229,   230,   231,   232,     0,     0,   233,   234,
-       0,   235,   236,   237,     0,     0,   238,     0,     0,     0,
-     239,   240,     0,   241,     0,   242,     0,   243,   244,   245,
-     246,     0,   247,     0,   248,     0,     0,     0,   249,   250,
-       0,   251,     0,     0,   252,   253,     0,     0,     0,   254,
-     255,   256,   257,     0,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,     0,   262,   263,     0,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,   270,   271,     0,     0,   272,
-       0,     0,   273,   274,     0,     0,     0,     0,     0,   275,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-       0,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,     0,   302,
-     303,   304,   305,     0,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   312,   313,     0,     0,   314,   315,
-       0,   316,     0,   317,     0,   318,   319,   320,   321,   322,
-     323,   324,   325,   326,     0,     0,   327,   328,     0,     0,
-     329,   330,   331,   332,     0,     0,     0,   333,   334,     0,
-       0,     0,   335,     0,   336,   337,   338,     0,   339,   340,
-     341,     0,   342,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   343,   344,   345,     0,   346,   347,     0,   348,
-     349,   350,   351,   352,   353,   354,   355,   356,   357,     0,
-       0,   358,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   367,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,   382,     0,   383,   384,
-     385,     0,     0,   386,     0,   387,     0,   388,   389,     0,
-     390,   391,   392,     0,   393,     0,     0,   394,   395,   396,
-     397,   398,   399,   400,   401,   402,   403,   404,     0,   405,
-     406,     0,     0,     0,   407,   408,   409,   410,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,   413,   414,   415,
-     416,     0,   417,   418,   419,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,   430,   431,   432,   433,
-     434,     0,     0,   435,   436,     0,   437,   438,   439,   440,
-     441,   442,     0,     0,   443,   444,   445,   446,     0,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,     0,   453,
-     454,     0,   455,   456,   457,   458,     0,     0,     0,     0,
-       0,   459,   460,     0,     0,     0,   461,   462,   463,   464,
-       0,   465,   466,     0,   467,   468,     0,   469,   470,     0,
-       0,   471,     0,     0,   472,     0,   473,     0,   474,   475,
-       0,     0,     0,     0,     0,     0,   476,     0,     0,   477,
-       0,     0,     0,   478,   479,   480,   481,   482,     0,     0,
-       0,     0,     0,     0,   483,   484,     0,   485,   486,   487,
-       0,     0,   488,   137,     0,   138,   139,   140,   141,   142,
-       0,     0,   143,     0,     0,     0,   144,     0,     0,   145,
-    1234,   146,   147,   148,   149,   150,   151,     0,   152,     0,
-       0,     0,   153,     0,     0,     0,   154,     0,     0,   155,
-     156,   157,     0,   158,     0,   159,   160,     0,     0,   161,
-       0,     0,   162,   163,     0,   164,   165,     0,   166,     0,
-     167,   168,   169,   170,   171,   172,     0,   173,   174,     0,
-     175,   176,   177,   178,   179,   180,   181,   182,   183,     0,
-     184,   185,     0,   186,   187,   188,   189,   190,     0,     0,
-       0,   191,     0,     0,   192,     0,   193,     0,     0,   194,
-       0,     0,     0,   195,   196,   197,     0,     0,   198,     0,
-       0,     0,     0,   199,   200,     0,     0,     0,     0,   201,
-     202,     0,   203,     0,     0,     0,   204,     0,   205,   206,
-     207,   208,   209,     0,     0,     0,   210,     0,     0,   211,
-     212,   213,     0,     0,     0,   214,     0,   215,   216,     0,
-     217,   218,   219,     0,     0,   220,   221,     0,   222,   223,
-     224,   225,   226,   227,     0,     0,   228,   229,   230,   231,
-     232,     0,     0,   233,   234,     0,   235,   236,   237,     0,
-       0,   238,     0,     0,     0,   239,   240,     0,   241,     0,
-     242,     0,   243,   244,   245,   246,     0,   247,     0,   248,
-       0,     0,     0,   249,   250,     0,   251,     0,     0,   252,
-     253,     0,     0,     0,   254,   255,   256,   257,     0,     0,
-     258,   259,   260,     0,     0,   261,     0,     0,     0,     0,
-     262,   263,     0,     0,     0,   264,     0,     0,     0,   265,
-     266,     0,   267,   268,     0,     0,     0,   269,     0,     0,
-     270,   271,     0,     0,   272,     0,     0,   273,   274,     0,
-       0,     0,     0,     0,   275,   276,     0,   277,     0,   278,
-       0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     281,     0,   282,   283,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,     0,
-     299,   300,   301,     0,   302,   303,   304,   305,     0,   306,
-     307,     0,     0,     0,     0,   308,   309,   310,   311,   312,
-     313,     0,     0,   314,   315,     0,   316,     0,   317,     0,
-     318,   319,   320,   321,   322,   323,   324,   325,   326,     0,
-       0,   327,   328,     0,     0,   329,   330,   331,   332,     0,
-       0,     0,   333,   334,     0,     0,     0,   335,     0,   336,
-     337,   338,     0,   339,   340,   341,     0,   342,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   343,   344,   345,
-       0,   346,   347,     0,   348,   349,   350,   351,   352,   353,
-     354,   355,   356,   357,     0,     0,   358,   359,   360,     0,
-     361,     0,   362,   363,   364,   365,   366,     0,   367,   368,
-     369,     0,     0,   370,     0,     0,     0,   371,   372,   373,
-     374,   375,     0,     0,   376,   377,   378,   379,   380,     0,
-     381,   382,     0,   383,   384,   385,     0,     0,   386,     0,
-     387,     0,   388,   389,     0,   390,   391,   392,     0,   393,
-       0,     0,   394,   395,   396,   397,   398,   399,   400,   401,
-     402,   403,   404,     0,   405,   406,     0,     0,     0,   407,
-     408,   409,   410,     0,     0,     0,   411,     0,     0,     0,
-     412,     0,   413,   414,   415,   416,     0,   417,   418,   419,
-     420,   421,     0,     0,     0,     0,     0,   422,   423,   424,
-       0,   425,   426,     0,   427,     0,     0,   428,     0,     0,
-     429,   430,   431,   432,   433,   434,     0,     0,   435,   436,
-       0,   437,   438,   439,   440,   441,   442,     0,     0,   443,
-     444,   445,   446,     0,   447,   448,     0,     0,   449,   450,
-     451,   452,     0,     0,   453,   454,     0,   455,   456,   457,
-     458,     0,     0,     0,     0,     0,   459,   460,     0,     0,
-       0,   461,   462,   463,   464,     0,   465,   466,     0,   467,
-     468,     0,   469,   470,     0,     0,   471,     0,     0,   472,
-       0,   473,     0,   474,   475,     0,     0,     0,     0,     0,
-       0,   476,     0,     0,   477,     0,     0,     0,   478,   479,
-     480,   481,   482,     0,     0,     0,     0,     0,     0,   483,
-     484,     0,   485,   486,   487,     0,     0,   488,   137,     0,
-     138,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,     0,  1234,   146,   147,   148,   149,
-     150,     0,     0,  -366,     0,     0,     0,   153,     0,     0,
-       0,   154,     0,     0,   155,   156,   157,     0,   158,     0,
-       0,     0,     0,     0,   161,  3967,     0,   162,   163,     0,
-     164,     0,     0,     0,     0,   167,   168,   169,  3968,   171,
-     172,     0,   173,   174,     0,   175,   176,     0,   178,     0,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,     0,   190,     0,     0,     0,   191,     0,     0,   192,
-       0,   193,     0,     0,   194,     0,     0,     0,   195,   196,
-     197,     0,     0,   198,     0,     0,     0,     0,   199,     0,
-       0,     0,     0,     0,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,     0,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,     0,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,     0,     0,
-       0,   228,   229,   230,   231,   232,     0,     0,   233,   234,
-    3969,   235,   236,   237,     0,     0,     0,     0,     0,     0,
-       0,   240,     0,   241,     0,   242,     0,   243,   244,   245,
-     246,     0,   247,     0,   248,     0,     0,     0,     0,   250,
-       0,     0,     0,     0,     0,   253,     0,     0,     0,   254,
-     255,   256,   257,  3970,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,     0,   262,     0,     0,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,  3971,
-       0,     0,   269,     0,     0,     0,   271,     0,     0,   272,
-    3972,     0,   273,   274,     0,     0,     0,     0,     0,   275,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-       0,     0,  -321,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,     0,   302,
-     303,   304,   305,     0,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   312,   313,     0,     0,   314,   315,
-       0,   316,     0,   317,     0,   318,   319,   320,   321,   322,
-     323,   324,   325,   326,     0,     0,   327,   328,     0,     0,
-     329,   330,   331,   332,     0,     0,     0,     0,   334,     0,
-       0,     0,   335,     0,   336,   337,   338,     0,   339,   340,
-    3973,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   344,   345,     0,     0,   347,     0,   348,
-     349,   350,   351,   352,   353,   354,   355,   356,     0,     0,
-       0,     0,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   367,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,     0,     0,   383,     0,
-     385,  -321,     0,   386,     0,     0,     0,   388,     0,     0,
-     390,   391,   392,  3974,   393,     0,     0,     0,   395,   396,
-     397,   398,   399,   400,   401,     0,   403,   404,     0,   405,
-       0,     0,     0,     0,   407,   408,   409,     0,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,     0,   414,     0,
-     416,     0,   417,     0,     0,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,     0,   431,   432,   433,
-     434,     0,     0,     0,   436,     0,   437,   438,   439,   440,
-     441,   442,     0,     0,   443,   444,   445,   446,     0,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,     0,   453,
-     454,     0,   455,   456,   457,   458,     0,     0,     0,     0,
-       0,   459,   460,     0,     0,     0,     0,   462,   463,   464,
-       0,   465,   466,     0,   467,   468,     0,     0,     0,     0,
-       0,   471,     0,     0,   472,     0,     0,     0,   474,   475,
-       0,     0,     0,     0,     0,     0,   476,     0,     0,   477,
-       0,     0,     0,   478,   479,   480,   481,   482,     0,     0,
-    -321,     0,     0,     0,   483,     0,     0,   485,     0,   487,
-       0,   137,   488,   138,   139,   140,   141,   142,     0,     0,
-     143,     0,     0,     0,   144,  4502,     0,   145,     0,   146,
-     147,   148,   149,   150,   151,     0,   152,     0,     0,     0,
-     153,     0,     0,     0,   154,     0,     0,   155,   156,   157,
-       0,   158,     0,   159,   160,     0,     0,   161,     0,     0,
-     162,   163,     0,   164,   165,     0,   166,     0,   167,   168,
-     169,   170,   171,   172,     0,   173,   174,     0,   175,   176,
-     177,   178,   179,   180,   181,   182,   183,     0,   184,   185,
-       0,   186,   187,   188,   189,   190,     0,     0,     0,   191,
-       0,     0,   192,     0,   193,     0,     0,   194,     0,     0,
-       0,   195,   196,   197,     0,     0,   198,     0,     0,     0,
-       0,   199,   200,     0,     0,     0,     0,   201,   202,     0,
-     203,     0,     0,     0,   204,     0,   205,   206,   207,   208,
-     209,     0,     0,     0,   210,     0,     0,   211,   212,   213,
-       0,     0,     0,   214,     0,   215,   216,     0,   217,   218,
-     219,     0,     0,   220,   221,     0,   222,   223,   224,   225,
-     226,   227,     0,     0,   228,   229,   230,   231,   232,     0,
-       0,   233,   234,     0,   235,   236,   237,     0,     0,   238,
-       0,     0,     0,   239,   240,     0,   241,     0,   242,     0,
-     243,   244,   245,   246,     0,   247,     0,   248,     0,     0,
-       0,   249,   250,     0,   251,     0,     0,   252,   253,     0,
-       0,     0,   254,   255,   256,   257,     0,     0,   258,   259,
-     260,     0,     0,   261,     0,     0,     0,     0,   262,   263,
-       0,     0,     0,   264,     0,     0,     0,   265,   266,     0,
-     267,   268,     0,     0,     0,   269,     0,     0,   270,   271,
-       0,     0,   272,     0,     0,   273,   274,     0,     0,     0,
-       0,     0,   275,   276,     0,   277,     0,   278,     0,   279,
-     280,     0,     0,     0,     0,     0,     0,     0,   281,     0,
-     282,   283,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,     0,   299,   300,
-     301,     0,   302,   303,   304,   305,     0,   306,   307,     0,
-       0,     0,     0,   308,   309,   310,   311,   312,   313,     0,
-       0,   314,   315,     0,   316,     0,   317,     0,   318,   319,
-     320,   321,   322,   323,   324,   325,   326,     0,     0,   327,
-     328,     0,     0,   329,   330,   331,   332,     0,     0,     0,
-     333,   334,     0,     0,     0,   335,     0,   336,   337,   338,
-       0,   339,   340,   341,     0,   342,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   343,   344,   345,     0,   346,
-     347,     0,   348,   349,   350,   351,   352,   353,   354,   355,
-     356,   357,     0,     0,   358,   359,   360,     0,   361,     0,
-     362,   363,   364,   365,   366,     0,   367,   368,   369,     0,
-       0,   370,     0,     0,     0,   371,   372,   373,   374,   375,
-       0,     0,   376,   377,   378,   379,   380,     0,   381,   382,
-       0,   383,   384,   385,     0,     0,   386,     0,   387,     0,
-     388,   389,     0,   390,   391,   392,     0,   393,     0,     0,
-     394,   395,   396,   397,   398,   399,   400,   401,   402,   403,
-     404,     0,   405,   406,     0,     0,     0,   407,   408,   409,
-     410,     0,     0,     0,   411,     0,     0,     0,   412,     0,
-     413,   414,   415,   416,     0,   417,   418,   419,   420,   421,
-       0,     0,     0,     0,     0,   422,   423,   424,     0,   425,
-     426,     0,   427,     0,     0,   428,     0,     0,   429,   430,
-     431,   432,   433,   434,     0,     0,   435,   436,     0,   437,
-     438,   439,   440,   441,   442,     0,     0,   443,   444,   445,
-     446,     0,   447,   448,     0,     0,   449,   450,   451,   452,
-       0,     0,   453,   454,     0,   455,   456,   457,   458,     0,
-       0,     0,     0,     0,   459,   460,     0,     0,     0,   461,
-     462,   463,   464,     0,   465,   466,     0,   467,   468,     0,
-     469,   470,     0,     0,   471,     0,     0,   472,     0,   473,
-       0,   474,   475,     0,     0,     0,     0,     0,     0,   476,
-       0,     0,   477,     0,     0,     0,   478,   479,   480,   481,
-     482,     0,     0,     0,     0,     0,     0,   483,   484,     0,
-     485,   486,   487,     0,   137,   488,   138,   139,   140,   141,
-     142,  2139,     0,   143,     0,     0,     0,   144,     0,     0,
-     145,     0,   146,   147,   148,   149,   150,   151,     0,   152,
-       0,     0,     0,   153,     0,     0,     0,   154,     0,     0,
-     155,   156,   157,     0,   158,     0,   159,   160,     0,     0,
-     161,     0,     0,   162,   163,     0,   164,   165,     0,   166,
-       0,   167,   168,   169,   170,   171,   172,     0,   173,   174,
-       0,   175,   176,   177,   178,   179,   180,   181,   182,   183,
-       0,   184,   185,     0,   186,   187,   188,   189,   190,     0,
-       0,     0,   191,     0,     0,   192,     0,   193,     0,     0,
-     194,     0,     0,     0,   195,   196,   197,     0,     0,   198,
-       0,     0,     0,     0,   199,   200,     0,     0,     0,     0,
-     201,   202,     0,   203,     0,     0,     0,   204,     0,   205,
-     206,   207,   208,   209,     0,     0,     0,   210,     0,     0,
-     211,   212,   213,     0,     0,     0,   214,     0,   215,   216,
-       0,   217,   218,   219,     0,     0,   220,   221,     0,   222,
-     223,   224,   225,   226,   227,     0,     0,   228,   229,   230,
-     231,   232,     0,     0,   233,   234,     0,   235,   236,   237,
-       0,     0,   238,     0,     0,     0,   239,   240,     0,   241,
-       0,   242,     0,   243,   244,   245,   246,     0,   247,     0,
-     248,     0,     0,     0,   249,   250,     0,   251,     0,     0,
-     252,   253,     0,     0,     0,   254,   255,   256,   257,     0,
-       0,   258,   259,   260,     0,     0,   261,     0,     0,     0,
-       0,   262,   263,     0,     0,     0,   264,     0,     0,     0,
-     265,   266,     0,   267,   268,     0,     0,     0,   269,     0,
-       0,   270,   271,     0,     0,   272,     0,     0,   273,   274,
-       0,     0,     0,     0,     0,   275,   276,     0,   277,     0,
-     278,     0,   279,   280,     0,     0,     0,     0,     0,     0,
-       0,   281,     0,   282,   283,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,     0,   302,   303,   304,   305,     0,
-     306,   307,     0,     0,     0,     0,   308,   309,   310,   311,
-     312,   313,     0,     0,   314,   315,     0,   316,     0,   317,
-       0,   318,   319,   320,   321,   322,   323,   324,   325,   326,
-       0,     0,   327,   328,     0,     0,   329,   330,   331,   332,
-       0,     0,     0,   333,   334,     0,     0,     0,   335,     0,
-     336,   337,   338,     0,   339,   340,   341,     0,   342,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   343,   344,
-     345,     0,   346,   347,     0,   348,   349,   350,   351,   352,
-     353,   354,   355,   356,   357,     0,     0,   358,   359,   360,
-       0,   361,     0,   362,   363,   364,   365,   366,     0,   367,
-     368,   369,     0,     0,   370,     0,     0,     0,   371,   372,
-     373,   374,   375,     0,     0,   376,   377,   378,   379,   380,
-       0,   381,   382,     0,   383,   384,   385,     0,     0,   386,
-       0,   387,     0,   388,   389,     0,   390,   391,   392,     0,
-     393,     0,     0,   394,   395,   396,   397,   398,   399,   400,
-     401,   402,   403,   404,     0,   405,   406,     0,     0,     0,
-     407,   408,   409,   410,     0,     0,     0,   411,     0,     0,
-       0,   412,     0,   413,   414,   415,   416,     0,   417,   418,
-     419,   420,   421,     0,     0,     0,     0,     0,   422,   423,
-     424,     0,   425,   426,     0,   427,     0,     0,   428,     0,
-       0,   429,   430,   431,   432,   433,   434,     0,     0,   435,
-     436,     0,   437,   438,   439,   440,   441,   442,     0,     0,
-     443,   444,   445,   446,     0,   447,   448,     0,     0,   449,
-     450,   451,   452,     0,     0,   453,   454,     0,   455,   456,
-     457,   458,     0,     0,     0,     0,     0,   459,   460,     0,
-       0,     0,   461,   462,   463,   464,     0,   465,   466,     0,
-     467,   468,     0,   469,   470,     0,     0,   471,     0,     0,
-     472,     0,   473,     0,   474,   475,     0,     0,     0,     0,
-       0,     0,   476,     0,     0,   477,     0,     0,     0,   478,
-     479,   480,   481,   482,     0,     0,     0,     0,     0,     0,
-     483,   484,     0,   485,   486,   487,     0,   137,   488,   138,
-     139,   140,   141,   142,  2856,     0,   143,     0,     0,     0,
-     144,     0,     0,   145,     0,   146,   147,   148,   149,   150,
-     151,     0,   152,     0,     0,     0,   153,     0,     0,     0,
-     154,     0,     0,   155,   156,   157,     0,   158,     0,   159,
-     160,     0,     0,   161,     0,     0,   162,   163,     0,   164,
-     165,     0,   166,     0,   167,   168,   169,   170,   171,   172,
-       0,   173,   174,     0,   175,   176,   177,   178,   179,   180,
-     181,   182,   183,     0,   184,   185,     0,   186,   187,   188,
-     189,   190,     0,     0,     0,   191,     0,     0,   192,     0,
-     193,     0,     0,   194,     0,     0,     0,   195,   196,   197,
-       0,     0,   198,     0,     0,     0,     0,   199,   200,     0,
-       0,     0,     0,   201,   202,     0,   203,     0,     0,     0,
-     204,     0,   205,   206,   207,   208,   209,     0,     0,     0,
-     210,     0,     0,   211,   212,   213,     0,     0,     0,   214,
-       0,   215,   216,     0,   217,   218,   219,     0,     0,   220,
-     221,     0,   222,   223,   224,   225,   226,   227,     0,     0,
-     228,   229,   230,   231,   232,     0,     0,   233,   234,     0,
-     235,   236,   237,     0,     0,   238,     0,     0,     0,   239,
-     240,     0,   241,     0,   242,     0,   243,   244,   245,   246,
-       0,   247,     0,   248,     0,     0,     0,   249,   250,     0,
-     251,     0,     0,   252,   253,     0,     0,     0,   254,   255,
-     256,   257,     0,     0,   258,   259,   260,     0,     0,   261,
-       0,     0,     0,     0,   262,   263,     0,     0,     0,   264,
-       0,     0,     0,   265,   266,     0,   267,   268,     0,     0,
-       0,   269,     0,     0,   270,   271,     0,     0,   272,     0,
-       0,   273,   274,     0,     0,     0,     0,     0,   275,   276,
-       0,   277,     0,   278,     0,   279,   280,     0,     0,     0,
-       0,     0,     0,     0,   281,     0,   282,   283,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,     0,   299,   300,   301,     0,   302,   303,
-     304,   305,     0,   306,   307,     0,     0,     0,     0,   308,
-     309,   310,   311,   312,   313,     0,     0,   314,   315,     0,
-     316,     0,   317,     0,   318,   319,   320,   321,   322,   323,
-     324,   325,   326,     0,     0,   327,   328,     0,     0,   329,
-     330,   331,   332,     0,     0,     0,   333,   334,     0,     0,
-       0,   335,     0,   336,   337,   338,     0,   339,   340,   341,
-       0,   342,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   343,   344,   345,     0,   346,   347,     0,   348,   349,
-     350,   351,   352,   353,   354,   355,   356,   357,     0,     0,
-     358,   359,   360,     0,   361,     0,   362,   363,   364,   365,
-     366,     0,   367,   368,   369,     0,     0,   370,     0,     0,
-       0,   371,   372,   373,   374,   375,     0,     0,   376,   377,
-     378,   379,   380,     0,   381,   382,     0,   383,   384,   385,
-       0,     0,   386,     0,   387,     0,   388,   389,     0,   390,
-     391,   392,     0,   393,     0,     0,   394,   395,   396,   397,
-     398,   399,   400,   401,   402,   403,   404,     0,   405,   406,
-       0,     0,     0,   407,   408,   409,   410,     0,     0,     0,
-     411,     0,     0,     0,   412,     0,   413,   414,   415,   416,
-       0,   417,   418,   419,   420,   421,     0,     0,     0,     0,
-       0,   422,   423,   424,     0,   425,   426,     0,   427,     0,
-       0,   428,     0,     0,   429,   430,   431,   432,   433,   434,
-       0,     0,   435,   436,     0,   437,   438,   439,   440,   441,
-     442,     0,     0,   443,   444,   445,   446,     0,   447,   448,
-       0,     0,   449,   450,   451,   452,     0,     0,   453,   454,
-       0,   455,   456,   457,   458,     0,     0,     0,     0,     0,
-     459,   460,     0,     0,     0,   461,   462,   463,   464,     0,
-     465,   466,     0,   467,   468,     0,   469,   470,     0,     0,
-     471,     0,     0,   472,     0,   473,     0,   474,   475,     0,
-       0,     0,     0,     0,     0,   476,     0,     0,   477,     0,
-       0,     0,   478,   479,   480,   481,   482,     0,     0,     0,
-       0,     0,     0,   483,   484,     0,   485,   486,   487,     0,
-     137,   488,   138,   139,   140,   141,   142,  3507,     0,   143,
-       0,     0,     0,   144,     0,     0,   145,     0,   146,   147,
-     148,   149,   150,   151,     0,   152,     0,     0,     0,   153,
-       0,     0,     0,   154,     0,     0,   155,   156,   157,     0,
-     158,     0,   159,   160,     0,     0,   161,     0,     0,   162,
-     163,     0,   164,   165,     0,   166,     0,   167,   168,   169,
-     170,   171,   172,     0,   173,   174,     0,   175,   176,   177,
-     178,   179,   180,   181,   182,   183,     0,   184,   185,     0,
-     186,   187,   188,   189,   190,     0,     0,     0,   191,     0,
-       0,   192,     0,   193,     0,     0,   194,     0,     0,     0,
-     195,   196,   197,     0,     0,   198,     0,     0,     0,     0,
-     199,   200,     0,     0,     0,     0,   201,   202,     0,   203,
-       0,     0,     0,   204,     0,   205,   206,   207,   208,   209,
-       0,     0,     0,   210,     0,     0,   211,   212,   213,     0,
-       0,     0,   214,     0,   215,   216,     0,   217,   218,   219,
-       0,     0,   220,   221,     0,   222,   223,   224,   225,   226,
-     227,     0,     0,   228,   229,   230,   231,   232,     0,     0,
-     233,   234,     0,   235,   236,   237,     0,     0,   238,     0,
-       0,     0,   239,   240,     0,   241,     0,   242,     0,   243,
-     244,   245,   246,     0,   247,     0,   248,     0,     0,     0,
-     249,   250,     0,   251,     0,     0,   252,   253,     0,     0,
-       0,   254,   255,   256,   257,     0,     0,   258,   259,   260,
-       0,     0,   261,     0,     0,     0,     0,   262,   263,     0,
-       0,     0,   264,     0,     0,     0,   265,   266,     0,   267,
-     268,     0,     0,     0,   269,     0,     0,   270,   271,     0,
-       0,   272,     0,     0,   273,   274,     0,     0,     0,     0,
-       0,   275,   276,     0,   277,     0,   278,     0,   279,   280,
-       0,     0,     0,     0,     0,     0,     0,   281,     0,   282,
-     283,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,     0,   299,   300,   301,
-       0,   302,   303,   304,   305,     0,   306,   307,     0,     0,
-       0,     0,   308,   309,   310,   311,   312,   313,     0,     0,
-     314,   315,     0,   316,     0,   317,     0,   318,   319,   320,
-     321,   322,   323,   324,   325,   326,     0,     0,   327,   328,
-       0,     0,   329,   330,   331,   332,     0,     0,     0,   333,
-     334,     0,     0,     0,   335,     0,   336,   337,   338,     0,
-     339,   340,   341,     0,   342,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   343,   344,   345,     0,   346,   347,
-       0,   348,   349,   350,   351,   352,   353,   354,   355,   356,
-     357,     0,     0,   358,   359,   360,     0,   361,     0,   362,
-     363,   364,   365,   366,     0,   367,   368,   369,     0,     0,
-     370,     0,     0,     0,   371,   372,   373,   374,   375,     0,
-       0,   376,   377,   378,   379,   380,     0,   381,   382,     0,
-     383,   384,   385,     0,     0,   386,     0,   387,     0,   388,
-     389,     0,   390,   391,   392,     0,   393,     0,     0,   394,
-     395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
-       0,   405,   406,     0,     0,     0,   407,   408,   409,   410,
-       0,     0,     0,   411,     0,     0,     0,   412,     0,   413,
-     414,   415,   416,     0,   417,   418,   419,   420,   421,     0,
-       0,     0,     0,     0,   422,   423,   424,     0,   425,   426,
-       0,   427,     0,     0,   428,     0,     0,   429,   430,   431,
-     432,   433,   434,     0,     0,   435,   436,     0,   437,   438,
-     439,   440,   441,   442,     0,     0,   443,   444,   445,   446,
-       0,   447,   448,     0,     0,   449,   450,   451,   452,     0,
-       0,   453,   454,     0,   455,   456,   457,   458,     0,     0,
-       0,     0,     0,   459,   460,     0,     0,     0,   461,   462,
-     463,   464,     0,   465,   466,     0,   467,   468,     0,   469,
-     470,     0,     0,   471,     0,     0,   472,     0,   473,     0,
-     474,   475,     0,     0,     0,     0,     0,     0,   476,     0,
-       0,   477,     0,     0,     0,   478,   479,   480,   481,   482,
-       0,     0,     0,     0,     0,     0,   483,   484,     0,   485,
-     486,   487,     0,   137,   488,   138,   139,   140,   141,   142,
-    3553,     0,   143,     0,     0,     0,   144,     0,     0,   145,
-       0,   146,   147,   148,   149,   150,   151,     0,   152,     0,
-       0,     0,   153,     0,     0,     0,   154,     0,     0,   155,
-     156,   157,     0,   158,     0,   159,   160,     0,     0,   161,
-       0,     0,   162,   163,     0,   164,   165,     0,   166,     0,
-     167,   168,   169,   170,   171,   172,     0,   173,   174,     0,
-     175,   176,   177,   178,   179,   180,   181,   182,   183,     0,
-     184,   185,     0,   186,   187,   188,   189,   190,     0,     0,
-       0,   191,     0,     0,   192,     0,   193,     0,     0,   194,
-       0,     0,     0,   195,   196,   197,     0,     0,   198,     0,
-       0,     0,     0,   199,   200,  2486,     0,     0,     0,   201,
-     202,     0,   203,     0,     0,     0,   204,     0,   205,   206,
-     207,   208,   209,     0,     0,     0,   210,     0,     0,   211,
-     212,   213,     0,     0,     0,   214,     0,   215,   216,     0,
-     217,   218,   219,     0,     0,   220,   221,     0,   222,   223,
-     224,   225,   226,   227,     0,     0,   228,   229,   230,   231,
-     232,     0,     0,   233,   234,     0,   235,   236,   237,  2487,
-       0,   238,     0,     0,     0,   239,   240,     0,   241,     0,
-     242,     0,   243,   244,   245,   246,     0,   247,     0,   248,
-       0,     0,     0,   249,   250,     0,   251,  2488,     0,   252,
-     253,     0,     0,     0,   254,   255,   256,   257,     0,     0,
-     258,   259,   260,     0,     0,   261,     0,     0,     0,     0,
-     262,   263,     0,     0,     0,   264,     0,     0,     0,   265,
-     266,     0,   267,   268,     0,     0,     0,   269,     0,     0,
-     270,   271,     0,     0,   272,     0,     0,   273,   274,     0,
-       0,     0,     0,     0,   275,   276,     0,   277,     0,   278,
-       0,   279,   280,     0,     0,  2489,     0,     0,     0,     0,
-     281,     0,   282,   283,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,     0,
-     299,   300,   301,     0,   302,   303,   304,   305,     0,   306,
-     307,     0,     0,     0,     0,   308,   309,   310,   311,   312,
-     313,     0,     0,   314,   315,     0,   316,     0,   317,     0,
-     318,   319,   320,   321,   322,   323,   324,   325,   326,     0,
-       0,   327,   328,     0,     0,   329,   330,   331,   332,  1003,
-    1004,     0,   333,   334,     0,     0,  2490,   335,     0,   336,
-     337,   338,     0,   339,   340,   341,     0,   342,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   343,   344,   345,
-       0,   346,   347,     0,   348,   349,   350,   351,   352,   353,
-     354,   355,   356,   357,     0,     0,   358,   359,   360,     0,
-     361,     0,   362,   363,   364,   365,   366,     0,   367,   368,
-     369,     0,     0,   370,     0,     0,     0,   371,   372,   373,
-     374,   375,     0,     0,   376,   377,   378,   379,   380,     0,
-     381,   382,     0,   383,   384,   385,     0,     0,   386,     0,
-     387,     0,   388,   389,     0,   390,   391,   392,     0,   393,
-       0,     0,   394,   395,   396,   397,   398,   399,   400,   401,
-     402,   403,   404,     0,   405,   406,     0,     0,     0,   407,
-     408,   409,   410,     0,     0,     0,   411,     0,     0,     0,
-     412,     0,   413,   414,   415,   416,     0,   417,   418,   419,
-     420,   421,     0,     0,  4489,   563,  4490,   422,   423,   424,
-       0,   425,   426,     0,   427,     0,     0,   428,     0,     0,
-     429,   430,   431,   432,   433,   434,     0,     0,   435,   436,
-       0,   437,   438,   439,   440,   441,   442,     0,     0,   443,
-     444,   445,   446,     0,   447,   448,     0,     0,   449,   450,
-     451,   452,     0,     0,   453,   454,     0,   455,   456,   457,
-     458,     0,     0,     0,     0,     0,   459,   460,     0,     0,
-       0,   461,   462,   463,   464,  2491,   465,   466,     0,   467,
-     468,     0,   469,   470,     0,     0,   471,     0,     0,   472,
-       0,   473,     0,   474,   475,     0,     0,     0,     0,     0,
-       0,   476,     0,     0,   477,     0,     0,     0,   478,   479,
-     480,   481,   482,     0,     0,     0,     0,     0,     0,   483,
-     484,     0,   485,   486,   487,     0,   137,   488,   138,   139,
-     140,   141,   142,     0,     0,   143,     0,     0,     0,   144,
-       0,     0,   145,     0,   146,   147,   148,   149,   150,   151,
-       0,   152,     0,     0,  1339,   153,     0,     0,     0,   154,
-       0,     0,   155,   156,   157,     0,   158,     0,   159,   160,
-       0,     0,   161,     0,     0,   162,   163,     0,   164,   165,
-       0,   166,     0,   167,   168,   169,   170,   171,   172,     0,
-     173,   174,     0,   175,   176,   177,   178,   179,   180,   181,
-     182,   183,     0,   184,   185,     0,   186,   187,   188,   189,
-     190,     0,     0,     0,   191,     0,     0,   192,     0,   193,
-       0,     0,   194,     0,     0,     0,   195,   196,   197,     0,
-       0,   198,     0,     0,     0,     0,   199,   200,     0,     0,
-       0,  1340,   201,   202,     0,   203,     0,     0,     0,   204,
-       0,   205,   206,   207,   208,   209,     0,     0,     0,   210,
-       0,     0,   211,   212,   213,     0,     0,     0,   214,     0,
-     215,   216,     0,   217,   218,   219,  1341,     0,   220,   221,
-       0,   222,   223,   224,   225,   226,   227,     0,     0,   228,
-     229,   230,   231,   232,     0,     0,   233,   234,     0,   235,
-     236,   237,     0,     0,   238,     0,     0,     0,   239,   240,
-       0,   241,     0,   242,     0,   243,   244,   245,   246,     0,
-     247,     0,   248,     0,     0,     0,   249,   250,     0,   251,
-       0,     0,   252,   253,     0,     0,     0,   254,   255,   256,
-     257,     0,     0,   258,   259,   260,     0,     0,   261,     0,
-       0,     0,     0,   262,   263,     0,     0,     0,   264,     0,
-       0,     0,   265,   266,     0,   267,   268,     0,     0,     0,
-     269,     0,     0,   270,   271,     0,     0,   272,     0,     0,
-     273,   274,   614,     0,     0,     0,     0,   275,   276,     0,
-     277,     0,   278,     0,   279,   280,     0,     0,     0,     0,
-       0,     0,     0,   281,     0,   282,   283,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,     0,   299,   300,   301,     0,   302,   303,   304,
-     305,     0,   306,   307,     0,     0,     0,     0,   308,   309,
-     310,   311,   312,   313,     0,     0,   314,   315,     0,   316,
-       0,   317,     0,   318,   319,   320,   321,   322,   323,   324,
-     325,   326,     0,     0,   327,   328,     0,     0,   329,   330,
-     331,   332,     0,     0,     0,   333,   334,     0,     0,     0,
-     335,     0,   336,   337,   338,     0,   339,   340,   341,     0,
-     342,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     343,   344,   345,     0,   346,   347,     0,   348,   349,   350,
-     351,   352,   353,   354,   355,   356,   357,     0,     0,   358,
-     359,   360,     0,   361,     0,   362,   363,   364,   365,   366,
-       0,   367,   368,   369,     0,     0,   370,     0,     0,     0,
-     371,   372,   373,   374,   375,     0,     0,   376,   377,   378,
-     379,   380,     0,   381,   382,     0,   383,   384,   385,     0,
-       0,   386,     0,   387,     0,   388,   389,     0,   390,   391,
-     392,     0,   393,     0,     0,   394,   395,   396,   397,   398,
-     399,   400,   401,   402,   403,   404,     0,   405,   406,     0,
-       0,     0,   407,   408,   409,   410,     0,     0,  1342,   411,
-       0,     0,     0,   412,     0,   413,   414,   415,   416,     0,
-     417,   418,   419,   420,   421,     0,     0,     0,     0,     0,
-     422,   423,   424,     0,   425,   426,     0,   427,     0,     0,
-     428,     0,     0,   429,   430,   431,   432,   433,   434,     0,
-       0,   435,   436,     0,   437,   438,   439,   440,   441,   442,
-       0,     0,   443,   444,   445,   446,     0,   447,   448,     0,
-       0,   449,   450,   451,   452,     0,   134,   453,   454,     0,
-     455,   456,   457,   458,     0,     0,     0,     0,     0,   459,
-     460,     0,     0,     0,   461,   462,   463,   464,     0,   465,
-     466,     0,   467,   468,     0,   469,   470,     0,     0,   471,
-       0,     0,   472,     0,   473,     0,   474,   475,     0,     0,
-       0,     0,     0,     0,   476,     0,     0,   477,     0,     0,
-       0,   478,   479,   480,   481,   482,     0,     0,     0,     0,
-       0,     0,   483,   484,     0,   485,   486,   487,     0,   137,
-     488,   138,   139,   140,   141,   142,     0,     0,   143,     0,
-       0,     0,   144,     0,     0,   145,     0,   146,   147,   148,
-     149,   150,   151,     0,   152,     0,     0,  1352,   153,     0,
-       0,     0,   154,     0,     0,   155,   156,   157,     0,   158,
-       0,   159,   160,     0,     0,   161,     0,     0,   162,   163,
-       0,   164,   165,     0,   166,     0,   167,   168,   169,   170,
-     171,   172,     0,   173,   174,     0,   175,   176,   177,   178,
-     179,   180,   181,   182,   183,     0,   184,   185,     0,   186,
-     187,   188,   189,   190,     0,     0,     0,   191,     0,     0,
-     192,     0,   193,     0,     0,   194,     0,     0,     0,   195,
-     196,   197,     0,     0,   198,     0,     0,     0,     0,   199,
-     200,     0,     0,     0,  1353,   201,   202,     0,   203,     0,
-       0,     0,   204,     0,   205,   206,   207,   208,   209,     0,
-       0,     0,   210,     0,     0,   211,   212,   213,     0,     0,
-       0,   214,     0,   215,   216,     0,   217,   218,   219,     0,
-       0,   220,   221,     0,   222,   223,   224,   225,   226,   227,
-       0,     0,   228,   229,   230,   231,   232,     0,     0,   233,
-     234,     0,   235,   236,   237,     0,     0,   238,     0,     0,
-       0,   239,   240,     0,   241,     0,   242,     0,   243,   244,
-     245,   246,     0,   247,     0,   248,     0,     0,     0,   249,
-     250,     0,   251,     0,     0,   252,   253,     0,     0,     0,
-     254,   255,   256,   257,     0,     0,   258,   259,   260,     0,
-       0,   261,     0,     0,     0,     0,   262,   263,     0,     0,
-       0,   264,     0,     0,     0,   265,   266,     0,   267,   268,
-       0,     0,     0,   269,     0,     0,   270,   271,     0,     0,
-     272,     0,     0,   273,   274,   614,     0,     0,     0,     0,
-     275,   276,     0,   277,     0,   278,     0,   279,   280,     0,
-       0,     0,     0,     0,     0,     0,   281,     0,   282,   283,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,     0,   299,   300,   301,     0,
-     302,   303,   304,   305,     0,   306,   307,     0,     0,     0,
-       0,   308,   309,   310,   311,   312,   313,     0,     0,   314,
-     315,     0,   316,     0,   317,     0,   318,   319,   320,   321,
-     322,   323,   324,   325,   326,     0,     0,   327,   328,     0,
-       0,   329,   330,   331,   332,     0,     0,     0,   333,   334,
-       0,     0,     0,   335,     0,   336,   337,   338,     0,   339,
-     340,   341,     0,   342,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   343,   344,   345,     0,   346,   347,     0,
-     348,   349,   350,   351,   352,   353,   354,   355,   356,   357,
-       0,     0,   358,   359,   360,     0,   361,     0,   362,   363,
-     364,   365,   366,     0,   367,   368,   369,     0,     0,   370,
-       0,     0,     0,   371,   372,   373,   374,   375,     0,     0,
-     376,   377,   378,   379,   380,     0,   381,   382,     0,   383,
-     384,   385,     0,     0,   386,     0,   387,     0,   388,   389,
-       0,   390,   391,   392,     0,   393,     0,     0,   394,   395,
-     396,   397,   398,   399,   400,   401,   402,   403,   404,     0,
-     405,   406,     0,     0,     0,   407,   408,   409,   410,     0,
-       0,     0,   411,     0,     0,     0,   412,     0,   413,   414,
-     415,   416,     0,   417,   418,   419,   420,   421,     0,     0,
-       0,     0,     0,   422,   423,   424,     0,   425,   426,     0,
-     427,     0,     0,   428,     0,     0,   429,   430,   431,   432,
-     433,   434,     0,     0,   435,   436,     0,   437,   438,   439,
-     440,   441,   442,     0,     0,   443,   444,   445,   446,     0,
-     447,   448,     0,     0,   449,   450,   451,   452,     0,   134,
-     453,   454,     0,   455,   456,   457,   458,     0,     0,     0,
-       0,     0,   459,   460,     0,     0,     0,   461,   462,   463,
-     464,     0,   465,   466,     0,   467,   468,     0,   469,   470,
-       0,     0,   471,     0,     0,   472,     0,   473,     0,   474,
-     475,     0,     0,     0,     0,     0,     0,   476,     0,     0,
-     477,     0,     0,     0,   478,   479,   480,   481,   482,     0,
-       0,     0,     0,     0,     0,   483,   484,     0,   485,   486,
-     487,     0,   137,   488,   138,   139,   140,   141,   142,     0,
-       0,   143,     0,     0,     0,   144,     0,     0,   145,     0,
-     146,   147,   148,   149,   150,   151,     0,   152,     0,     0,
-       0,   153,     0,     0,     0,   154,     0,     0,   155,   156,
-     157,     0,   158,     0,   159,   160,     0,     0,   161,     0,
-       0,   162,   163,     0,   164,   165,     0,   166,     0,   167,
-     168,   169,   170,   171,   172,     0,   173,   174,     0,   175,
-     176,   177,   178,   179,   180,   181,   182,   183,     0,   184,
-     185,     0,   186,   187,   188,   189,   190,     0,     0,     0,
-     191,     0,     0,   192,     0,   193,     0,     0,   194,     0,
-       0,     0,   195,   196,   197,     0,     0,   198,     0,     0,
-       0,     0,   199,   200,     0,     0,     0,     0,   201,   202,
-       0,   203,     0,     0,     0,   204,     0,   205,   206,   207,
-     208,   209,     0,     0,     0,   210,     0,     0,   211,   212,
-     213,     0,     0,     0,   214,     0,   215,   216,     0,   217,
-     218,   219,     0,     0,   220,   221,     0,   222,   223,   224,
-     225,   226,   227,     0,     0,   228,   229,   230,   231,   232,
-       0,     0,   233,   234,     0,   235,   236,   237,     0,     0,
-     238,     0,     0,     0,   239,   240,     0,   241,     0,   242,
-       0,   243,   244,   245,   246,     0,   247,     0,   248,     0,
-       0,     0,   249,   250,     0,   251,     0,     0,   252,   253,
-       0,     0,     0,   254,   255,   256,   257,     0,     0,   258,
-     259,   260,     0,     0,   261,     0,     0,     0,     0,   262,
-     263,     0,     0,     0,   264,     0,     0,     0,   265,   266,
-       0,   267,   268,     0,     0,     0,   269,     0,     0,   270,
-     271,     0,     0,   272,     0,     0,   273,   274,     0,     0,
-       0,     0,     0,   275,   276,     0,   277,     0,   278,     0,
-     279,   280,     0,     0,  1884,     0,     0,     0,     0,   281,
-       0,   282,   283,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,     0,   299,
-     300,   301,     0,   302,   303,   304,   305,     0,   306,   307,
-       0,     0,     0,     0,   308,   309,   310,   311,   312,   313,
-       0,     0,   314,   315,     0,   316,     0,   317,     0,   318,
-     319,   320,   321,   322,   323,   324,   325,   326,     0,     0,
-     327,   328,     0,     0,   329,   330,   331,   332,     0,     0,
-       0,   333,   334,     0,     0,  1885,   335,     0,   336,   337,
-     338,     0,   339,   340,   341,     0,   342,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   343,   344,   345,   722,
-     346,   347,     0,   348,   349,   350,   351,   352,   353,   354,
-     355,   356,   357,     0,     0,   358,   359,   360,     0,   361,
-       0,   362,   363,   364,   365,   366,     0,   367,   368,   369,
-       0,     0,   370,     0,     0,     0,   371,   372,   373,   374,
-     375,     0,     0,   376,   377,   378,   379,   380,     0,   381,
-     382,     0,   383,   384,   385,     0,     0,   386,     0,   387,
-       0,   388,   389,     0,   390,   391,   392,     0,   393,     0,
-       0,   394,   395,   396,   397,   398,   399,   400,   401,   402,
-     403,   404,     0,   405,   406,     0,     0,     0,   407,   408,
-     409,   410,     0,     0,     0,   411,     0,     0,     0,   412,
-       0,   413,   414,   415,   416,     0,   417,   418,   419,   420,
-     421,     0,     0,     0,     0,     0,   422,   423,   424,     0,
-     425,   426,     0,   427,     0,     0,   428,     0,     0,   429,
-     430,   431,   432,   433,   434,     0,     0,   435,   436,     0,
-     437,   438,   439,   440,   441,   442,     0,     0,   443,   444,
-     445,   446,     0,   447,   448,     0,     0,   449,   450,   451,
-     452,     0,     0,   453,   454,     0,   455,   456,   457,   458,
-       0,     0,     0,     0,     0,   459,   460,     0,     0,     0,
-     461,   462,   463,   464,  1886,   465,   466,     0,   467,   468,
-       0,   469,   470,     0,     0,   471,     0,     0,   472,     0,
-     473,     0,   474,   475,     0,     0,     0,     0,     0,     0,
-     476,     0,     0,   477,     0,     0,     0,   478,   479,   480,
-     481,   482,     0,     0,     0,     0,     0,     0,   483,   484,
-       0,   485,   486,   487,     0,   137,   488,   138,   139,   140,
-     141,   142,     0,     0,   143,     0,     0,     0,   144,     0,
-       0,   145,     0,   146,   147,   148,   149,   150,   151,     0,
-     152,     0,     0,  1339,   153,     0,     0,     0,   154,     0,
-       0,   155,   156,   157,     0,   158,     0,   159,   160,     0,
-       0,   161,     0,     0,   162,   163,     0,   164,   165,     0,
-     166,     0,   167,   168,   169,   170,   171,   172,     0,   173,
-     174,     0,   175,   176,   177,   178,   179,   180,   181,   182,
-     183,     0,   184,   185,     0,   186,   187,   188,   189,   190,
-       0,     0,     0,   191,     0,     0,   192,     0,   193,     0,
-       0,   194,     0,     0,     0,   195,   196,   197,     0,     0,
-     198,     0,     0,     0,     0,   199,   200,     0,     0,     0,
-    1340,   201,   202,     0,   203,     0,     0,     0,   204,     0,
-     205,   206,   207,   208,   209,     0,     0,     0,   210,     0,
-       0,   211,   212,   213,     0,     0,     0,   214,     0,   215,
-     216,     0,   217,   218,   219,     0,     0,   220,   221,     0,
-     222,   223,   224,   225,   226,   227,     0,     0,   228,   229,
-     230,   231,   232,     0,     0,   233,   234,     0,   235,   236,
-     237,     0,     0,   238,     0,     0,     0,   239,   240,     0,
-     241,     0,   242,     0,   243,   244,   245,   246,     0,   247,
-       0,   248,     0,     0,     0,   249,   250,     0,   251,     0,
-       0,   252,   253,     0,     0,     0,   254,   255,   256,   257,
-       0,     0,   258,   259,   260,     0,     0,   261,     0,     0,
-       0,     0,   262,   263,     0,     0,     0,   264,     0,     0,
-       0,   265,   266,     0,   267,   268,     0,     0,     0,   269,
-       0,     0,   270,   271,     0,     0,   272,     0,     0,   273,
-     274,   614,     0,     0,     0,     0,   275,   276,     0,   277,
-       0,   278,     0,   279,   280,     0,     0,     0,     0,     0,
-       0,     0,   281,     0,   282,   283,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,     0,   299,   300,   301,     0,   302,   303,   304,   305,
-       0,   306,   307,     0,     0,     0,     0,   308,   309,   310,
-     311,   312,   313,     0,     0,   314,   315,     0,   316,     0,
-     317,     0,   318,   319,   320,   321,   322,   323,   324,   325,
-     326,     0,     0,   327,   328,     0,     0,   329,   330,   331,
-     332,     0,     0,     0,   333,   334,     0,     0,     0,   335,
-       0,   336,   337,   338,     0,   339,   340,   341,     0,   342,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,   343,
-     344,   345,     0,   346,   347,     0,   348,   349,   350,   351,
-     352,   353,   354,   355,   356,   357,     0,     0,   358,   359,
-     360,     0,   361,     0,   362,   363,   364,   365,   366,     0,
-     367,   368,   369,     0,     0,   370,     0,     0,     0,   371,
-     372,   373,   374,   375,     0,     0,   376,   377,   378,   379,
-     380,     0,   381,   382,     0,   383,   384,   385,     0,     0,
-     386,     0,   387,     0,   388,   389,     0,   390,   391,   392,
-       0,   393,     0,     0,   394,   395,   396,   397,   398,   399,
-     400,   401,   402,   403,   404,     0,   405,   406,     0,     0,
-       0,   407,   408,   409,   410,     0,     0,     0,   411,     0,
-       0,     0,   412,     0,   413,   414,   415,   416,     0,   417,
-     418,   419,   420,   421,     0,     0,     0,     0,     0,   422,
-     423,   424,     0,   425,   426,     0,   427,     0,     0,   428,
-       0,     0,   429,   430,   431,   432,   433,   434,     0,     0,
-     435,   436,     0,   437,   438,   439,   440,   441,   442,     0,
-       0,   443,   444,   445,   446,     0,   447,   448,     0,     0,
-     449,   450,   451,   452,     0,   134,   453,   454,     0,   455,
-     456,   457,   458,     0,     0,     0,     0,     0,   459,   460,
-       0,     0,     0,   461,   462,   463,   464,     0,   465,   466,
-       0,   467,   468,     0,   469,   470,     0,     0,   471,     0,
-       0,   472,     0,   473,     0,   474,   475,     0,     0,     0,
-       0,     0,     0,   476,     0,     0,   477,     0,     0,     0,
-     478,   479,   480,   481,   482,     0,     0,     0,     0,     0,
-       0,   483,   484,     0,   485,   486,   487,     0,   137,   488,
-     138,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,   145,     0,   146,   147,   148,   149,
-     150,   151,     0,   152,     0,     0,     0,   153,     0,     0,
-       0,   154,     0,     0,   155,   156,   157,     0,   158,     0,
-     159,   160,     0,     0,   161,     0,     0,   162,   163,     0,
-     164,   165,     0,   166,     0,   167,   168,   169,   170,   171,
-     172,     0,   173,   174,     0,   175,   176,   177,   178,   179,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,   189,   190,     0,     0,     0,   191,     0,     0,   192,
-       0,   193,   960,     0,   194,     0,     0,     0,   195,   196,
-     197,     0,     0,   198,     0,     0,     0,     0,   199,   200,
-       0,     0,     0,     0,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,   210,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,   215,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,   227,     0,
-       0,   228,   229,   230,   231,   232,     0,     0,   233,   234,
-       0,   235,   236,   237,     0,     0,   238,     0,     0,     0,
-     239,   240,     0,   241,     0,   242,     0,   243,   244,   245,
-     246,     0,   247,     0,   248,     0,     0,     0,   249,   250,
-       0,   251,     0,     0,   252,   253,     0,     0,     0,   254,
-     255,   256,   257,     0,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,     0,   262,   263,     0,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,   270,   271,     0,     0,   272,
-       0,     0,   273,   274,   614,     0,     0,     0,     0,   275,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-       0,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,     0,   302,
-     303,   304,   305,     0,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   312,   313,     0,     0,   314,   315,
-       0,   316,     0,   317,     0,   318,   319,   320,   321,   322,
-     323,   324,   325,   326,     0,     0,   327,   328,     0,     0,
-     329,   330,   331,   332,     0,     0,     0,   333,   334,     0,
-       0,     0,   335,     0,   336,   337,   338,     0,   339,   340,
-     341,     0,   342,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   343,   344,   345,     0,   346,   347,     0,   348,
-     349,   350,   351,   352,   353,   354,   355,   356,   357,     0,
-       0,   358,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   367,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,   382,     0,   383,   384,
-     385,     0,     0,   386,     0,   387,     0,   388,   389,     0,
-     390,   391,   392,     0,   393,     0,     0,   394,   395,   396,
-     397,   398,   399,   400,   401,   402,   403,   404,     0,   405,
-     406,     0,     0,     0,   407,   408,   409,   410,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,   413,   414,   415,
-     416,     0,   417,   418,   419,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,   430,   431,   432,   433,
-     434,     0,     0,   435,   436,     0,   437,   438,   439,   440,
-     441,   442,     0,     0,   443,   444,   445,   446,     0,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,   134,   453,
-     454,     0,   455,   456,   457,   458,     0,     0,     0,     0,
-       0,   459,   460,     0,     0,     0,   461,   462,   463,   464,
-       0,   465,   466,     0,   467,   468,     0,   469,   470,     0,
-       0,   471,     0,     0,   472,     0,   473,     0,   474,   475,
-       0,     0,     0,     0,     0,     0,   476,     0,     0,   477,
-       0,     0,     0,   478,   479,   480,   481,   482,     0,     0,
-       0,     0,     0,     0,   483,   484,     0,   485,   486,   487,
-       0,   137,   488,   138,   139,   140,   141,   142,  1374,     0,
-     143,     0,     0,     0,   144,     0,     0,   145,     0,   146,
-     147,   148,   149,   150,   151,     0,   152,     0,     0,     0,
-     153,     0,     0,     0,   154,     0,     0,   155,   156,   157,
-       0,   158,     0,   159,   160,     0,     0,   161,     0,     0,
-     162,   163,     0,   164,   165,     0,   166,     0,   167,   168,
-     169,   170,   171,   172,     0,   173,   174,     0,   175,   176,
-     177,   178,   179,   180,   181,   182,   183,     0,   184,   185,
-       0,   186,   187,   188,   189,   190,     0,     0,     0,   191,
-       0,     0,   192,     0,   193,     0,     0,   194,     0,     0,
-       0,   195,   196,   197,     0,     0,   198,     0,     0,     0,
-       0,   199,   200,     0,     0,     0,     0,   201,   202,     0,
-     203,     0,     0,     0,   204,     0,   205,   206,   207,   208,
-     209,     0,     0,     0,   210,     0,     0,   211,   212,   213,
-       0,     0,     0,   214,     0,   215,   216,     0,   217,   218,
-     219,     0,     0,   220,   221,     0,   222,   223,   224,   225,
-     226,   227,     0,     0,   228,   229,   230,   231,   232,     0,
-       0,   233,   234,     0,   235,   236,   237,     0,     0,   238,
-       0,     0,     0,   239,   240,     0,   241,     0,   242,     0,
-     243,   244,   245,   246,     0,   247,     0,   248,     0,     0,
-       0,   249,   250,     0,   251,     0,     0,   252,   253,     0,
-       0,     0,   254,   255,   256,   257,     0,     0,   258,   259,
-     260,     0,     0,   261,     0,     0,     0,     0,   262,   263,
-       0,     0,     0,   264,     0,     0,     0,   265,   266,     0,
-     267,   268,     0,     0,     0,   269,     0,     0,   270,   271,
-       0,     0,   272,     0,     0,   273,   274,   614,     0,     0,
-       0,     0,   275,   276,     0,   277,     0,   278,     0,   279,
-     280,     0,     0,     0,     0,     0,     0,     0,   281,     0,
-     282,   283,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,     0,   299,   300,
-     301,     0,   302,   303,   304,   305,     0,   306,   307,     0,
-       0,     0,     0,   308,   309,   310,   311,   312,   313,     0,
-       0,   314,   315,     0,   316,     0,   317,     0,   318,   319,
-     320,   321,   322,   323,   324,   325,   326,     0,     0,   327,
-     328,     0,     0,   329,   330,   331,   332,     0,     0,     0,
-     333,   334,     0,     0,     0,   335,     0,   336,   337,   338,
-       0,   339,   340,   341,     0,   342,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   343,   344,   345,     0,   346,
-     347,     0,   348,   349,   350,   351,   352,   353,   354,   355,
-     356,   357,     0,     0,   358,   359,   360,     0,   361,     0,
-     362,   363,   364,   365,   366,     0,   367,   368,   369,     0,
-       0,   370,     0,     0,     0,   371,   372,   373,   374,   375,
-       0,     0,   376,   377,   378,   379,   380,     0,   381,   382,
-       0,   383,   384,   385,     0,     0,   386,     0,   387,     0,
-     388,   389,     0,   390,   391,   392,     0,   393,     0,     0,
-     394,   395,   396,   397,   398,   399,   400,   401,   402,   403,
-     404,     0,   405,   406,     0,     0,     0,   407,   408,   409,
-     410,     0,     0,     0,   411,     0,     0,     0,   412,     0,
-     413,   414,   415,   416,     0,   417,   418,   419,   420,   421,
-       0,     0,     0,     0,     0,   422,   423,   424,     0,   425,
-     426,     0,   427,     0,     0,   428,     0,     0,   429,   430,
-     431,   432,   433,   434,     0,     0,   435,   436,     0,   437,
-     438,   439,   440,   441,   442,     0,     0,   443,   444,   445,
-     446,     0,   447,   448,     0,     0,   449,   450,   451,   452,
-       0,   134,   453,   454,     0,   455,   456,   457,   458,     0,
-       0,     0,     0,     0,   459,   460,     0,     0,     0,   461,
-     462,   463,   464,     0,   465,   466,     0,   467,   468,     0,
-     469,   470,     0,     0,   471,     0,     0,   472,     0,   473,
-       0,   474,   475,     0,     0,     0,     0,     0,     0,   476,
-       0,     0,   477,     0,     0,     0,   478,   479,   480,   481,
-     482,     0,     0,     0,     0,     0,     0,   483,   484,     0,
-     485,   486,   487,     0,   137,   488,   138,   139,   140,   141,
-     142,     0,     0,   143,     0,     0,     0,   144,     0,     0,
-     145,     0,   146,   147,   148,   149,   150,   151,     0,   152,
-       0,     0,     0,   153,   937,     0,     0,   154,     0,     0,
-     155,   156,   157,     0,   158,     0,   159,   160,     0,     0,
-     161,     0,     0,   162,   163,     0,   164,   165,     0,   166,
-       0,   167,   168,   169,   170,   171,   172,     0,   173,   174,
-       0,   175,   176,   177,   178,   179,   180,   181,   182,   183,
-       0,   184,   185,     0,   186,   187,   188,   189,   190,     0,
-       0,     0,   191,     0,     0,   192,     0,   193,     0,     0,
-     194,     0,     0,     0,   195,   196,   197,     0,     0,   198,
-       0,     0,     0,     0,   199,   200,     0,     0,     0,     0,
-     201,   202,     0,   203,     0,     0,     0,   204,     0,   205,
-     206,   207,   208,   209,     0,     0,     0,   210,     0,     0,
-     211,   212,   213,     0,     0,     0,   214,     0,   215,   216,
-       0,   217,   218,   219,     0,     0,   220,   221,     0,   222,
-     223,   224,   225,   226,   227,     0,     0,   228,   229,   230,
-     231,   232,     0,     0,   233,   234,     0,   235,   236,   237,
-       0,     0,   238,     0,     0,     0,   239,   240,     0,   241,
-       0,   242,     0,   243,   244,   245,   246,     0,   247,     0,
-     248,     0,     0,     0,   249,   250,     0,   251,   938,     0,
-     252,   253,     0,     0,     0,   254,   255,   256,   257,     0,
-       0,   258,   259,   260,     0,     0,   261,     0,     0,     0,
-       0,   262,   263,     0,     0,     0,   264,     0,     0,     0,
-     265,   266,     0,   267,   268,     0,     0,     0,   269,     0,
-       0,   270,   271,     0,     0,   272,     0,     0,   273,   274,
-       0,     0,     0,     0,     0,   275,   276,     0,   277,     0,
-     278,     0,   279,   280,     0,     0,     0,     0,     0,     0,
-       0,   281,     0,   282,   283,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,     0,   302,   303,   304,   305,     0,
-     306,   307,     0,     0,     0,     0,   308,   309,   310,   311,
-     312,   313,     0,     0,   314,   315,     0,   316,     0,   317,
-       0,   318,   319,   320,   321,   322,   323,   324,   325,   326,
-       0,     0,   327,   328,     0,     0,   329,   330,   331,   332,
-       0,     0,     0,   333,   334,     0,     0,     0,   335,     0,
-     336,   337,   338,     0,   339,   340,   341,     0,   342,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   343,   344,
-     345,     0,   346,   347,     0,   348,   349,   350,   351,   352,
-     353,   354,   355,   356,   357,     0,     0,   358,   359,   360,
-       0,   361,     0,   362,   363,   364,   365,   366,     0,   367,
-     368,   369,     0,     0,   370,     0,     0,     0,   371,   372,
-     373,   374,   375,     0,     0,   376,   377,   378,   379,   380,
-       0,   381,   382,     0,   383,   384,   385,     0,     0,   386,
-       0,   387,     0,   388,   389,     0,   390,   391,   392,     0,
-     393,     0,     0,   394,   395,   396,   397,   398,   399,   400,
-     401,   402,   403,   404,     0,   405,   406,     0,     0,     0,
-     407,   408,   409,   410,     0,     0,     0,   411,     0,     0,
-       0,   412,     0,   413,   414,   415,   416,     0,   417,   418,
-     419,   420,   421,     0,     0,     0,     0,     0,   422,   423,
-     424,     0,   425,   426,     0,   427,     0,     0,   428,     0,
-       0,   429,   430,   431,   432,   433,   434,     0,     0,   435,
-     436,     0,   437,   438,   439,   440,   441,   442,     0,     0,
-     443,   444,   445,   446,     0,   447,   448,     0,     0,   449,
-     450,   451,   452,     0,   939,   453,   454,     0,   455,   456,
-     457,   458,     0,     0,     0,     0,     0,   459,   460,     0,
-       0,     0,   461,   462,   463,   464,     0,   465,   466,     0,
-     467,   468,     0,   469,   470,     0,     0,   471,     0,     0,
-     472,     0,   473,     0,   474,   475,     0,     0,     0,     0,
-       0,     0,   476,     0,     0,   477,     0,     0,     0,   478,
-     479,   480,   481,   482,     0,     0,     0,     0,     0,     0,
-     483,   484,     0,   485,   486,   487,     0,   137,   488,   138,
-     139,   140,   141,   142,     0,     0,   143,     0,     0,     0,
-     144,     0,     0,   145,     0,   146,   147,   148,   149,   150,
-     151,     0,   152,     0,     0,     0,   153,     0,     0,     0,
-     154,     0,     0,   155,   156,   157,     0,   158,     0,   159,
-     160,     0,     0,   161,     0,     0,   162,   163,     0,   164,
-     165,     0,   166,     0,   167,   168,   169,   170,   171,   172,
-       0,   173,   174,     0,   175,   176,   177,   178,   179,   180,
-     181,   182,   183,     0,   184,   185,     0,   186,   187,   188,
-     189,   190,     0,     0,     0,   191,     0,     0,   192,     0,
-     193,     0,     0,   194,     0,     0,     0,   195,   196,   197,
-       0,     0,   198,     0,     0,     0,     0,   199,   200,     0,
-       0,     0,  2395,   201,   202,     0,   203,     0,     0,     0,
-     204,     0,   205,   206,   207,   208,   209,     0,     0,     0,
-     210,     0,     0,   211,   212,   213,     0,     0,     0,   214,
-       0,   215,   216,     0,   217,   218,   219,     0,     0,   220,
-     221,     0,   222,   223,   224,   225,   226,   227,     0,     0,
-     228,   229,   230,   231,   232,     0,     0,   233,   234,     0,
-     235,   236,   237,     0,     0,   238,     0,     0,     0,   239,
-     240,     0,   241,     0,   242,     0,   243,   244,   245,   246,
-       0,   247,     0,   248,     0,     0,     0,   249,   250,     0,
-     251,     0,     0,   252,   253,     0,     0,     0,   254,   255,
-     256,   257,     0,     0,   258,   259,   260,     0,     0,   261,
-       0,     0,     0,     0,   262,   263,     0,     0,     0,   264,
-       0,     0,     0,   265,   266,     0,   267,   268,     0,     0,
-       0,   269,     0,     0,   270,   271,     0,     0,   272,     0,
-       0,   273,   274,   614,     0,     0,     0,     0,   275,   276,
-       0,   277,     0,   278,     0,   279,   280,     0,     0,     0,
-       0,     0,     0,     0,   281,     0,   282,   283,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,     0,   299,   300,   301,     0,   302,   303,
-     304,   305,     0,   306,   307,     0,     0,     0,     0,   308,
-     309,   310,   311,   312,   313,     0,     0,   314,   315,     0,
-     316,     0,   317,     0,   318,   319,   320,   321,   322,   323,
-     324,   325,   326,     0,     0,   327,   328,     0,     0,   329,
-     330,   331,   332,     0,     0,     0,   333,   334,     0,     0,
-       0,   335,     0,   336,   337,   338,     0,   339,   340,   341,
-       0,   342,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   343,   344,   345,     0,   346,   347,     0,   348,   349,
-     350,   351,   352,   353,   354,   355,   356,   357,     0,     0,
-     358,   359,   360,     0,   361,     0,   362,   363,   364,   365,
-     366,     0,   367,   368,   369,     0,     0,   370,     0,     0,
-       0,   371,   372,   373,   374,   375,     0,     0,   376,   377,
-     378,   379,   380,     0,   381,   382,     0,   383,   384,   385,
-       0,     0,   386,     0,   387,     0,   388,   389,     0,   390,
-     391,   392,     0,   393,     0,     0,   394,   395,   396,   397,
-     398,   399,   400,   401,   402,   403,   404,     0,   405,   406,
-       0,     0,     0,   407,   408,   409,   410,     0,     0,     0,
-     411,     0,     0,     0,   412,     0,   413,   414,   415,   416,
-       0,   417,   418,   419,   420,   421,     0,     0,     0,     0,
-       0,   422,   423,   424,     0,   425,   426,     0,   427,     0,
-       0,   428,     0,     0,   429,   430,   431,   432,   433,   434,
-       0,     0,   435,   436,     0,   437,   438,   439,   440,   441,
-     442,     0,     0,   443,   444,   445,   446,     0,   447,   448,
-       0,     0,   449,   450,   451,   452,     0,   134,   453,   454,
-       0,   455,   456,   457,   458,     0,     0,     0,     0,     0,
-     459,   460,     0,     0,     0,   461,   462,   463,   464,     0,
-     465,   466,     0,   467,   468,     0,   469,   470,     0,     0,
-     471,     0,     0,   472,     0,   473,     0,   474,   475,     0,
-       0,     0,     0,     0,     0,   476,     0,     0,   477,     0,
-       0,     0,   478,   479,   480,   481,   482,     0,     0,     0,
-       0,     0,     0,   483,   484,     0,   485,   486,   487,     0,
-     137,   488,   138,   139,   140,   141,   142,     0,     0,   143,
-       0,     0,     0,   144,     0,     0,   145,     0,   146,   147,
-     148,   149,   150,   151,     0,   152,     0,     0,  1339,   153,
-       0,     0,     0,   154,     0,     0,   155,   156,   157,     0,
-     158,     0,   159,   160,     0,     0,   161,     0,     0,   162,
-     163,     0,   164,   165,     0,   166,     0,   167,   168,   169,
-     170,   171,   172,     0,   173,   174,     0,   175,   176,   177,
-     178,   179,   180,   181,   182,   183,     0,   184,   185,     0,
-     186,   187,   188,   189,   190,     0,     0,     0,   191,     0,
-       0,   192,     0,   193,     0,     0,   194,     0,     0,     0,
-     195,   196,   197,     0,     0,   198,     0,     0,     0,     0,
-     199,   200,     0,     0,     0,     0,   201,   202,     0,   203,
-       0,     0,     0,   204,     0,   205,   206,   207,   208,   209,
-       0,     0,     0,   210,     0,     0,   211,   212,   213,     0,
-       0,     0,   214,     0,   215,   216,     0,   217,   218,   219,
-       0,     0,   220,   221,     0,   222,   223,   224,   225,   226,
-     227,     0,     0,   228,   229,   230,   231,   232,     0,     0,
-     233,   234,     0,   235,   236,   237,     0,     0,   238,     0,
-       0,     0,   239,   240,     0,   241,     0,   242,     0,   243,
-     244,   245,   246,     0,   247,     0,   248,     0,     0,     0,
-     249,   250,     0,   251,     0,     0,   252,   253,     0,     0,
-       0,   254,   255,   256,   257,     0,     0,   258,   259,   260,
-       0,     0,   261,     0,     0,     0,     0,   262,   263,     0,
-       0,     0,   264,     0,     0,     0,   265,   266,     0,   267,
-     268,     0,     0,     0,   269,     0,     0,   270,   271,     0,
-       0,   272,     0,     0,   273,   274,   614,     0,     0,     0,
-       0,   275,   276,     0,   277,     0,   278,     0,   279,   280,
-       0,     0,     0,     0,     0,     0,     0,   281,     0,   282,
-     283,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,     0,   299,   300,   301,
-       0,   302,   303,   304,   305,     0,   306,   307,     0,     0,
-       0,     0,   308,   309,   310,   311,   312,   313,     0,     0,
-     314,   315,     0,   316,     0,   317,     0,   318,   319,   320,
-     321,   322,   323,   324,   325,   326,     0,     0,   327,   328,
-       0,     0,   329,   330,   331,   332,     0,     0,     0,   333,
-     334,     0,     0,     0,   335,     0,   336,   337,   338,     0,
-     339,   340,   341,     0,   342,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   343,   344,   345,     0,   346,   347,
-       0,   348,   349,   350,   351,   352,   353,   354,   355,   356,
-     357,     0,     0,   358,   359,   360,     0,   361,     0,   362,
-     363,   364,   365,   366,     0,   367,   368,   369,     0,     0,
-     370,     0,     0,     0,   371,   372,   373,   374,   375,     0,
-       0,   376,   377,   378,   379,   380,     0,   381,   382,     0,
-     383,   384,   385,     0,     0,   386,     0,   387,     0,   388,
-     389,     0,   390,   391,   392,     0,   393,     0,     0,   394,
-     395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
-       0,   405,   406,     0,     0,     0,   407,   408,   409,   410,
-       0,     0,     0,   411,     0,     0,     0,   412,     0,   413,
-     414,   415,   416,     0,   417,   418,   419,   420,   421,     0,
-       0,     0,     0,     0,   422,   423,   424,     0,   425,   426,
-       0,   427,     0,     0,   428,     0,     0,   429,   430,   431,
-     432,   433,   434,     0,     0,   435,   436,     0,   437,   438,
-     439,   440,   441,   442,     0,     0,   443,   444,   445,   446,
-       0,   447,   448,     0,     0,   449,   450,   451,   452,     0,
-     134,   453,   454,     0,   455,   456,   457,   458,     0,     0,
-       0,     0,     0,   459,   460,     0,     0,     0,   461,   462,
-     463,   464,     0,   465,   466,     0,   467,   468,     0,   469,
-     470,     0,     0,   471,     0,     0,   472,     0,   473,     0,
-     474,   475,     0,     0,     0,     0,     0,     0,   476,     0,
-       0,   477,     0,     0,     0,   478,   479,   480,   481,   482,
-       0,     0,     0,     0,     0,     0,   483,   484,     0,   485,
-     486,   487,     0,   137,   488,   138,   139,   140,   141,   142,
-       0,     0,   143,     0,     0,     0,   144,     0,     0,   145,
-       0,   146,   147,   148,   149,   150,   151,     0,   152,     0,
-       0,     0,   153,     0,     0,     0,   154,     0,     0,   155,
-     156,   157,     0,   158,     0,   159,   160,     0,     0,   161,
-       0,     0,   162,   163,     0,   164,   165,     0,   166,     0,
-     167,   168,   169,   170,   171,   172,     0,   173,   174,     0,
-     175,   176,   177,   178,   179,   180,   181,   182,   183,     0,
-     184,   185,     0,   186,   187,   188,   189,   190,     0,     0,
-       0,   191,     0,     0,   192,     0,   193,     0,     0,   194,
-       0,     0,     0,   195,   196,   197,     0,     0,   198,     0,
-       0,     0,     0,   199,   200,     0,     0,     0,     0,   201,
-     202,     0,   203,     0,     0,     0,   204,     0,   205,   206,
-     207,   208,   209,     0,     0,     0,   210,     0,     0,   211,
-     212,   213,     0,     0,     0,   214,     0,   215,   216,     0,
-     217,   218,   219,     0,     0,   220,   221,     0,   222,   223,
-     224,   225,   226,   227,     0,     0,   228,   229,   230,   231,
-     232,     0,     0,   233,   234,     0,   235,   236,   237,     0,
-       0,   238,     0,     0,     0,   239,   240,     0,   241,     0,
-     242,     0,   243,   244,   245,   246,     0,   247,     0,   248,
-       0,     0,     0,   249,   250,     0,   251,     0,     0,   252,
-     253,     0,     0,     0,   254,   255,   256,   257,     0,     0,
-     258,   259,   260,     0,     0,   261,     0,     0,     0,     0,
-     262,   263,     0,     0,     0,   264,     0,     0,     0,   265,
-     266,     0,   267,   268,     0,     0,     0,   269,     0,     0,
-     270,   271,     0,     0,   272,     0,     0,   273,   274,   614,
-       0,     0,     0,     0,   275,   276,     0,   277,     0,   278,
-       0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     281,     0,   282,   283,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,     0,
-     299,   300,   301,     0,   302,   303,   304,   305,     0,   306,
-     307,     0,     0,     0,     0,   308,   309,   310,   311,   312,
-     313,     0,     0,   314,   315,     0,   316,     0,   317,     0,
-     318,   319,   320,   321,   322,   323,   324,   325,   326,     0,
-       0,   327,   328,     0,     0,   329,   330,   331,   332,     0,
-       0,     0,   333,   334,     0,     0,     0,   335,     0,   336,
-     337,   338,     0,   339,   340,   341,     0,   342,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   343,   344,   345,
-       0,   346,   347,     0,   348,   349,   350,   351,   352,   353,
-     354,   355,   356,   357,     0,     0,   358,   359,   360,     0,
-     361,     0,   362,   363,   364,   365,   366,     0,   367,   368,
-     369,     0,     0,   370,     0,     0,     0,   371,   372,   373,
-     374,   375,     0,     0,   376,   377,   378,   379,   380,     0,
-     381,   382,     0,   383,   384,   385,     0,     0,   386,     0,
-     387,     0,   388,   389,     0,   390,   391,   392,     0,   393,
-       0,     0,   394,   395,   396,   397,   398,   399,   400,   401,
-     402,   403,   404,     0,   405,   406,     0,     0,     0,   407,
-     408,   409,   410,     0,     0,     0,   411,     0,     0,     0,
-     412,     0,   413,   414,   415,   416,     0,   417,   418,   419,
-     420,   421,     0,     0,     0,     0,     0,   422,   423,   424,
-       0,   425,   426,     0,   427,     0,     0,   428,     0,     0,
-     429,   430,   431,   432,   433,   434,     0,     0,   435,   436,
-       0,   437,   438,   439,   440,   441,   442,     0,     0,   443,
-     444,   445,   446,     0,   447,   448,     0,     0,   449,   450,
-     451,   452,     0,   134,   453,   454,     0,   455,   456,   457,
-     458,     0,     0,     0,     0,     0,   459,   460,     0,     0,
-       0,   461,   462,   463,   464,     0,   465,   466,     0,   467,
-     468,     0,   469,   470,     0,     0,   471,     0,     0,   472,
-       0,   473,     0,   474,   475,     0,     0,     0,     0,     0,
-       0,   476,     0,     0,   477,     0,     0,     0,   478,   479,
-     480,   481,   482,     0,     0,     0,     0,     0,     0,   483,
-     484,     0,   485,   486,   487,     0,   137,   488,   138,   139,
-     140,   141,   142,     0,     0,   143,     0,     0,     0,   144,
-    2852,     0,   145,     0,   146,   147,   148,   149,   150,   151,
-       0,   152,     0,     0,     0,   153,     0,     0,     0,   154,
-       0,     0,   155,   156,   157,     0,   158,     0,   159,   160,
-       0,     0,   161,     0,     0,   162,   163,     0,   164,   165,
-       0,   166,     0,   167,   168,   169,   170,   171,   172,     0,
-     173,   174,     0,   175,   176,   177,   178,   179,   180,   181,
-     182,   183,     0,   184,   185,     0,   186,   187,   188,   189,
-     190,     0,     0,     0,   191,     0,     0,   192,     0,   193,
-       0,     0,   194,     0,     0,     0,   195,   196,   197,     0,
-       0,   198,     0,     0,     0,     0,   199,   200,     0,     0,
-       0,     0,   201,   202,     0,   203,     0,     0,     0,   204,
-       0,   205,   206,   207,   208,   209,     0,     0,     0,   210,
-       0,     0,   211,   212,   213,     0,     0,     0,   214,     0,
-     215,   216,     0,   217,   218,   219,     0,     0,   220,   221,
-       0,   222,   223,   224,   225,   226,   227,     0,     0,   228,
-     229,   230,   231,   232,     0,     0,   233,   234,     0,   235,
-     236,   237,     0,     0,   238,     0,     0,     0,   239,   240,
-       0,   241,     0,   242,     0,   243,   244,   245,   246,     0,
-     247,     0,   248,     0,     0,     0,   249,   250,     0,   251,
-       0,     0,   252,   253,     0,     0,     0,   254,   255,   256,
-     257,     0,     0,   258,   259,   260,     0,     0,   261,     0,
-       0,     0,     0,   262,   263,     0,     0,     0,   264,     0,
-       0,     0,   265,   266,     0,   267,   268,     0,     0,     0,
-     269,     0,     0,   270,   271,     0,     0,   272,     0,     0,
-     273,   274,     0,     0,     0,     0,     0,   275,   276,     0,
-     277,     0,   278,     0,   279,   280,     0,     0,     0,     0,
-       0,     0,     0,   281,     0,   282,   283,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,     0,   299,   300,   301,     0,   302,   303,   304,
-     305,     0,   306,   307,     0,     0,     0,     0,   308,   309,
-     310,   311,   312,   313,     0,     0,   314,   315,     0,   316,
-       0,   317,     0,   318,   319,   320,   321,   322,   323,   324,
-     325,   326,     0,     0,   327,   328,     0,     0,   329,   330,
-     331,   332,     0,     0,     0,   333,   334,     0,     0,     0,
-     335,     0,   336,   337,   338,     0,   339,   340,   341,     0,
-     342,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     343,   344,   345,     0,   346,   347,     0,   348,   349,   350,
-     351,   352,   353,   354,   355,   356,   357,     0,     0,   358,
-     359,   360,     0,   361,     0,   362,   363,   364,   365,   366,
-       0,   367,   368,   369,     0,     0,   370,     0,     0,     0,
-     371,   372,   373,   374,   375,     0,     0,   376,   377,   378,
-     379,   380,     0,   381,   382,     0,   383,   384,   385,     0,
-       0,   386,     0,   387,     0,   388,   389,     0,   390,   391,
-     392,     0,   393,     0,     0,   394,   395,   396,   397,   398,
-     399,   400,   401,   402,   403,   404,     0,   405,   406,     0,
-       0,     0,   407,   408,   409,   410,     0,     0,     0,   411,
-       0,     0,     0,   412,     0,   413,   414,   415,   416,     0,
-     417,   418,   419,   420,   421,     0,     0,     0,     0,     0,
-     422,   423,   424,     0,   425,   426,     0,   427,     0,     0,
-     428,     0,     0,   429,   430,   431,   432,   433,   434,     0,
-       0,   435,   436,     0,   437,   438,   439,   440,   441,   442,
-       0,     0,   443,   444,   445,   446,     0,   447,   448,     0,
-       0,   449,   450,   451,   452,     0,   134,   453,   454,     0,
-     455,   456,   457,   458,     0,     0,     0,     0,     0,   459,
-     460,     0,     0,     0,   461,   462,   463,   464,     0,   465,
-     466,     0,   467,   468,     0,   469,   470,     0,     0,   471,
-       0,     0,   472,     0,   473,     0,   474,   475,     0,     0,
-       0,     0,     0,     0,   476,     0,     0,   477,     0,     0,
-       0,   478,   479,   480,   481,   482,     0,     0,     0,     0,
-       0,     0,   483,   484,     0,   485,   486,   487,     0,   137,
-     488,   138,   139,   140,   141,   142,     0,     0,   143,     0,
-       0,     0,   144,     0,     0,   145,     0,   146,   147,   148,
-     149,   150,   151,     0,   152,     0,     0,     0,   153,     0,
-       0,     0,   154,     0,     0,   155,   156,   157,     0,   158,
-       0,   159,   160,     0,     0,   161,     0,     0,   162,   163,
-       0,   164,   165,     0,   166,     0,   167,   168,   169,   170,
-     171,   172,     0,   173,   174,     0,   175,   176,   177,   178,
-     179,   180,   181,   182,   183,     0,   184,   185,     0,   186,
-     187,   188,   189,   190,  4409,     0,     0,   191,     0,     0,
-     192,     0,   193,     0,     0,   194,     0,     0,     0,   195,
-     196,   197,     0,     0,   198,     0,     0,     0,     0,   199,
-     200,     0,     0,     0,     0,   201,   202,     0,   203,     0,
-       0,     0,   204,     0,   205,   206,   207,   208,   209,     0,
-       0,     0,   210,     0,     0,   211,   212,   213,     0,     0,
-       0,   214,     0,   215,   216,     0,   217,   218,   219,     0,
-       0,   220,   221,     0,   222,   223,   224,   225,   226,   227,
-       0,  4410,   228,   229,   230,   231,   232,     0,     0,   233,
-     234,     0,   235,   236,   237,     0,     0,   238,     0,     0,
-       0,   239,   240,     0,   241,     0,   242,     0,   243,   244,
-     245,   246,     0,   247,     0,   248,     0,     0,     0,   249,
-     250,     0,   251,     0,     0,   252,   253,     0,     0,     0,
-     254,   255,   256,   257,     0,     0,   258,   259,   260,     0,
-       0,   261,     0,     0,     0,     0,   262,   263,     0,     0,
-       0,   264,     0,     0,     0,   265,   266,     0,   267,   268,
-       0,     0,     0,   269,     0,     0,   270,   271,     0,     0,
-     272,     0,     0,   273,   274,     0,     0,     0,     0,     0,
-     275,   276,     0,   277,     0,   278,     0,   279,   280,     0,
-       0,     0,     0,     0,     0,     0,   281,     0,   282,   283,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,     0,   299,   300,   301,     0,
-     302,   303,   304,   305,     0,   306,   307,     0,     0,     0,
-       0,   308,   309,   310,   311,   312,   313,     0,     0,   314,
-     315,     0,   316,     0,   317,     0,   318,   319,   320,   321,
-     322,   323,   324,   325,   326,     0,     0,   327,   328,     0,
-       0,   329,   330,   331,   332,     0,     0,     0,   333,   334,
-       0,     0,     0,   335,     0,   336,   337,   338,     0,   339,
-     340,   341,     0,   342,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   343,   344,   345,     0,   346,   347,     0,
-     348,   349,   350,   351,   352,   353,   354,   355,   356,   357,
-       0,     0,   358,   359,   360,     0,   361,     0,   362,   363,
-     364,   365,   366,     0,   367,   368,   369,     0,     0,   370,
-       0,     0,     0,   371,   372,   373,   374,   375,     0,     0,
-     376,   377,   378,   379,   380,     0,   381,   382,     0,   383,
-     384,   385,     0,     0,   386,     0,   387,     0,   388,   389,
-       0,   390,   391,   392,     0,   393,     0,     0,   394,   395,
-     396,   397,   398,   399,   400,   401,   402,   403,   404,     0,
-     405,   406,     0,     0,     0,   407,   408,   409,   410,     0,
-       0,     0,   411,     0,     0,     0,   412,     0,   413,   414,
-     415,   416,     0,   417,   418,   419,   420,   421,     0,     0,
-       0,     0,     0,   422,   423,   424,     0,   425,   426,     0,
-     427,     0,     0,   428,     0,     0,   429,   430,   431,   432,
-     433,   434,     0,     0,   435,   436,     0,   437,   438,   439,
-     440,   441,   442,     0,     0,   443,   444,   445,   446,     0,
-     447,   448,     0,     0,   449,   450,   451,   452,     0,     0,
-     453,   454,     0,   455,   456,   457,   458,     0,     0,     0,
-       0,     0,   459,   460,     0,     0,     0,   461,   462,   463,
-     464,     0,   465,   466,     0,   467,   468,     0,   469,   470,
-       0,     0,   471,     0,     0,   472,     0,   473,     0,   474,
-     475,     0,     0,     0,     0,     0,     0,   476,     0,     0,
-     477,     0,     0,     0,   478,   479,   480,   481,   482,     0,
-       0,     0,     0,     0,     0,   483,   484,     0,   485,   486,
-     487,     0,   137,   488,   138,   139,   140,   141,   142,     0,
-       0,   143,     0,     0,     0,   144,     0,     0,   145,     0,
-     146,   147,   148,   149,   150,   151,     0,   152,     0,     0,
-       0,   153,     0,     0,     0,   154,     0,     0,   155,   156,
-     157,     0,   158,     0,   159,   160,     0,     0,   161,     0,
-       0,   162,   163,     0,   164,   165,     0,   166,     0,   167,
-     168,   169,   170,   171,   172,     0,   173,   174,     0,   175,
-     176,   177,   178,   179,   180,   181,   182,   183,     0,   184,
-     185,     0,   186,   187,   188,   189,   190,     0,     0,     0,
-     191,     0,     0,   192,     0,   193,     0,     0,   194,     0,
-       0,     0,   195,   196,   197,     0,     0,   198,     0,     0,
-       0,     0,   199,   200,     0,     0,     0,     0,   201,   202,
-       0,   203,     0,     0,     0,   204,     0,   205,   206,   207,
-     208,   209,     0,     0,     0,   210,     0,     0,   211,   212,
-     213,     0,     0,     0,   214,     0,   215,   216,     0,   217,
-     218,   219,     0,     0,   220,   221,     0,   222,   223,   224,
-     225,   226,   227,     0,     0,   228,   229,   230,   231,   232,
-       0,     0,   233,   234,     0,   235,   236,   237,     0,     0,
-     238,     0,     0,     0,   239,   240,     0,   241,     0,   242,
-       0,   243,   244,   245,   246,     0,   247,     0,   248,     0,
-       0,     0,   249,   250,     0,   251,     0,     0,   252,   253,
-       0,     0,     0,   254,   255,   256,   257,     0,     0,   258,
-     259,   260,     0,     0,   261,     0,     0,     0,     0,   262,
-     263,     0,     0,     0,   264,     0,     0,     0,   265,   266,
-       0,   267,   268,     0,     0,     0,   269,     0,     0,   270,
-     271,     0,     0,   272,     0,     0,   273,   274,     0,     0,
-       0,     0,     0,   275,   276,     0,   277,     0,   278,     0,
-     279,   280,     0,     0,     0,     0,     0,     0,     0,   281,
-       0,   282,   283,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,     0,   299,
-     300,   301,     0,   302,   303,   304,   305,     0,   306,   307,
-       0,     0,     0,     0,   308,   309,   310,   311,   312,   313,
-       0,     0,   314,   315,     0,   316,     0,   317,     0,   318,
-     319,   320,   321,   322,   323,   324,   325,   326,     0,     0,
-     327,   328,     0,     0,   329,   330,   331,   332,     0,     0,
-       0,   333,   334,     0,     0,     0,   335,     0,   336,   337,
-     338,     0,   339,   340,   341,     0,   342,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   343,   344,   345,     0,
-     346,   347,     0,   348,   349,   350,   351,   352,   353,   354,
-     355,   356,   357,     0,     0,   358,   359,   360,     0,   361,
-       0,   362,   363,   364,   365,   366,     0,   367,   368,   369,
-       0,     0,   370,     0,     0,     0,   371,   372,   373,   374,
-     375,     0,     0,   376,   377,   378,   379,   380,     0,   381,
-     382,     0,   383,   384,   385,     0,     0,   386,     0,   387,
-       0,   388,   389,     0,   390,   391,   392,     0,   393,     0,
-       0,   394,   395,   396,   397,   398,   399,   400,   401,   402,
-     403,   404,     0,   405,   406,     0,     0,     0,   407,   408,
-     409,   410,     0,     0,     0,   411,     0,     0,     0,   412,
-       0,   413,   414,   415,   416,     0,   417,   418,   419,   420,
-     421,     0,     0,     0,   563,     0,   422,   423,   424,     0,
-     425,   426,     0,   427,     0,     0,   428,     0,     0,   429,
-     430,   431,   432,   433,   434,     0,     0,   435,   436,     0,
-     437,   438,   439,   440,   441,   442,     0,     0,   443,   444,
-     445,   446,     0,   447,   448,     0,     0,   449,   450,   451,
-     452,     0,     0,   453,   454,     0,   455,   456,   457,   458,
-       0,     0,     0,     0,     0,   459,   460,     0,     0,     0,
-     461,   462,   463,   464,     0,   465,   466,     0,   467,   468,
-       0,   469,   470,     0,     0,   471,     0,     0,   472,     0,
-     473,     0,   474,   475,     0,     0,     0,     0,     0,     0,
-     476,     0,     0,   477,     0,     0,     0,   478,   479,   480,
-     481,   482,     0,     0,     0,     0,     0,     0,   483,   484,
-       0,   485,   486,   487,     0,   137,   488,   138,   139,   140,
-     141,   142,     0,     0,   143,     0,     0,     0,   144,     0,
-       0,   145,     0,   146,   147,   148,   149,   150,   151,     0,
-     152,     0,     0,     0,   153,     0,     0,     0,   154,     0,
-       0,   155,   156,   157,     0,   158,     0,   159,   160,     0,
-       0,   161,     0,     0,   162,   163,     0,   164,   165,     0,
-     166,     0,   167,   168,   169,   170,   171,   172,     0,   173,
-     174,     0,   175,   176,   177,   178,   179,   180,   181,   182,
-     183,     0,   184,   185,     0,   186,   187,   188,   189,   190,
-       0,     0,     0,   191,     0,     0,   192,     0,   193,     0,
-       0,   194,     0,     0,     0,   195,   196,   197,     0,     0,
-     198,     0,     0,     0,     0,   199,   200,     0,     0,     0,
-       0,   201,   202,     0,   203,     0,     0,     0,   204,     0,
-     205,   206,   207,   208,   209,     0,     0,     0,   210,     0,
-       0,   211,   212,   213,     0,     0,     0,   214,     0,   215,
-     216,     0,   217,   218,   219,     0,     0,   220,   221,     0,
-     222,   223,   224,   225,   226,   227,     0,     0,   228,   229,
-     230,   231,   232,     0,     0,   233,   234,     0,   235,   236,
-     237,     0,     0,   238,     0,     0,     0,   239,   240,  1039,
-     241,     0,   242,     0,   243,   244,   245,   246,     0,   247,
-       0,   248,     0,     0,     0,   249,   250,     0,   251,     0,
-       0,   252,   253,     0,     0,     0,   254,   255,   256,   257,
-       0,     0,   258,   259,   260,     0,     0,   261,     0,     0,
-       0,     0,   262,   263,     0,     0,     0,   264,     0,     0,
-       0,   265,   266,     0,   267,   268,     0,     0,     0,   269,
-       0,     0,   270,   271,     0,     0,   272,     0,     0,   273,
-     274,     0,     0,     0,     0,     0,   275,   276,     0,   277,
-       0,   278,     0,   279,   280,     0,     0,     0,     0,     0,
-       0,     0,   281,     0,   282,   283,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,     0,   299,   300,   301,     0,   302,   303,   304,   305,
-       0,   306,   307,     0,     0,     0,     0,   308,   309,   310,
-     311,   312,   313,     0,     0,   314,   315,     0,   316,     0,
-     317,     0,   318,   319,   320,   321,   322,   323,   324,   325,
-     326,     0,     0,   327,   328,     0,     0,   329,   330,   331,
-     332,     0,     0,     0,   333,   334,     0,     0,     0,   335,
-       0,   336,   337,   338,     0,   339,   340,   341,     0,   342,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,   343,
-     344,   345,     0,   346,   347,     0,   348,   349,   350,   351,
-     352,   353,   354,   355,   356,   357,     0,     0,   358,   359,
-     360,     0,   361,     0,   362,   363,   364,   365,   366,     0,
-     367,   368,   369,     0,     0,   370,     0,     0,     0,   371,
-     372,   373,   374,   375,     0,     0,   376,   377,   378,   379,
-     380,     0,   381,   382,     0,   383,   384,   385,     0,     0,
-     386,     0,   387,     0,   388,   389,     0,   390,   391,   392,
-       0,   393,     0,     0,   394,   395,   396,   397,   398,   399,
-     400,   401,   402,   403,   404,     0,   405,   406,     0,     0,
-       0,   407,   408,   409,   410,     0,     0,     0,   411,     0,
-       0,     0,   412,     0,   413,   414,   415,   416,     0,   417,
-     418,   419,   420,   421,     0,     0,     0,     0,     0,   422,
-     423,   424,     0,   425,   426,     0,   427,     0,     0,   428,
-       0,     0,   429,   430,   431,   432,   433,   434,     0,     0,
-     435,   436,     0,   437,   438,   439,   440,   441,   442,     0,
-       0,   443,   444,   445,   446,     0,   447,   448,     0,     0,
-     449,   450,   451,   452,     0,     0,   453,   454,     0,   455,
-     456,   457,   458,     0,     0,     0,     0,     0,   459,   460,
-       0,     0,     0,   461,   462,   463,   464,     0,   465,   466,
-       0,   467,   468,     0,   469,   470,     0,     0,   471,     0,
-       0,   472,     0,   473,     0,   474,   475,     0,     0,     0,
-       0,     0,     0,   476,     0,     0,   477,     0,     0,     0,
-     478,   479,   480,   481,   482,     0,     0,     0,     0,     0,
-       0,   483,   484,     0,   485,   486,   487,     0,   137,   488,
-     138,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,   145,     0,   146,   147,   148,   149,
-     150,   151,     0,   152,     0,     0,     0,   153,     0,     0,
-       0,   154,     0,     0,   155,   156,   157,     0,   158,     0,
-     159,   160,     0,     0,   161,     0,     0,   162,   163,     0,
-     164,   165,     0,   166,     0,   167,   168,   169,   170,   171,
-     172,     0,   173,   174,     0,   175,   176,   177,   178,   179,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,   189,   190,     0,     0,     0,   191,     0,     0,   192,
-       0,   193,     0,     0,   194,     0,     0,     0,   195,   196,
-     197,     0,     0,   198,     0,     0,     0,     0,   199,   200,
-       0,     0,     0,   870,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,   210,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,   215,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,   227,     0,
-       0,   228,   229,   230,   231,   232,     0,     0,   233,   234,
-       0,   235,   236,   237,     0,     0,   238,     0,     0,     0,
-     239,   240,     0,   241,     0,   242,     0,   243,   244,   245,
-     246,     0,   247,     0,   248,     0,     0,     0,   249,   250,
-       0,   251,     0,     0,   252,   253,     0,     0,     0,   254,
-     255,   256,   257,     0,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,     0,   262,   263,     0,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,   270,   271,     0,     0,   272,
-       0,     0,   273,   274,     0,     0,     0,     0,     0,   275,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-       0,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,     0,   302,
-     303,   304,   305,     0,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   312,   313,     0,     0,   314,   315,
-       0,   316,     0,   317,     0,   318,   319,   320,   321,   322,
-     323,   324,   325,   326,     0,     0,   327,   328,     0,     0,
-     329,   330,   331,   332,     0,     0,     0,   333,   334,     0,
-       0,     0,   335,     0,   336,   337,   338,     0,   339,   340,
-     341,     0,   342,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   343,   344,   345,     0,   346,   347,     0,   348,
-     349,   350,   351,   352,   353,   354,   355,   356,   357,     0,
-       0,   358,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   367,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,   382,     0,   383,   384,
-     385,     0,     0,   386,     0,   387,     0,   388,   389,     0,
-     390,   391,   392,     0,   393,     0,     0,   394,   395,   396,
-     397,   398,   399,   400,   401,   402,   403,   404,     0,   405,
-     406,     0,     0,     0,   407,   408,   409,   410,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,   413,   414,   415,
-     416,     0,   417,   418,   419,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,   430,   431,   432,   433,
-     434,     0,     0,   435,   436,     0,   437,   438,   439,   440,
-     441,   442,     0,     0,   443,   444,   445,   446,     0,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,     0,   453,
-     454,     0,   455,   456,   457,   458,     0,     0,     0,     0,
-       0,  1860,   460,     0,     0,     0,   461,   462,   463,   464,
-       0,   465,   466,     0,   467,   468,     0,   469,   470,     0,
-       0,   471,     0,     0,   472,     0,   473,     0,   474,   475,
-       0,     0,     0,     0,     0,     0,   476,     0,     0,   477,
-       0,     0,     0,   478,   479,   480,   481,   482,     0,     0,
-       0,     0,     0,     0,   483,   484,     0,   485,   486,   487,
-       0,   137,   488,   138,   139,   140,   141,   142,     0,     0,
-     143,     0,     0,     0,   144,     0,     0,   145,     0,   146,
-     147,   148,   149,   150,   151,     0,   152,     0,     0,     0,
-     153,     0,     0,     0,   154,     0,     0,   155,   156,   157,
-       0,   158,     0,   159,   160,     0,     0,   161,     0,     0,
-     162,   163,     0,   164,   165,     0,   166,     0,   167,   168,
-     169,   170,   171,   172,     0,   173,   174,     0,   175,   176,
-     177,   178,   179,   180,   181,   182,   183,     0,   184,   185,
-       0,   186,   187,   188,   189,   190,     0,     0,     0,   191,
-       0,     0,   192,     0,   193,     0,     0,   194,     0,     0,
-       0,   195,   196,   197,     0,     0,   198,     0,     0,     0,
-       0,   199,   200,     0,     0,     0,  2056,   201,   202,     0,
-     203,     0,     0,     0,   204,     0,   205,   206,   207,   208,
-     209,     0,     0,     0,   210,     0,     0,   211,   212,   213,
-       0,     0,     0,   214,     0,   215,   216,     0,   217,   218,
-     219,     0,     0,   220,   221,     0,   222,   223,   224,   225,
-     226,   227,     0,     0,   228,   229,   230,   231,   232,     0,
-       0,   233,   234,     0,   235,   236,   237,     0,     0,   238,
-       0,     0,     0,   239,   240,     0,   241,     0,   242,     0,
-     243,   244,   245,   246,     0,   247,     0,   248,     0,     0,
-       0,   249,   250,     0,   251,     0,     0,   252,   253,     0,
-       0,     0,   254,   255,   256,   257,     0,     0,   258,   259,
-     260,     0,     0,   261,     0,     0,     0,     0,   262,   263,
-       0,     0,     0,   264,     0,     0,     0,   265,   266,     0,
-     267,   268,     0,     0,     0,   269,     0,     0,   270,   271,
-       0,     0,   272,     0,     0,   273,   274,     0,     0,     0,
-       0,     0,   275,   276,     0,   277,     0,   278,     0,   279,
-     280,     0,     0,     0,     0,     0,     0,     0,   281,     0,
-     282,   283,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,     0,   299,   300,
-     301,     0,   302,   303,   304,   305,     0,   306,   307,     0,
-       0,     0,     0,   308,   309,   310,   311,   312,   313,     0,
-       0,   314,   315,     0,   316,     0,   317,     0,   318,   319,
-     320,   321,   322,   323,   324,   325,   326,     0,     0,   327,
-     328,     0,     0,   329,   330,   331,   332,     0,     0,     0,
-     333,   334,     0,     0,     0,   335,     0,   336,   337,   338,
-       0,   339,   340,   341,     0,   342,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   343,   344,   345,     0,   346,
-     347,     0,   348,   349,   350,   351,   352,   353,   354,   355,
-     356,   357,     0,     0,   358,   359,   360,     0,   361,     0,
-     362,   363,   364,   365,   366,     0,   367,   368,   369,     0,
-       0,   370,     0,     0,     0,   371,   372,   373,   374,   375,
-       0,     0,   376,   377,   378,   379,   380,     0,   381,   382,
-       0,   383,   384,   385,     0,     0,   386,     0,   387,     0,
-     388,   389,     0,   390,   391,   392,     0,   393,     0,     0,
-     394,   395,   396,   397,   398,   399,   400,   401,   402,   403,
-     404,     0,   405,   406,     0,     0,     0,   407,   408,   409,
-     410,     0,     0,     0,   411,     0,     0,     0,   412,     0,
-     413,   414,   415,   416,     0,   417,   418,   419,   420,   421,
-       0,     0,     0,     0,     0,   422,   423,   424,     0,   425,
-     426,     0,   427,     0,     0,   428,     0,     0,   429,   430,
-     431,   432,   433,   434,     0,     0,   435,   436,     0,   437,
-     438,   439,   440,   441,   442,     0,     0,   443,   444,   445,
-     446,     0,   447,   448,     0,     0,   449,   450,   451,   452,
-       0,     0,   453,   454,     0,   455,   456,   457,   458,     0,
-       0,     0,     0,     0,   459,   460,     0,     0,     0,   461,
-     462,   463,   464,     0,   465,   466,     0,   467,   468,     0,
-     469,   470,     0,     0,   471,     0,     0,   472,     0,   473,
-       0,   474,   475,     0,     0,     0,     0,     0,     0,   476,
-       0,     0,   477,     0,     0,     0,   478,   479,   480,   481,
-     482,     0,     0,     0,     0,     0,     0,   483,   484,     0,
-     485,   486,   487,     0,   137,   488,   138,   139,   140,   141,
-     142,     0,     0,   143,     0,     0,     0,   144,     0,     0,
-     145,     0,   146,   147,   148,   149,   150,   151,     0,   152,
-       0,     0,     0,   153,     0,     0,     0,   154,     0,     0,
-     155,   156,   157,     0,   158,     0,   159,   160,     0,     0,
-     161,     0,     0,   162,   163,     0,   164,   165,     0,   166,
-       0,   167,   168,   169,   170,   171,   172,     0,   173,   174,
-       0,   175,   176,   177,   178,   179,   180,   181,   182,   183,
-       0,   184,   185,     0,   186,   187,   188,   189,   190,     0,
-       0,     0,   191,     0,     0,   192,     0,   193,     0,     0,
-     194,     0,     0,     0,   195,   196,   197,     0,     0,   198,
-       0,     0,     0,     0,   199,   200,     0,     0,     0,   870,
-     201,   202,     0,   203,     0,     0,     0,   204,     0,   205,
-     206,   207,   208,   209,     0,     0,     0,   210,     0,     0,
-     211,   212,   213,     0,     0,     0,   214,     0,   215,   216,
-       0,   217,   218,   219,     0,     0,   220,   221,     0,   222,
-     223,   224,   225,   226,   227,     0,     0,   228,   229,   230,
-     231,   232,     0,     0,   233,   234,     0,   235,   236,   237,
-       0,     0,   238,     0,     0,     0,   239,   240,     0,   241,
-       0,   242,     0,   243,   244,   245,   246,     0,   247,     0,
-     248,     0,     0,     0,   249,   250,     0,   251,     0,     0,
-     252,   253,     0,     0,     0,   254,   255,   256,   257,     0,
-       0,   258,   259,   260,     0,     0,   261,     0,     0,     0,
-       0,   262,   263,     0,     0,     0,   264,     0,     0,     0,
-     265,   266,     0,   267,   268,     0,     0,     0,   269,     0,
-       0,   270,   271,     0,     0,   272,     0,     0,   273,   274,
-       0,     0,     0,     0,     0,   275,   276,     0,   277,     0,
-     278,     0,   279,   280,     0,     0,     0,     0,     0,     0,
-       0,   281,     0,   282,   283,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,     0,   302,   303,   304,   305,     0,
-     306,   307,     0,     0,     0,     0,   308,   309,   310,   311,
-     312,   313,     0,     0,   314,   315,     0,   316,     0,   317,
-       0,   318,   319,   320,   321,   322,   323,   324,   325,   326,
-       0,     0,   327,   328,     0,     0,   329,   330,   331,   332,
-       0,     0,     0,   333,   334,     0,     0,     0,   335,     0,
-     336,   337,   338,     0,   339,   340,   341,     0,   342,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   343,   344,
-     345,     0,   346,   347,     0,   348,   349,   350,   351,   352,
-     353,   354,   355,   356,   357,     0,     0,   358,   359,   360,
-       0,   361,     0,   362,   363,   364,   365,   366,     0,   367,
-     368,   369,     0,     0,   370,     0,     0,     0,   371,   372,
-     373,   374,   375,     0,     0,   376,   377,   378,   379,   380,
-       0,   381,   382,     0,   383,   384,   385,     0,     0,   386,
-       0,   387,     0,   388,   389,     0,   390,   391,   392,     0,
-     393,     0,     0,   394,   395,   396,   397,   398,   399,   400,
-     401,   402,   403,   404,     0,   405,   406,     0,     0,     0,
-     407,   408,   409,   410,     0,     0,     0,   411,     0,     0,
-       0,   412,     0,   413,   414,   415,   416,     0,   417,   418,
-     419,   420,   421,     0,     0,     0,     0,     0,   422,   423,
-     424,     0,   425,   426,     0,   427,     0,     0,   428,     0,
-       0,   429,   430,   431,   432,   433,   434,     0,     0,   435,
-     436,     0,   437,   438,   439,   440,   441,   442,     0,     0,
-     443,   444,   445,   446,     0,   447,   448,     0,     0,   449,
-     450,   451,   452,     0,     0,   453,   454,     0,   455,   456,
-     457,   458,     0,     0,     0,     0,     0,   459,   460,     0,
-       0,     0,   461,   462,   463,   464,     0,   465,   466,     0,
-     467,   468,     0,   469,   470,     0,     0,   471,     0,     0,
-     472,     0,   473,     0,   474,   475,     0,     0,     0,     0,
-       0,     0,   476,     0,     0,   477,     0,     0,     0,   478,
-     479,   480,   481,   482,     0,     0,     0,     0,     0,     0,
-     483,   484,     0,   485,   486,   487,     0,   137,   488,   138,
-     139,   140,   141,   142,     0,     0,   143,     0,     0,     0,
-     144,     0,     0,   145,     0,   146,   147,   148,   149,   150,
-     151,     0,   152,     0,     0,     0,   153,     0,     0,     0,
-     154,     0,     0,   155,   156,   157,     0,   158,     0,   159,
-     160,     0,     0,   161,     0,     0,   162,   163,     0,   164,
-     165,     0,   166,     0,   167,   168,   169,   170,   171,   172,
-       0,   173,   174,     0,   175,   176,   177,   178,   179,   180,
-     181,   182,   183,     0,   184,   185,     0,   186,   187,   188,
-     189,   190,     0,     0,     0,   191,     0,     0,   192,     0,
-     193,     0,     0,   194,     0,     0,     0,   195,   196,   197,
-       0,     0,   198,     0,     0,     0,     0,   199,   200,     0,
-       0,     0,  2948,   201,   202,     0,   203,     0,     0,     0,
-     204,     0,   205,   206,   207,   208,   209,     0,     0,     0,
-     210,     0,     0,   211,   212,   213,     0,     0,     0,   214,
-       0,   215,   216,     0,   217,   218,   219,     0,     0,   220,
-     221,     0,   222,   223,   224,   225,   226,   227,     0,     0,
-     228,   229,   230,   231,   232,     0,     0,   233,   234,     0,
-     235,   236,   237,     0,     0,   238,     0,     0,     0,   239,
-     240,     0,   241,     0,   242,     0,   243,   244,   245,   246,
-       0,   247,     0,   248,     0,     0,     0,   249,   250,     0,
-     251,     0,     0,   252,   253,     0,     0,     0,   254,   255,
-     256,   257,     0,     0,   258,   259,   260,     0,     0,   261,
-       0,     0,     0,     0,   262,   263,     0,     0,     0,   264,
-       0,     0,     0,   265,   266,     0,   267,   268,     0,     0,
-       0,   269,     0,     0,   270,   271,     0,     0,   272,     0,
-       0,   273,   274,     0,     0,     0,     0,     0,   275,   276,
-       0,   277,     0,   278,     0,   279,   280,     0,     0,     0,
-       0,     0,     0,     0,   281,     0,   282,   283,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,     0,   299,   300,   301,     0,   302,   303,
-     304,   305,     0,   306,   307,     0,     0,     0,     0,   308,
-     309,   310,   311,   312,   313,     0,     0,   314,   315,     0,
-     316,     0,   317,     0,   318,   319,   320,   321,   322,   323,
-     324,   325,   326,     0,     0,   327,   328,     0,     0,   329,
-     330,   331,   332,     0,     0,     0,   333,   334,     0,     0,
-       0,   335,     0,   336,   337,   338,     0,   339,   340,   341,
-       0,   342,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   343,   344,   345,     0,   346,   347,     0,   348,   349,
-     350,   351,   352,   353,   354,   355,   356,   357,     0,     0,
-     358,   359,   360,     0,   361,     0,   362,   363,   364,   365,
-     366,     0,   367,   368,   369,     0,     0,   370,     0,     0,
-       0,   371,   372,   373,   374,   375,     0,     0,   376,   377,
-     378,   379,   380,     0,   381,   382,     0,   383,   384,   385,
-       0,     0,   386,     0,   387,     0,   388,   389,     0,   390,
-     391,   392,     0,   393,     0,     0,   394,   395,   396,   397,
-     398,   399,   400,   401,   402,   403,   404,     0,   405,   406,
-       0,     0,     0,   407,   408,   409,   410,     0,     0,     0,
-     411,     0,     0,     0,   412,     0,   413,   414,   415,   416,
-       0,   417,   418,   419,   420,   421,     0,     0,     0,     0,
-       0,   422,   423,   424,     0,   425,   426,     0,   427,     0,
-       0,   428,     0,     0,   429,   430,   431,   432,   433,   434,
-       0,     0,   435,   436,     0,   437,   438,   439,   440,   441,
-     442,     0,     0,   443,   444,   445,   446,     0,   447,   448,
-       0,     0,   449,   450,   451,   452,     0,     0,   453,   454,
-       0,   455,   456,   457,   458,     0,     0,     0,     0,     0,
-     459,   460,     0,     0,     0,   461,   462,   463,   464,     0,
-     465,   466,     0,   467,   468,     0,   469,   470,     0,     0,
-     471,     0,     0,   472,     0,   473,     0,   474,   475,     0,
-       0,     0,     0,     0,     0,   476,     0,     0,   477,     0,
-       0,     0,   478,   479,   480,   481,   482,     0,     0,     0,
-       0,     0,     0,   483,   484,     0,   485,   486,   487,     0,
-     137,   488,   138,   139,   140,   141,   142,  2956,     0,   143,
-       0,     0,     0,   144,     0,     0,   145,     0,   146,   147,
-     148,   149,   150,   151,     0,   152,     0,     0,     0,   153,
-       0,     0,     0,   154,     0,     0,   155,   156,   157,     0,
-     158,     0,   159,   160,     0,     0,   161,     0,     0,   162,
-     163,     0,   164,   165,     0,   166,     0,   167,   168,   169,
-     170,   171,   172,     0,   173,   174,     0,   175,   176,   177,
-     178,   179,   180,   181,   182,   183,     0,   184,   185,     0,
-     186,   187,   188,   189,   190,     0,     0,     0,   191,     0,
-       0,   192,     0,   193,     0,     0,   194,     0,     0,     0,
-     195,   196,   197,     0,     0,   198,     0,     0,     0,     0,
-     199,   200,     0,     0,     0,     0,   201,   202,     0,   203,
-       0,     0,     0,   204,     0,   205,   206,   207,   208,   209,
-       0,     0,     0,   210,     0,     0,   211,   212,   213,     0,
-       0,     0,   214,     0,   215,   216,     0,   217,   218,   219,
-       0,     0,   220,   221,     0,   222,   223,   224,   225,   226,
-     227,     0,     0,   228,   229,   230,   231,   232,     0,     0,
-     233,   234,     0,   235,   236,   237,     0,     0,   238,     0,
-       0,     0,   239,   240,     0,   241,     0,   242,     0,   243,
-     244,   245,   246,     0,   247,     0,   248,     0,     0,     0,
-     249,   250,     0,   251,     0,     0,   252,   253,     0,     0,
-       0,   254,   255,   256,   257,     0,     0,   258,   259,   260,
-       0,     0,   261,     0,     0,     0,     0,   262,   263,     0,
-       0,     0,   264,     0,     0,     0,   265,   266,     0,   267,
-     268,     0,     0,     0,   269,     0,     0,   270,   271,     0,
-       0,   272,     0,     0,   273,   274,     0,     0,     0,     0,
-       0,   275,   276,     0,   277,     0,   278,     0,   279,   280,
-       0,     0,     0,     0,     0,     0,     0,   281,     0,   282,
-     283,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,     0,   299,   300,   301,
-       0,   302,   303,   304,   305,     0,   306,   307,     0,     0,
-       0,     0,   308,   309,   310,   311,   312,   313,     0,     0,
-     314,   315,     0,   316,     0,   317,     0,   318,   319,   320,
-     321,   322,   323,   324,   325,   326,     0,     0,   327,   328,
-       0,     0,   329,   330,   331,   332,     0,     0,     0,   333,
-     334,     0,     0,     0,   335,     0,   336,   337,   338,     0,
-     339,   340,   341,     0,   342,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   343,   344,   345,     0,   346,   347,
-       0,   348,   349,   350,   351,   352,   353,   354,   355,   356,
-     357,     0,     0,   358,   359,   360,     0,   361,     0,   362,
-     363,   364,   365,   366,     0,   367,   368,   369,     0,     0,
-     370,     0,     0,     0,   371,   372,   373,   374,   375,     0,
-       0,   376,   377,   378,   379,   380,     0,   381,   382,     0,
-     383,   384,   385,     0,     0,   386,     0,   387,     0,   388,
-     389,     0,   390,   391,   392,     0,   393,     0,     0,   394,
-     395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
-       0,   405,   406,     0,     0,     0,   407,   408,   409,   410,
-       0,     0,     0,   411,     0,     0,     0,   412,     0,   413,
-     414,   415,   416,     0,   417,   418,   419,   420,   421,     0,
-       0,     0,     0,     0,   422,   423,   424,     0,   425,   426,
-       0,   427,     0,     0,   428,     0,     0,   429,   430,   431,
-     432,   433,   434,     0,     0,   435,   436,     0,   437,   438,
-     439,   440,   441,   442,     0,     0,   443,   444,   445,   446,
-       0,   447,   448,     0,     0,   449,   450,   451,   452,     0,
-       0,   453,   454,     0,   455,   456,   457,   458,     0,     0,
-       0,     0,     0,   459,   460,     0,     0,     0,   461,   462,
-     463,   464,     0,   465,   466,     0,   467,   468,     0,   469,
-     470,     0,     0,   471,     0,     0,   472,     0,   473,     0,
-     474,   475,     0,     0,     0,     0,     0,     0,   476,     0,
-       0,   477,     0,     0,     0,   478,   479,   480,   481,   482,
-       0,     0,     0,     0,     0,     0,   483,   484,     0,   485,
-     486,   487,     0,   137,   488,   138,   139,   140,   141,   142,
-       0,     0,   143,     0,     0,     0,   144,     0,     0,   145,
-       0,   146,   147,   148,   149,   150,   151,     0,   152,     0,
-       0,     0,   153,     0,     0,     0,   154,     0,     0,   155,
-     156,   157,     0,   158,     0,   159,   160,     0,     0,   161,
-       0,     0,   162,   163,     0,   164,   165,     0,   166,     0,
-     167,   168,   169,   170,   171,   172,     0,   173,   174,     0,
-     175,   176,   177,   178,   179,   180,   181,   182,   183,     0,
-     184,   185,     0,   186,   187,   188,   189,   190,     0,     0,
-       0,   191,     0,     0,   192,     0,   193,     0,     0,   194,
-       0,     0,     0,   195,   196,   197,     0,     0,   198,     0,
-       0,     0,     0,   199,   200,     0,     0,     0,  2980,   201,
-     202,     0,   203,     0,     0,     0,   204,     0,   205,   206,
-     207,   208,   209,     0,     0,     0,   210,     0,     0,   211,
-     212,   213,     0,     0,     0,   214,     0,   215,   216,     0,
-     217,   218,   219,     0,     0,   220,   221,     0,   222,   223,
-     224,   225,   226,   227,     0,     0,   228,   229,   230,   231,
-     232,     0,     0,   233,   234,     0,   235,   236,   237,     0,
-       0,   238,     0,     0,     0,   239,   240,     0,   241,     0,
-     242,     0,   243,   244,   245,   246,     0,   247,     0,   248,
-       0,     0,     0,   249,   250,     0,   251,     0,     0,   252,
-     253,     0,     0,     0,   254,   255,   256,   257,     0,     0,
-     258,   259,   260,     0,     0,   261,     0,     0,     0,     0,
-     262,   263,     0,     0,     0,   264,     0,     0,     0,   265,
-     266,     0,   267,   268,     0,     0,     0,   269,     0,     0,
-     270,   271,     0,     0,   272,     0,     0,   273,   274,     0,
-       0,     0,     0,     0,   275,   276,     0,   277,     0,   278,
-       0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     281,     0,   282,   283,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,     0,
-     299,   300,   301,     0,   302,   303,   304,   305,     0,   306,
-     307,     0,     0,     0,     0,   308,   309,   310,   311,   312,
-     313,     0,     0,   314,   315,     0,   316,     0,   317,     0,
-     318,   319,   320,   321,   322,   323,   324,   325,   326,     0,
-       0,   327,   328,     0,     0,   329,   330,   331,   332,     0,
-       0,     0,   333,   334,     0,     0,     0,   335,     0,   336,
-     337,   338,     0,   339,   340,   341,     0,   342,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   343,   344,   345,
-       0,   346,   347,     0,   348,   349,   350,   351,   352,   353,
-     354,   355,   356,   357,     0,     0,   358,   359,   360,     0,
-     361,     0,   362,   363,   364,   365,   366,     0,   367,   368,
-     369,     0,     0,   370,     0,     0,     0,   371,   372,   373,
-     374,   375,     0,     0,   376,   377,   378,   379,   380,     0,
-     381,   382,     0,   383,   384,   385,     0,     0,   386,     0,
-     387,     0,   388,   389,     0,   390,   391,   392,     0,   393,
-       0,     0,   394,   395,   396,   397,   398,   399,   400,   401,
-     402,   403,   404,     0,   405,   406,     0,     0,     0,   407,
-     408,   409,   410,     0,     0,     0,   411,     0,     0,     0,
-     412,     0,   413,   414,   415,   416,     0,   417,   418,   419,
-     420,   421,     0,     0,     0,     0,     0,   422,   423,   424,
-       0,   425,   426,     0,   427,     0,     0,   428,     0,     0,
-     429,   430,   431,   432,   433,   434,     0,     0,   435,   436,
-       0,   437,   438,   439,   440,   441,   442,     0,     0,   443,
-     444,   445,   446,     0,   447,   448,     0,     0,   449,   450,
-     451,   452,     0,     0,   453,   454,     0,   455,   456,   457,
-     458,     0,     0,     0,     0,     0,   459,   460,     0,     0,
-       0,   461,   462,   463,   464,     0,   465,   466,     0,   467,
-     468,     0,   469,   470,     0,     0,   471,     0,     0,   472,
-       0,   473,     0,   474,   475,     0,     0,     0,     0,     0,
-       0,   476,     0,     0,   477,     0,     0,     0,   478,   479,
-     480,   481,   482,     0,     0,     0,     0,     0,     0,   483,
-     484,     0,   485,   486,   487,     0,   137,   488,   138,   139,
-     140,   141,   142,     0,     0,   143,     0,     0,     0,   144,
-       0,     0,   145,     0,   146,   147,   148,   149,   150,   151,
-       0,   152,     0,     0,     0,   153,     0,     0,     0,   154,
-       0,     0,   155,   156,   157,     0,   158,     0,   159,   160,
-       0,     0,   161,     0,     0,   162,   163,     0,   164,   165,
-       0,   166,     0,   167,   168,   169,   170,   171,   172,     0,
-     173,   174,     0,   175,   176,   177,   178,   179,   180,   181,
-     182,   183,     0,   184,   185,     0,   186,   187,   188,   189,
-     190,     0,     0,     0,   191,     0,     0,   192,     0,   193,
-       0,     0,   194,     0,     0,     0,   195,   196,   197,     0,
-       0,   198,     0,     0,     0,     0,   199,   200,     0,     0,
-       0,     0,   201,   202,     0,   203,     0,     0,     0,   204,
-       0,   205,   206,   207,   208,   209,     0,     0,     0,   210,
-       0,     0,   211,   212,   213,     0,     0,     0,   214,     0,
-     215,   216,     0,   217,   218,   219,     0,     0,   220,   221,
-       0,   222,   223,   224,   225,   226,   227,     0,     0,   228,
-     229,   230,   231,   232,     0,     0,   233,   234,     0,   235,
-     236,   237,     0,     0,   238,     0,     0,     0,   239,   240,
-       0,   241,     0,   242,     0,   243,   244,   245,   246,     0,
-     247,     0,   248,     0,     0,     0,   249,   250,     0,   251,
-       0,     0,   252,   253,     0,     0,     0,   254,   255,   256,
-     257,     0,     0,   258,   259,   260,     0,     0,   261,     0,
-       0,     0,     0,   262,   263,     0,     0,     0,   264,     0,
-       0,     0,   265,   266,     0,   267,   268,     0,     0,     0,
-     269,     0,     0,   270,   271,     0,     0,   272,     0,     0,
-     273,   274,     0,     0,     0,     0,     0,   275,   276,     0,
-     277,     0,   278,     0,   279,   280,     0,     0,     0,     0,
-       0,     0,     0,   281,     0,   282,   283,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,     0,   299,   300,   301,     0,   302,   303,   304,
-     305,     0,   306,   307,     0,     0,     0,     0,   308,   309,
-     310,   311,   312,   313,     0,     0,   314,   315,     0,   316,
-       0,   317,     0,   318,   319,   320,   321,   322,   323,   324,
-     325,   326,     0,     0,   327,   328,     0,     0,   329,   330,
-     331,   332,     0,     0,     0,   333,   334,     0,     0,     0,
-     335,     0,   336,   337,   338,     0,   339,   340,   341,     0,
-     342,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     343,   344,   345,     0,   346,   347,     0,   348,   349,   350,
-     351,   352,   353,   354,   355,   356,   357,     0,     0,   358,
-     359,   360,  3044,   361,     0,   362,   363,   364,   365,   366,
-       0,   367,   368,   369,     0,     0,   370,     0,     0,     0,
-     371,   372,   373,   374,   375,     0,     0,   376,   377,   378,
-     379,   380,     0,   381,   382,     0,   383,   384,   385,     0,
-       0,   386,     0,   387,     0,   388,   389,     0,   390,   391,
-     392,     0,   393,     0,     0,   394,   395,   396,   397,   398,
-     399,   400,   401,   402,   403,   404,     0,   405,   406,     0,
-       0,     0,   407,   408,   409,   410,     0,     0,     0,   411,
-       0,     0,     0,   412,     0,   413,   414,   415,   416,     0,
-     417,   418,   419,   420,   421,     0,     0,     0,     0,     0,
-     422,   423,   424,     0,   425,   426,     0,   427,     0,     0,
-     428,     0,     0,   429,   430,   431,   432,   433,   434,     0,
-       0,   435,   436,     0,   437,   438,   439,   440,   441,   442,
-       0,     0,   443,   444,   445,   446,     0,   447,   448,     0,
-       0,   449,   450,   451,   452,     0,     0,   453,   454,     0,
-     455,   456,   457,   458,     0,     0,     0,     0,     0,   459,
-     460,     0,     0,     0,   461,   462,   463,   464,     0,   465,
-     466,     0,   467,   468,     0,   469,   470,     0,     0,   471,
-       0,     0,   472,     0,   473,     0,   474,   475,     0,     0,
-       0,     0,     0,     0,   476,     0,     0,   477,     0,     0,
-       0,   478,   479,   480,   481,   482,     0,     0,     0,     0,
-       0,     0,   483,   484,     0,   485,   486,   487,     0,   137,
-     488,   138,   139,   140,   141,   142,     0,     0,   143,     0,
-       0,     0,   144,     0,     0,   145,     0,   146,   147,   148,
-     149,   150,   151,     0,   152,     0,     0,     0,   153,     0,
-       0,     0,   154,     0,     0,   155,   156,   157,     0,   158,
-       0,   159,   160,     0,     0,   161,     0,     0,   162,   163,
-       0,   164,   165,     0,   166,     0,   167,   168,   169,   170,
-     171,   172,     0,   173,   174,     0,   175,   176,   177,   178,
-     179,   180,   181,   182,   183,     0,   184,   185,     0,   186,
-     187,   188,   189,   190,     0,     0,     0,   191,     0,     0,
-     192,     0,   193,     0,     0,   194,     0,     0,     0,   195,
-     196,   197,     0,     0,   198,     0,     0,     0,     0,   199,
-     200,     0,     0,     0,     0,   201,   202,     0,   203,     0,
-       0,     0,   204,     0,   205,   206,   207,   208,   209,     0,
-       0,     0,   210,     0,     0,   211,   212,   213,     0,     0,
-       0,   214,     0,   215,   216,     0,   217,   218,   219,     0,
-       0,   220,   221,     0,   222,   223,   224,   225,   226,   227,
-       0,     0,   228,   229,   230,   231,   232,     0,     0,   233,
-     234,     0,   235,   236,   237,     0,     0,   238,     0,     0,
-       0,   239,   240,     0,   241,     0,   242,     0,   243,   244,
-     245,   246,     0,   247,     0,   248,     0,     0,     0,   249,
-     250,     0,   251,     0,     0,   252,   253,     0,     0,     0,
-     254,   255,   256,   257,     0,     0,   258,   259,   260,     0,
-       0,   261,     0,     0,     0,     0,   262,   263,     0,     0,
-       0,   264,     0,     0,     0,   265,   266,     0,   267,   268,
-       0,     0,     0,   269,     0,     0,   270,   271,     0,     0,
-     272,     0,     0,   273,   274,     0,     0,     0,     0,     0,
-     275,   276,     0,   277,     0,   278,     0,   279,   280,     0,
-       0,     0,     0,     0,     0,     0,   281,     0,   282,   283,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,     0,   299,   300,   301,     0,
-     302,   303,   304,   305,     0,   306,   307,     0,     0,     0,
-       0,   308,   309,   310,   311,   312,   313,     0,     0,   314,
-     315,     0,   316,     0,   317,     0,   318,   319,   320,   321,
-     322,   323,   324,   325,   326,     0,     0,   327,   328,     0,
-       0,   329,   330,   331,   332,     0,     0,     0,   333,   334,
-       0,     0,     0,   335,     0,   336,   337,   338,     0,   339,
-     340,   341,     0,   342,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   343,   344,   345,     0,   346,   347,     0,
-     348,   349,   350,   351,   352,   353,   354,   355,   356,   357,
-       0,     0,   358,   359,   360,     0,   361,     0,   362,   363,
-     364,   365,   366,     0,   367,   368,   369,     0,     0,   370,
-       0,     0,     0,   371,   372,   373,   374,   375,     0,     0,
-     376,   377,   378,   379,   380,     0,   381,   382,     0,   383,
-     384,   385,     0,     0,   386,     0,   387,     0,   388,   389,
-       0,   390,   391,   392,     0,   393,     0,     0,   394,   395,
-     396,   397,   398,   399,   400,   401,   402,   403,   404,     0,
-     405,   406,     0,     0,     0,   407,   408,   409,   410,     0,
-       0,     0,   411,     0,     0,     0,   412,     0,   413,   414,
-     415,   416,     0,   417,   418,   419,   420,   421,     0,     0,
-       0,     0,     0,   422,   423,   424,     0,   425,   426,     0,
-     427,     0,     0,   428,     0,     0,   429,   430,   431,   432,
-     433,   434,     0,     0,   435,   436,     0,   437,   438,   439,
-     440,   441,   442,     0,     0,   443,   444,   445,   446,     0,
-     447,   448,     0,     0,   449,   450,   451,   452,     0,   134,
-     453,   454,     0,   455,   456,   457,   458,     0,     0,     0,
-       0,     0,   459,   460,     0,     0,     0,   461,   462,   463,
-     464,     0,   465,   466,     0,   467,   468,     0,   469,   470,
-       0,     0,   471,     0,     0,   472,     0,   473,     0,   474,
-     475,     0,     0,     0,     0,     0,     0,   476,     0,     0,
-     477,     0,     0,     0,   478,   479,   480,   481,   482,     0,
-       0,     0,     0,     0,     0,   483,   484,     0,   485,   486,
-     487,     0,   137,   488,   138,   139,   140,   141,   142,     0,
-       0,   143,     0,     0,     0,   144,     0,     0,   145,     0,
-     146,   147,   148,   149,   150,   151,     0,   152,     0,     0,
-       0,   153,     0,     0,     0,   154,     0,     0,   155,   156,
-     157,     0,   158,     0,   159,   160,     0,     0,   161,     0,
-       0,   162,   163,     0,   164,   165,     0,   166,     0,   167,
-     168,   169,   170,   171,   172,     0,   173,   174,     0,   175,
-     176,   177,   178,   179,   180,   181,   182,   183,     0,   184,
-     185,     0,   186,   187,   188,   189,   190,     0,     0,     0,
-     191,     0,     0,   192,     0,   193,     0,     0,   194,     0,
-       0,     0,   195,   196,   197,     0,     0,   198,     0,     0,
-       0,     0,   199,   200,     0,     0,     0,     0,   201,   202,
-       0,   203,     0,     0,     0,   204,     0,   205,   206,   207,
-     208,   209,     0,     0,     0,   210,     0,     0,   211,   212,
-     213,     0,     0,     0,   214,     0,   215,   216,     0,   217,
-     218,   219,     0,     0,   220,   221,     0,   222,   223,   224,
-     225,   226,   227,     0,     0,   228,   229,   230,   231,   232,
-       0,     0,   233,   234,     0,   235,   236,   237,     0,     0,
-     238,     0,     0,     0,   239,   240,     0,   241,     0,   242,
-       0,   243,   244,   245,   246,     0,   247,     0,   248,     0,
-       0,     0,   249,   250,     0,   251,     0,     0,   252,   253,
-       0,     0,     0,   254,   255,   256,   257,     0,     0,   258,
-     259,   260,     0,     0,   261,     0,     0,     0,     0,   262,
-     263,     0,     0,     0,   264,     0,     0,     0,   265,   266,
-       0,   267,   268,     0,     0,     0,   269,     0,     0,   270,
-     271,     0,     0,   272,     0,     0,   273,   274,     0,     0,
-       0,     0,     0,   275,   276,     0,   277,     0,   278,     0,
-     279,   280,     0,     0,     0,     0,     0,     0,     0,   281,
-       0,   282,   283,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,     0,   299,
-     300,   301,     0,   302,   303,   304,   305,     0,   306,   307,
-       0,     0,     0,     0,   308,   309,   310,   311,   312,   313,
-       0,     0,   314,   315,     0,   316,     0,   317,     0,   318,
-     319,   320,   321,   322,   323,   324,   325,   326,     0,     0,
-     327,   328,     0,     0,   329,   330,   331,   332,     0,     0,
-       0,   333,   334,     0,     0,     0,   335,     0,   336,   337,
-     338,     0,   339,   340,   341,     0,   342,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   343,   344,   345,     0,
-     346,   347,     0,   348,   349,   350,   351,   352,   353,   354,
-     355,   356,   357,     0,     0,   358,   359,   360,     0,   361,
-       0,   362,   363,   364,   365,   366,     0,   367,   368,   369,
-       0,     0,   370,     0,     0,     0,   371,   372,   373,   374,
-     375,     0,     0,   376,   377,   378,   379,   380,     0,   381,
-     382,     0,   383,   384,   385,     0,     0,   386,     0,   387,
-       0,   388,   389,     0,   390,   391,   392,     0,   393,     0,
-       0,   394,   395,   396,   397,   398,   399,   400,   401,   402,
-     403,   404,     0,   405,   406,     0,     0,     0,   407,   408,
-     409,   410,     0,     0,     0,   411,     0,     0,     0,   412,
-       0,   413,   414,   415,   416,     0,   417,   418,   419,   420,
-     421,     0,     0,     0,     0,     0,   422,   423,   424,     0,
-     425,   426,     0,   427,     0,     0,   428,     0,     0,   429,
-     430,   431,   432,   433,   434,     0,     0,   435,   436,     0,
-     437,   438,   439,   440,   441,   442,     0,     0,   443,   444,
-     445,   446,     0,   447,   448,     0,     0,   449,   450,   451,
-     452,     0,     0,   453,   454,     0,   455,   456,   457,   458,
-       0,     0,     0,     0,     0,   459,   460,     0,     0,     0,
-     461,   462,   463,   464,     0,   465,   466,     0,   467,   468,
-       0,   469,   470,     0,     0,   471,     0,     0,   472,     0,
-     473,     0,   474,   475,     0,     0,     0,     0,     0,     0,
-     476,     0,     0,   477,     0,     0,     0,   478,   479,   480,
-     481,   482,     0,     0,     0,     0,     0,     0,   483,   484,
-       0,   485,   486,   487,     0,   137,   488,   138,   139,   140,
-     141,   142,     0,     0,   143,     0,     0,     0,   144,     0,
-       0,   145,     0,   146,   147,   148,   149,   150,   151,     0,
-     152,     0,     0,     0,   153,     0,     0,     0,   154,     0,
-       0,   155,   156,   157,     0,   158,     0,   159,   160,     0,
-       0,   161,     0,     0,   162,   163,     0,   164,   165,     0,
-     166,     0,   167,   168,   169,   170,   171,   172,     0,   173,
-     174,     0,   175,   176,   177,   178,   179,   180,   181,   182,
-     183,     0,   184,   185,     0,   186,   187,   188,   189,   190,
-       0,     0,     0,   191,     0,     0,   192,     0,   193,     0,
-       0,   194,     0,     0,     0,   195,   196,   197,     0,     0,
-     198,     0,     0,     0,     0,   199,   200,     0,     0,     0,
-       0,   201,   202,     0,   203,     0,     0,     0,   204,     0,
-     205,   206,   207,   208,   209,     0,     0,     0,   210,     0,
-       0,   211,   212,   213,     0,     0,     0,   214,     0,   215,
-     216,     0,   217,   218,   219,     0,     0,   220,   221,     0,
-     222,   223,   224,   225,   226,   227,     0,     0,   228,   229,
-     230,   231,   232,     0,     0,   233,   234,     0,   235,  1785,
-     237,     0,     0,   238,     0,     0,     0,   239,   240,     0,
-     241,     0,   242,     0,   243,   244,   245,   246,     0,   247,
-       0,   248,     0,     0,     0,   249,   250,     0,   251,     0,
-       0,   252,   253,     0,     0,     0,   254,   255,   256,   257,
-       0,     0,   258,   259,   260,     0,     0,   261,     0,     0,
-       0,     0,   262,   263,     0,     0,     0,   264,     0,     0,
-       0,   265,   266,     0,   267,   268,     0,     0,     0,   269,
-       0,     0,   270,   271,     0,     0,   272,     0,     0,   273,
-     274,     0,     0,     0,     0,     0,   275,   276,     0,   277,
-       0,   278,     0,   279,   280,     0,     0,     0,     0,     0,
-       0,     0,   281,     0,   282,   283,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,     0,   299,   300,   301,     0,   302,   303,   304,   305,
-       0,   306,   307,     0,     0,     0,     0,   308,   309,   310,
-     311,   312,   313,     0,     0,   314,   315,     0,   316,     0,
-     317,     0,   318,   319,   320,   321,   322,   323,   324,   325,
-     326,     0,     0,   327,   328,     0,     0,   329,  1786,   331,
-     332,     0,     0,     0,   333,   334,     0,     0,     0,   335,
-       0,   336,   337,   338,     0,   339,   340,   341,     0,   342,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,   343,
-     344,   345,     0,   346,   347,     0,   348,   349,   350,   351,
-     352,   353,   354,   355,   356,   357,     0,     0,   358,   359,
-     360,     0,   361,     0,   362,   363,   364,   365,   366,     0,
-     367,   368,   369,     0,     0,   370,     0,     0,     0,   371,
-     372,   373,   374,   375,     0,     0,   376,   377,   378,   379,
-     380,     0,   381,   382,     0,   383,   384,   385,     0,     0,
-     386,     0,   387,     0,   388,   389,     0,   390,   391,   392,
-       0,   393,     0,     0,   394,   395,   396,   397,   398,   399,
-     400,   401,   402,   403,   404,     0,   405,   406,     0,     0,
-       0,   407,   408,   409,   410,     0,     0,     0,   411,     0,
-       0,     0,   412,     0,   413,   414,   415,   416,     0,   417,
-     418,   419,   420,   421,     0,     0,     0,     0,     0,   422,
-     423,   424,     0,   425,   426,     0,   427,     0,     0,   428,
-       0,     0,   429,   430,   431,   432,   433,   434,     0,     0,
-     435,   436,     0,   437,   438,   439,   440,   441,   442,     0,
-       0,   443,   444,   445,   446,     0,   447,   448,     0,     0,
-     449,   450,   451,   452,     0,     0,   453,   454,     0,   455,
-     456,   457,   458,     0,     0,     0,     0,     0,   459,   460,
-       0,     0,     0,   461,   462,   463,   464,     0,   465,   466,
-       0,   467,   468,     0,   469,   470,     0,     0,   471,     0,
-       0,   472,     0,   473,     0,   474,   475,     0,     0,     0,
-       0,     0,     0,   476,     0,     0,   477,     0,     0,     0,
-     478,   479,   480,   481,   482,     0,     0,     0,     0,     0,
-       0,   483,   484,     0,   485,   486,   487,     0,   137,   488,
-     138,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,     0,     0,   146,   147,   148,   149,
-     150,     0,     0,  -366,     0,     0,     0,   153,     0,     0,
-       0,   154,     0,     0,   155,   156,   157,     0,   158,     0,
-       0,     0,     0,     0,   161,  3967,     0,   162,   163,     0,
-     164,     0,     0,     0,     0,   167,   168,   169,  3968,   171,
-     172,     0,   173,   174,     0,   175,   176,     0,   178,     0,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,     0,   190,     0,     0,     0,   191,     0,     0,   192,
-       0,   193,     0,     0,   194,     0,     0,     0,   195,   196,
-     197,     0,     0,   198,     0,     0,     0,     0,   199,     0,
-       0,     0,     0,     0,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,     0,     0,     0,   211,   212,   213,     0,  -336,  -336,
-     214,     0,  -336,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,     0,     0,
-       0,   228,   229,   230,   231,   232,     0,     0,   233,   234,
-    3969,   235,   236,   237,     0,     0,     0,     0,     0,     0,
-       0,   240,     0,   241,     0,   242,     0,   243,   244,   245,
-     246,     0,   247,     0,   248,     0,     0,     0,     0,   250,
-       0,     0,     0,     0,     0,   253,     0,     0,     0,   254,
-     255,   256,   257,  3970,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,     0,   262,     0,     0,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,  3971,
-       0,     0,   269,     0,     0,     0,   271,     0,     0,   272,
-    3972,     0,   273,   274,     0,     0,     0,     0,     0,   275,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-       0,     0,  -321,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,     0,   302,
-     303,   304,   305,     0,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   312,   313,     0,     0,   314,   315,
-       0,   316,     0,   317,     0,   318,   319,   320,   321,   322,
-     323,   324,   325,   326,     0,     0,   327,   328,     0,     0,
-     329,   330,   331,   332,     0,     0,     0,     0,   334,     0,
-       0,     0,   335,     0,   336,   337,   338,     0,   339,   340,
-    3973,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   344,   345,     0,     0,   347,     0,   348,
-     349,   350,   351,   352,   353,   354,   355,   356,     0,     0,
-       0,     0,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   367,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,     0,     0,   383,     0,
-     385,  -321,     0,   386,     0,     0,     0,   388,     0,     0,
-     390,   391,   392,  3974,   393,     0,     0,     0,   395,   396,
-     397,   398,   399,   400,   401,     0,   403,   404,     0,   405,
-       0,     0,     0,     0,   407,   408,   409,     0,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,     0,   414,     0,
-     416,     0,   417,     0,     0,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,     0,   431,   432,   433,
-     434,     0,     0,     0,   436,     0,   437,   438,   439,   440,
-     441,   442,     0,     0,   443,   444,   445,   446,     0,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,     0,   453,
-     454,     0,   455,   456,   457,   458,     0,     0,     0,     0,
-       0,   459,   460,     0,     0,     0,     0,   462,   463,   464,
-       0,   465,   466,     0,   467,   468,     0,     0,     0,     0,
-       0,   471,     0,     0,   472,     0,     0,     0,   474,   475,
-       0,     0,     0,     0,     0,     0,   476,     0,     0,   477,
-       0,     0,     0,   478,   479,   480,   481,   482,     0,     0,
-    -321,     0,     0,     0,   483,     0,     0,   485,     0,   487,
-       0,   137,   488,   138,   139,   140,   141,   142,     0,     0,
-     143,     0,     0,     0,   144,     0,     0,     0,     0,   146,
-     147,   148,   149,   150,     0,     0,  -366,     0,     0,     0,
-     153,     0,     0,     0,   154,     0,     0,   155,   156,   157,
-       0,   158,     0,     0,     0,     0,     0,   161,  3967,     0,
-     162,   163,     0,   164,     0,     0,     0,     0,   167,   168,
-     169,  3968,   171,   172,     0,   173,   174,     0,   175,   176,
-       0,   178,     0,   180,   181,   182,   183,     0,   184,   185,
-       0,   186,   187,   188,     0,   190,     0,     0,     0,   191,
-       0,     0,   192,     0,   193,     0,     0,   194,     0,     0,
-       0,   195,   196,   197,     0,     0,   198,     0,     0,     0,
-       0,   199,     0,     0,     0,     0,     0,   201,   202,     0,
-     203,     0,     0,     0,   204,     0,   205,   206,   207,   208,
-     209,     0,     0,     0,     0,     0,     0,   211,   212,   213,
-       0,  -357,     0,   214,     0,  -357,   216,     0,   217,   218,
-     219,     0,     0,   220,   221,     0,   222,   223,   224,   225,
-     226,     0,     0,     0,   228,   229,   230,   231,   232,     0,
-       0,   233,   234,  3969,   235,   236,   237,     0,     0,     0,
-       0,     0,     0,     0,   240,     0,   241,     0,   242,     0,
-     243,   244,   245,   246,     0,   247,     0,   248,     0,     0,
-       0,     0,   250,     0,     0,     0,     0,     0,   253,     0,
-       0,     0,   254,   255,   256,   257,  3970,     0,   258,   259,
-     260,     0,     0,   261,     0,     0,     0,     0,   262,     0,
-       0,     0,     0,   264,     0,     0,     0,   265,   266,     0,
-     267,   268,  3971,     0,     0,   269,     0,     0,     0,   271,
-       0,     0,   272,  3972,     0,   273,   274,     0,     0,     0,
-       0,     0,   275,   276,     0,   277,     0,   278,     0,   279,
-     280,     0,     0,     0,     0,  -321,     0,     0,   281,     0,
-     282,   283,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,     0,   299,   300,
-     301,     0,   302,   303,   304,   305,     0,   306,   307,     0,
-       0,     0,     0,   308,   309,   310,   311,   312,   313,     0,
-       0,   314,   315,     0,   316,     0,   317,     0,   318,   319,
-     320,   321,   322,   323,   324,   325,   326,     0,     0,   327,
-     328,     0,     0,   329,   330,   331,   332,     0,     0,     0,
-       0,   334,     0,     0,     0,   335,     0,   336,   337,   338,
-       0,   339,   340,  3973,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   344,   345,     0,     0,
-     347,     0,   348,   349,   350,   351,   352,   353,   354,   355,
-     356,     0,     0,     0,     0,   359,   360,     0,   361,     0,
-     362,   363,   364,   365,   366,     0,   367,   368,   369,     0,
-       0,   370,     0,     0,     0,   371,   372,   373,   374,   375,
-       0,     0,   376,   377,   378,   379,   380,     0,   381,     0,
-       0,   383,     0,   385,  -321,     0,   386,     0,     0,     0,
-     388,     0,     0,   390,   391,   392,  3974,   393,     0,     0,
-       0,   395,   396,   397,   398,   399,   400,   401,     0,   403,
-     404,     0,   405,     0,     0,     0,     0,   407,   408,   409,
-       0,     0,     0,     0,   411,     0,     0,     0,   412,     0,
-       0,   414,     0,   416,     0,   417,     0,     0,   420,   421,
-       0,     0,     0,     0,     0,   422,   423,   424,     0,   425,
-     426,     0,   427,     0,     0,   428,     0,     0,   429,     0,
-     431,   432,   433,   434,     0,     0,     0,   436,     0,   437,
-     438,   439,   440,   441,   442,     0,     0,   443,   444,   445,
-     446,     0,   447,   448,     0,     0,   449,   450,   451,   452,
-       0,     0,   453,   454,     0,   455,   456,   457,   458,     0,
-       0,     0,     0,     0,   459,   460,     0,     0,     0,     0,
-     462,   463,   464,     0,   465,   466,     0,   467,   468,     0,
-       0,     0,     0,     0,   471,     0,     0,   472,     0,     0,
-       0,   474,   475,     0,     0,     0,     0,     0,     0,   476,
-       0,     0,   477,     0,     0,     0,   478,   479,   480,   481,
-     482,  -357,     0,  -321,     0,     0,     0,   483,     0,     0,
-     485,     0,   487,     0,   137,   488,   138,   139,   140,   141,
-     142,     0,     0,   143,     0,     0,     0,   144,     0,     0,
-       0,     0,   146,   147,   148,   149,   150,     0,     0,  -366,
-       0,     0,     0,   153,     0,     0,     0,   154,     0,     0,
-     155,   156,   157,     0,   158,     0,     0,     0,     0,     0,
-     161,  3967,     0,   162,   163,     0,   164,     0,     0,     0,
-       0,   167,   168,   169,  3968,   171,   172,     0,   173,   174,
-       0,   175,   176,     0,   178,     0,   180,   181,   182,   183,
-       0,   184,   185,     0,   186,   187,   188,     0,   190,     0,
-       0,     0,   191,     0,     0,   192,     0,   193,     0,     0,
-     194,     0,     0,     0,   195,   196,   197,     0,     0,   198,
-       0,     0,     0,     0,   199,     0,     0,     0,     0,     0,
-     201,   202,     0,   203,     0,     0,     0,   204,     0,   205,
-     206,   207,   208,   209,     0,     0,     0,     0,     0,     0,
-     211,   212,   213,     0,  -354,     0,   214,     0,  -354,   216,
-       0,   217,   218,   219,     0,     0,   220,   221,     0,   222,
-     223,   224,   225,   226,     0,     0,     0,   228,   229,   230,
-     231,   232,     0,     0,   233,   234,  3969,   235,   236,   237,
-       0,     0,     0,     0,     0,     0,     0,   240,     0,   241,
-       0,   242,     0,   243,   244,   245,   246,     0,   247,     0,
-     248,     0,     0,     0,     0,   250,     0,     0,     0,     0,
-       0,   253,     0,     0,     0,   254,   255,   256,   257,  3970,
-       0,   258,   259,   260,     0,     0,   261,     0,     0,     0,
-       0,   262,     0,     0,     0,     0,   264,     0,     0,     0,
-     265,   266,     0,   267,   268,  3971,     0,     0,   269,     0,
-       0,     0,   271,     0,     0,   272,  3972,     0,   273,   274,
-       0,     0,     0,     0,     0,   275,   276,     0,   277,     0,
-     278,     0,   279,   280,     0,     0,     0,     0,  -321,     0,
-       0,   281,     0,   282,   283,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,     0,   302,   303,   304,   305,     0,
-     306,   307,     0,     0,     0,     0,   308,   309,   310,   311,
-     312,   313,     0,     0,   314,   315,     0,   316,     0,   317,
-       0,   318,   319,   320,   321,   322,   323,   324,   325,   326,
-       0,     0,   327,   328,     0,     0,   329,   330,   331,   332,
-       0,     0,     0,     0,   334,     0,     0,     0,   335,     0,
-     336,   337,   338,     0,   339,   340,  3973,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,   344,
-     345,     0,     0,   347,     0,   348,   349,   350,   351,   352,
-     353,   354,   355,   356,     0,     0,     0,     0,   359,   360,
-       0,   361,     0,   362,   363,   364,   365,   366,     0,   367,
-     368,   369,     0,     0,   370,     0,     0,     0,   371,   372,
-     373,   374,   375,     0,     0,   376,   377,   378,   379,   380,
-       0,   381,     0,     0,   383,     0,   385,  -321,     0,   386,
-       0,     0,     0,   388,     0,     0,   390,   391,   392,  3974,
-     393,     0,     0,     0,   395,   396,   397,   398,   399,   400,
-     401,     0,   403,   404,     0,   405,     0,     0,     0,     0,
-     407,   408,   409,     0,     0,     0,     0,   411,     0,     0,
-       0,   412,     0,     0,   414,     0,   416,     0,   417,     0,
-       0,   420,   421,     0,     0,     0,     0,     0,   422,   423,
-     424,     0,   425,   426,     0,   427,     0,     0,   428,     0,
-       0,   429,     0,   431,   432,   433,   434,     0,     0,     0,
-     436,     0,   437,   438,   439,   440,   441,   442,     0,     0,
-     443,   444,   445,   446,     0,   447,   448,     0,     0,   449,
-     450,   451,   452,     0,     0,   453,   454,     0,   455,   456,
-     457,   458,     0,     0,     0,     0,     0,   459,   460,     0,
-       0,     0,     0,   462,   463,   464,     0,   465,   466,     0,
-     467,   468,     0,     0,     0,     0,     0,   471,     0,     0,
-     472,     0,     0,     0,   474,   475,     0,     0,     0,     0,
-       0,     0,   476,     0,     0,   477,     0,     0,     0,   478,
-     479,   480,   481,   482,  -354,     0,  -321,     0,     0,     0,
-     483,     0,     0,   485,     0,   487,     0,   137,   488,   138,
-     139,   140,   141,   142,     0,     0,   143,     0,     0,     0,
-     144,     0,     0,     0,     0,   146,   147,   148,   149,   150,
-       0,     0,  -366,     0,     0,     0,   153,     0,     0,     0,
-     154,     0,     0,   155,   156,   157,     0,   158,     0,     0,
-       0,     0,     0,   161,  3967,     0,   162,   163,     0,   164,
-       0,     0,     0,     0,   167,   168,   169,  3968,   171,   172,
-       0,   173,   174,     0,   175,   176,     0,   178,     0,   180,
-     181,   182,   183,     0,   184,   185,     0,   186,   187,   188,
-       0,   190,     0,     0,     0,   191,     0,     0,   192,     0,
-     193,     0,     0,   194,     0,     0,     0,   195,   196,   197,
-       0,     0,   198,     0,     0,     0,     0,   199,     0,     0,
-       0,     0,     0,   201,   202,     0,   203,     0,     0,     0,
-     204,     0,   205,   206,   207,   208,   209,     0,     0,     0,
-       0,     0,     0,   211,   212,   213,     0,     0,     0,   214,
-       0,  4306,   216,     0,   217,   218,   219,     0,     0,   220,
-     221,     0,   222,   223,   224,   225,   226,     0,     0,     0,
-     228,   229,   230,   231,   232,     0,     0,   233,   234,  3969,
-     235,   236,   237,     0,     0,     0,     0,     0,     0,     0,
-     240,     0,   241,     0,   242,     0,   243,   244,   245,   246,
-       0,   247,     0,   248,     0,     0,     0,     0,   250,     0,
-       0,     0,     0,     0,   253,     0,     0,     0,   254,   255,
-     256,   257,  3970,     0,   258,   259,   260,     0,     0,   261,
-       0,     0,     0,     0,   262,     0,     0,     0,     0,   264,
-       0,     0,     0,   265,   266,     0,   267,   268,  3971,     0,
-       0,   269,     0,     0,     0,   271,     0,     0,   272,  3972,
-       0,   273,   274,     0,     0,     0,     0,     0,   275,   276,
-       0,   277,     0,   278,     0,   279,   280,     0,     0,     0,
-       0,  -321,     0,     0,   281,     0,   282,   283,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,     0,   299,   300,   301,     0,   302,   303,
-     304,   305,     0,   306,   307,     0,     0,     0,     0,   308,
-     309,   310,   311,   312,   313,     0,     0,   314,   315,     0,
-     316,     0,   317,     0,   318,   319,   320,   321,   322,   323,
-     324,   325,   326,     0,     0,   327,   328,     0,     0,   329,
-     330,   331,   332,     0,     0,     0,     0,   334,     0,     0,
-       0,   335,     0,   336,   337,   338,     0,   339,   340,  3973,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,   344,   345,     0,     0,   347,     0,   348,   349,
-     350,   351,   352,   353,   354,   355,   356,     0,     0,     0,
-       0,   359,   360,     0,   361,     0,   362,   363,   364,   365,
-     366,     0,   367,   368,   369,     0,     0,   370,     0,     0,
-       0,   371,   372,   373,   374,   375,     0,     0,   376,   377,
-     378,   379,   380,     0,   381,     0,     0,   383,     0,   385,
-    -321,     0,   386,     0,     0,     0,   388,     0,     0,   390,
-     391,   392,  3974,   393,     0,     0,     0,   395,   396,   397,
-     398,   399,   400,   401,     0,   403,   404,     0,   405,     0,
-       0,     0,     0,   407,   408,   409,     0,     0,     0,     0,
-     411,     0,     0,     0,   412,     0,     0,   414,     0,   416,
-       0,   417,     0,     0,   420,   421,     0,     0,     0,     0,
-       0,   422,   423,   424,     0,   425,   426,     0,   427,     0,
-       0,   428,     0,     0,   429,     0,   431,   432,   433,   434,
-       0,     0,     0,   436,     0,   437,   438,   439,   440,   441,
-     442,     0,     0,   443,   444,   445,   446,     0,   447,   448,
-       0,     0,   449,   450,   451,   452,     0,     0,   453,   454,
-       0,   455,   456,   457,   458,     0,     0,     0,     0,     0,
-     459,   460,     0,     0,     0,     0,   462,   463,   464,     0,
-     465,   466,     0,   467,   468,     0,     0,     0,     0,     0,
-     471,     0,     0,   472,     0,     0,     0,   474,   475,     0,
-       0,     0,     0,     0,     0,   476,     0,     0,   477,     0,
-       0,     0,   478,   479,   480,   481,   482,     0,     0,  -321,
-       0,     0,     0,   483,     0,     0,   485,     0,   487,     0,
-     137,   488,   138,   139,   140,   141,   142,     0,     0,   143,
-       0,     0,     0,   144,     0,     0,     0,     0,   146,   147,
-     148,   149,   150,     0,     0,  -366,     0,     0,     0,   153,
-       0,     0,     0,   154,     0,     0,   155,   156,   157,     0,
-     158,     0,     0,     0,     0,     0,   161,  3967,     0,   162,
-     163,     0,   164,     0,     0,     0,     0,   167,   168,   169,
-    3968,   171,   172,     0,   173,   174,     0,   175,   176,     0,
-     178,     0,   180,   181,   182,   183,     0,   184,   185,     0,
-     186,   187,   188,     0,   190,     0,     0,     0,   191,     0,
-       0,   192,     0,   193,     0,     0,   194,     0,     0,     0,
-     195,   196,   197,     0,     0,   198,     0,     0,     0,     0,
-     199,     0,     0,     0,     0,     0,   201,   202,     0,   203,
-       0,     0,     0,   204,     0,   205,   206,   207,   208,   209,
-       0,     0,     0,     0,     0,     0,   211,   212,   213,     0,
-       0,     0,   214,     0,  -359,   216,     0,   217,   218,   219,
-       0,     0,   220,   221,     0,   222,   223,   224,   225,   226,
-       0,     0,     0,   228,   229,   230,   231,   232,     0,     0,
-     233,   234,  3969,   235,   236,   237,     0,     0,     0,     0,
-       0,     0,     0,   240,     0,   241,     0,   242,     0,   243,
-     244,   245,   246,     0,   247,     0,   248,     0,     0,     0,
-       0,   250,     0,     0,     0,     0,     0,   253,     0,     0,
-       0,   254,   255,   256,   257,  3970,     0,   258,   259,   260,
-       0,     0,   261,     0,     0,     0,     0,   262,     0,     0,
-       0,     0,   264,     0,     0,     0,   265,   266,     0,   267,
-     268,  3971,     0,     0,   269,     0,     0,     0,   271,     0,
-       0,   272,  3972,     0,   273,   274,     0,     0,     0,     0,
-       0,   275,   276,     0,   277,     0,   278,     0,   279,   280,
-       0,     0,     0,     0,  -321,     0,     0,   281,     0,   282,
-     283,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,     0,   299,   300,   301,
-       0,   302,   303,   304,   305,     0,   306,   307,     0,     0,
-       0,     0,   308,   309,   310,   311,   312,   313,     0,     0,
-     314,   315,     0,   316,     0,   317,     0,   318,   319,   320,
-     321,   322,   323,   324,   325,   326,     0,     0,   327,   328,
-       0,     0,   329,   330,   331,   332,     0,     0,     0,     0,
-     334,     0,     0,     0,   335,     0,   336,   337,   338,     0,
-     339,   340,  3973,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   344,   345,     0,     0,   347,
-       0,   348,   349,   350,   351,   352,   353,   354,   355,   356,
-       0,     0,     0,     0,   359,   360,     0,   361,     0,   362,
-     363,   364,   365,   366,     0,   367,   368,   369,     0,     0,
-     370,     0,     0,     0,   371,   372,   373,   374,   375,     0,
-       0,   376,   377,   378,   379,   380,     0,   381,     0,     0,
-     383,     0,   385,  -321,     0,   386,     0,     0,     0,   388,
-       0,     0,   390,   391,   392,  3974,   393,     0,     0,     0,
-     395,   396,   397,   398,   399,   400,   401,     0,   403,   404,
-       0,   405,     0,     0,     0,     0,   407,   408,   409,     0,
-       0,     0,     0,   411,     0,     0,     0,   412,     0,     0,
-     414,     0,   416,     0,   417,     0,     0,   420,   421,     0,
-       0,     0,     0,     0,   422,   423,   424,     0,   425,   426,
-       0,   427,     0,     0,   428,     0,     0,   429,     0,   431,
-     432,   433,   434,     0,     0,     0,   436,     0,   437,   438,
-     439,   440,   441,   442,     0,     0,   443,   444,   445,   446,
-       0,   447,   448,     0,     0,   449,   450,   451,   452,     0,
-       0,   453,   454,     0,   455,   456,   457,   458,     0,     0,
-       0,     0,     0,   459,   460,     0,     0,     0,     0,   462,
-     463,   464,     0,   465,   466,     0,   467,   468,     0,     0,
-       0,     0,     0,   471,     0,     0,   472,     0,     0,     0,
-     474,   475,     0,     0,     0,     0,     0,     0,   476,     0,
-       0,   477,     0,     0,     0,   478,   479,   480,   481,   482,
-       0,     0,  -321,     0,     0,     0,   483,     0,     0,   485,
-       0,   487,     0,   137,   488,   138,   139,   140,   141,   142,
-       0,     0,   143,     0,     0,     0,   144,     0,     0,     0,
-       0,   146,   147,   148,   149,   150,     0,     0,  -366,     0,
-       0,     0,   153,     0,     0,     0,   154,     0,     0,   155,
-     156,   157,     0,   158,     0,     0,     0,     0,     0,   161,
-    3967,     0,   162,   163,     0,   164,     0,     0,     0,     0,
-     167,   168,   169,  3968,   171,   172,     0,   173,   174,     0,
-     175,   176,     0,   178,     0,   180,   181,   182,   183,     0,
-     184,   185,     0,   186,   187,   188,     0,   190,     0,     0,
-       0,   191,     0,     0,   192,     0,   193,     0,     0,   194,
-       0,     0,     0,   195,   196,   197,     0,     0,   198,     0,
-       0,     0,     0,   199,     0,     0,     0,     0,     0,   201,
-     202,     0,   203,     0,     0,     0,   204,     0,   205,   206,
-     207,   208,   209,     0,     0,     0,     0,     0,     0,   211,
-     212,   213,     0,     0,     0,   214,     0,  4414,   216,     0,
-     217,   218,   219,     0,     0,   220,   221,     0,   222,   223,
-     224,   225,   226,     0,     0,     0,   228,   229,   230,   231,
-     232,     0,     0,   233,   234,  3969,   235,   236,   237,     0,
-       0,     0,     0,     0,     0,     0,   240,     0,   241,     0,
-     242,     0,   243,   244,   245,   246,     0,   247,     0,   248,
-       0,     0,     0,     0,   250,     0,     0,     0,     0,     0,
-     253,     0,     0,     0,   254,   255,   256,   257,  3970,     0,
-     258,   259,   260,     0,     0,   261,     0,     0,     0,     0,
-     262,     0,     0,     0,     0,   264,     0,     0,     0,   265,
-     266,     0,   267,   268,  3971,     0,     0,   269,     0,     0,
-       0,   271,     0,     0,   272,  3972,     0,   273,   274,     0,
-       0,     0,     0,     0,   275,   276,     0,   277,     0,   278,
-       0,   279,   280,     0,     0,     0,     0,  -321,     0,     0,
-     281,     0,   282,   283,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,     0,
-     299,   300,   301,     0,   302,   303,   304,   305,     0,   306,
-     307,     0,     0,     0,     0,   308,   309,   310,   311,   312,
-     313,     0,     0,   314,   315,     0,   316,     0,   317,     0,
-     318,   319,   320,   321,   322,   323,   324,   325,   326,     0,
-       0,   327,   328,     0,     0,   329,   330,   331,   332,     0,
-       0,     0,     0,   334,     0,     0,     0,   335,     0,   336,
-     337,   338,     0,   339,   340,  3973,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   344,   345,
-       0,     0,   347,     0,   348,   349,   350,   351,   352,   353,
-     354,   355,   356,     0,     0,     0,     0,   359,   360,     0,
-     361,     0,   362,   363,   364,   365,   366,     0,   367,   368,
-     369,     0,     0,   370,     0,     0,     0,   371,   372,   373,
-     374,   375,     0,     0,   376,   377,   378,   379,   380,     0,
-     381,     0,     0,   383,     0,   385,  -321,     0,   386,     0,
-       0,     0,   388,     0,     0,   390,   391,   392,  3974,   393,
-       0,     0,     0,   395,   396,   397,   398,   399,   400,   401,
-       0,   403,   404,     0,   405,     0,     0,     0,     0,   407,
-     408,   409,     0,     0,     0,     0,   411,     0,     0,     0,
-     412,     0,     0,   414,     0,   416,     0,   417,     0,     0,
-     420,   421,     0,     0,     0,     0,     0,   422,   423,   424,
-       0,   425,   426,     0,   427,     0,     0,   428,     0,     0,
-     429,     0,   431,   432,   433,   434,     0,     0,     0,   436,
-       0,   437,   438,   439,   440,   441,   442,     0,     0,   443,
-     444,   445,   446,     0,   447,   448,     0,     0,   449,   450,
-     451,   452,     0,     0,   453,   454,     0,   455,   456,   457,
-     458,     0,     0,     0,     0,     0,   459,   460,     0,     0,
-       0,     0,   462,   463,   464,     0,   465,   466,     0,   467,
-     468,     0,     0,     0,     0,     0,   471,     0,     0,   472,
-       0,     0,     0,   474,   475,     0,     0,     0,     0,     0,
-       0,   476,     0,     0,   477,     0,     0,     0,   478,   479,
-     480,   481,   482,     0,     0,  -321,     0,     0,     0,   483,
-       0,     0,   485,     0,   487,     0,   137,   488,   138,   139,
-     140,   141,   142,     0,     0,   143,     0,     0,     0,   144,
-       0,     0,     0,     0,   146,   147,   148,   149,   150,     0,
-       0,  -366,     0,     0,     0,   153,     0,     0,     0,   154,
-       0,     0,   155,   156,   157,     0,   158,     0,     0,     0,
-       0,     0,   161,  3967,     0,   162,   163,     0,   164,     0,
-       0,     0,     0,   167,   168,   169,  3968,   171,   172,     0,
-     173,   174,     0,   175,   176,     0,   178,     0,   180,   181,
-     182,   183,     0,   184,   185,     0,   186,   187,   188,     0,
-     190,     0,     0,     0,   191,     0,     0,   192,     0,   193,
-       0,     0,   194,     0,     0,     0,   195,   196,   197,     0,
-       0,   198,     0,     0,     0,     0,   199,     0,     0,     0,
-       0,     0,   201,   202,     0,   203,     0,     0,     0,   204,
-       0,   205,   206,   207,   208,   209,     0,     0,     0,     0,
-       0,     0,   211,   212,   213,     0,     0,     0,   214,     0,
-    4460,   216,     0,   217,   218,   219,     0,     0,   220,   221,
-       0,   222,   223,   224,   225,   226,     0,     0,     0,   228,
-     229,   230,   231,   232,     0,     0,   233,   234,  3969,   235,
-     236,   237,     0,     0,     0,     0,     0,     0,     0,   240,
-       0,   241,     0,   242,     0,   243,   244,   245,   246,     0,
-     247,     0,   248,     0,     0,     0,     0,   250,     0,     0,
-       0,     0,     0,   253,     0,     0,     0,   254,   255,   256,
-     257,  3970,     0,   258,   259,   260,     0,     0,   261,     0,
-       0,     0,     0,   262,     0,     0,     0,     0,   264,     0,
-       0,     0,   265,   266,     0,   267,   268,  3971,     0,     0,
-     269,     0,     0,     0,   271,     0,     0,   272,  3972,     0,
-     273,   274,     0,     0,     0,     0,     0,   275,   276,     0,
-     277,     0,   278,     0,   279,   280,     0,     0,     0,     0,
-    -321,     0,     0,   281,     0,   282,   283,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,     0,   299,   300,   301,     0,   302,   303,   304,
-     305,     0,   306,   307,     0,     0,     0,     0,   308,   309,
-     310,   311,   312,   313,     0,     0,   314,   315,     0,   316,
-       0,   317,     0,   318,   319,   320,   321,   322,   323,   324,
-     325,   326,     0,     0,   327,   328,     0,     0,   329,   330,
-     331,   332,     0,     0,     0,     0,   334,     0,     0,     0,
-     335,     0,   336,   337,   338,     0,   339,   340,  3973,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   344,   345,     0,     0,   347,     0,   348,   349,   350,
-     351,   352,   353,   354,   355,   356,     0,     0,     0,     0,
-     359,   360,     0,   361,     0,   362,   363,   364,   365,   366,
-       0,   367,   368,   369,     0,     0,   370,     0,     0,     0,
-     371,   372,   373,   374,   375,     0,     0,   376,   377,   378,
-     379,   380,     0,   381,     0,     0,   383,     0,   385,  -321,
-       0,   386,     0,     0,     0,   388,     0,     0,   390,   391,
-     392,  3974,   393,     0,     0,     0,   395,   396,   397,   398,
-     399,   400,   401,     0,   403,   404,     0,   405,     0,     0,
-       0,     0,   407,   408,   409,     0,     0,     0,     0,   411,
-       0,     0,     0,   412,     0,     0,   414,     0,   416,     0,
-     417,     0,     0,   420,   421,     0,     0,     0,     0,     0,
-     422,   423,   424,     0,   425,   426,     0,   427,     0,     0,
-     428,     0,     0,   429,     0,   431,   432,   433,   434,     0,
-       0,     0,   436,     0,   437,   438,   439,   440,   441,   442,
-       0,     0,   443,   444,   445,   446,     0,   447,   448,     0,
-       0,   449,   450,   451,   452,     0,     0,   453,   454,     0,
-     455,   456,   457,   458,     0,     0,     0,     0,     0,   459,
-     460,     0,     0,     0,     0,   462,   463,   464,     0,   465,
-     466,     0,   467,   468,     0,     0,     0,     0,     0,   471,
-       0,     0,   472,     0,     0,     0,   474,   475,     0,     0,
-       0,     0,     0,     0,   476,     0,     0,   477,     0,     0,
-       0,   478,   479,   480,   481,   482,     0,     0,  -321,     0,
-       0,     0,   483,     0,     0,   485,     0,   487,     0,   137,
-     488,   138,   139,   140,   141,   142,     0,     0,   143,     0,
-       0,     0,   144,     0,     0,     0,     0,   146,   147,   148,
-     149,   150,     0,     0,  -366,     0,     0,     0,   153,     0,
-       0,     0,   154,     0,     0,   155,   156,   157,     0,   158,
-       0,     0,     0,     0,     0,   161,  3967,     0,   162,   163,
-       0,   164,     0,     0,     0,     0,   167,   168,   169,  3968,
-     171,   172,     0,   173,   174,     0,   175,   176,     0,   178,
-       0,   180,   181,   182,   183,     0,   184,   185,     0,   186,
-     187,   188,     0,   190,     0,     0,     0,   191,     0,     0,
-     192,     0,   193,     0,     0,   194,     0,     0,     0,   195,
-     196,   197,     0,     0,   198,     0,     0,     0,     0,   199,
-       0,     0,     0,     0,     0,   201,   202,     0,   203,     0,
-       0,     0,   204,     0,   205,   206,   207,   208,   209,     0,
-       0,     0,     0,     0,     0,   211,   212,   213,     0,     0,
-       0,   214,     0,  -340,   216,     0,   217,   218,   219,     0,
-       0,   220,   221,     0,   222,   223,   224,   225,   226,     0,
-       0,     0,   228,   229,   230,   231,   232,     0,     0,   233,
-     234,  3969,   235,   236,   237,     0,     0,     0,     0,     0,
-       0,     0,   240,     0,   241,     0,   242,     0,   243,   244,
-     245,   246,     0,   247,     0,   248,     0,     0,     0,     0,
-     250,     0,     0,     0,     0,     0,   253,     0,     0,     0,
-     254,   255,   256,   257,  3970,     0,   258,   259,   260,     0,
-       0,   261,     0,     0,     0,     0,   262,     0,     0,     0,
-       0,   264,     0,     0,     0,   265,   266,     0,   267,   268,
-    3971,     0,     0,   269,     0,     0,     0,   271,     0,     0,
-     272,  3972,     0,   273,   274,     0,     0,     0,     0,     0,
-     275,   276,     0,   277,     0,   278,     0,   279,   280,     0,
-       0,     0,     0,  -321,     0,     0,   281,     0,   282,   283,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,     0,   299,   300,   301,     0,
-     302,   303,   304,   305,     0,   306,   307,     0,     0,     0,
-       0,   308,   309,   310,   311,   312,   313,     0,     0,   314,
-     315,     0,   316,     0,   317,     0,   318,   319,   320,   321,
-     322,   323,   324,   325,   326,     0,     0,   327,   328,     0,
-       0,   329,   330,   331,   332,     0,     0,     0,     0,   334,
-       0,     0,     0,   335,     0,   336,   337,   338,     0,   339,
-     340,  3973,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   344,   345,     0,     0,   347,     0,
-     348,   349,   350,   351,   352,   353,   354,   355,   356,     0,
-       0,     0,     0,   359,   360,     0,   361,     0,   362,   363,
-     364,   365,   366,     0,   367,   368,   369,     0,     0,   370,
-       0,     0,     0,   371,   372,   373,   374,   375,     0,     0,
-     376,   377,   378,   379,   380,     0,   381,     0,     0,   383,
-       0,   385,  -321,     0,   386,     0,     0,     0,   388,     0,
-       0,   390,   391,   392,  3974,   393,     0,     0,     0,   395,
-     396,   397,   398,   399,   400,   401,     0,   403,   404,     0,
-     405,     0,     0,     0,     0,   407,   408,   409,     0,     0,
-       0,     0,   411,     0,     0,     0,   412,     0,     0,   414,
-       0,   416,     0,   417,     0,     0,   420,   421,     0,     0,
-       0,     0,     0,   422,   423,   424,     0,   425,   426,     0,
-     427,     0,     0,   428,     0,     0,   429,     0,   431,   432,
-     433,   434,     0,     0,     0,   436,     0,   437,   438,   439,
-     440,   441,   442,     0,     0,   443,   444,   445,   446,     0,
-     447,   448,     0,     0,   449,   450,   451,   452,     0,     0,
-     453,   454,     0,   455,   456,   457,   458,     0,     0,     0,
-       0,     0,   459,   460,     0,     0,     0,     0,   462,   463,
-     464,     0,   465,   466,     0,   467,   468,     0,     0,     0,
-       0,     0,   471,     0,     0,   472,     0,     0,     0,   474,
-     475,     0,     0,     0,     0,     0,     0,   476,     0,     0,
-     477,     0,     0,     0,   478,   479,   480,   481,   482,     0,
-       0,  -321,     0,     0,     0,   483,     0,     0,   485,     0,
-     487,     0,   137,   488,   138,   139,   140,   141,   142,     0,
-       0,   143,     0,     0,     0,   144,     0,     0,     0,     0,
-     146,   147,   148,   149,   150,     0,     0,  -366,     0,     0,
-       0,   153,     0,     0,     0,   154,     0,     0,   155,   156,
-     157,     0,   158,     0,     0,     0,     0,     0,   161,  3967,
-       0,   162,   163,     0,   164,     0,     0,     0,     0,   167,
-     168,   169,  3968,   171,   172,     0,   173,   174,     0,   175,
-     176,     0,   178,     0,   180,   181,   182,   183,     0,   184,
-     185,     0,   186,   187,   188,     0,   190,     0,     0,     0,
-     191,     0,     0,   192,     0,   193,     0,     0,   194,     0,
-       0,     0,   195,   196,   197,     0,     0,   198,     0,     0,
-       0,     0,   199,     0,     0,     0,     0,     0,   201,   202,
-       0,   203,     0,     0,     0,   204,     0,   205,   206,   207,
-     208,   209,     0,     0,     0,     0,     0,     0,   211,   212,
-     213,     0,     0,     0,   214,     0,     0,   216,     0,   217,
-     218,   219,     0,     0,   220,   221,     0,   222,   223,   224,
-     225,   226,     0,     0,     0,   228,   229,   230,   231,   232,
-       0,     0,   233,   234,  3969,   235,   236,   237,     0,     0,
-       0,     0,     0,     0,     0,   240,     0,   241,     0,   242,
-       0,   243,   244,   245,   246,     0,   247,     0,   248,     0,
-       0,     0,     0,   250,     0,     0,     0,     0,     0,   253,
-       0,     0,     0,   254,   255,   256,   257,  3970,     0,   258,
-     259,   260,     0,     0,   261,     0,     0,     0,     0,   262,
-       0,     0,     0,     0,   264,     0,     0,     0,   265,   266,
-       0,   267,   268,  3971,     0,     0,   269,     0,     0,     0,
-     271,     0,     0,   272,  3972,     0,   273,   274,     0,     0,
-       0,     0,     0,   275,   276,     0,   277,     0,   278,     0,
-     279,   280,     0,     0,     0,     0,  -321,     0,     0,   281,
-       0,   282,   283,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,     0,   299,
-     300,   301,     0,   302,   303,   304,   305,     0,   306,   307,
-       0,     0,     0,     0,   308,   309,   310,   311,   312,   313,
-       0,     0,   314,   315,     0,   316,     0,   317,     0,   318,
-     319,   320,   321,   322,   323,   324,   325,   326,     0,     0,
-     327,   328,     0,     0,   329,   330,   331,   332,     0,     0,
-       0,     0,   334,     0,     0,     0,   335,     0,   336,   337,
-     338,     0,   339,   340,  3973,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   344,   345,     0,
-       0,   347,     0,   348,   349,   350,   351,   352,   353,   354,
-     355,   356,     0,     0,     0,     0,   359,   360,     0,   361,
-       0,   362,   363,   364,   365,   366,     0,   367,   368,   369,
-       0,     0,   370,     0,     0,     0,   371,   372,   373,   374,
-     375,     0,     0,   376,   377,   378,   379,   380,     0,   381,
-       0,     0,   383,     0,   385,  -321,     0,   386,     0,     0,
-       0,   388,     0,     0,   390,   391,   392,  3974,   393,     0,
-       0,     0,   395,   396,   397,   398,   399,   400,   401,     0,
-     403,   404,     0,   405,     0,     0,     0,     0,   407,   408,
-     409,     0,     0,     0,     0,   411,     0,     0,     0,   412,
-       0,     0,   414,     0,   416,     0,   417,     0,     0,   420,
-     421,     0,     0,     0,     0,     0,   422,   423,   424,     0,
-     425,   426,     0,   427,     0,     0,   428,     0,     0,   429,
-       0,   431,   432,   433,   434,     0,     0,     0,   436,     0,
-     437,   438,   439,   440,   441,   442,     0,     0,   443,   444,
-     445,   446,     0,   447,   448,     0,     0,   449,   450,   451,
-     452,     0,     0,   453,   454,     0,   455,   456,   457,   458,
-       0,     0,     0,     0,     0,   459,   460,     0,     0,     0,
-       0,   462,   463,   464,     0,   465,   466,     0,   467,   468,
-       0,     0,     0,     0,     0,   471,     0,     0,   472,     0,
-       0,     0,   474,   475,     0,     0,     0,     0,     0,     0,
-     476,     0,     0,   477,     0,     0,     0,   478,   479,   480,
-     481,   482,     0,     0,  -321,     0,     0,     0,   483,     0,
-       0,   485,     0,   487,     0,   137,   488,   138,   139,   140,
-     141,   142,     0,     0,   143,     0,     0,     0,   144,     0,
-       0,     0,     0,   146,   147,   148,   149,   150,     0,     0,
-    -366,     0,     0,     0,   153,     0,     0,     0,   154,     0,
-       0,   155,   156,   157,     0,   158,     0,     0,     0,     0,
-       0,   161,  3967,     0,   162,   163,     0,   164,     0,     0,
-       0,     0,   167,   168,   169,  3968,   171,   172,     0,   173,
-     174,     0,   175,   176,     0,   178,     0,   180,   181,   182,
-     183,     0,   184,   185,     0,   186,   187,   188,     0,   190,
-       0,     0,     0,   191,     0,     0,   192,     0,   193,     0,
-       0,   194,     0,     0,     0,   195,   196,   197,     0,     0,
-     198,     0,     0,     0,     0,   199,     0,     0,     0,     0,
-       0,   201,   202,     0,   203,     0,     0,     0,   204,     0,
-     205,   206,   207,   208,   209,     0,     0,     0,     0,     0,
-       0,   211,   212,   213,     0,     0,     0,   214,     0,     0,
-     216,     0,   217,   218,   219,     0,     0,   220,   221,     0,
-     222,   223,   224,   225,   226,     0,     0,     0,   228,   229,
-     230,   231,   232,     0,     0,   233,   234,  3969,   235,   236,
-     237,     0,     0,     0,     0,     0,     0,     0,   240,     0,
-     241,     0,   242,     0,   243,   244,   245,   246,     0,   247,
-       0,   248,     0,     0,     0,     0,   250,     0,     0,     0,
-       0,     0,   253,     0,     0,     0,   254,   255,   256,   257,
-    3970,     0,   258,   259,   260,     0,     0,   261,     0,     0,
-       0,     0,   262,     0,     0,     0,     0,   264,     0,     0,
-       0,   265,   266,     0,   267,   268,  3971,     0,     0,   269,
-       0,     0,     0,   271,     0,     0,   272,  3972,     0,   273,
-     274,     0,     0,     0,     0,     0,   275,   276,     0,   277,
-       0,   278,     0,   279,   280,     0,     0,     0,     0,  -321,
-       0,     0,   281,     0,   282,   283,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,     0,   299,   300,   301,     0,   302,   303,   304,   305,
-       0,   306,   307,     0,     0,     0,     0,   308,   309,   310,
-     311,   312,   313,     0,     0,   314,   315,     0,   316,     0,
-     317,     0,   318,   319,   320,   321,   322,   323,   324,   325,
-     326,     0,     0,   327,   328,     0,     0,   329,   330,   331,
-     332,     0,     0,     0,     0,   334,     0,     0,     0,   335,
-       0,   336,   337,   338,     0,   339,   340,  3973,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     344,   345,     0,     0,   347,     0,   348,   349,   350,   351,
-     352,   353,   354,   355,   356,     0,     0,     0,     0,   359,
-     360,     0,   361,     0,   362,   363,   364,   365,   366,     0,
-     367,   368,   369,     0,     0,   370,     0,     0,     0,   371,
-     372,   373,   374,   375,     0,     0,   376,   377,   378,   379,
-     380,     0,   381,     0,     0,   383,     0,   385,  -321,     0,
-     386,     0,     0,     0,   388,     0,     0,   390,   391,   392,
-    3974,   393,     0,     0,     0,   395,   396,   397,   398,   399,
-     400,   401,     0,   403,   404,     0,   405,     0,     0,     0,
-       0,   407,   408,   409,     0,     0,     0,     0,   411,     0,
-       0,     0,   412,     0,     0,   414,     0,   416,     0,   417,
-       0,     0,   420,   421,     0,     0,     0,     0,     0,   422,
-     423,   424,     0,   425,   426,     0,   427,     0,     0,   428,
-       0,     0,   429,     0,   431,   432,   433,   434,     0,     0,
-       0,   436,     0,   437,   438,   439,   440,   441,   442,     0,
-       0,   443,   444,   445,   446,     0,   447,   448,     0,     0,
-     449,   450,   451,   452,     0,     0,   453,   454,     0,   455,
-     456,   457,   458,     0,     0,     0,     0,     0,   459,   460,
-       0,     0,     0,     0,   462,   463,   464,     0,   465,   466,
-       0,   467,   468,     0,     0,     0,     0,     0,   471,     0,
-       0,  4309,     0,     0,     0,   474,   475,     0,     0,     0,
-       0,     0,     0,   476,     0,     0,   477,     0,     0,     0,
-     478,   479,   480,   481,   482,     0,     0,  -321,     0,     0,
-       0,   483,     0,     0,   485,     0,   487,     0,   137,   488,
-     138,   139,   140,   141,   142,     0,     0,   143,     0,     0,
-       0,   144,     0,     0,     0,     0,   146,   147,   148,   149,
-     150,     0,     0,     0,     0,     0,     0,   153,     0,     0,
-       0,   154,     0,     0,   155,   156,   157,     0,   158,     0,
-       0,     0,     0,     0,   161,     0,     0,   162,   163,     0,
-     164,     0,     0,     0,     0,   167,   168,   169,     0,   171,
-     172,     0,   173,   174,     0,   175,   176,     0,   178,     0,
-     180,   181,   182,   183,     0,   184,   185,     0,   186,   187,
-     188,     0,   190,     0,     0,     0,   191,     0,     0,   192,
-       0,   193,     0,     0,   194,     0,     0,     0,   195,   196,
-     197,     0,     0,   198,     0,     0,     0,     0,   199,     0,
-       0,     0,     0,     0,   201,   202,     0,   203,     0,     0,
-       0,   204,     0,   205,   206,   207,   208,   209,     0,     0,
-       0,     0,     0,     0,   211,   212,   213,     0,     0,     0,
-     214,     0,     0,   216,     0,   217,   218,   219,     0,     0,
-     220,   221,     0,   222,   223,   224,   225,   226,     0,     0,
-       0,   228,   229,   230,   231,   232,     0,     0,   233,   234,
-       0,   235,   236,   237,     0,     0,     0,     0,     0,     0,
-       0,   240,     0,   241,     0,   242,     0,   243,   244,   245,
-     246,     0,   247,     0,   248,     0,     0,     0,     0,   250,
-       0,     0,     0,     0,     0,   253,     0,     0,     0,   254,
-     255,   256,   257,     0,     0,   258,   259,   260,     0,     0,
-     261,     0,     0,     0,     0,   262,     0,     0,     0,     0,
-     264,     0,     0,     0,   265,   266,     0,   267,   268,     0,
-       0,     0,   269,     0,     0,     0,   271,     0,     0,   272,
-       0,     0,   273,   274,     0,     0,     0,     0,     0,   275,
-     276,     0,   277,     0,   278,     0,   279,   280,     0,     0,
-       0,     0,     0,     0,     0,   281,     0,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,     0,   299,   300,   301,     0,   302,
-     303,   304,   305,     0,   306,   307,     0,     0,     0,     0,
-     308,   309,   310,   311,   312,   313,     0,     0,   314,   315,
-       0,   316,     0,   317,     0,   318,   319,   320,   321,   322,
-     323,   324,   325,   326,     0,     0,   327,   328,     0,     0,
-     329,   330,   331,   332,     0,     0,     0,     0,   334,     0,
-       0,     0,   335,     0,   336,   337,   338,     0,   339,   340,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   344,   345,     0,     0,   347,     0,   348,
-     349,   350,   351,   352,   353,   354,   355,   356,     0,     0,
-       0,     0,   359,   360,     0,   361,     0,   362,   363,   364,
-     365,   366,     0,   367,   368,   369,     0,     0,   370,     0,
-       0,     0,   371,   372,   373,   374,   375,     0,     0,   376,
-     377,   378,   379,   380,     0,   381,     0,     0,   383,     0,
-     385,     0,     0,   386,     0,     0,     0,   388,     0,     0,
-     390,   391,   392,     0,   393,     0,     0,     0,   395,   396,
-     397,   398,   399,   400,   401,     0,   403,   404,     0,   405,
-       0,     0,     0,     0,   407,   408,   409,     0,     0,     0,
-       0,   411,     0,     0,     0,   412,     0,     0,   414,     0,
-     416,     0,   417,     0,     0,   420,   421,     0,     0,     0,
-       0,     0,   422,   423,   424,     0,   425,   426,     0,   427,
-       0,     0,   428,     0,     0,   429,     0,   431,   432,   433,
-     434,     0,     0,     0,   436,     0,   437,   438,   439,   440,
-     441,   442,     0,     0,   443,   444,   445,   446,     0,   447,
-     448,     0,     0,   449,   450,   451,   452,     0,     0,   453,
-     454,     0,   455,   456,   457,   458,     0,     0,     0,     0,
-       0,   459,   460,     0,     0,     0,     0,   462,   463,   464,
-       0,   465,   466,     0,   467,   468,     0,     0,     0,     0,
-       0,   471,     0,     0,   472,     0,     0,     0,   474,   475,
-       0,     0,     0,     0,     0,     0,   476,     0,     0,   477,
-       0,     0,     0,   478,   479,   480,   481,   482,     0,     0,
-       0,     0,     0,     0,   483,     0,     0,   485,     0,   487,
-       0,     0,   488
-};
-
-static const yytype_int16 yycheck[] =
-{
-       6,   638,   647,   648,   594,   575,   574,   575,   953,  1137,
-     853,  1837,   122,    19,   954,   873,   874,    23,  1550,  1483,
-     519,  1233,    20,  1377,  1084,   883,    32,     6,  1043,  1137,
-    1037,  1038,    30,    39,  1683,   610,    42,   705,    36,  1280,
-      46,  1358,  2019,   891,   913,  1804,  2540,    53,   623,   665,
-      23,  1472,  2090,  1481,  1472,  2479,  2155,  2468,  1107,  1160,
-    3301,  2160,  1074,  1233,  2326,   913,  1167,  2891,  2371,  2833,
-    2657,  1472,   958,  2497,  2498,  2428,  2429,  1286,  2456,  2251,
-    1988,   889,  1986,  1826,  1992,  1756,   958,  2115,    94,   652,
-    1913,  2449,  1982,  1982,  3036,  2003,  2535,  2513,  1462,  2457,
-    2541,  2289,  1466,  2115,  1468,     4,   914,  2015,  3533,  3091,
-     116,  2436,   118,  2691,  3306,   121,   122,   123,  2787,  1168,
-    1169,    94,    46,  1172,  1173,  1174,  1175,  2389,  1177,  1178,
-    1179,  1180,  1181,  1182,  1183,  1184,   773,    16,    17,   118,
-    1937,  1938,   121,  3174,  1388,   761,   762,   763,  1965,  2045,
-      17,   634,   635,  1452,    16,    17,    24,  1954,   774,    19,
-      33,  2749,  1406,    70,  2685,  3324,    74,  1531,  2689,  2838,
-    1414,  1415,  1462,   933,  1971,  1972,    10,  1462,  1835,    17,
-    2104,  1466,  1206,  1468,  2138,  1956,    29,  2455,  2497,  2498,
-    1987,    19,   145,  1990,  1991,    59,  1993,  2659,   915,  1996,
-    1997,  2625,  2626,  2000,    11,  1928,  2414,   153,  2005,    31,
-     104,  1974,   145,  2010,  2011,  2012,  2013,  2014,    67,   129,
-     171,  2018,  3581,  2020,    50,  2115,  2115,    62,   803,  2026,
-    2027,  2028,  2029,    19,   148,  2032,   120,  2034,    20,  3591,
-    2245,  1531,   158,  4006,  2501,   159,  1531,    55,   280,   155,
-    3364,  3365,  2516,  2070,  3368,  2072,  2073,    16,    17,   834,
-      21,  2078,  2079,   386,    11,  2688,   313,   151,    82,  4099,
-    2087,  2088,    33,  3387,  2944,  2092,    24,    80,   139,  3393,
-     186,    16,    17,    68,   151,   106,    47,   247,  3529,   263,
-     134,   151,   416,   221,     9,   155,   103,    58,    59,    21,
-    3638,   363,  2099,  2100,  2101,  2102,   403,   385,    50,     8,
-     265,    35,   640,   468,    29,   122,  2625,  2626,   421,   120,
-      35,   145,    35,   120,    16,    17,   388,   155,    12,    16,
-      17,    75,    19,   449,   122,   468,    58,    59,    16,    17,
-     244,   249,    16,    17,   126,   819,  2671,    61,  2673,   186,
-     151,   184,    16,    17,   151,   433,   269,    67,   122,   227,
-     430,    16,    17,    16,    17,    16,    17,   354,   263,   155,
-    1015,  1016,  1017,  4136,  2820,   160,   221,   120,   486,   125,
-     545,   186,   352,  2633,   416,   192,   125,  4260,   221,    33,
-    4263,     8,   784,   536,   504,   162,   539,   609,   610,   373,
-     143,   624,    16,    17,   225,  1073,   162,   238,   631,   355,
-     245,   508,    29,   506,   221,    59,   238,   132,    74,  1087,
-     632,    21,  2239,    16,    17,   192,    64,   511,   259,   399,
-     189,  2385,   542,    33,   527,   280,   192,   180,  2826,   509,
-     262,   309,   585,   356,   431,    16,    17,    47,  3873,   237,
-     558,   135,   280,    16,    17,   847,    20,   371,    58,    59,
-     544,   412,   936,   560,  2910,   630,   273,   272,   571,   155,
-     798,   185,   184,   237,   318,   630,   155,   280,   373,   227,
-     179,    16,    17,   545,   608,   209,  1426,   447,    16,    17,
-      16,    17,   231,  1351,    16,    17,   209,   630,   504,  3837,
-     506,   984,   457,   600,  3696,  3619,  4379,   630,  3749,   221,
-     372,   439,   416,   375,  3628,   189,    78,   523,  2843,  2844,
-    2898,   527,   638,  4353,  4354,   272,  1163,  2943,   647,   648,
-    2946,  2947,   538,    16,    17,   262,   542,  3651,   544,  2003,
-    1857,    40,  3656,  3212,  3213,  3214,   354,    16,    17,    16,
-      17,   557,   155,  2964,   632,  1171,    70,  1056,  1057,    16,
-      17,   309,   126,    16,    17,  1233,  1452,   412,   574,   403,
-      65,   477,  1188,   260,  1382,   521,   582,  1385,  1077,  2556,
-    1452,   613,  1390,   630,  3253,  3254,  3255,  1086,   416,   374,
-    1438,  3573,  1956,   249,   600,  3787,   403,   411,  3950,  1098,
-    1099,  1100,   576,   425,   610,  2633,   612,  1106,  1416,  1417,
-    1974,  2501,  2501,   372,  1826,   476,   375,   623,   624,   625,
-     446,  2633,  3084,  2519,   630,   124,   632,  2523,   634,   635,
-     544,  2899,  2900,   639,   640,  3059,  2037,   372,   644,   155,
-     375,  2537,  2538,  3313,  1530,  2462,   625,  3235,   654,   655,
-     656,   624,   605,  2549,   660,   601,  1826,   630,  1530,  2867,
-      16,    17,  1711,  1907,    16,    17,  1956,   474,   517,   451,
-    3494,  1956,   605,  1722,   508,  2932,  1725,  2941,   140,  4442,
-     372,   632,  2578,   375,   608,   372,   602,   401,   375,  1974,
-     800,   526,  1982,  1705,   372,  1412,  3888,   375,   372,   705,
-     608,   375,  4127,  2627,   446,  2522,   600,  2524,   372,  2480,
-    1734,   375,  3871,   556,  2531,  3303,  2670,   372,   556,   372,
-     375,   372,   375,   630,   375,  2448,   560,  3919,  2545,  1212,
-     537,   595,   539,  2530,  2391,  2552,  2499,  4096,   617,   649,
-    2104,   608,  3773,  2633,  2633,  2750,  2543,  2564,  2565,  2566,
-    3059,  2115,   636,  2570,   587,   617,  1516,   630,   372,  2655,
-     766,   375,   768,   873,   632,  3090,   600,   877,   878,   636,
-     556,   608,  1347,   635,  3352,  2592,   636,  3080,   585,   372,
-     890,   605,   375,  2971,  3766,   613,    16,    17,   794,   795,
-     796,   477,   798,   799,   800,   616,   802,   803,   477,  2098,
-    1283,   372,   808,  1366,   375,  3383,  3384,   517,   814,   372,
-    3060,  1386,   375,   574,  2104,  1298,   795,   532,   824,  2104,
-     799,   545,  4247,   802,   568,  2115,   153,  3348,   834,   835,
-    2115,  4023,   545,   839,  2631,   636,   582,   372,   553,   636,
-     375,   623,   952,   582,   372,   560,   372,   375,   486,   375,
-     372,   824,   574,   375,    16,    17,  3244,    61,   617,    16,
-      17,  3382,   835,   577,   983,  2624,   839,   873,   583,  3390,
-    3539,   877,   878,   632,   477,   587,  3397,    16,    17,   606,
-      45,  3322,   617,   151,   890,    16,    17,   451,  1456,   372,
-     632,   405,   375,   212,  3310,  1470,   631,   632,    42,  3338,
-     227,   463,   125,   372,  2332,   372,   375,  3030,   375,   565,
-     588,    16,    17,  3291,  1033,   372,   171,  3295,   375,   372,
-      33,   416,   375,  3346,  3347,   617,  3868,   933,  2460,   828,
-     617,  3354,   588,  3291,  3357,  3358,   174,  3295,  3241,   617,
-     632,    16,    17,   617,  2770,   632,   952,   545,   954,    16,
-      17,  3374,   638,   617,   632,    16,    17,   631,  4150,   638,
-    1628,   477,   617,   117,   617,  3388,   617,   631,   632,    68,
-    3393,  3394,  3395,  3396,   574,  3300,  1539,   632,   984,   632,
-     631,   632,   151,   229,  2810,  1843,  4100,  4179,  4102,   192,
-     362,   367,   238,   171,  3256,   263,   155,   468,   598,    16,
-      17,    16,    17,   617,   680,  1863,   468,   279,   231,   117,
-     509,    16,    17,   225,  4255,    50,   372,   631,   632,   375,
-     372,   302,   536,   375,   617,    16,    17,   181,   355,  1035,
-     630,   530,  3060,  1039,  1903,   638,   358,  4132,   631,   632,
-    1150,   206,  2932,  2932,   373,   559,   617,   264,  3060,   141,
-     267,  2515,  2516,   355,   617,  1903,   441,  2816,   576,   558,
-     631,   632,  1035,  2886,  1933,   117,  1039,  1073,   631,   632,
-     120,  2967,  3782,   181,  2428,  2429,   752,  1187,   366,    16,
-      17,  1087,   617,    23,  1729,  1933,    16,    17,  1896,   617,
-     468,   617,   807,  2836,   263,   617,   631,   632,  1906,   366,
-     359,  1909,  1910,   631,   632,  3692,   632,  3015,  1724,   631,
-    3014,  3165,  2783,   631,  3286,  3169,  2480,   302,  3578,   357,
-      16,    17,   638,   277,  1234,  2140,    16,    17,    16,    17,
-     411,  1137,   378,   192,   617,  2499,  2185,   107,    16,    17,
-     110,   120,   372,  2352,  1150,   375,  3758,   611,   617,   632,
-     617,   151,    74,  2574,  1799,   134,  2574,   412,  1826,   630,
-     617,  2262,  1737,   632,   617,   632,   438,   391,   630,   277,
-    3060,  3060,   634,  2574,  3786,   632,   199,   319,   631,  1289,
-     510,  1187,    16,    17,    16,    17,  1192,  3565,  3566,   302,
-    2480,  1197,   247,  2437,   521,  2480,   413,   341,   517,  1774,
-     403,   460,  2961,   258,   358,   486,  1212,  3330,  2268,  2269,
-     372,  2501,  2098,   375,  2499,   372,   439,    11,   375,   521,
-     424,   221,   190,   163,  1197,   277,  2098,  1233,  1234,    16,
-      17,    16,    17,   372,   412,    98,   375,  1812,  1813,  4003,
-     274,   372,  2891,  2371,   375,   468,   269,   632,   462,  2261,
-     358,  4015,   630,  1828,    16,    17,  1739,  4081,  3718,  2271,
-     632,   617,   638,  2627,  1270,   617,  1272,   372,  1274,  2633,
-     375,  3248,    16,    17,   601,   374,   632,  1283,    16,    17,
-     632,  4376,   539,  1289,   960,   377,  4527,   117,    16,    17,
-     186,  2340,  1298,  1299,    16,    17,   461,   372,   486,   601,
-     375,  1274,   336,   632,  3764,   372,   358,   357,   375,   631,
-      12,   372,    16,    17,   375,  3856,    16,    17,   477,   354,
-     650,  1327,    16,    17,   562,   613,  1299,   249,   122,  1335,
-    2458,   586,  1338,    16,    17,   607,   539,  2627,   606,   318,
-     578,  1347,  2627,  2633,   403,   117,   613,  3700,  2633,  1459,
-    2458,  1357,  1358,  3170,   468,   372,  3455,   372,   375,   582,
-     375,  1367,  1368,  1369,  1370,  1371,  1372,   372,   636,   123,
-     375,  1377,  2800,  4083,   189,  4085,  1275,  1383,  1384,   545,
-    1386,   372,   244,  1389,   375,   631,    12,   617,  1367,  1368,
-    1369,  3694,  1371,    16,    17,    16,    17,  1370,   453,  1372,
-    3159,   543,   632,  1409,   263,  1384,   468,   630,   586,   181,
-    1389,   446,   189,   567,   179,    24,   384,    16,    17,   391,
-      62,   468,   545,  2551,  3320,    16,    17,   569,   484,   341,
-    3971,  3972,    12,   135,    51,   372,  1409,   606,   375,   439,
-     398,   476,   372,  2551,    61,   375,  3342,   277,  3944,   217,
-     473,   219,   364,  1459,   632,   617,    16,    17,   235,   567,
-     617,     0,    57,  1362,  1470,    74,   118,   636,   202,  1475,
-     632,   637,  1478,  1479,   517,   632,   372,  2941,   617,   375,
-     539,   468,   372,   517,   372,   375,   617,   375,   253,   136,
-     151,    16,    17,   632,   372,   136,   155,   375,    16,    17,
-     565,   632,  1475,    16,    17,   277,  1479,   630,    24,   135,
-    1516,  3922,   617,   247,   373,   567,   630,   485,   153,    16,
-      17,   229,   388,   588,   580,    12,   280,   632,   358,  1535,
-     238,  1537,  1538,   348,  1540,  1541,    21,   468,   372,    12,
-     372,   375,   617,   375,   153,    16,    17,  1553,    33,  1555,
-     617,  3015,  2410,   596,   416,   135,   617,   632,  1537,  1538,
-      16,    17,    47,   172,   620,   632,  1465,   227,   630,    16,
-      17,   632,  3875,    58,    59,  4035,   171,  4118,  4119,   549,
-     175,   375,   552,   630,   236,   372,   358,   372,   375,   354,
-     375,   186,   227,    16,    17,  4091,   373,    16,    17,  3416,
-     617,   132,   617,   245,    16,    17,    16,    17,    16,    17,
-     372,  3710,   617,   375,  4074,   632,   147,   632,   227,   155,
-     123,   545,  1628,  1629,  2836,    41,   617,   632,   372,   225,
-    1740,   375,    16,    17,   372,   189,   636,   375,    20,   373,
-     631,   202,  2932,   630,   372,    16,    17,   375,   135,  2265,
-     372,   162,   269,   375,   250,    16,    17,  2672,    19,  3921,
-      16,    17,   135,  2162,   468,  2766,  2836,  2908,   372,   539,
-     378,   375,   372,  4214,   630,   375,   588,  2176,   372,   545,
-     617,   375,   638,  1689,   331,    16,    17,   617,  4229,   372,
-     331,   122,   375,  2821,   631,   355,  3060,    16,    17,   630,
-     309,   631,  4243,   634,    24,   416,   630,   210,   350,   263,
-    2209,   227,   638,  2821,    16,    17,   556,   133,    16,    17,
-     355,   617,   317,    16,    17,  1731,   437,   617,   468,   617,
-    1840,  1737,    17,  1739,  1740,   631,   476,   567,   206,   617,
-     349,   631,   189,   631,   126,  1751,   355,  4171,  4172,   372,
-    1756,   372,   375,   631,   375,  1761,  3971,  3972,   220,  4300,
-     471,  3799,  3800,    16,    17,   189,   418,  3188,  1774,  3187,
-    3060,  4312,  4313,   372,   202,  3060,   375,   280,   539,  2278,
-    4274,   372,   250,   617,   375,   617,  1792,    17,   592,   593,
-    1796,   206,  3220,   309,    77,   567,    79,   631,   225,   631,
-     608,    12,  2418,    16,    17,   630,  1812,  1813,  1814,  1815,
-      16,    17,   372,   638,   238,   375,   225,   412,  4359,  1792,
-    1826,  3580,  1828,  1796,   632,   542,   630,  3804,  4369,   225,
-     617,  4141,   617,   153,  1840,   250,  4146,   120,  4148,   355,
-     536,  1814,  1815,   539,   631,  3494,   631,   372,  2416,   624,
-     375,  1857,   592,   593,   372,   617,   631,   375,   220,   372,
-     143,   521,   375,   200,    30,  4406,  1872,  4408,   510,   631,
-     202,   523,   130,   617,   367,   372,   588,  4418,   375,   617,
-      16,    17,    16,    17,   526,    39,   521,   631,   235,   617,
-     630,   189,    46,   631,  4435,   617,  4437,   180,  4439,    16,
-      17,   372,  1908,   631,   375,  4446,   136,   227,    46,   631,
-      76,  1810,   521,   617,  1920,  4456,   372,   617,  3735,   375,
-     632,  1927,   189,   617,   135,   372,   638,   631,   375,  4470,
-    4471,   631,    81,   476,   617,  1908,   189,   631,   351,   352,
-     593,   601,   287,   288,  3654,  4486,  4487,  3657,   631,   372,
-    4491,   100,   375,   372,  1927,   280,   375,   631,  3275,   636,
-     372,  2529,   372,   375,   372,   375,   601,   375,  1867,   306,
-     307,    17,   614,   155,   311,   312,   623,   624,   625,   626,
-     627,   628,   638,   149,   625,   626,   627,   628,   372,   309,
-    2833,   375,   601,   583,   617,   103,   617,   632,   508,   210,
-     369,   372,  3712,  2113,   375,   521,  2875,  2117,   631,   185,
-     631,   372,  2881,   439,   375,  2424,   372,   588,   617,   375,
-     630,   595,   588,   632,   598,  2031,   617,  2875,    58,    59,
-     548,     6,   631,  2881,  3094,   355,   630,   632,    68,  2045,
-     631,   372,  1941,    11,   375,  2155,  3287,   630,  2906,   630,
-    2160,  1950,  1951,   372,   630,     6,   375,   617,  3118,  3119,
-     631,   632,  1961,  1962,  1963,  1964,   632,  1966,  1967,   632,
-     372,   631,   638,   375,   372,  2883,   545,   375,   630,   372,
-     630,  3141,   375,   428,   429,   601,   631,   632,    57,   574,
-     136,   638,   617,  2310,   166,  2312,   630,  4312,  4313,   617,
-     630,   331,   630,   211,   617,    56,   631,  2113,   630,   594,
-     595,  2117,  2521,  2119,   364,   718,  2122,  3245,   631,   372,
-     617,   630,   375,  2129,  2130,  2131,  2132,  2772,    24,  2135,
-     456,   631,   632,   588,   631,   630,   125,   740,  2547,  2548,
-     423,    33,    12,  2122,  2254,  2571,   617,   630,    31,  2155,
-     753,   754,   630,    24,  2160,   630,  2129,  2130,  2131,   372,
-     631,   617,   375,  2380,  2381,  2382,   372,    59,  2836,   375,
-     617,  3299,  2071,   630,  2284,  2074,  2075,   630,  2077,   631,
-     632,  2080,  2081,  2082,  2083,  2084,  2085,  2086,   139,    95,
-    2089,  3299,  2091,   630,   617,   630,   125,   630,   617,   631,
-     632,   521,   171,    74,  3332,   617,   175,   617,   631,   617,
-      74,   537,   631,    24,   221,   107,   542,   186,   110,   631,
-    4017,   631,   491,   631,  3332,   630,   118,  4053,  4045,  4046,
-    4047,  4048,   398,   617,  1775,   630,   372,  1778,   372,   375,
-    1781,   375,   231,  2818,   970,   971,   617,   631,  2254,   479,
-     480,   631,   632,   136,   420,   372,   617,   153,   375,   585,
-     631,   617,  2761,    74,  4061,   135,   630,  4064,  4065,  4066,
-    4067,   379,   630,  2279,   600,   631,   631,   632,  2284,   630,
-     388,   601,   153,    48,  1010,   331,   617,   395,   454,   153,
-     630,   502,   503,   274,   505,  4054,   507,  2303,   617,    48,
-     631,   172,   231,  2309,  2310,   632,  2312,   630,  3315,  3316,
-    3354,   522,   631,  3357,  3358,   617,  1049,  1050,  1051,   617,
-      74,   630,   228,  4140,   617,   631,   632,   630,  1061,   631,
-    3374,   227,   462,  2339,   630,    71,  2309,  2310,   631,  2312,
-     210,   247,  3402,   631,   632,   576,  3700,   513,   317,    16,
-      17,   630,   258,   631,   632,   238,   227,  2467,  2468,  1092,
-     630,   172,  1095,   227,   617,  2371,   631,   632,   630,  2375,
-      58,    59,  4169,  4170,  2380,  2381,  2382,   625,  3590,   262,
-    3238,  4178,   490,  1116,  1117,   103,  2392,  1120,  2394,   631,
-     632,   621,   622,   623,   624,   625,   626,   627,   628,   153,
-    3528,   352,   631,   632,   617,  1138,  1139,  2380,  2381,  2382,
-    2416,   617,   630,   309,  4173,    74,   227,   476,   631,   638,
-    3528,   630,  2428,  2429,   638,   631,  3638,  3442,   630,   136,
-    2540,   548,  4081,   479,   480,   341,   630,    95,   309,   631,
-     632,   631,   632,   412,   162,   117,   631,   632,   331,   185,
-     439,   343,  2458,   630,   117,   588,   589,   120,   591,   355,
-     593,  2467,  2468,   630,   415,   630,   417,   630,   351,   352,
-     630,  3935,  3936,   227,   192,    19,   161,   585,   349,   468,
-      35,   617,   630,   617,   355,   349,   117,   631,   632,   225,
-     630,   355,   263,  2392,    74,   631,   186,   631,   309,   630,
-     617,   630,  2508,   631,   632,   631,   632,  2513,    88,   181,
-     439,  2509,  2518,  2519,   250,   631,   632,  2523,   181,  2525,
-    4052,   630,  2520,   145,   146,  2951,  3466,    12,  2526,  2535,
-     630,  2537,  2538,   630,  2540,  2541,   630,   209,   349,   468,
-    2546,   630,   425,  2549,   355,  2551,   209,   453,   631,   632,
-     181,    95,  2550,   630,  2560,   110,    41,  2555,   422,  2985,
-     631,   632,   117,  2561,  2562,  2571,   630,  2993,   227,   630,
-     228,  2997,  2578,  2579,   630,   621,   622,   623,   624,   625,
-     626,   627,   628,    74,  2590,   103,   217,  2560,   219,   247,
-     631,   632,   484,   582,   630,   349,   479,   480,   631,   632,
-     258,   355,   631,   632,    89,   277,   630,   151,    93,   492,
-     630,   155,   631,   632,   277,   106,   522,  3043,   630,   174,
-     631,   632,   630,   174,   331,   521,   181,   630,  2527,  2528,
-    3129,   630,   502,   503,   504,   505,   506,   507,   631,   632,
-     184,   630,   186,   631,   632,   630,   277,   630,  2654,  2655,
-     521,   630,   522,   582,   209,  2554,   630,   521,   202,   630,
-     552,   536,   153,   207,    61,   401,    25,   630,   422,   631,
-     632,   630,   252,   191,    71,   631,   632,   221,   631,   632,
-     630,  2654,  3181,   341,   228,   403,   358,    84,   580,   630,
-     349,   235,   631,   632,   630,   358,   355,   631,   632,   631,
-     632,   630,  4528,   247,   517,   601,  3274,   225,   572,    68,
-     521,   631,   632,    72,   258,    74,   631,   632,   117,   263,
-     161,   120,   277,   517,  2623,  3736,  3737,   358,   272,   635,
-     601,   274,   117,   152,   225,   120,   632,   601,   621,   622,
-     623,   624,   625,   626,   627,   628,    61,   631,   632,   329,
-     631,   632,   631,   632,   632,   273,    71,   242,    12,    13,
-      83,   120,   365,   422,   631,   632,   632,   521,   632,    84,
-     631,   632,   479,   480,   354,   631,   632,  2783,   632,  3424,
-     532,  2787,   181,   631,  3440,  3441,   151,   342,   185,   120,
-     601,   631,   632,  2799,   191,   453,   181,   341,   353,   106,
-     351,   352,   357,   358,   631,   632,   357,   637,   117,     6,
-     209,  2817,  2818,   630,  4119,  2821,   105,   308,   572,     4,
-     364,   539,  4171,  4172,   209,   497,  2799,  1560,   225,   373,
-    2836,   632,  2838,   318,   414,   326,   388,  1124,  1125,   117,
-      94,   117,   560,   467,   120,   600,  2852,   601,  3258,  3259,
-    3509,  3510,   136,   250,  2964,  3746,  3747,   238,   349,   403,
-     632,   385,   521,  3912,   522,    55,   431,   166,   106,   218,
-     185,   125,   181,   632,   632,   638,   191,    68,   277,   115,
-    3820,    12,   600,   605,  3452,   139,  3826,   631,   631,   135,
-      19,   250,   277,     9,   632,   567,   381,  1630,   638,   631,
-     209,  1634,    71,   181,   567,   181,   631,   631,   162,   453,
-     225,   165,   638,   572,   621,   622,   623,   624,   625,   626,
-     627,   628,   630,  4051,   178,  1658,   262,   638,   508,   632,
-    3586,   209,   476,   209,   153,   250,   567,  2943,   632,   637,
-    2946,  2947,   601,  4051,   274,  2951,   200,   521,   522,   274,
-     274,   525,   526,  2852,   238,   529,   474,   531,  2964,   358,
-     274,  2967,    48,   274,   274,   402,    95,   632,   277,   155,
-     632,   225,   456,   358,   370,   536,   494,   231,   522,  2985,
-     216,  3881,  3882,   632,   364,  2884,  2885,  2993,  2887,   364,
-     545,  2997,   351,   352,   549,  4300,   269,   552,   357,   277,
-     632,   277,   386,   632,   401,   364,   556,   562,   493,   632,
-     556,   562,   567,   385,    12,   570,   185,  3023,   272,   537,
-    3026,   539,   151,   632,   542,  3031,   155,   578,   155,   364,
-     521,  3037,   576,   632,    68,  3041,   364,  3043,   632,   238,
-     625,   241,   401,   587,   588,   534,   537,   331,   533,   358,
-     176,   186,  3058,  3026,   632,   581,   225,   186,  3037,   577,
-     489,   131,   606,   389,   608,  3071,  2965,   585,   623,   624,
-     385,   136,  3078,   202,   169,  2974,    25,    26,   207,   364,
-     358,   250,   358,  3089,   632,   321,   401,   631,   632,   325,
-     631,   635,   636,   632,   155,   155,   332,   494,   155,   228,
-     155,  4406,   155,  4408,   155,  3078,   235,  3752,   155,    58,
-      59,    60,   155,   472,   155,   155,   155,   155,   247,    68,
-     155,   632,   155,   155,   155,    74,  4254,  4027,   155,   258,
-    4435,  4031,   155,    82,   263,  3791,  3792,   155,  3794,  3795,
-     155,   155,   155,   272,   287,   288,  4254,   155,   155,   583,
-     404,  3261,   612,   364,   408,    16,    17,   106,   364,   587,
-    4003,  4101,   521,   192,  3063,  4470,  4471,   632,   567,  3175,
-     424,   120,  4015,   238,   410,   124,   364,  3183,   432,   494,
-     577,   631,   567,   189,   631,   136,   440,   631,   631,   631,
-     625,   631,   631,  4093,  4094,   479,   480,  3613,  3614,  3767,
-     631,   189,  3208,   630,   153,  3211,  3212,  3213,  3214,   136,
-    3626,   632,   341,   624,   468,   631,   385,  3633,   577,   631,
-    3226,   631,    25,    26,   631,   631,   631,   481,   482,   632,
-     466,   805,   401,   576,   632,   364,   631,   631,   477,  3245,
-    3246,   630,  3658,  3249,   373,  3661,   628,  3253,  3254,  3255,
-     111,   112,   113,   114,   115,  3261,   630,    60,   567,   630,
-     630,  3267,   577,   631,   545,   632,   331,   536,  3274,  3275,
-     545,    74,   606,   545,   403,    33,   225,   531,   226,    82,
-    4329,   528,   630,   232,  3183,   428,   429,    11,   630,   567,
-     260,   567,   632,  3299,   638,   632,   189,   630,   630,   638,
-     249,   411,  4160,   106,  3310,   632,   560,   186,   585,    95,
-     631,   476,    46,   339,  3320,   632,  3322,   120,   638,   638,
-     632,   124,   155,   156,   453,   508,  3332,   508,   582,   508,
-     584,   508,  3338,   508,  3340,   467,  3342,   621,   622,   623,
-     624,   625,   626,   627,   628,  3455,  3916,   476,    71,   385,
-     153,   388,   213,   214,   215,   216,   499,   500,   501,   308,
-     193,   385,   556,   385,   131,   248,   537,   603,    74,   385,
-     128,   204,  4500,  4422,   248,   537,   131,   326,    46,   630,
-     331,   385,    88,   619,  3283,   385,  4514,   630,   387,   385,
-     385,  4519,  4500,   522,   385,   153,  4524,   273,   630,   157,
-    4340,  4341,   631,  4343,   331,   638,  4514,  3997,  3414,   434,
-     243,  4519,   588,   149,   479,   480,  4524,   631,   234,   234,
-     638,   254,   225,   129,   631,   155,   631,   631,   631,   232,
-     631,   380,   103,  3439,  3440,  3441,   194,   632,  3548,   388,
-     632,   556,   228,   632,   631,   545,   249,   576,   281,  3455,
-    4390,   631,  4392,  4393,   212,   613,   269,    46,   630,   588,
-     321,   247,   323,   324,   325,   155,   630,   630,    35,   556,
-     630,   332,   258,   155,   200,   189,   235,   606,   189,   608,
-      95,   545,   545,   244,   416,   632,   358,   632,   155,  4134,
-     155,   162,   155,   388,   247,  4132,   247,   322,   376,  4069,
-     106,   106,   631,   632,   250,   308,   635,   636,  3407,   458,
-     169,   372,   345,   250,   375,   638,   274,  3523,   630,   630,
-     369,   192,  3528,   326,   202,  3635,   556,  4467,   479,   480,
-      19,  3430,   449,  3539,   545,   385,   630,  4482,   630,   638,
-     625,   630,  3548,   110,   236,   236,   252,   630,   630,   410,
-     117,   631,   479,   480,   225,   341,   621,   622,   623,   624,
-     625,   626,   627,   628,    54,   514,   515,   516,   364,   631,
-     638,   638,   521,    63,   632,   631,   556,   380,   364,   631,
-    3586,   556,   632,    73,   638,   388,   631,   631,   537,  3595,
-     556,   540,   221,   385,   264,    85,    86,    87,  3604,  3597,
-    3710,   370,   273,   631,   465,   466,   189,   174,   189,   189,
-     631,   101,   631,   228,   181,   632,   238,   582,   630,    54,
-     155,   631,  3595,   329,   121,   416,   247,   576,    63,  3635,
-     632,   247,   247,   638,   631,   364,   250,   631,    73,   632,
-     630,   250,   209,   258,   402,   351,   352,   632,   354,   608,
-      85,    86,    87,   411,   632,   458,  3662,   630,  3557,  3769,
-     631,   399,   364,  3669,  4522,   632,   101,   453,   426,   364,
-      74,   622,   623,   624,   625,   626,   627,   628,    19,   631,
-     364,  3687,   632,   632,   630,   364,   444,   491,  4256,   468,
-     631,   630,   630,   630,  3700,   631,   623,   624,   625,   626,
-     627,   628,   358,    46,  3710,   470,   631,   373,   414,   608,
-     277,   514,   515,   516,   260,   631,   451,   272,   521,    11,
-     416,   625,   142,   256,   631,   631,   341,   398,   189,   487,
-     632,   202,   403,   478,   537,   390,   522,   540,  3637,  4376,
-     155,   247,   603,   247,   632,   630,   120,   120,   630,   364,
-     539,   397,   638,   630,    78,   486,   617,   618,   619,   517,
-     138,   631,   463,  3769,   491,   631,   631,  4214,   632,    13,
-      19,   631,   263,   576,   631,   342,  3782,  3676,   536,   631,
-     631,   539,  4229,   631,   631,  3791,  3792,    33,  3794,  3795,
-     357,   358,    33,   155,   631,   631,  4243,   631,   328,     6,
-     252,   411,   508,   474,    11,   631,    13,   170,    15,   632,
-     272,   200,  3922,   235,  4384,   632,   630,   179,    25,    26,
-     631,    46,    12,    13,   207,   632,   638,   328,   155,   630,
-     320,   193,   588,   630,   588,   630,   630,   630,   453,  4476,
-     305,   631,   204,   630,   120,   630,   598,   337,   598,    56,
-      94,   250,   250,    60,    61,   357,    33,   582,   358,    66,
-    3866,  3867,   632,   631,   630,  4502,   537,    74,   328,   168,
-     358,   542,  3878,  3772,   631,    82,   370,   539,   250,   592,
-    4525,   125,   630,   588,    91,   320,   608,   235,    33,   560,
-     588,   253,   254,   593,  3867,   139,   364,   353,   608,   106,
-     632,   512,   337,   358,    94,  3911,   449,   522,  3914,   545,
-     631,   631,  4359,   120,   585,   632,  3922,   124,   162,   281,
-     545,   165,  4369,   527,   582,   132,   133,   545,   150,   600,
-     605,   630,   139,   630,   178,   125,   630,    30,  3911,   186,
-     147,   383,   370,   631,   151,   631,   153,  3953,   519,   139,
-     639,   631,   547,   131,   630,   131,   200,   164,   448,   153,
-     403,    70,  3968,   186,   605,   424,    30,  3973,   189,    61,
-     631,  4418,   162,   370,   464,   165,   547,   184,   545,    61,
-     632,   225,   549,   128,   631,   552,   348,   231,   178,   528,
-    4437,   630,  4439,    14,   265,   562,     5,   364,   364,  4446,
-     567,   235,   149,   570,   636,   370,   370,   129,   153,  4456,
-     200,   138,   157,   630,    46,    46,   223,   148,   225,    46,
-      46,    46,   630,   630,   582,   232,   125,   605,   272,   464,
-     149,   220,   119,   636,   524,   225,   279,   639,   400,  4486,
-    4487,   231,   249,   144,  4491,  4051,   630,    46,    46,   194,
-      46,   541,    52,   548,   138,   457,   623,   624,   459,   636,
-     632,   358,   631,   149,  4174,   272,   548,   212,   632,   205,
-     632,   636,   111,   112,   113,   114,   115,  4083,   218,  4085,
-     631,   631,   272,   632,    52,    46,   149,   438,   186,   524,
-     186,   186,   607,   221,   665,   548,   120,   358,   630,   670,
-     188,   308,  3978,   632,  2291,  4111,   541,   476,  3416,  2093,
-    3417,  2496,   648,  3685,  4135,  4008,  4319,  4016,  4320,   326,
-    3687,   967,  3683,   330,  3865,  4502,  4464,    46,   576,   274,
-     701,  1761,  1825,  2783,  4356,  3856,  3856,  3856,  3856,  3856,
-     547,  2074,  2075,  4472,  2077,  3856,   717,  2080,  2081,  2082,
-    2083,  2084,  2085,  2086,  3856,  3856,  2089,  4207,  2091,  4165,
-     404,   368,  3856,  3856,  4274,  4356,   373,  3856,  4174,  4313,
-    4233,  3856,  4232,   380,   213,   214,   215,   216,   385,  3856,
-     424,   388,  1468,  3874,  1008,  2044,  2991,  2812,   432,  1472,
-     761,   762,   763,   764,  3522,  2817,   440,  3226,  1286,  4165,
-    4258,  3525,  4422,   774,  3912,  4337,  4384,   514,  1530,  2037,
-    4069,  3433,   419,  3064,   404,  2655,  3342,  3320,   408,  2045,
-    3365,  2581,  3365,  3398,   468,  4335,   433,   434,   435,   436,
-    3818,  3596,  3646,  4256,   424,  3635,  3169,   481,   482,  2467,
-    2739,  3166,   432,  3161,  4090,    11,    11,  4094,  4254,  1544,
-     440,   458,  4093,  4019,  4031,  4027,  3878,   402,  2127,  2044,
-    3826,  2574,  1423,   670,   579,  1419,   411,  3601,  4274,  4168,
-    2366,  1526,  3321,  2799,  1814,  2332,  3221,  1479,   468,  2383,
-    2247,   426,   321,   595,   323,   324,   325,   531,  3183,   865,
-    2772,   481,   482,   332,   701,  2459,  1834,  3289,  2161,   444,
-    2246,  4088,  3938,  1087,  3414,  4351,  2272,   514,   515,   516,
-     717,  4352,  1061,  3332,   521,  3783,   560,  1438,  4453,  3769,
-    2388,  1274,  2132,  1198,  3240,   953,   953,  1299,  2370,  4335,
-     537,  2327,  3528,   540,  3239,  3299,  4254,  1553,   582,   584,
-     584,   531,   487,   661,  1904,  4351,  4352,   575,  1905,  1750,
-    3340,  1306,   953,   953,  1403,  4361,   563,   764,  4281,  3224,
-    4449,  4420,  4368,  4347,  4524,  4519,  4265,  4266,  3638,   576,
-     560,   410,   517,  3245,  1375,  1335,  2413,  3274,   574,   574,
-    1686,  3275,  1860,  2406,   222,  2399,   850,  2405,  1796,  1322,
-    1783,  1829,   582,  4043,   584,  1535,  3208,  4049,   569,   510,
-    4510,   852,   510,  3998,    -1,  3671,   648,    -1,   648,   648,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   990,
-      -1,    -1,    -1,    -1,    -1,    -1,   465,   466,    -1,   636,
-    4436,    -1,    -1,    -1,    -1,  4441,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   282,   283,   284,   285,   286,   287,
-     288,   289,   290,   291,    -1,   293,   294,   295,   296,   297,
-     298,   299,   300,   301,    -1,   303,   304,    -1,    -1,    -1,
-    4476,    -1,    -1,    -1,  1045,  1046,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  1054,  1055,  1056,  1057,  1058,  1059,  1060,
-      -1,    -1,    -1,    -1,  4500,    -1,  4502,  1068,  1069,    -1,
-    1071,  1072,    -1,    -1,  4510,  1076,  1077,    -1,  4514,  1080,
-    1081,  1082,  1083,  4519,  1085,  1086,    -1,    -1,  4524,    -1,
-      -1,    -1,  1093,  1094,    -1,  1096,  1097,  1098,  1099,  1100,
-      -1,    -1,  1103,  1104,  1105,  1106,  1107,  1108,  1109,  1110,
-    1111,  1112,  1113,    -1,  1115,    -1,    -1,  1118,  1119,    -1,
-      -1,    -1,  1123,    -1,    -1,    -1,  1127,  1128,  1129,    -1,
-      -1,    -1,    -1,    -1,   603,    -1,    -1,    -1,    -1,  1140,
-    1141,  1142,    -1,    -1,    -1,    -1,    -1,    -1,  1149,   618,
-     619,    -1,    -1,   990,    -1,  1156,  1157,  1158,    -1,  1160,
-     428,   429,    -1,    -1,    -1,    -1,  1167,  1168,  1169,    -1,
-    1171,  1172,  1173,  1174,  1175,    -1,  1177,  1178,  1179,  1180,
-    1181,  1182,  1183,  1184,    -1,    -1,    -1,  1188,  1189,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  1045,  1046,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,  1054,  1055,    -1,
-      -1,  1058,  1059,  1060,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,  1068,  1069,    -1,  1071,  1072,    -1,    -1,    -1,  1076,
-      -1,    -1,    -1,  1080,  1081,  1082,  1083,    -1,  1085,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,  1093,  1094,    -1,  1096,
-    1097,    -1,    -1,    -1,    -1,    -1,  1103,  1104,  1105,    -1,
-      -1,  1108,  1109,  1110,  1111,  1112,  1113,    -1,  1115,    -1,
-      -1,  1118,  1119,    -1,    -1,    -1,  1123,    -1,    -1,    -1,
-    1127,  1128,  1129,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  1140,  1141,  1142,    -1,    -1,    -1,    -1,
-      -1,    -1,  1149,    -1,    -1,    -1,    -1,    -1,    -1,  1156,
-    1157,  1158,    -1,    -1,    13,    -1,    15,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  1335,    -1,    -1,    -1,    -1,    -1,
-      -1,    30,    -1,    -1,  1345,    34,    -1,    -1,    -1,    -1,
-      -1,    -1,  1189,    -1,    -1,    -1,    -1,    -1,    -1,    48,
-      49,    -1,  1363,    -1,    -1,    -1,    -1,    56,    -1,    -1,
-      -1,    60,    61,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    76,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    94,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    13,    -1,    15,    -1,    -1,    -1,   116,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   125,   126,   127,    -1,
-      -1,    -1,    34,    -1,    -1,    -1,    -1,    -1,    -1,   138,
-     139,    -1,    -1,    -1,    -1,    -1,    48,    49,    -1,    -1,
-      -1,    -1,   151,    -1,    56,    -1,    -1,    -1,    60,    61,
-      -1,    -1,    -1,    -1,    -1,    -1,   165,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    76,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   183,    -1,    -1,    -1,  1335,    -1,
-      -1,    -1,    94,    -1,    -1,    -1,    -1,    -1,  1345,   198,
-      -1,   200,    -1,    -1,    -1,    -1,   205,    -1,    -1,   208,
-      -1,    -1,    -1,    -1,   116,    -1,  1363,    -1,    -1,    -1,
-      -1,    -1,    -1,   125,   126,   127,    -1,    -1,    -1,    -1,
-      -1,    -1,   231,    -1,   233,    -1,   138,   139,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   251,    -1,    -1,  1566,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   165,    -1,    -1,    -1,    -1,    -1,   268,
-      -1,    -1,    -1,   272,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   183,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   198,    -1,   200,    -1,
-      -1,    -1,    -1,   205,    -1,    -1,   208,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   231,
-      -1,   233,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   251,
-      -1,    -1,    -1,  1664,  1665,  1666,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   268,    -1,  1679,   368,
-     272,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   385,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  1705,    -1,    -1,    -1,    -1,   398,
-    1711,    -1,    -1,  1714,    -1,  1716,    -1,    -1,    -1,    -1,
-     409,  1722,    -1,  1724,  1725,    -1,    -1,    -1,    -1,  1566,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   431,    -1,    -1,   434,    -1,   436,    -1,    -1,
-     439,    -1,    -1,   442,   443,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   452,    -1,   454,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   462,    -1,    -1,   368,    -1,    -1,   468,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   476,    -1,    -1,
-      -1,    -1,   481,   385,   483,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   398,    -1,  1809,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   409,    -1,    -1,
-      -1,    -1,    -1,    -1,   513,    -1,    -1,  1664,  1665,  1666,
-      -1,   520,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   431,
-      -1,    -1,   434,    -1,   436,    -1,    -1,   439,    -1,    -1,
-     442,   443,    -1,    -1,    -1,    -1,    -1,  1858,    -1,    -1,
-     452,    -1,   454,    -1,    -1,  1866,    -1,    -1,  1705,    -1,
-     462,    -1,    -1,    -1,   563,    -1,   468,  1714,    -1,  1716,
-      -1,    -1,    -1,    -1,   476,    -1,   575,    -1,    -1,   481,
-     579,   483,    -1,   582,    -1,    -1,    -1,    -1,   587,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   513,    -1,    -1,    -1,    -1,   615,    -1,   520,    -1,
-      -1,    -1,    25,    26,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   630,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    58,    59,    60,    -1,    -1,
-      -1,   563,  1809,    -1,    -1,    68,    -1,    -1,    -1,    -1,
-      -1,    74,    -1,   575,    -1,    -1,    -1,   579,    -1,    82,
-     582,    -1,    -1,    -1,    -1,   587,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   106,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,  1858,    -1,   615,    -1,    -1,    -1,   120,    -1,  1866,
-      -1,   124,    -1,    -1,    -1,    -1,    -1,    -1,   630,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     153,    -1,    -1,    -1,    -1,    -1,    -1,  2068,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   225,    -1,    -1,    -1,    -1,    -1,    -1,   232,
-    2141,    -1,    -1,    -1,  2145,    -1,    -1,    -1,    -1,  2150,
-    2151,    -1,    -1,    -1,    -1,    -1,   249,    -1,  2159,    -1,
-      -1,  2162,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   262,
-      -1,  2172,  2173,    -1,  2175,  2176,    -1,  2178,  2179,  2180,
-    2181,  2182,    -1,    -1,  2185,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  2194,    -1,    -1,    -1,    -1,    -1,    -1,
-    2201,    -1,  2203,    -1,  2205,  2206,    -1,  2208,  2209,    -1,
-      -1,    -1,  2213,  2214,  2215,   308,    -1,    -1,  2219,  2220,
-    2221,    -1,  2223,    -1,  2225,    -1,  2227,    -1,  2229,    -1,
-    2231,  2068,    -1,   326,    -1,  2236,    -1,    -1,    -1,    -1,
-      -1,    32,    33,    -1,    -1,    -1,    -1,    38,    -1,    40,
-      -1,    42,    43,    -1,  2255,    -1,    -1,    -1,    -1,    -1,
-      -1,  2262,    -1,    -1,  2265,    -1,    -1,    -1,    59,    -1,
-    2271,    -1,    -1,  2274,    -1,    -1,    -1,  2278,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   380,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   388,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  2141,    -1,    -1,    -1,  2145,    -1,
-      -1,    -1,    -1,  2150,  2151,    -1,   107,    -1,    -1,   110,
-      -1,    -1,  2159,    -1,    -1,    -1,    -1,   118,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,  2172,  2173,    -1,  2175,  2340,
-      -1,  2178,  2179,  2180,  2181,  2182,   137,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,  2194,    -1,    -1,
-      -1,    -1,    -1,   154,  2201,   458,  2203,    -1,  2205,  2206,
-      -1,  2208,    -1,    -1,    -1,    -1,  2213,  2214,  2215,    -1,
-      -1,    -1,  2219,  2220,  2221,    -1,  2223,    -1,  2225,   180,
-    2227,   182,  2229,    -1,  2231,    -1,    -1,    -1,    -1,  2236,
-      -1,    -1,    -1,    -1,   195,   196,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  2414,    -1,    -1,    -1,  2418,  2255,    -1,
-      -1,   514,   515,   516,    -1,    -1,    -1,    -1,   521,    -1,
-      -1,    -1,    -1,    -1,  2271,    -1,    -1,  2274,    -1,    -1,
-      -1,    -1,    -1,    -1,   537,   236,    -1,   540,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   266,    -1,    -1,  2479,    -1,
-      -1,    -1,    -1,   576,   275,   276,    -1,   278,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,  2497,  2498,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   314,   315,   316,    -1,    -1,    -1,    -1,
-      -1,     6,    -1,    -1,    -1,    -1,    11,   630,    13,    -1,
-      -1,    -1,   333,   334,   335,    -1,    -1,    -1,    -1,   340,
-      25,    26,   343,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   360,
-     361,    -1,    -1,    -1,    -1,    -1,    -1,  2414,    -1,    -1,
-      -1,    56,    -1,    -1,    -1,    60,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    74,
-      -1,    -1,   393,   394,    -1,    -1,    -1,    82,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    91,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  2625,  2626,    -1,   418,    -1,    -1,
-      -1,   106,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   120,    -1,    -1,    -1,   124,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   132,    -1,    -1,
-      -1,    -1,    -1,    -1,   139,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   147,    -1,    -1,  2676,    -1,    -1,   153,  2680,
-      -1,   472,    -1,    -1,    -1,   476,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   488,    -1,  2700,
-    2701,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   184,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    2721,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  2730,
-      -1,  2732,    -1,  2734,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     225,    -1,    -1,    -1,    -1,   546,    -1,   232,   549,    -1,
-    2761,   552,   553,   554,   555,  2766,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   249,    -1,    -1,    -1,    -1,    -1,
-      -1,    33,    34,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  2795,    -1,    -1,   272,    -1,    -1,
-      -1,    -1,    -1,   594,   595,    -1,    58,    59,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    69,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   619,    -1,
-      -1,    -1,    -1,   308,    -1,    -1,    -1,    25,    26,  2676,
-      92,    -1,    94,  2680,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   326,   104,    -1,    -1,   330,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  2700,  2701,    -1,  2867,    -1,    -1,    -1,
-      58,    59,    60,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      68,    -1,    -1,    -1,  2721,    -1,    74,    -1,    -1,    -1,
-      -1,    -1,    -1,  2730,    82,  2732,    -1,  2734,   373,    -1,
-     152,   153,    -1,    -1,    -1,   380,   158,    -1,    -1,   161,
-      -1,    -1,  2913,   388,    -1,    -1,    -1,    -1,   106,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   120,    -1,    -1,    -1,   124,    -1,   190,    -1,
-     192,    -1,    -1,    -1,    -1,    -1,    -1,   199,    -1,   201,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  2795,   434,
-      -1,    -1,    -1,    -1,    -1,   153,    -1,    -1,    -1,    -1,
-      -1,    -1,   224,   225,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   458,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   248,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   269,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    2867,    -1,    -1,  3034,  3035,    -1,    -1,   225,    -1,   514,
-     515,   516,    -1,    -1,   232,    -1,   521,    -1,    -1,    -1,
-     302,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  3059,    -1,
-      -1,   249,   537,    -1,    -1,   540,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,  2913,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,  3097,    -1,    -1,    -1,
-      -1,   576,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   367,    -1,    -1,    -1,    -1,
-     308,  3122,    -1,    -1,    -1,  3126,  3127,    -1,  3129,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,  3138,   326,    -1,
-     392,    -1,  3143,    -1,    -1,  3146,    -1,  3148,  3149,    -1,
-     402,   403,    -1,    -1,   406,   407,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   427,    -1,    -1,    -1,    -1,
-    3181,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   380,    -1,    -1,    -1,    -1,  3034,  3035,    -1,
-     388,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  3215,    -1,    -1,    -1,    -1,    -1,
-      -1,   473,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   486,    -1,    -1,    -1,  3239,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    3097,    -1,    -1,    -1,    -1,   517,    -1,    -1,    -1,   521,
-     458,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,  3122,    -1,   539,    -1,  3126,
-    3127,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    3301,  3138,    -1,    -1,    -1,    -1,  3143,    -1,  3309,  3146,
-      -1,  3148,  3149,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   514,   515,   516,    -1,
-      -1,    -1,    -1,   521,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   596,    -1,    -1,    -1,    -1,   537,
-     602,    -1,   540,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  3215,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   576,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,  3239,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  3301,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,  3309,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  3529,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  3569,  3570,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,  3578,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,  3529,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,  3718,    -1,    -1,
-      -1,  3722,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,  3569,  3570,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,  3578,    -1,    -1,    -1,    -1,    -1,    -1,  3749,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  3764,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,  3856,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,  3718,    -1,    -1,    -1,  3722,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,  3912,  3749,    -1,    -1,    -1,    -1,    -1,    -1,  3920,
-      -1,    -1,    -1,    -1,    -1,    -1,  3927,  3764,  3929,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  3965,    -1,    -1,    -1,    -1,    -1,
-    3971,  3972,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  4035,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  4074,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  3920,    -1,    -1,    -1,    -1,    -1,    -1,
-    3927,    -1,  3929,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  4104,    -1,  4106,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,  4116,    -1,  4118,  4119,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  3965,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  4145,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  4035,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,  4212,    -1,  4214,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  4229,  4230,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,  4074,    -1,    -1,
-      -1,    -1,  4243,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  4255,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,  4104,    -1,  4106,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  4116,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  4299,  4300,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,  4312,  4313,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  4329,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,  4359,    -1,
-      -1,    -1,    -1,    -1,    -1,  4366,    -1,    -1,  4369,    -1,
-      -1,    -1,    -1,    -1,    -1,  4212,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,  4230,    -1,    -1,    -1,    -1,  4399,    -1,
-      -1,    -1,    -1,    -1,    -1,  4406,    -1,  4408,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,  4418,  4255,    -1,
-      -1,  4422,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,  4435,    -1,  4437,    -1,  4439,    -1,
-      -1,    -1,    -1,    -1,    -1,  4446,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,  4456,    -1,    -1,    -1,    -1,
-      -1,    -1,  4299,    -1,    -1,    -1,    -1,    -1,    -1,  4470,
-    4471,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,  4486,  4487,    -1,    -1,    -1,
-    4491,    -1,    -1,    -1,    -1,    -1,  4497,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,  4527,    -1,    -1,  4366,
-      -1,    -1,    -1,    -1,    -1,    -1,     5,    -1,     7,     8,
-       9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
-      -1,    -1,    21,    -1,    23,    24,    25,    26,    27,    28,
-      -1,    30,  4399,    -1,    33,    34,    35,    36,    37,    38,
-      39,    -1,    41,    42,    43,    44,    45,    -1,    47,    48,
-      -1,    -1,    51,    52,    53,    54,    55,    -1,    57,    58,
-      59,    60,    -1,    62,    63,    64,    65,    66,    67,    -1,
-      69,    70,    -1,    72,    73,    74,    75,    76,    77,    78,
-      79,    80,    -1,    82,    83,    -1,    85,    86,    87,    88,
-      89,    -1,    91,    92,    93,    -1,    -1,    96,    97,    98,
-      99,    -1,   101,   102,   103,    -1,   105,   106,   107,   108,
-     109,   110,    -1,    -1,    -1,    -1,   115,   116,   117,    -1,
-      -1,   120,   121,   122,    -1,   124,    -1,    -1,    -1,   128,
-    4497,   130,   131,   132,   133,   134,    -1,    -1,    -1,   138,
-      -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,
-     149,   150,    -1,   152,   153,   154,    -1,    -1,   157,   158,
-    4527,   160,   161,   162,   163,   164,   165,   166,    -1,   168,
-     169,   170,   171,   172,   173,   174,   175,   176,    -1,   178,
-     179,   180,   181,    -1,   183,    -1,    -1,    -1,   187,   188,
-      -1,   190,    -1,   192,    -1,   194,   195,   196,   197,    -1,
-     199,    -1,   201,    -1,   203,    -1,   205,   206,    -1,   208,
-     209,    -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,
-     219,   220,    -1,   222,   223,   224,    -1,    -1,   227,    -1,
-      -1,    -1,   231,   232,   233,   234,    -1,    -1,   237,    -1,
-      -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,
-     249,    -1,    -1,   252,   253,    -1,   255,   256,    -1,   258,
-     259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,
-     269,    -1,   271,    -1,   273,   274,    -1,    -1,   277,    -1,
-      -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-     299,   300,    -1,   302,   303,   304,   305,   306,   307,   308,
-     309,   310,   311,   312,    -1,    -1,    -1,    -1,   317,   318,
-     319,   320,   321,   322,    -1,    -1,   325,   326,   327,   328,
-      -1,   330,   331,   332,   333,   334,   335,   336,   337,   338,
-     339,   340,    -1,   342,   343,   344,    -1,    -1,   347,   348,
-     349,   350,   351,   352,   353,   354,   355,    -1,   357,   358,
-     359,    -1,   361,   362,   363,    -1,   365,   366,   367,    -1,
-     369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     379,   380,   381,   382,   383,   384,    -1,   386,   387,   388,
-     389,   390,   391,   392,   393,   394,   395,   396,    -1,   398,
-     399,   400,    -1,   402,    -1,   404,   405,   406,   407,   408,
-      -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,
-     419,   420,   421,   422,   423,    -1,    -1,   426,   427,   428,
-     429,   430,    -1,   432,   433,    -1,   435,   436,   437,   438,
-     439,   440,    -1,   442,    -1,   444,   445,    -1,   447,   448,
-     449,    -1,   451,    -1,   453,   454,   455,   456,   457,   458,
-     459,   460,   461,   462,   463,   464,    -1,   466,   467,    -1,
-      -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,
-      -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,
-     489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,
-     499,   500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,
-     509,    -1,    -1,   512,   513,   514,   515,   516,   517,   518,
-     519,   520,   521,    -1,   523,   524,   525,   526,   527,   528,
-     529,   530,   531,   532,   533,   534,   535,   536,   537,    -1,
-      -1,   540,   541,   542,   543,    -1,   545,   546,   547,    -1,
-     549,   550,   551,   552,    -1,    -1,    -1,    -1,   557,   558,
-     559,    -1,   561,   562,   563,   564,   565,   566,   567,   568,
-     569,   570,   571,   572,    -1,   574,   575,    -1,    -1,   578,
-      -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,
-     589,   590,   591,   592,   593,    -1,    -1,   596,   597,    -1,
-     599,   600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,
-      -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,    -1,
-     619,    -1,    -1,    -1,   623,   624,    -1,    -1,    -1,    -1,
-     629,   630,    -1,    -1,   633,   634,    -1,    -1,   637,   638,
-       5,    -1,     7,     8,     9,    10,    11,    12,    -1,    14,
-      -1,    -1,    -1,    18,    -1,    -1,    21,    -1,    23,    24,
-      25,    26,    27,    28,    -1,    30,    -1,    -1,    33,    34,
-      35,    36,    37,    38,    39,    -1,    41,    42,    43,    -1,
-      45,    -1,    47,    48,    -1,    -1,    51,    52,    53,    54,
-      55,    -1,    57,    58,    59,    60,    -1,    62,    63,    64,
-      65,    66,    67,    -1,    69,    70,    -1,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    -1,    82,    83,    -1,
-      85,    86,    87,    88,    89,    -1,    91,    92,    93,    -1,
-      -1,    96,    97,    98,    99,    -1,   101,   102,   103,    -1,
-     105,   106,   107,   108,   109,   110,    -1,    -1,    -1,    -1,
-     115,   116,   117,    -1,    -1,   120,   121,   122,    -1,   124,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-      -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,
-      -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,   154,
-      -1,    -1,   157,   158,    -1,   160,   161,   162,   163,   164,
-     165,   166,    -1,   168,   169,   170,   171,   172,   173,   174,
-     175,   176,    -1,   178,   179,   180,   181,    -1,   183,    -1,
-      -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,
-     195,   196,   197,    -1,   199,    -1,   201,    -1,   203,    -1,
-     205,   206,    -1,   208,   209,    -1,   211,   212,    -1,    -1,
-      -1,   216,   217,   218,   219,   220,    -1,   222,   223,   224,
-      -1,    -1,   227,    -1,    -1,    -1,   231,   232,   233,   234,
-      -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,
-     245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,
-      -1,   256,    -1,   258,   259,   260,    -1,    -1,    -1,    -1,
-      -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,   274,
-      -1,    -1,   277,    -1,    -1,    -1,    -1,   282,    -1,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,    -1,   302,   303,   304,
-     305,   306,   307,   308,   309,   310,   311,   312,    -1,    -1,
-      -1,    -1,   317,   318,   319,   320,   321,   322,    -1,    -1,
-     325,   326,   327,   328,    -1,   330,   331,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,    -1,   342,   343,   344,
-      -1,    -1,   347,   348,   349,   350,   351,   352,   353,   354,
-     355,    -1,   357,   358,   359,    -1,   361,   362,   363,   364,
-     365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   379,   380,   381,   382,   383,   384,
-      -1,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,   396,    -1,   398,   399,   400,    -1,   402,    -1,   404,
-     405,   406,   407,   408,    -1,   410,   411,   412,    -1,    -1,
-     415,    -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,
-      -1,   426,   427,   428,   429,   430,    -1,   432,   433,    -1,
-     435,   436,   437,   438,   439,   440,    -1,   442,    -1,   444,
-     445,    -1,   447,   448,   449,    -1,   451,    -1,   453,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-      -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,   474,
-      -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,
-     485,   486,   487,    -1,   489,   490,   491,   492,   493,    -1,
-      -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,
-      -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,
-     515,   516,   517,   518,   519,   520,   521,    -1,   523,   524,
-     525,   526,   527,   528,   529,   530,   531,   532,   533,   534,
-     535,   536,   537,    -1,    -1,   540,   541,   542,   543,    -1,
-     545,   546,   547,    -1,   549,   550,   551,   552,    -1,    -1,
-      -1,    -1,    -1,   558,   559,    -1,   561,   562,   563,   564,
-     565,   566,   567,   568,   569,   570,   571,   572,    -1,   574,
-     575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,
-     585,   586,    -1,    -1,   589,   590,   591,   592,   593,    -1,
-      -1,   596,   597,    -1,   599,   600,   601,   602,   603,   604,
-      -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,
-     615,   616,    -1,    -1,   619,    -1,    -1,    -1,   623,   624,
-      -1,    -1,    -1,    -1,   629,   630,    -1,    -1,   633,   634,
-      -1,    -1,   637,   638,     5,    -1,     7,     8,     9,    10,
-      11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,
-      21,    -1,    23,    24,    25,    26,    27,    28,    -1,    30,
-      -1,    -1,    33,    34,    35,    36,    37,    38,    39,    -1,
-      41,    42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,
-      51,    52,    53,    54,    55,    -1,    57,    58,    59,    60,
-      -1,    62,    63,    64,    65,    66,    67,    -1,    69,    70,
-      -1,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-      -1,    82,    83,    -1,    85,    86,    87,    88,    89,    -1,
-      91,    92,    93,    -1,    -1,    96,    97,    98,    99,    -1,
-     101,   102,   103,    -1,   105,   106,   107,   108,   109,   110,
-      -1,    -1,    -1,    -1,   115,   116,   117,    -1,    -1,   120,
-     121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,
-     131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,
-     141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,
-      -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,   160,
-     161,   162,   163,   164,   165,   166,    -1,   168,   169,   170,
-     171,   172,   173,   174,   175,   176,    -1,   178,   179,   180,
-     181,    -1,   183,    -1,    -1,    -1,   187,   188,   189,   190,
-      -1,   192,    -1,   194,   195,   196,   197,    -1,   199,    -1,
-     201,    -1,   203,    -1,   205,   206,    -1,   208,   209,    -1,
-     211,   212,    -1,    -1,    -1,   216,   217,   218,   219,   220,
-      -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,
-     231,   232,   233,   234,    -1,    -1,   237,    -1,    -1,    -1,
-     241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,
-      -1,   252,   253,    -1,    -1,   256,    -1,   258,   259,   260,
-      -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,
-     271,    -1,   273,   274,    -1,    -1,   277,    -1,    -1,    -1,
-      -1,   282,    -1,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
-      -1,   302,   303,   304,   305,   306,   307,   308,   309,   310,
-     311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,
-     321,   322,    -1,    -1,   325,   326,   327,   328,    -1,   330,
-     331,   332,   333,   334,   335,   336,   337,   338,   339,   340,
-      -1,   342,   343,   344,    -1,    -1,   347,   348,   349,   350,
-     351,   352,   353,   354,   355,    -1,   357,   358,   359,    -1,
-     361,   362,   363,    -1,   365,   366,   367,    -1,   369,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,
-     381,   382,   383,   384,    -1,   386,   387,   388,   389,   390,
-     391,   392,   393,   394,   395,   396,    -1,   398,   399,   400,
-      -1,   402,    -1,   404,   405,   406,   407,   408,    -1,   410,
-     411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,
-     421,   422,   423,    -1,    -1,   426,   427,   428,   429,   430,
-      -1,   432,   433,    -1,   435,   436,   437,   438,   439,   440,
-      -1,   442,    -1,   444,   445,    -1,   447,   448,   449,    -1,
-     451,    -1,   453,   454,   455,   456,   457,   458,   459,   460,
-     461,   462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,
-     471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,
-      -1,   482,    -1,   484,   485,   486,   487,    -1,   489,   490,
-     491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,
-     501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,
-      -1,   512,   513,   514,   515,   516,   517,   518,   519,   520,
-     521,    -1,   523,   524,   525,   526,   527,   528,   529,   530,
-     531,   532,   533,   534,   535,   536,   537,    -1,    -1,   540,
-     541,   542,   543,    -1,   545,   546,   547,    -1,   549,   550,
-     551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,
-     561,   562,   563,   564,   565,   566,   567,   568,   569,   570,
-     571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,
-     581,    -1,   583,    -1,   585,   586,    -1,    -1,   589,   590,
-     591,   592,   593,    -1,    -1,   596,   597,    -1,   599,   600,
-     601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,
-     611,   612,    -1,   614,   615,   616,    -1,    -1,   619,    -1,
-      -1,    -1,   623,   624,    -1,    -1,    -1,    -1,   629,   630,
-      -1,    -1,   633,   634,    -1,    -1,   637,   638,     5,    -1,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    21,    -1,    23,    24,    25,    26,
-      27,    28,    -1,    30,    -1,    -1,    33,    34,    35,    36,
-      37,    38,    39,    -1,    41,    42,    43,    -1,    45,    -1,
-      47,    48,    -1,    -1,    51,    52,    53,    54,    55,    -1,
-      57,    58,    59,    60,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    88,    89,    -1,    91,    92,    93,    -1,    -1,    96,
-      97,    98,    99,    -1,   101,   102,   103,    -1,   105,   106,
-     107,   108,   109,   110,    -1,    -1,    -1,    -1,   115,   116,
-     117,    -1,    -1,   120,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,   165,   166,
-      -1,   168,   169,   170,   171,   172,   173,   174,   175,   176,
-      -1,   178,   179,   180,   181,    -1,   183,    -1,    -1,    -1,
-     187,   188,   189,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,   203,    -1,   205,   206,
-      -1,   208,   209,    -1,   211,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,   220,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,   231,   232,   233,   234,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,
-      -1,   258,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-     277,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,   305,   306,
-     307,   308,   309,   310,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-     327,   328,    -1,   330,   331,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,   342,   343,   344,    -1,    -1,
-     347,   348,   349,   350,   351,   352,   353,   354,   355,    -1,
-     357,   358,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   379,   380,   381,   382,   383,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,   395,   396,
-      -1,   398,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,   433,    -1,   435,   436,
-     437,   438,   439,   440,    -1,   442,    -1,   444,   445,    -1,
-     447,   448,   449,    -1,   451,    -1,   453,   454,   455,   456,
-     457,   458,   459,   460,   461,   462,   463,   464,    -1,   466,
-     467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,
-     487,    -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,   516,
-     517,   518,   519,   520,   521,    -1,   523,   524,   525,   526,
-     527,   528,   529,   530,   531,   532,   533,   534,   535,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,   545,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,   561,   562,   563,   564,   565,   566,
-     567,   568,   569,   570,   571,   572,    -1,   574,   575,    -1,
-      -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,
-      -1,    -1,   589,   590,   591,   592,   593,    -1,    -1,   596,
-     597,    -1,   599,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,
-      -1,    -1,   619,    -1,    -1,    -1,   623,   624,    -1,    -1,
-      -1,    -1,   629,   630,    -1,    -1,   633,   634,    -1,    -1,
-     637,   638,     5,    -1,     7,     8,     9,    10,    11,    -1,
-      -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,    -1,
-      23,    24,    25,    26,    27,    28,    -1,    30,    -1,    -1,
-      33,    34,    35,    36,    37,    38,    39,    -1,    41,    42,
-      43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,    52,
-      53,    54,    55,    -1,    57,    58,    59,    60,    -1,    62,
-      63,    64,    65,    66,    67,    -1,    69,    70,    -1,    72,
-      73,    74,    75,    76,    77,    78,    79,    80,    -1,    82,
-      83,    -1,    85,    86,    87,    88,    89,    -1,    91,    92,
-      93,    -1,    -1,    96,    97,    98,    99,    -1,   101,   102,
-     103,    -1,   105,   106,   107,   108,   109,   110,    -1,    -1,
-      -1,    -1,   115,   116,   117,    -1,    -1,   120,   121,   122,
-      -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,
-     133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,
-     143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,
-     153,   154,    -1,    -1,   157,   158,    -1,   160,   161,   162,
-     163,   164,   165,   166,    -1,   168,   169,   170,   171,   172,
-     173,   174,   175,   176,    -1,   178,   179,   180,   181,    -1,
-     183,    -1,    -1,    -1,   187,   188,   189,   190,    -1,   192,
-      -1,   194,   195,   196,   197,    -1,   199,    -1,   201,    -1,
-     203,    -1,   205,   206,    -1,   208,   209,    -1,   211,   212,
-      -1,    -1,    -1,   216,   217,   218,   219,   220,    -1,   222,
-     223,   224,    -1,    -1,   227,    -1,    -1,    -1,   231,   232,
-     233,   234,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,
-      -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,
-     253,    -1,    -1,   256,    -1,   258,   259,   260,    -1,    -1,
-      -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,
-     273,   274,    -1,    -1,   277,    -1,    -1,    -1,    -1,   282,
-      -1,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,   299,   300,    -1,   302,
-     303,   304,   305,   306,   307,   308,   309,   310,   311,   312,
-      -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,   322,
-      -1,    -1,   325,   326,   327,   328,    -1,   330,   331,   332,
-     333,   334,   335,   336,   337,   338,   339,   340,    -1,   342,
-     343,   344,    -1,    -1,   347,   348,   349,   350,   351,   352,
-     353,   354,   355,    -1,   357,   358,   359,    -1,   361,   362,
-     363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,   382,
-     383,   384,    -1,   386,   387,   388,   389,   390,   391,   392,
-     393,   394,   395,   396,    -1,   398,   399,   400,    -1,   402,
-      -1,   404,   405,   406,   407,   408,    -1,   410,   411,   412,
-      -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,
-     423,    -1,    -1,   426,   427,   428,   429,   430,    -1,   432,
-     433,    -1,   435,   436,   437,   438,   439,   440,    -1,   442,
-      -1,   444,   445,    -1,   447,   448,   449,    -1,   451,    -1,
-     453,   454,   455,   456,   457,   458,   459,   460,   461,   462,
-     463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,
-     473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,
-      -1,   484,   485,   486,   487,    -1,   489,   490,   491,   492,
-     493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,
-     503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,
-     513,   514,   515,   516,   517,   518,   519,   520,   521,    -1,
-     523,   524,   525,   526,   527,   528,   529,   530,   531,   532,
-     533,   534,   535,   536,   537,    -1,    -1,   540,   541,   542,
-     543,    -1,   545,   546,   547,    -1,   549,   550,   551,   552,
-      -1,    -1,    -1,    -1,    -1,   558,   559,    -1,   561,   562,
-     563,   564,   565,   566,   567,   568,   569,   570,   571,   572,
-      -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,
-     583,    -1,   585,   586,    -1,    -1,   589,   590,   591,   592,
-     593,    -1,    -1,   596,   597,    -1,   599,   600,   601,   602,
-     603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,
-      -1,   614,   615,   616,    -1,    -1,   619,    -1,    -1,    -1,
-     623,   624,    -1,    -1,    -1,    -1,   629,   630,    -1,    -1,
-     633,   634,    -1,    -1,   637,   638,     5,    -1,     7,     8,
-       9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
-      -1,    -1,    21,    -1,    23,    24,    25,    26,    27,    28,
-      -1,    30,    -1,    -1,    33,    34,    35,    36,    37,    38,
-      39,    -1,    41,    42,    43,    -1,    45,    -1,    47,    48,
-      -1,    -1,    51,    52,    53,    54,    55,    -1,    57,    58,
-      59,    60,    -1,    62,    63,    64,    65,    66,    67,    -1,
-      69,    70,    -1,    72,    73,    74,    75,    76,    77,    78,
-      79,    80,    -1,    82,    83,    -1,    85,    86,    87,    88,
-      89,    -1,    91,    92,    93,    -1,    -1,    96,    97,    98,
-      99,    -1,   101,   102,   103,    -1,   105,   106,   107,   108,
-     109,   110,    -1,    -1,    -1,    -1,   115,   116,   117,    -1,
-      -1,   120,   121,   122,    -1,   124,    -1,    -1,    -1,   128,
-      -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,   138,
-      -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,
-     149,   150,    -1,   152,   153,   154,    -1,    -1,   157,   158,
-      -1,   160,   161,   162,   163,   164,   165,   166,    -1,   168,
-     169,   170,   171,   172,   173,   174,   175,   176,    -1,   178,
-     179,   180,   181,    -1,   183,    -1,    -1,    -1,   187,   188,
-      -1,   190,    -1,   192,    -1,   194,   195,   196,   197,    -1,
-     199,    -1,   201,    -1,   203,    -1,   205,   206,    -1,   208,
-     209,    -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,
-     219,   220,    -1,   222,   223,   224,    -1,    -1,   227,    -1,
-      -1,    -1,   231,   232,   233,   234,    -1,    -1,   237,    -1,
-      -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,
-     249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,   258,
-     259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,
-     269,    -1,   271,    -1,   273,   274,    -1,    -1,   277,    -1,
-      -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-     299,   300,    -1,   302,   303,   304,   305,   306,   307,   308,
-     309,   310,   311,   312,    -1,    -1,    -1,    -1,   317,   318,
-     319,   320,   321,   322,    -1,    -1,   325,   326,   327,   328,
-      -1,   330,   331,   332,   333,   334,   335,   336,   337,   338,
-     339,   340,    -1,   342,   343,   344,    -1,    -1,   347,   348,
-     349,   350,   351,   352,   353,   354,   355,    -1,   357,   358,
-     359,    -1,   361,   362,   363,    -1,   365,   366,   367,    -1,
-     369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     379,   380,   381,   382,   383,   384,    -1,   386,   387,   388,
-     389,   390,   391,   392,   393,   394,   395,   396,    -1,   398,
-     399,   400,    -1,   402,    -1,   404,   405,   406,   407,   408,
-      -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,
-     419,   420,   421,   422,   423,    -1,    -1,   426,   427,   428,
-     429,   430,    -1,   432,   433,    -1,   435,   436,   437,   438,
-     439,   440,    -1,   442,    -1,   444,   445,    -1,   447,   448,
-     449,    -1,   451,    -1,   453,   454,   455,   456,   457,   458,
-     459,   460,   461,   462,   463,   464,    -1,   466,   467,    -1,
-      -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,
-      -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,
-     489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,
-     499,   500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,
-     509,    -1,    -1,   512,   513,   514,   515,   516,   517,   518,
-     519,   520,   521,    -1,   523,   524,   525,   526,   527,   528,
-     529,   530,   531,   532,   533,   534,   535,   536,   537,    -1,
-      -1,   540,   541,   542,   543,    -1,   545,   546,   547,    -1,
-     549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,
-     559,    -1,   561,   562,   563,   564,   565,   566,   567,   568,
-     569,   570,   571,   572,    -1,   574,   575,    -1,    -1,   578,
-      -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,
-     589,   590,   591,   592,   593,    -1,    -1,   596,   597,    -1,
-     599,   600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,
-      -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,    -1,
-     619,    -1,    -1,    -1,   623,   624,    -1,    -1,    -1,    -1,
-     629,   630,    -1,    -1,   633,   634,    -1,    -1,   637,   638,
-       5,    -1,     7,     8,     9,    10,    11,    -1,    -1,    14,
-      -1,    -1,    -1,    18,    -1,    -1,    21,    -1,    23,    24,
-      25,    26,    27,    28,    -1,    30,    -1,    -1,    33,    34,
-      35,    36,    37,    38,    39,    -1,    41,    42,    43,    -1,
-      45,    -1,    47,    48,    -1,    -1,    51,    52,    53,    54,
-      55,    -1,    57,    58,    59,    60,    -1,    62,    63,    64,
-      65,    66,    67,    -1,    69,    70,    -1,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    -1,    82,    83,    -1,
-      85,    86,    87,    88,    89,    -1,    91,    92,    93,    -1,
-      -1,    96,    97,    98,    99,    -1,   101,   102,   103,    -1,
-     105,   106,   107,   108,   109,   110,    -1,    -1,    -1,    -1,
-     115,   116,   117,    -1,    -1,   120,   121,   122,    -1,   124,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-      -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,
-      -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,   154,
-      -1,    -1,   157,   158,    -1,   160,   161,   162,   163,   164,
-     165,   166,    -1,   168,   169,   170,   171,   172,   173,   174,
-     175,   176,    -1,   178,   179,   180,   181,    -1,   183,    -1,
-      -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,
-     195,   196,   197,    -1,   199,    -1,   201,    -1,   203,    -1,
-     205,   206,    -1,   208,   209,    -1,   211,   212,    -1,    -1,
-      -1,   216,   217,   218,   219,   220,    -1,   222,   223,   224,
-      -1,    -1,   227,    -1,    -1,    -1,   231,   232,   233,   234,
-      -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,
-     245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,
-      -1,   256,    -1,   258,   259,   260,    -1,    -1,    -1,    -1,
-      -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,   274,
-      -1,    -1,   277,    -1,    -1,    -1,    -1,   282,    -1,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,    -1,   302,   303,   304,
-     305,   306,   307,   308,   309,   310,   311,   312,    -1,    -1,
-      -1,    -1,   317,   318,   319,   320,   321,   322,    -1,    -1,
-     325,   326,   327,   328,    -1,   330,   331,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,    -1,   342,   343,   344,
-      -1,    -1,   347,   348,   349,   350,   351,   352,   353,   354,
-     355,    -1,   357,   358,   359,    -1,   361,   362,   363,    -1,
-     365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   379,   380,   381,   382,   383,   384,
-      -1,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,   396,    -1,   398,   399,   400,    -1,   402,    -1,   404,
-     405,   406,   407,   408,    -1,   410,   411,   412,    -1,    -1,
-     415,    -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,
-      -1,   426,   427,   428,   429,   430,    -1,   432,   433,    -1,
-     435,   436,   437,   438,   439,   440,    -1,   442,    -1,   444,
-     445,    -1,   447,   448,   449,    -1,   451,    -1,   453,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-      -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,   474,
-      -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,
-     485,   486,   487,    -1,   489,   490,   491,   492,   493,    -1,
-      -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,
-      -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,
-     515,   516,   517,   518,   519,   520,   521,    -1,   523,   524,
-     525,   526,   527,   528,   529,   530,   531,   532,   533,   534,
-     535,   536,   537,    -1,    -1,   540,   541,   542,   543,    -1,
-     545,   546,   547,    -1,   549,   550,   551,   552,    -1,    -1,
-      -1,    -1,    -1,   558,   559,    -1,   561,   562,   563,   564,
-     565,   566,   567,   568,   569,   570,   571,   572,    -1,   574,
-     575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,
-     585,   586,    -1,    -1,   589,   590,   591,   592,   593,    -1,
-      -1,   596,   597,    -1,   599,   600,   601,   602,   603,   604,
-      -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,
-     615,   616,    -1,    -1,   619,    -1,    -1,    -1,   623,   624,
-      -1,    -1,    -1,    -1,   629,   630,    -1,    -1,   633,   634,
-      -1,    -1,   637,   638,     5,    -1,     7,     8,     9,    10,
-      11,    12,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,
-      21,    -1,    23,    24,    25,    26,    27,    28,    -1,    30,
-      -1,    -1,    33,    34,    35,    36,    37,    38,    39,    -1,
-      41,    42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,
-      51,    52,    53,    54,    55,    -1,    57,    58,    59,    60,
-      -1,    62,    63,    64,    65,    66,    67,    -1,    69,    70,
-      -1,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-      -1,    82,    83,    -1,    85,    86,    87,    88,    89,    -1,
-      91,    92,    93,    -1,    -1,    96,    97,    98,    99,    -1,
-     101,   102,   103,    -1,   105,   106,   107,   108,   109,   110,
-      -1,    -1,    -1,    -1,   115,   116,   117,    -1,    -1,   120,
-     121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,
-     131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,
-     141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,
-      -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,   160,
-     161,   162,   163,   164,   165,   166,    -1,   168,   169,   170,
-     171,   172,   173,   174,   175,   176,    -1,   178,   179,   180,
-     181,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,
-      -1,   192,    -1,   194,   195,   196,   197,    -1,   199,    -1,
-     201,    -1,   203,    -1,   205,   206,    -1,   208,   209,    -1,
-     211,   212,    -1,    -1,    -1,   216,   217,   218,   219,   220,
-      -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,
-     231,   232,   233,   234,    -1,    -1,   237,    -1,    -1,    -1,
-     241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,
-      -1,   252,   253,    -1,    -1,   256,    -1,   258,   259,   260,
-      -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,
-     271,    -1,   273,   274,    -1,    -1,   277,    -1,    -1,    -1,
-      -1,   282,    -1,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
-      -1,   302,   303,   304,   305,   306,   307,   308,   309,   310,
-     311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,
-     321,   322,    -1,    -1,   325,   326,   327,   328,    -1,   330,
-     331,   332,   333,   334,   335,   336,   337,   338,   339,   340,
-      -1,   342,   343,   344,    -1,    -1,   347,   348,   349,   350,
-     351,    -1,   353,   354,   355,    -1,   357,   358,   359,    -1,
-     361,   362,   363,    -1,   365,   366,   367,    -1,   369,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,
-     381,   382,   383,   384,    -1,   386,   387,   388,   389,   390,
-     391,   392,   393,   394,   395,   396,    -1,   398,   399,   400,
-      -1,   402,    -1,   404,   405,   406,   407,   408,    -1,   410,
-     411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,
-     421,   422,   423,    -1,    -1,   426,   427,   428,   429,   430,
-      -1,   432,   433,    -1,   435,   436,   437,   438,   439,   440,
-      -1,   442,    -1,   444,   445,    -1,   447,   448,   449,    -1,
-     451,    -1,   453,   454,   455,   456,   457,   458,   459,   460,
-     461,   462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,
-     471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,
-      -1,   482,    -1,   484,   485,   486,   487,    -1,   489,   490,
-     491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,
-     501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,
-      -1,   512,   513,   514,   515,   516,   517,   518,   519,   520,
-     521,    -1,   523,   524,   525,   526,   527,   528,   529,   530,
-     531,   532,   533,   534,   535,   536,   537,    -1,    -1,   540,
-     541,   542,   543,    -1,   545,   546,   547,    -1,   549,   550,
-     551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,
-     561,   562,   563,   564,   565,   566,   567,   568,   569,   570,
-     571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,
-     581,    -1,   583,    -1,   585,   586,    -1,    -1,   589,   590,
-     591,   592,   593,    -1,    -1,   596,   597,    -1,   599,   600,
-     601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,
-     611,   612,    -1,   614,   615,   616,    -1,    -1,   619,    -1,
-      -1,    -1,   623,   624,    -1,    -1,    -1,    -1,   629,   630,
-      -1,    -1,   633,   634,    -1,    -1,   637,   638,     5,    -1,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    21,    -1,    23,    24,    25,    26,
-      27,    28,    -1,    30,    -1,    -1,    33,    34,    35,    36,
-      37,    38,    39,    -1,    41,    42,    43,    -1,    45,    -1,
-      47,    48,    -1,    -1,    51,    52,    53,    54,    55,    -1,
-      57,    58,    59,    60,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    88,    89,    -1,    91,    92,    93,    -1,    -1,    96,
-      97,    98,    99,    -1,   101,   102,   103,    -1,   105,   106,
-     107,   108,   109,   110,    -1,    -1,    -1,    -1,   115,   116,
-     117,    -1,    -1,   120,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,   165,   166,
-      -1,   168,   169,   170,   171,   172,   173,   174,   175,   176,
-      -1,   178,   179,   180,   181,    -1,   183,    -1,    -1,    -1,
-     187,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,   203,    -1,   205,   206,
-      -1,   208,   209,    -1,   211,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,   220,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,   231,   232,   233,   234,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,
-      -1,   258,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-     277,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,   305,   306,
-     307,   308,   309,   310,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-     327,   328,    -1,   330,   331,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,   342,   343,   344,    -1,    -1,
-     347,   348,   349,   350,   351,   352,   353,   354,   355,    -1,
-     357,   358,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   379,   380,   381,   382,   383,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,   395,   396,
-      -1,   398,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,   433,    -1,   435,   436,
-     437,   438,   439,   440,    -1,   442,    -1,   444,   445,    -1,
-     447,   448,   449,    -1,   451,    -1,   453,   454,   455,   456,
-     457,   458,   459,   460,   461,   462,   463,   464,    -1,   466,
-     467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,
-     487,    -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,   516,
-     517,   518,   519,   520,   521,    -1,   523,   524,   525,   526,
-     527,   528,   529,   530,   531,   532,   533,   534,   535,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,   545,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,   561,   562,   563,   564,   565,   566,
-     567,   568,   569,   570,   571,   572,    -1,   574,   575,    -1,
-      -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,
-      -1,    -1,   589,   590,   591,   592,   593,    -1,    -1,   596,
-     597,    -1,   599,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,
-      -1,    -1,   619,    -1,    -1,    -1,   623,   624,    -1,    -1,
-      -1,    -1,   629,   630,    -1,    -1,   633,   634,    -1,    -1,
-     637,   638,     5,    -1,     7,     8,     9,    10,    11,    -1,
-      -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,    -1,
-      23,    24,    25,    26,    27,    28,    -1,    30,    -1,    -1,
-      33,    34,    35,    36,    37,    38,    39,    -1,    41,    42,
-      43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,    52,
-      53,    54,    55,    -1,    57,    58,    59,    60,    -1,    62,
-      63,    64,    65,    66,    67,    -1,    69,    70,    -1,    72,
-      73,    74,    75,    76,    77,    78,    79,    80,    -1,    82,
-      83,    -1,    85,    86,    87,    88,    89,    -1,    91,    92,
-      93,    -1,    -1,    96,    97,    98,    99,    -1,   101,   102,
-     103,    -1,   105,   106,   107,   108,   109,   110,    -1,    -1,
-      -1,    -1,   115,   116,   117,    -1,    -1,   120,   121,   122,
-      -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,
-     133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,
-     143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,
-     153,   154,    -1,    -1,   157,   158,    -1,   160,   161,   162,
-     163,   164,   165,   166,    -1,   168,   169,   170,   171,   172,
-     173,   174,   175,   176,    -1,   178,   179,   180,   181,    -1,
-     183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,
-      -1,   194,   195,   196,   197,    -1,   199,    -1,   201,    -1,
-     203,    -1,   205,   206,    -1,   208,   209,    -1,   211,   212,
-      -1,    -1,    -1,   216,   217,   218,   219,   220,    -1,   222,
-     223,   224,    -1,    -1,   227,    -1,    -1,    -1,   231,   232,
-     233,   234,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,
-      -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,
-     253,    -1,    -1,   256,    -1,   258,   259,   260,    -1,    -1,
-      -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,
-     273,   274,    -1,    -1,   277,    -1,    -1,    -1,    -1,   282,
-      -1,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,   299,   300,    -1,   302,
-     303,   304,   305,   306,   307,   308,   309,   310,   311,   312,
-      -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,   322,
-      -1,    -1,   325,   326,   327,   328,    -1,   330,   331,   332,
-     333,   334,   335,   336,   337,   338,   339,   340,    -1,   342,
-     343,   344,    -1,    -1,   347,   348,   349,   350,   351,   352,
-     353,   354,   355,    -1,   357,   358,   359,    -1,   361,   362,
-     363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,   382,
-     383,   384,    -1,   386,   387,   388,   389,   390,   391,   392,
-     393,   394,   395,   396,    -1,   398,   399,   400,    -1,   402,
-      -1,   404,   405,   406,   407,   408,    -1,   410,   411,   412,
-      -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,
-     423,    -1,    -1,   426,   427,   428,   429,   430,    -1,   432,
-     433,    -1,   435,   436,   437,   438,   439,   440,    -1,   442,
-      -1,   444,   445,    -1,   447,   448,   449,    -1,   451,    -1,
-     453,   454,   455,   456,   457,   458,   459,   460,   461,   462,
-     463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,
-     473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,
-      -1,   484,   485,   486,   487,    -1,   489,   490,   491,   492,
-     493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,
-     503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,
-     513,   514,   515,   516,   517,   518,   519,   520,   521,    -1,
-     523,   524,   525,   526,   527,   528,   529,   530,   531,   532,
-     533,   534,   535,   536,   537,    -1,    -1,   540,   541,   542,
-     543,    -1,   545,   546,   547,    -1,   549,   550,   551,   552,
-      -1,    -1,    -1,    -1,    -1,   558,   559,    -1,   561,   562,
-     563,   564,   565,   566,   567,   568,   569,   570,   571,   572,
-      -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,
-     583,    -1,   585,   586,    -1,    -1,   589,   590,   591,   592,
-     593,    -1,    -1,   596,   597,    -1,   599,   600,   601,   602,
-     603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,
-      -1,   614,   615,   616,    -1,    -1,   619,    -1,    -1,    -1,
-     623,   624,    -1,    -1,    -1,    -1,   629,   630,    -1,    -1,
-     633,   634,    -1,    -1,   637,   638,     5,    -1,     7,     8,
-       9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
-      -1,    -1,    21,    -1,    23,    24,    25,    26,    27,    28,
-      -1,    30,    -1,    -1,    33,    34,    35,    36,    37,    38,
-      39,    -1,    41,    42,    43,    -1,    45,    -1,    47,    48,
-      -1,    -1,    51,    52,    53,    54,    55,    -1,    57,    58,
-      59,    60,    -1,    62,    63,    64,    65,    66,    67,    -1,
-      69,    70,    -1,    72,    73,    74,    75,    76,    77,    78,
-      79,    80,    -1,    82,    83,    -1,    85,    86,    87,    88,
-      89,    -1,    91,    92,    93,    -1,    -1,    96,    97,    98,
-      99,    -1,   101,   102,   103,    -1,   105,   106,   107,   108,
-     109,   110,    -1,    -1,    -1,    -1,   115,   116,   117,    -1,
-      -1,   120,   121,   122,    -1,   124,    -1,    -1,    -1,   128,
-      -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,   138,
-      -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,
-     149,   150,    -1,   152,   153,   154,    -1,    -1,   157,   158,
-      -1,   160,   161,   162,   163,   164,   165,   166,    -1,   168,
-     169,   170,   171,   172,   173,   174,   175,   176,    -1,   178,
-     179,   180,   181,    -1,   183,    -1,    -1,    -1,   187,   188,
-      -1,   190,    -1,   192,    -1,   194,   195,   196,   197,    -1,
-     199,    -1,   201,    -1,   203,    -1,   205,   206,    -1,   208,
-     209,    -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,
-     219,   220,    -1,   222,   223,   224,    -1,    -1,   227,    -1,
-      -1,    -1,   231,   232,   233,   234,    -1,    -1,   237,    -1,
-      -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,
-     249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,   258,
-     259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,
-     269,    -1,   271,    -1,   273,   274,    -1,    -1,   277,    -1,
-      -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-     299,   300,    -1,   302,   303,   304,   305,   306,   307,   308,
-     309,   310,   311,   312,    -1,    -1,    -1,    -1,   317,   318,
-     319,   320,   321,   322,    -1,    -1,   325,   326,   327,   328,
-      -1,   330,   331,   332,   333,   334,   335,   336,   337,   338,
-     339,   340,    -1,   342,   343,   344,    -1,    -1,   347,   348,
-     349,   350,   351,   352,   353,   354,   355,    -1,   357,   358,
-     359,    -1,   361,   362,   363,    -1,   365,   366,   367,    -1,
-     369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     379,   380,   381,   382,   383,   384,    -1,   386,   387,   388,
-     389,   390,   391,   392,   393,   394,   395,   396,    -1,   398,
-     399,   400,    -1,   402,    -1,   404,   405,   406,   407,   408,
-      -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,
-     419,   420,   421,   422,   423,    -1,    -1,   426,   427,   428,
-     429,   430,    -1,   432,   433,    -1,   435,   436,   437,   438,
-     439,   440,    -1,   442,    -1,   444,   445,    -1,   447,   448,
-     449,    -1,   451,    -1,   453,   454,   455,   456,   457,   458,
-     459,   460,   461,   462,   463,   464,    -1,   466,   467,    -1,
-      -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,
-      -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,
-     489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,
-     499,   500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,
-     509,    -1,    -1,   512,   513,   514,   515,   516,   517,   518,
-     519,   520,   521,    -1,   523,   524,   525,   526,   527,   528,
-     529,   530,   531,   532,   533,   534,   535,   536,   537,    -1,
-      -1,   540,   541,   542,   543,    -1,   545,   546,   547,    -1,
-     549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,
-     559,    -1,   561,   562,   563,   564,   565,   566,   567,   568,
-     569,   570,   571,   572,    -1,   574,   575,    -1,    -1,   578,
-      -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,
-     589,   590,   591,   592,   593,    -1,    -1,   596,   597,    -1,
-     599,   600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,
-      -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,    -1,
-     619,    -1,    -1,    -1,   623,   624,    -1,    -1,    -1,    -1,
-     629,   630,    -1,    -1,   633,   634,    -1,    -1,   637,   638,
-       5,    -1,     7,     8,     9,    10,    11,    -1,    -1,    14,
-      -1,    -1,    -1,    18,    -1,    -1,    21,    -1,    23,    24,
-      25,    26,    27,    28,    -1,    30,    -1,    -1,    33,    34,
-      35,    36,    37,    38,    39,    -1,    41,    42,    43,    -1,
-      45,    -1,    47,    48,    -1,    -1,    51,    52,    53,    54,
-      55,    -1,    57,    58,    59,    60,    -1,    62,    63,    64,
-      65,    66,    67,    -1,    69,    70,    -1,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    -1,    82,    83,    -1,
-      85,    86,    87,    88,    89,    -1,    91,    92,    93,    -1,
-      -1,    96,    97,    98,    99,    -1,   101,   102,   103,    -1,
-     105,   106,   107,   108,   109,   110,    -1,    -1,    -1,    -1,
-     115,   116,   117,    -1,    -1,   120,   121,   122,    -1,   124,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-      -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,
-      -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,   154,
-      -1,    -1,   157,   158,    -1,   160,   161,   162,   163,   164,
-     165,   166,    -1,   168,   169,   170,   171,   172,   173,   174,
-     175,   176,    -1,   178,   179,   180,   181,    -1,   183,    -1,
-      -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,
-     195,   196,   197,    -1,   199,    -1,   201,    -1,   203,    -1,
-     205,   206,    -1,   208,   209,    -1,   211,   212,    -1,    -1,
-      -1,   216,   217,   218,   219,   220,    -1,   222,   223,   224,
-      -1,    -1,   227,    -1,    -1,    -1,   231,   232,   233,   234,
-      -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,
-     245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,
-      -1,   256,    -1,   258,   259,   260,    -1,    -1,    -1,    -1,
-      -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,   274,
-      -1,    -1,   277,    -1,    -1,    -1,    -1,   282,    -1,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,    -1,   302,   303,   304,
-     305,   306,   307,   308,   309,   310,   311,   312,   313,    -1,
-      -1,    -1,   317,   318,   319,   320,   321,   322,    -1,    -1,
-     325,   326,   327,   328,    -1,   330,   331,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,    -1,   342,   343,   344,
-      -1,    -1,   347,   348,   349,   350,   351,    -1,   353,   354,
-     355,    -1,   357,   358,   359,    -1,   361,   362,   363,    -1,
-     365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   379,   380,   381,   382,   383,   384,
-      -1,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,   396,    -1,   398,   399,   400,    -1,   402,    -1,   404,
-     405,   406,   407,   408,    -1,   410,   411,   412,    -1,    -1,
-     415,    -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,
-      -1,   426,   427,   428,   429,   430,    -1,   432,   433,    -1,
-     435,   436,   437,   438,   439,   440,    -1,   442,    -1,   444,
-     445,    -1,   447,   448,   449,    -1,   451,    -1,   453,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-      -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,   474,
-      -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,
-     485,   486,   487,    -1,   489,   490,   491,   492,   493,    -1,
-      -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,
-      -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,
-     515,   516,   517,   518,   519,   520,   521,    -1,   523,   524,
-     525,   526,   527,   528,   529,   530,   531,   532,   533,   534,
-     535,   536,   537,    -1,    -1,   540,   541,   542,   543,    -1,
-     545,   546,   547,    -1,   549,   550,   551,   552,    -1,    -1,
-      -1,    -1,    -1,   558,   559,    -1,   561,   562,   563,   564,
-     565,   566,   567,   568,   569,   570,   571,   572,    -1,   574,
-     575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,
-     585,   586,    -1,    -1,   589,   590,   591,   592,   593,    -1,
-      -1,   596,   597,    -1,   599,   600,   601,   602,   603,   604,
-      -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,
-     615,   616,    -1,    -1,   619,    -1,    -1,    -1,   623,   624,
-      -1,    -1,    -1,    -1,   629,   630,    -1,    -1,   633,   634,
-      -1,    -1,   637,   638,     5,    -1,     7,     8,     9,    10,
-      11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,
-      21,    -1,    23,    24,    25,    26,    27,    28,    -1,    30,
-      -1,    -1,    33,    34,    35,    36,    37,    38,    39,    -1,
-      41,    42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,
-      51,    52,    53,    54,    55,    -1,    57,    58,    59,    60,
-      -1,    62,    63,    64,    65,    66,    67,    -1,    69,    70,
-      -1,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-      -1,    82,    83,    -1,    85,    86,    87,    88,    89,    -1,
-      91,    92,    93,    -1,    -1,    96,    97,    98,    99,    -1,
-     101,   102,   103,    -1,   105,   106,   107,   108,   109,   110,
-      -1,    -1,    -1,    -1,   115,   116,   117,    -1,    -1,   120,
-     121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,
-     131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,
-     141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,
-      -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,   160,
-     161,   162,   163,   164,   165,   166,    -1,   168,   169,   170,
-     171,   172,   173,   174,   175,   176,    -1,   178,   179,   180,
-     181,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,
-      -1,   192,    -1,   194,   195,   196,   197,    -1,   199,    -1,
-     201,    -1,   203,    -1,   205,   206,    -1,   208,   209,    -1,
-     211,   212,    -1,    -1,    -1,   216,   217,   218,   219,   220,
-      -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,
-     231,   232,   233,   234,    -1,    -1,   237,    -1,    -1,    -1,
-     241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,
-      -1,   252,   253,    -1,    -1,   256,    -1,   258,   259,   260,
-      -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,
-     271,    -1,   273,   274,    -1,    -1,   277,    -1,    -1,    -1,
-      -1,   282,    -1,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
-      -1,   302,   303,   304,   305,   306,   307,   308,   309,   310,
-     311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,
-     321,   322,    -1,    -1,   325,   326,   327,   328,    -1,   330,
-     331,   332,   333,   334,   335,   336,   337,   338,   339,   340,
-      -1,   342,   343,   344,    -1,    -1,   347,   348,   349,   350,
-     351,    -1,   353,   354,   355,    -1,   357,   358,   359,    -1,
-     361,   362,   363,    -1,   365,   366,   367,    -1,   369,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,
-     381,   382,   383,   384,    -1,   386,   387,   388,   389,   390,
-     391,   392,   393,   394,   395,   396,    -1,   398,   399,   400,
-      -1,   402,    -1,   404,   405,   406,   407,   408,    -1,   410,
-     411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,
-     421,   422,   423,    -1,    -1,   426,   427,   428,   429,   430,
-      -1,   432,   433,    -1,   435,   436,   437,   438,   439,   440,
-      -1,   442,    -1,   444,   445,    -1,   447,   448,   449,    -1,
-     451,    -1,   453,   454,   455,   456,   457,   458,   459,   460,
-     461,   462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,
-     471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,
-      -1,   482,    -1,   484,   485,   486,   487,    -1,   489,   490,
-     491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,
-     501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,
-      -1,   512,   513,   514,   515,   516,   517,   518,   519,   520,
-     521,    -1,   523,   524,   525,   526,   527,   528,   529,   530,
-     531,   532,   533,   534,   535,   536,   537,    -1,    -1,   540,
-     541,   542,   543,    -1,   545,   546,   547,    -1,   549,   550,
-     551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,
-     561,   562,   563,   564,   565,   566,   567,   568,   569,   570,
-     571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,
-     581,    -1,   583,    -1,   585,   586,    -1,    -1,   589,   590,
-     591,   592,   593,    -1,    -1,   596,   597,    -1,   599,   600,
-     601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,
-     611,   612,    -1,   614,   615,   616,    -1,    -1,   619,    -1,
-      -1,    -1,   623,   624,    -1,    -1,    -1,    -1,   629,   630,
-      -1,    -1,   633,   634,    -1,    -1,   637,   638,     5,    -1,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    21,    -1,    23,    24,    25,    26,
-      27,    28,    -1,    30,    -1,    -1,    33,    34,    35,    36,
-      37,    38,    39,    -1,    41,    42,    43,    -1,    45,    -1,
-      47,    48,    -1,    -1,    51,    52,    53,    54,    55,    -1,
-      57,    58,    59,    60,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    88,    89,    -1,    91,    92,    93,    -1,    -1,    96,
-      97,    98,    99,    -1,   101,   102,   103,    -1,   105,   106,
-     107,   108,   109,   110,    -1,    -1,    -1,    -1,   115,   116,
-     117,    -1,    -1,   120,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,   165,   166,
-      -1,   168,   169,   170,   171,   172,   173,   174,   175,   176,
-      -1,   178,   179,   180,   181,    -1,   183,    -1,    -1,    -1,
-     187,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,   203,    -1,   205,   206,
-      -1,   208,   209,    -1,   211,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,   220,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,   231,   232,   233,   234,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,
-      -1,   258,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-     277,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,   305,   306,
-     307,   308,   309,   310,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-     327,   328,    -1,   330,   331,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,   342,   343,   344,    -1,    -1,
-     347,   348,   349,   350,   351,    -1,   353,   354,   355,    -1,
-     357,   358,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   379,   380,   381,   382,   383,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,   395,   396,
-      -1,   398,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,   433,    -1,   435,   436,
-     437,   438,   439,   440,    -1,   442,    -1,   444,   445,    -1,
-     447,   448,   449,    -1,   451,    -1,   453,   454,   455,   456,
-     457,   458,   459,   460,   461,   462,   463,   464,    -1,   466,
-     467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,
-     487,    -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,   516,
-     517,   518,   519,   520,   521,    -1,   523,   524,   525,   526,
-     527,   528,   529,   530,   531,   532,   533,   534,   535,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,   545,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,   561,   562,   563,   564,   565,   566,
-     567,   568,   569,   570,   571,   572,    -1,   574,   575,    -1,
-      -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,
-      -1,    -1,   589,   590,   591,   592,   593,    -1,    -1,   596,
-     597,    -1,   599,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,
-      -1,    -1,   619,    -1,    -1,    -1,   623,   624,    -1,    -1,
-      -1,    -1,   629,   630,    -1,    -1,   633,   634,    -1,    -1,
-     637,   638,     5,    -1,     7,     8,     9,    10,    11,    -1,
-      -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,    -1,
-      23,    24,    25,    26,    27,    28,    -1,    30,    -1,    -1,
-      33,    34,    35,    36,    37,    38,    39,    -1,    41,    42,
-      43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,    52,
-      53,    54,    55,    -1,    57,    58,    59,    60,    -1,    62,
-      63,    64,    65,    66,    67,    -1,    69,    70,    -1,    72,
-      73,    74,    75,    76,    77,    78,    79,    80,    -1,    82,
-      83,    -1,    85,    86,    87,    88,    89,    -1,    91,    92,
-      93,    -1,    -1,    96,    97,    98,    99,    -1,   101,   102,
-     103,    -1,   105,   106,   107,   108,   109,   110,    -1,    -1,
-      -1,    -1,   115,   116,   117,    -1,    -1,   120,   121,   122,
-      -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,
-     133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,
-     143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,
-     153,   154,    -1,    -1,   157,   158,    -1,   160,   161,   162,
-     163,   164,   165,   166,    -1,   168,   169,   170,   171,   172,
-     173,   174,   175,   176,    -1,   178,   179,   180,   181,    -1,
-     183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,
-      -1,   194,   195,   196,   197,    -1,   199,    -1,   201,    -1,
-     203,    -1,   205,   206,    -1,   208,   209,    -1,   211,   212,
-      -1,    -1,    -1,   216,   217,   218,   219,   220,    -1,   222,
-     223,   224,    -1,    -1,   227,    -1,    -1,    -1,   231,   232,
-     233,   234,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,
-      -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,
-     253,    -1,    -1,   256,    -1,   258,   259,   260,    -1,    -1,
-      -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,
-     273,   274,    -1,    -1,   277,    -1,    -1,    -1,    -1,   282,
-      -1,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,   299,   300,    -1,   302,
-     303,   304,   305,   306,   307,   308,   309,   310,   311,   312,
-      -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,   322,
-      -1,    -1,   325,   326,   327,   328,    -1,   330,   331,   332,
-     333,   334,   335,   336,   337,   338,   339,   340,    -1,   342,
-     343,   344,    -1,    -1,   347,   348,   349,   350,   351,    -1,
-     353,   354,   355,    -1,   357,   358,   359,    -1,   361,   362,
-     363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,   382,
-     383,   384,    -1,   386,   387,   388,   389,   390,   391,   392,
-     393,   394,   395,   396,    -1,   398,   399,   400,    -1,   402,
-      -1,   404,   405,   406,   407,   408,    -1,   410,   411,   412,
-      -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,
-     423,    -1,    -1,   426,   427,   428,   429,   430,    -1,   432,
-     433,    -1,   435,   436,   437,   438,   439,   440,    -1,   442,
-      -1,   444,   445,    -1,   447,   448,   449,    -1,   451,    -1,
-     453,   454,   455,   456,   457,   458,   459,   460,   461,   462,
-     463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,
-     473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,
-      -1,   484,   485,   486,   487,    -1,   489,   490,   491,   492,
-     493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,
-     503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,
-     513,   514,   515,   516,   517,   518,   519,   520,   521,    -1,
-     523,   524,   525,   526,   527,   528,   529,   530,   531,   532,
-     533,   534,   535,   536,   537,    -1,    -1,   540,   541,   542,
-     543,    -1,   545,   546,   547,    -1,   549,   550,   551,   552,
-      -1,    -1,    -1,    -1,    -1,   558,   559,    -1,   561,   562,
-     563,   564,   565,   566,   567,   568,   569,   570,   571,   572,
-      -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,
-     583,    -1,   585,   586,    -1,    -1,   589,   590,   591,   592,
-     593,    -1,    -1,   596,   597,    -1,   599,   600,   601,   602,
-     603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,
-      -1,   614,   615,   616,    -1,    -1,   619,    -1,    -1,    -1,
-     623,   624,    -1,    -1,    -1,    -1,   629,   630,    -1,    -1,
-     633,   634,    -1,    -1,   637,   638,     5,    -1,     7,     8,
-       9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
-      -1,    -1,    21,    -1,    23,    24,    25,    26,    27,    28,
-      -1,    30,    -1,    -1,    -1,    34,    35,    -1,    -1,    38,
-      -1,    -1,    41,    42,    43,    -1,    45,    -1,    47,    48,
-      -1,    -1,    51,    -1,    -1,    54,    55,    -1,    57,    58,
-      -1,    60,    -1,    62,    63,    64,    65,    66,    67,    -1,
-      69,    70,    -1,    72,    73,    74,    75,    76,    77,    78,
-      79,    80,    -1,    82,    83,    -1,    85,    86,    87,    88,
-      89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,
-      -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,
-      -1,   110,    -1,    -1,    -1,    -1,   115,   116,   117,    -1,
-      -1,    -1,   121,   122,    -1,   124,    -1,    -1,    -1,   128,
-      -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,   138,
-      -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,
-     149,   150,    -1,   152,   153,   154,    -1,    -1,   157,   158,
-      -1,   160,   161,   162,   163,   164,   165,    -1,    -1,   168,
-     169,   170,   171,   172,    -1,   174,   175,   176,    -1,   178,
-     179,   180,   181,    -1,   183,    -1,    -1,    -1,   187,   188,
-      -1,   190,    -1,   192,    -1,   194,   195,   196,   197,    -1,
-     199,    -1,   201,    -1,    -1,    -1,   205,   206,    -1,   208,
-     209,    -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,
-     219,    -1,    -1,   222,   223,   224,    -1,    -1,   227,    -1,
-      -1,    -1,    -1,   232,   233,    -1,    -1,    -1,   237,    -1,
-      -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,
-     249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,    -1,
-     259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,
-     269,    -1,   271,    -1,   273,   274,    -1,    -1,   277,    -1,
-      -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-     299,   300,    -1,   302,   303,   304,    -1,   306,   307,   308,
-     309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,
-     319,   320,   321,   322,    -1,    -1,   325,   326,    -1,   328,
-      -1,   330,    -1,   332,   333,   334,   335,   336,   337,   338,
-     339,   340,    -1,   342,   343,   344,    -1,    -1,   347,   348,
-     349,   350,    -1,    -1,    -1,   354,   355,    -1,   357,   358,
-     359,    -1,   361,   362,   363,    -1,   365,   366,   367,    -1,
-     369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     379,   380,   381,    -1,   383,   384,    -1,   386,   387,   388,
-     389,   390,   391,   392,   393,   394,   395,    -1,    -1,   398,
-     399,   400,    -1,   402,    -1,   404,   405,   406,   407,   408,
-      -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,
-     419,   420,   421,   422,   423,    -1,    -1,   426,   427,   428,
-     429,   430,    -1,   432,   433,    -1,   435,   436,   437,    -1,
-      -1,   440,    -1,   442,    -1,   444,   445,    -1,   447,   448,
-     449,    -1,   451,    -1,    -1,   454,   455,   456,   457,   458,
-     459,   460,   461,   462,   463,   464,    -1,   466,   467,    -1,
-      -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,
-      -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,
-     489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,
-     499,   500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,
-     509,    -1,    -1,   512,   513,   514,   515,   516,   517,    -1,
-      -1,   520,   521,    -1,   523,   524,   525,   526,   527,   528,
-      -1,    -1,   531,   532,   533,   534,    -1,   536,   537,    -1,
-      -1,   540,   541,   542,   543,    -1,   545,   546,   547,    -1,
-     549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,
-     559,    -1,    -1,   562,   563,   564,   565,   566,   567,   568,
-     569,   570,   571,   572,    -1,   574,   575,    -1,    -1,   578,
-      -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,
-      -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,
-      -1,   600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,
-      -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,    -1,
-     619,    -1,    -1,    -1,     5,    -1,     7,     8,     9,    10,
-      11,    -1,    -1,    14,    -1,    -1,    -1,    18,   637,   638,
-      21,    -1,    23,    24,    25,    26,    27,    28,    -1,    30,
-      -1,    -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,
-      41,    42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,
-      51,    -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,
-      -1,    62,    63,    64,    65,    66,    67,    -1,    69,    70,
-      -1,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-      -1,    82,    83,    84,    85,    86,    87,    88,    89,    -1,
-      -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,
-     101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,
-      -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,    -1,
-     121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,
-     131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,
-     141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,
-      -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,   160,
-     161,   162,   163,   164,   165,    -1,    -1,   168,   169,   170,
-     171,   172,    -1,    -1,   175,   176,    -1,   178,   179,   180,
-      -1,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,
-     191,   192,    -1,   194,   195,   196,   197,    -1,   199,    -1,
-     201,    -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,
-     211,   212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,
-      -1,   222,   223,   224,   225,    -1,   227,    -1,    -1,    -1,
-      -1,   232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,
-     241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,   250,
-      -1,   252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,
-      -1,   262,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,
-     271,    -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   282,    -1,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
-      -1,   302,   303,   304,    -1,   306,   307,   308,   309,    -1,
-     311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,
-     321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,
-      -1,   332,   333,   334,   335,   336,   337,   338,   339,   340,
-      -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,   350,
-      -1,    -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,
-     361,   362,   363,    -1,   365,   366,   367,    -1,   369,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,
-     381,    -1,   383,   384,   385,   386,   387,   388,   389,   390,
-     391,   392,   393,   394,   395,    -1,    -1,   398,   399,   400,
-      -1,   402,    -1,   404,   405,   406,   407,   408,    -1,   410,
-     411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,
-     421,   422,   423,    -1,    -1,   426,   427,   428,   429,   430,
-      -1,   432,   433,    -1,   435,   436,   437,    -1,    -1,   440,
-      -1,   442,    -1,   444,   445,    -1,   447,   448,   449,    -1,
-     451,    -1,    -1,   454,   455,   456,   457,   458,   459,   460,
-     461,   462,   463,   464,    -1,   466,   467,   468,    -1,    -1,
-     471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,
-      -1,   482,    -1,   484,   485,   486,   487,    -1,   489,   490,
-     491,   492,   493,   494,    -1,    -1,    -1,    -1,   499,   500,
-     501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,
-      -1,   512,   513,   514,   515,   516,   517,    -1,    -1,   520,
-     521,    -1,   523,   524,   525,   526,   527,   528,    -1,    -1,
-     531,   532,   533,   534,    -1,   536,   537,    -1,    -1,   540,
-     541,   542,   543,    -1,    -1,   546,   547,    -1,   549,   550,
-     551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,
-      -1,    -1,   563,   564,   565,   566,    -1,   568,   569,    -1,
-     571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,
-     581,    -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,
-      -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,
-     601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,
-     611,   612,    -1,   614,   615,   616,    -1,    -1,   619,    -1,
-       5,    -1,     7,     8,     9,    10,    11,    -1,    -1,    14,
-      -1,    -1,    -1,    18,    -1,    -1,    21,   638,    23,    24,
-      25,    26,    27,    28,    -1,    30,    -1,    -1,    -1,    34,
-      -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,
-      45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,    54,
-      55,    -1,    57,    58,    -1,    60,    -1,    62,    63,    64,
-      65,    66,    67,    -1,    69,    70,    -1,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    -1,    82,    83,    84,
-      85,    86,    87,    88,    89,    -1,    -1,    -1,    93,    -1,
-      -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,
-     105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,
-     115,   116,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-      -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,
-      -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,   154,
-      -1,    -1,   157,   158,    -1,   160,   161,   162,   163,   164,
-     165,    -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,
-     175,   176,    -1,   178,   179,   180,    -1,    -1,   183,    -1,
-      -1,    -1,   187,   188,    -1,   190,   191,   192,    -1,   194,
-     195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,
-     205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,    -1,
-      -1,   216,   217,   218,   219,    -1,    -1,   222,   223,   224,
-     225,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,    -1,
-      -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,
-     245,    -1,    -1,    -1,   249,   250,    -1,   252,   253,    -1,
-      -1,   256,    -1,    -1,   259,   260,    -1,    -1,    -1,    -1,
-      -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,   274,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,    -1,   302,   303,   304,
-      -1,   306,   307,   308,   309,    -1,   311,   312,    -1,    -1,
-      -1,    -1,   317,   318,   319,   320,   321,   322,    -1,    -1,
-     325,   326,    -1,   328,    -1,   330,    -1,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,    -1,    -1,   343,   344,
-      -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,   354,
-     355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,
-     365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,   384,
-      -1,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,   404,
-     405,   406,   407,   408,    -1,   410,   411,   412,    -1,    -1,
-     415,    -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,
-      -1,   426,   427,   428,   429,   430,    -1,   432,   433,    -1,
-     435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,   444,
-     445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-      -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,   474,
-      -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,
-     485,   486,   487,    -1,   489,   490,   491,   492,   493,   494,
-      -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,
-      -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,
-     515,   516,   517,    -1,    -1,   520,   521,    -1,   523,   524,
-     525,   526,   527,   528,    -1,    -1,   531,   532,   533,   534,
-      -1,   536,   537,    -1,    -1,   540,   541,   542,   543,    -1,
-      -1,   546,   547,    -1,   549,   550,   551,   552,    -1,    -1,
-      -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,   564,
-     565,   566,    -1,   568,   569,    -1,   571,   572,    -1,   574,
-     575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,
-     585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,
-      -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,   604,
-      -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,
-     615,   616,    -1,    -1,   619,    -1,     5,    -1,     7,     8,
-       9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
-      -1,    -1,    21,   638,    23,    24,    25,    26,    27,    28,
-      -1,    30,    -1,    -1,    -1,    34,    -1,    -1,    -1,    38,
-      -1,    -1,    41,    42,    43,    -1,    45,    -1,    47,    48,
-      -1,    -1,    51,    -1,    -1,    54,    55,    -1,    57,    58,
-      -1,    60,    -1,    62,    63,    64,    65,    66,    67,    -1,
-      69,    70,    -1,    72,    73,    74,    75,    76,    77,    78,
-      79,    80,    -1,    82,    83,    -1,    85,    86,    87,    88,
-      89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,
-      -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,
-      -1,   110,    -1,    -1,    -1,    -1,   115,   116,    -1,    -1,
-      -1,    -1,   121,   122,    -1,   124,    -1,    -1,    -1,   128,
-      -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,   138,
-      -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,
-     149,   150,    -1,   152,   153,   154,    -1,    -1,   157,   158,
-      -1,   160,   161,   162,   163,   164,   165,    -1,    -1,   168,
-     169,   170,   171,   172,    -1,    -1,   175,   176,    -1,   178,
-     179,   180,    -1,    -1,   183,    -1,    -1,    -1,   187,   188,
-      -1,   190,    -1,   192,    -1,   194,   195,   196,   197,    -1,
-     199,    -1,   201,    -1,    -1,    -1,   205,   206,    -1,   208,
-      -1,    -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,
-     219,    -1,    -1,   222,   223,   224,    -1,    -1,   227,    -1,
-      -1,    -1,    -1,   232,   233,    -1,    -1,    -1,   237,    -1,
-      -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,
-     249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,    -1,
-     259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,
-     269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-     299,   300,    -1,   302,   303,   304,    -1,   306,   307,   308,
-     309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,
-     319,   320,   321,   322,    -1,    -1,   325,   326,    -1,   328,
-      -1,   330,    -1,   332,   333,   334,   335,   336,   337,   338,
-     339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,
-     349,   350,    -1,    -1,    -1,   354,   355,    -1,    -1,    -1,
-     359,    -1,   361,   362,   363,    -1,   365,   366,   367,    -1,
-     369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     379,   380,   381,    -1,   383,   384,    -1,   386,   387,   388,
-     389,   390,   391,   392,   393,   394,   395,    -1,    -1,   398,
-     399,   400,    -1,   402,    -1,   404,   405,   406,   407,   408,
-      -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,
-     419,   420,   421,   422,   423,    -1,    -1,   426,   427,   428,
-     429,   430,    -1,   432,   433,    -1,   435,   436,   437,    -1,
-      -1,   440,    -1,   442,    -1,   444,   445,    -1,   447,   448,
-     449,    -1,   451,    -1,    -1,   454,   455,   456,   457,   458,
-     459,   460,   461,   462,   463,   464,    -1,   466,   467,   468,
-      -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,
-      -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,
-     489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,
-     499,   500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,
-     509,    -1,    -1,   512,   513,   514,   515,   516,   517,    -1,
-      -1,   520,   521,    -1,   523,   524,   525,   526,   527,   528,
-      -1,    -1,   531,   532,   533,   534,    -1,   536,   537,    -1,
-      -1,   540,   541,   542,   543,    -1,    -1,   546,   547,    -1,
-     549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,
-     559,    -1,    -1,    -1,   563,   564,   565,   566,    -1,   568,
-     569,    -1,   571,   572,    -1,   574,   575,    -1,    -1,   578,
-      -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,
-      -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,
-      -1,   600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,
-      -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,    -1,
-     619,    -1,     5,    -1,     7,     8,     9,    10,    11,    -1,
-      -1,    14,   631,    -1,    -1,    18,    -1,    -1,    21,   638,
-      23,    24,    25,    26,    27,    28,    -1,    30,    -1,    -1,
-      -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,
-      43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,
-      -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,    62,
-      63,    64,    65,    66,    67,    -1,    69,    70,    -1,    72,
-      73,    74,    75,    76,    77,    78,    79,    80,    -1,    82,
-      83,    -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,
-      93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,
-      -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,
-      -1,    -1,   115,   116,    -1,    -1,    -1,    -1,   121,   122,
-      -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,
-     133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,
-     143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,
-     153,   154,    -1,    -1,   157,   158,    -1,   160,   161,   162,
-     163,   164,   165,    -1,    -1,   168,   169,   170,   171,   172,
-      -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,
-     183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,
-      -1,   194,   195,   196,   197,    -1,   199,    -1,   201,    -1,
-      -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,
-      -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,
-     223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,
-     233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,
-      -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,
-     253,    -1,    -1,   256,    -1,    -1,   259,   260,    -1,    -1,
-      -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,
-     273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,
-      -1,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,   299,   300,    -1,   302,
-     303,   304,    -1,   306,   307,   308,   309,    -1,   311,   312,
-      -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,   322,
-      -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,
-     333,   334,   335,   336,   337,   338,   339,   340,    -1,    -1,
-     343,   344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,
-      -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,   362,
-     363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,    -1,
-     383,   384,    -1,   386,   387,   388,   389,   390,   391,   392,
-     393,   394,   395,    -1,    -1,   398,   399,   400,    -1,   402,
-      -1,   404,   405,   406,   407,   408,    -1,   410,   411,   412,
-      -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,
-     423,    -1,    -1,   426,   427,   428,   429,   430,    -1,   432,
-     433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,
-      -1,   444,   445,    -1,   447,   448,   449,    -1,   451,    -1,
-      -1,   454,   455,   456,   457,   458,   459,   460,   461,   462,
-     463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,
-     473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,
-      -1,   484,   485,   486,   487,    -1,   489,   490,   491,   492,
-     493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,
-     503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,
-     513,   514,   515,   516,   517,    -1,    -1,   520,   521,    -1,
-     523,   524,   525,   526,   527,   528,    -1,    -1,   531,   532,
-     533,   534,    -1,   536,   537,    -1,    -1,   540,   541,   542,
-     543,    -1,    -1,   546,   547,    -1,   549,   550,   551,   552,
-      -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,
-     563,   564,   565,   566,    -1,   568,   569,    -1,   571,   572,
-      -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,
-     583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,
-     593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,
-     603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,
-      -1,   614,   615,   616,    -1,    -1,   619,    -1,    -1,    -1,
-       5,    -1,     7,     8,     9,    10,    11,    -1,   631,    14,
-      -1,    -1,    -1,    18,   637,   638,    21,    -1,    23,    24,
-      25,    26,    27,    28,    -1,    30,    -1,    -1,    -1,    34,
-      -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,
-      45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,    54,
-      55,    -1,    57,    58,    -1,    60,    -1,    62,    63,    64,
-      65,    66,    67,    -1,    69,    70,    -1,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    -1,    82,    83,    -1,
-      85,    86,    87,    88,    89,    -1,    -1,    -1,    93,    -1,
-      -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,
-     105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,
-     115,   116,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-      -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,
-      -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,   154,
-      -1,    -1,   157,   158,    -1,   160,   161,   162,   163,   164,
-     165,    -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,
-     175,   176,    -1,   178,   179,   180,    -1,    -1,   183,    -1,
-      -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,
-     195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,
-     205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,    -1,
-      -1,   216,   217,   218,   219,    -1,    -1,   222,   223,   224,
-      -1,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,    -1,
-      -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,
-     245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,
-      -1,   256,    -1,    -1,   259,   260,    -1,    -1,    -1,    -1,
-      -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,   274,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,    -1,   302,   303,   304,
-      -1,   306,   307,   308,   309,    -1,   311,   312,    -1,    -1,
-      -1,    -1,   317,   318,   319,   320,   321,   322,    -1,    -1,
-     325,   326,    -1,   328,    -1,   330,    -1,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,    -1,    -1,   343,   344,
-      -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,   354,
-     355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,
-     365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,   384,
-      -1,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,   404,
-     405,   406,   407,   408,    -1,   410,   411,   412,    -1,    -1,
-     415,    -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,
-      -1,   426,   427,   428,   429,   430,    -1,   432,   433,    -1,
-     435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,   444,
-     445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-      -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,   474,
-      -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,
-     485,   486,   487,    -1,   489,   490,   491,   492,   493,    -1,
-      -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,
-      -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,
-     515,   516,   517,    -1,    -1,   520,   521,    -1,   523,   524,
-     525,   526,   527,   528,    -1,    -1,   531,   532,   533,   534,
-      -1,   536,   537,    -1,    -1,   540,   541,   542,   543,    -1,
-      -1,   546,   547,    -1,   549,   550,   551,   552,    -1,    -1,
-      -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,   564,
-     565,   566,    -1,   568,   569,    -1,   571,   572,    -1,   574,
-     575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,
-     585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,
-      -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,   604,
-      -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,
-     615,   616,    -1,    -1,   619,    -1,    -1,    -1,     5,    -1,
-       7,     8,     9,    10,    11,   630,    -1,    14,    -1,    -1,
-      -1,    18,    -1,   638,    21,    -1,    23,    24,    25,    26,
-      27,    28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,
-      -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,
-      47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,
-      57,    58,    -1,    60,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,
-      -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,
-     107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,
-      -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,   165,    -1,
-      -1,   168,   169,   170,   171,   172,    -1,    -1,   175,   176,
-      -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,
-     187,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,
-      -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,    -1,   232,   233,    -1,   235,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,
-      -1,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,    -1,   306,
-     307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-      -1,   328,    -1,   330,    -1,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,
-     347,   348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,
-      -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,   395,    -1,
-      -1,   398,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,   433,    -1,   435,   436,
-     437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,
-     447,   448,   449,    -1,   451,    -1,    -1,   454,   455,   456,
-     457,   458,   459,   460,   461,   462,   463,   464,    -1,   466,
-     467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,
-     487,    -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,   516,
-     517,    -1,    -1,   520,   521,    -1,   523,   524,   525,   526,
-     527,   528,    -1,    -1,   531,   532,   533,   534,    -1,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,   566,
-      -1,   568,   569,    -1,   571,   572,    -1,   574,   575,    -1,
-      -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,
-      -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,
-      -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,
-      -1,    -1,   619,    -1,     5,    -1,     7,     8,     9,    10,
-      11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,
-      21,   638,    23,    24,    25,    26,    27,    28,    -1,    30,
-      -1,    -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,
-      41,    42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,
-      51,    -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,
-      -1,    62,    63,    64,    65,    66,    67,    -1,    69,    70,
-      -1,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-      -1,    82,    83,    -1,    85,    86,    87,    88,    89,    -1,
-      -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,
-     101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,
-      -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,    -1,
-     121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,
-     131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,
-     141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,
-      -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,   160,
-     161,   162,   163,   164,   165,    -1,    -1,   168,   169,   170,
-     171,   172,    -1,    -1,   175,   176,    -1,   178,   179,   180,
-      -1,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,
-      -1,   192,    -1,   194,   195,   196,   197,    -1,   199,    -1,
-     201,    -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,
-     211,   212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,
-      -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,
-      -1,   232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,
-     241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,
-      -1,   252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,
-      -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,
-     271,    -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   282,    -1,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
-      -1,   302,   303,   304,    -1,   306,   307,   308,   309,    -1,
-     311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,
-     321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,
-      -1,   332,   333,   334,   335,   336,   337,   338,   339,   340,
-      -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,   350,
-      -1,    -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,
-     361,   362,   363,    -1,   365,   366,   367,    -1,   369,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,
-     381,    -1,   383,   384,    -1,   386,   387,   388,   389,   390,
-     391,   392,   393,   394,   395,    -1,    -1,   398,   399,   400,
-      -1,   402,    -1,   404,   405,   406,   407,   408,    -1,   410,
-     411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,
-     421,   422,   423,    -1,    -1,   426,   427,   428,   429,   430,
-      -1,   432,   433,    -1,   435,   436,   437,    -1,    -1,   440,
-      -1,   442,    -1,   444,   445,    -1,   447,   448,   449,    -1,
-     451,    -1,    -1,   454,   455,   456,   457,   458,   459,   460,
-     461,   462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,
-     471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,
-      -1,   482,    -1,   484,   485,   486,   487,    -1,   489,   490,
-     491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,
-     501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,
-      -1,   512,   513,   514,   515,   516,   517,    -1,    -1,   520,
-     521,    -1,   523,   524,   525,   526,   527,   528,    -1,    -1,
-     531,   532,   533,   534,    -1,   536,   537,    -1,    -1,   540,
-     541,   542,   543,    -1,    -1,   546,   547,    -1,   549,   550,
-     551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,
-      -1,    -1,   563,   564,   565,   566,    -1,   568,   569,    -1,
-     571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,
-     581,    -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,
-      -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,
-     601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,
-     611,   612,    -1,   614,   615,   616,    -1,    -1,   619,    -1,
-      -1,    -1,     5,    -1,     7,     8,     9,    10,    11,   630,
-      -1,    14,    -1,    -1,    -1,    18,    -1,   638,    21,    -1,
-      23,    24,    25,    26,    27,    28,    -1,    30,    -1,    -1,
-      -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,
-      43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,
-      -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,    62,
-      63,    64,    65,    66,    67,    -1,    69,    70,    -1,    72,
-      73,    74,    75,    76,    77,    78,    79,    80,    -1,    82,
-      83,    -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,
-      93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,
-      -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,
-      -1,    -1,   115,   116,    -1,    -1,    -1,    -1,   121,   122,
-      -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,
-     133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,
-     143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,
-     153,   154,    -1,    -1,   157,   158,    -1,   160,   161,   162,
-     163,   164,   165,    -1,    -1,   168,   169,   170,   171,   172,
-      -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,
-     183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,
-      -1,   194,   195,   196,   197,    -1,   199,    -1,   201,    -1,
-      -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,
-      -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,
-     223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,
-     233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,
-      -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,
-     253,    -1,    -1,   256,    -1,    -1,   259,   260,    -1,    -1,
-      -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,
-     273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,
-      -1,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,   299,   300,    -1,   302,
-     303,   304,    -1,   306,   307,   308,   309,    -1,   311,   312,
-      -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,   322,
-      -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,
-     333,   334,   335,   336,   337,   338,   339,   340,    -1,    -1,
-     343,   344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,
-      -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,   362,
-     363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,    -1,
-     383,   384,    -1,   386,   387,   388,   389,   390,   391,   392,
-     393,   394,   395,    -1,    -1,   398,   399,   400,    -1,   402,
-      -1,   404,   405,   406,   407,   408,    -1,   410,   411,   412,
-      -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,
-     423,    -1,    -1,   426,   427,   428,   429,   430,    -1,   432,
-     433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,
-      -1,   444,   445,    -1,   447,   448,   449,    -1,   451,    -1,
-      -1,   454,   455,   456,   457,   458,   459,   460,   461,   462,
-     463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,
-     473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,
-      -1,   484,   485,   486,   487,    -1,   489,   490,   491,   492,
-     493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,
-     503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,
-     513,   514,   515,   516,   517,    -1,    -1,   520,   521,    -1,
-     523,   524,   525,   526,   527,   528,    -1,    -1,   531,   532,
-     533,   534,    -1,   536,   537,    -1,    -1,   540,   541,   542,
-     543,    -1,    -1,   546,   547,    -1,   549,   550,   551,   552,
-      -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,
-     563,   564,   565,   566,    -1,   568,   569,    -1,   571,   572,
-      -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,
-     583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,
-     593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,
-     603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,
-      -1,   614,   615,   616,    -1,    -1,   619,    -1,    -1,    -1,
-      -1,     5,   625,     7,     8,     9,    10,    11,    -1,    -1,
-      14,    -1,    -1,    -1,    18,   638,    -1,    21,    -1,    23,
-      24,    25,    26,    27,    28,    -1,    30,    -1,    -1,    -1,
-      34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,
-      -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,
-      54,    55,    -1,    57,    58,    -1,    60,    -1,    62,    63,
-      64,    65,    66,    67,    -1,    69,    70,    -1,    72,    73,
-      74,    75,    76,    77,    78,    79,    80,    -1,    82,    83,
-      -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,    93,
-      -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,
-      -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,
-      -1,   115,   116,    -1,    -1,    -1,    -1,   121,   122,    -1,
-     124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,
-     134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,
-      -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,
-     154,    -1,    -1,   157,   158,    -1,   160,   161,   162,   163,
-     164,   165,    -1,    -1,   168,   169,   170,   171,   172,    -1,
-      -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,   183,
-      -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,
-     194,   195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,
-      -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,
-      -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,   223,
-     224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,
-      -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,
-     244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,
-      -1,    -1,   256,    -1,    -1,   259,   260,    -1,    -1,    -1,
-      -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,
-     274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,   299,   300,    -1,   302,   303,
-     304,    -1,   306,   307,   308,   309,    -1,   311,   312,    -1,
-      -1,    -1,    -1,   317,   318,   319,   320,   321,   322,    -1,
-      -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,   333,
-     334,   335,   336,   337,   338,   339,   340,    -1,    -1,   343,
-     344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,
-     354,   355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,
-      -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,
-     384,    -1,   386,   387,   388,   389,   390,   391,   392,   393,
-     394,   395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,
-     404,   405,   406,   407,   408,    -1,   410,   411,   412,    -1,
-      -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,   423,
-      -1,    -1,   426,   427,   428,   429,   430,    -1,   432,   433,
-      -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,
-     444,   445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,
-     454,   455,   456,   457,   458,   459,   460,   461,   462,   463,
-     464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,
-     474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,
-     484,   485,   486,   487,    -1,   489,   490,   491,   492,   493,
-      -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,
-     504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,
-     514,   515,   516,   517,    -1,    -1,   520,   521,    -1,   523,
-     524,   525,   526,   527,   528,    -1,    -1,   531,   532,   533,
-     534,    -1,   536,   537,    -1,    -1,   540,   541,   542,   543,
-      -1,    -1,   546,   547,    -1,   549,   550,   551,   552,    -1,
-      -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,
-     564,   565,   566,    -1,   568,   569,    -1,   571,   572,    -1,
-     574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,
-      -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,
-      -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,
-     604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,
-     614,   615,   616,    -1,    -1,   619,    -1,    -1,    -1,     5,
-      -1,     7,     8,     9,    10,    11,    -1,    -1,    14,    -1,
-      -1,    -1,    18,   637,   638,    21,    -1,    23,    24,    25,
-      26,    27,    28,    -1,    30,    -1,    -1,    -1,    34,    -1,
-      -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,
-      -1,    47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,
-      -1,    57,    58,    -1,    60,    -1,    62,    63,    64,    65,
-      66,    67,    -1,    69,    70,    -1,    72,    73,    74,    75,
-      76,    77,    78,    79,    80,    -1,    82,    83,    -1,    85,
-      86,    87,    88,    89,    -1,    -1,    -1,    93,    -1,    -1,
-      96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,
-     106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,
-     116,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,
-      -1,    -1,   128,    -1,   130,   131,   132,   133,   134,    -1,
-      -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,
-      -1,   147,    -1,   149,   150,    -1,   152,   153,   154,    -1,
-      -1,   157,   158,    -1,   160,   161,   162,   163,   164,   165,
-      -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,   175,
-     176,    -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,
-      -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,   195,
-     196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,
-     206,    -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,
-     216,   217,   218,   219,    -1,    -1,   222,   223,   224,    -1,
-      -1,   227,    -1,    -1,    -1,    -1,   232,   233,    -1,    -1,
-      -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,
-      -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,
-     256,    -1,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,
-     266,   267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,   299,   300,    -1,   302,   303,   304,    -1,
-     306,   307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,
-      -1,   317,   318,   319,   320,   321,   322,    -1,    -1,   325,
-     326,    -1,   328,    -1,   330,    -1,   332,   333,   334,   335,
-     336,   337,   338,   339,   340,    -1,    -1,   343,   344,    -1,
-      -1,   347,   348,   349,   350,    -1,    -1,    -1,   354,   355,
-      -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,
-     366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,
-     386,   387,   388,   389,   390,   391,   392,   393,   394,   395,
-      -1,    -1,   398,   399,   400,    -1,   402,    -1,   404,   405,
-     406,   407,   408,    -1,   410,   411,   412,    -1,    -1,   415,
-      -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,
-     426,   427,   428,   429,   430,    -1,   432,   433,    -1,   435,
-     436,   437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,
-      -1,   447,   448,   449,    -1,   451,    -1,    -1,   454,   455,
-     456,   457,   458,   459,   460,   461,   462,   463,   464,    -1,
-     466,   467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,
-      -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,
-     486,   487,    -1,   489,   490,   491,   492,   493,    -1,    -1,
-      -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,
-     506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,
-     516,   517,    -1,    -1,   520,   521,    -1,   523,   524,   525,
-     526,   527,   528,    -1,    -1,   531,   532,   533,   534,    -1,
-     536,   537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,
-     546,   547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,
-      -1,    -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,
-     566,    -1,   568,   569,    -1,   571,   572,    -1,   574,   575,
-      -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,
-     586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,
-     596,    -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,
-      -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,
-     616,    -1,    -1,   619,    -1,     5,    -1,     7,     8,     9,
-      10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,
-      -1,    21,   638,    23,    24,    25,    26,    27,    28,    -1,
-      30,    -1,    -1,    -1,    34,    -1,    -1,    -1,    38,    -1,
-      -1,    41,    42,    43,    -1,    45,    -1,    47,    48,    -1,
-      -1,    51,    -1,    -1,    54,    55,    -1,    57,    58,    -1,
-      60,    -1,    62,    63,    64,    65,    66,    67,    -1,    69,
-      70,    -1,    72,    73,    74,    75,    76,    77,    78,    79,
-      80,    -1,    82,    83,    -1,    85,    86,    87,    88,    89,
-      -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,
-      -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,
-     110,    -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,
-      -1,   121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,
-     130,   131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,
-      -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,
-     150,    -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,
-     160,   161,   162,   163,   164,   165,    -1,    -1,   168,   169,
-     170,   171,   172,    -1,    -1,   175,   176,    -1,   178,   179,
-     180,    -1,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,
-     190,    -1,   192,    -1,   194,   195,   196,   197,    -1,   199,
-      -1,   201,    -1,    -1,    -1,   205,   206,    -1,   208,    -1,
-      -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,   219,
-      -1,    -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,
-      -1,    -1,   232,   233,    -1,    -1,    -1,   237,    -1,    -1,
-      -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,
-      -1,    -1,   252,   253,    -1,    -1,   256,    -1,    -1,   259,
-     260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,
-      -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   282,    -1,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,   299,
-     300,    -1,   302,   303,   304,    -1,   306,   307,   308,   309,
-      -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,
-     320,   321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,
-     330,    -1,   332,   333,   334,   335,   336,   337,   338,   339,
-     340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,
-     350,    -1,    -1,    -1,   354,   355,    -1,    -1,    -1,   359,
-      -1,   361,   362,   363,    -1,   365,   366,   367,    -1,   369,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,
-     380,   381,    -1,   383,   384,    -1,   386,   387,   388,   389,
-     390,   391,   392,   393,   394,   395,    -1,    -1,   398,   399,
-     400,    -1,   402,    -1,   404,   405,   406,   407,   408,    -1,
-     410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,
-     420,   421,   422,   423,    -1,    -1,   426,   427,   428,   429,
-     430,    -1,   432,   433,    -1,   435,   436,   437,    -1,    -1,
-     440,    -1,   442,    -1,   444,   445,    -1,   447,   448,   449,
-      -1,   451,    -1,    -1,   454,   455,   456,   457,   458,   459,
-     460,   461,   462,   463,   464,    -1,   466,   467,    -1,    -1,
-      -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,
-      -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,   489,
-     490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,
-     500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,
-      -1,    -1,   512,   513,   514,   515,   516,   517,    -1,    -1,
-     520,   521,    -1,   523,   524,   525,   526,   527,   528,    -1,
-      -1,   531,   532,   533,   534,    -1,   536,   537,    -1,    -1,
-     540,   541,   542,   543,    -1,    -1,   546,   547,    -1,   549,
-     550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,
-      -1,    -1,    -1,   563,   564,   565,   566,    -1,   568,   569,
-      -1,   571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,
-      -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,    -1,
-      -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,
-     600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,
-      -1,   611,   612,    -1,   614,   615,   616,    -1,    -1,   619,
-      -1,     5,    -1,     7,     8,     9,    10,    11,    -1,    -1,
-      14,    -1,    -1,    -1,    18,    -1,    -1,    21,   638,    23,
-      24,    25,    26,    27,    28,    -1,    30,    -1,    -1,    -1,
-      34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,
-      -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,
-      54,    55,    -1,    57,    58,    -1,    60,    -1,    62,    63,
-      64,    65,    66,    67,    -1,    69,    70,    -1,    72,    73,
-      74,    75,    76,    77,    78,    79,    80,    -1,    82,    83,
-      -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,    93,
-      -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,
-      -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,
-      -1,   115,   116,    -1,    -1,    -1,    -1,   121,   122,    -1,
-     124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,
-     134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,
-      -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,
-     154,    -1,    -1,   157,   158,    -1,   160,   161,   162,   163,
-     164,   165,    -1,    -1,   168,   169,   170,   171,   172,    -1,
-      -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,   183,
-      -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,
-     194,   195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,
-      -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,
-      -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,   223,
-     224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,
-      -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,
-     244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,
-      -1,    -1,   256,    -1,    -1,   259,   260,    -1,    -1,    -1,
-      -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,
-     274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,   299,   300,    -1,   302,   303,
-     304,    -1,   306,   307,   308,   309,    -1,   311,   312,    -1,
-      -1,    -1,    -1,   317,   318,   319,   320,   321,   322,    -1,
-      -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,   333,
-     334,   335,   336,   337,   338,   339,   340,    -1,    -1,   343,
-     344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,
-     354,   355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,
-      -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,
-     384,    -1,   386,   387,   388,   389,   390,   391,   392,   393,
-     394,   395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,
-     404,   405,   406,   407,   408,    -1,   410,   411,   412,    -1,
-      -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,   423,
-      -1,    -1,   426,   427,   428,   429,   430,    -1,   432,   433,
-      -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,
-     444,   445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,
-     454,   455,   456,   457,   458,   459,   460,   461,   462,   463,
-     464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,
-     474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,
-     484,   485,   486,   487,    -1,   489,   490,   491,   492,   493,
-      -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,
-     504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,
-     514,   515,   516,   517,    -1,    -1,   520,   521,    -1,   523,
-     524,   525,   526,   527,   528,    -1,    -1,   531,   532,   533,
-     534,    -1,   536,   537,    -1,    -1,   540,   541,   542,   543,
-      -1,    -1,   546,   547,    -1,   549,   550,   551,   552,    -1,
-      -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,
-     564,   565,   566,    -1,   568,   569,    -1,   571,   572,    -1,
-     574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,
-      -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,
-      -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,
-     604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,
-     614,   615,   616,    -1,    -1,   619,    -1,     5,    -1,     7,
-       8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,
-      18,    -1,    -1,    21,   638,    23,    24,    25,    26,    27,
-      28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,    -1,
-      38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,    47,
-      48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,    57,
-      58,    -1,    60,    -1,    62,    63,    64,    65,    66,    67,
-      -1,    69,    70,    -1,    72,    73,    74,    75,    76,    77,
-      78,    79,    80,    -1,    82,    83,    -1,    85,    86,    87,
-      88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,
-      98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,
-      -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,    -1,
-      -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,    -1,
-     128,    -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,
-     138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,
-      -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,   157,
-     158,    -1,   160,   161,   162,   163,   164,   165,    -1,    -1,
-     168,   169,   170,   171,   172,    -1,    -1,   175,   176,    -1,
-     178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,   187,
-     188,    -1,   190,    -1,   192,    -1,   194,   195,   196,   197,
-      -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,    -1,
-     208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,   217,
-     218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,   227,
-      -1,    -1,    -1,    -1,   232,   233,    -1,    -1,    -1,   237,
-      -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,
-      -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,
-      -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,
-      -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,   299,   300,    -1,   302,   303,   304,    -1,   306,   307,
-     308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,
-     318,   319,   320,   321,   322,    -1,    -1,   325,   326,    -1,
-     328,    -1,   330,    -1,   332,   333,   334,   335,   336,   337,
-     338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,
-     348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,    -1,
-      -1,   359,    -1,   361,   362,   363,    -1,   365,   366,   367,
-      -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   379,   380,   381,    -1,   383,   384,    -1,   386,   387,
-     388,   389,   390,   391,   392,   393,   394,   395,    -1,    -1,
-     398,   399,   400,    -1,   402,    -1,   404,   405,   406,   407,
-     408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,
-      -1,   419,   420,   421,   422,   423,    -1,    -1,   426,   427,
-     428,   429,   430,    -1,   432,   433,    -1,   435,   436,   437,
-      -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,   447,
-     448,   449,    -1,   451,    -1,    -1,   454,   455,   456,   457,
-     458,   459,   460,   461,   462,   463,   464,    -1,   466,   467,
-      -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,
-     478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,
-      -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,
-      -1,   499,   500,   501,    -1,   503,   504,    -1,   506,    -1,
-      -1,   509,    -1,    -1,   512,   513,   514,   515,   516,   517,
-      -1,    -1,   520,   521,    -1,   523,   524,   525,   526,   527,
-     528,    -1,    -1,   531,   532,   533,   534,    -1,   536,   537,
-      -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,   547,
-      -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,
-     558,   559,    -1,    -1,    -1,   563,   564,   565,   566,    -1,
-     568,   569,    -1,   571,   572,    -1,   574,   575,    -1,    -1,
-     578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,
-      -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,
-      -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,    -1,
-      -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,
-      -1,   619,    -1,     5,    -1,     7,     8,     9,    10,    11,
-      -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,
-     638,    23,    24,    25,    26,    27,    28,    -1,    30,    -1,
-      -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,
-      42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,
-      -1,    -1,    54,    55,    -1,    57,    58,    59,    60,    -1,
-      62,    63,    64,    65,    66,    67,    -1,    69,    70,    -1,
-      72,    73,    74,    75,    76,    77,    78,    79,    80,    -1,
-      82,    83,    -1,    85,    86,    87,    88,    89,    -1,    -1,
-      -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,
-      -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,
-      -1,    -1,    -1,   115,   116,    -1,    -1,    -1,   120,   121,
-     122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,
-     132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,
-     142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,
-     152,   153,   154,    -1,    -1,   157,   158,    -1,   160,   161,
-     162,   163,   164,   165,    -1,    -1,   168,   169,   170,   171,
-     172,    -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,
-      -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,
-     192,    -1,   194,   195,   196,   197,    -1,   199,    -1,   201,
-      -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,
-     212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,
-     222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,
-     232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,
-     242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,
-     252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,    -1,
-      -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,
-      -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     282,    -1,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,   299,   300,    -1,
-     302,   303,   304,    -1,   306,   307,   308,   309,    -1,   311,
-     312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,
-     322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,
-     332,   333,   334,   335,   336,   337,   338,   339,   340,    -1,
-      -1,   343,   344,    -1,    -1,   347,   348,   349,   350,    -1,
-      -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,
-     362,   363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,
-      -1,   383,   384,    -1,   386,   387,   388,   389,   390,   391,
-     392,   393,   394,   395,    -1,    -1,   398,   399,   400,    -1,
-     402,    -1,   404,   405,   406,   407,   408,    -1,   410,   411,
-     412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,
-     422,   423,    -1,    -1,   426,   427,   428,   429,   430,    -1,
-     432,   433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,
-     442,    -1,   444,   445,    -1,   447,   448,   449,    -1,   451,
-      -1,    -1,   454,   455,   456,   457,   458,   459,   460,   461,
-     462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,
-     472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,
-     482,    -1,   484,   485,   486,   487,    -1,   489,   490,   491,
-     492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,
-      -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,
-     512,   513,   514,   515,   516,   517,    -1,    -1,   520,   521,
-      -1,   523,   524,   525,   526,   527,   528,    -1,    -1,   531,
-     532,   533,   534,    -1,   536,   537,    -1,    -1,   540,   541,
-     542,   543,    -1,    -1,   546,   547,    -1,   549,   550,   551,
-     552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,
-      -1,   563,   564,   565,   566,    -1,   568,   569,    -1,   571,
-     572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,
-      -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,
-      -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,
-     602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,
-     612,    -1,   614,   615,   616,    -1,    -1,   619,     5,    -1,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    21,   637,    23,    24,    25,    26,
-      27,    28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,
-      -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,
-      47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,
-      57,    58,    -1,    60,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,
-      -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,
-     107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,
-      -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,   165,    -1,
-      -1,   168,   169,   170,   171,   172,    -1,    -1,   175,   176,
-      -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,
-     187,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,
-      -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,    -1,   232,   233,    -1,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,
-      -1,    -1,   259,   260,   261,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,    -1,   306,
-     307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-      -1,   328,    -1,   330,    -1,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,
-     347,   348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,
-      -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,   395,    -1,
-      -1,   398,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,   433,    -1,   435,   436,
-     437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,
-     447,   448,   449,    -1,   451,    -1,    -1,   454,   455,   456,
-     457,   458,   459,   460,   461,   462,   463,   464,    -1,   466,
-     467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,
-     487,    -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,   516,
-     517,    -1,    -1,   520,   521,    -1,   523,   524,   525,   526,
-     527,   528,    -1,    -1,   531,   532,   533,   534,    -1,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,   545,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,   566,
-      -1,   568,   569,    -1,   571,   572,    -1,   574,   575,    -1,
-      -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,
-      -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,
-      -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,
-      -1,    -1,   619,     5,    -1,     7,     8,     9,    10,    11,
-      -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,
-     637,    23,    24,    25,    26,    27,    28,    -1,    30,    -1,
-      -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,
-      42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,
-      -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,
-      62,    63,    64,    65,    66,    67,    -1,    69,    70,    -1,
-      72,    73,    74,    75,    76,    77,    78,    79,    80,    -1,
-      82,    83,    -1,    85,    86,    87,    88,    89,    -1,    -1,
-      -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,
-      -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,
-      -1,    -1,    -1,   115,   116,    -1,    -1,    -1,    -1,   121,
-     122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,
-     132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,
-     142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,
-     152,   153,   154,    -1,    -1,   157,   158,    -1,   160,   161,
-     162,   163,   164,   165,    -1,    -1,   168,   169,   170,   171,
-     172,    -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,
-      -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,
-     192,    -1,   194,   195,   196,   197,    -1,   199,    -1,   201,
-      -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,
-     212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,
-     222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,
-     232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,
-     242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,
-     252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,   261,
-      -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,
-      -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     282,    -1,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,   299,   300,    -1,
-     302,   303,   304,    -1,   306,   307,   308,   309,    -1,   311,
-     312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,
-     322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,
-     332,   333,   334,   335,   336,   337,   338,   339,   340,    -1,
-      -1,   343,   344,    -1,    -1,   347,   348,   349,   350,    -1,
-      -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,
-     362,   363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,
-      -1,   383,   384,    -1,   386,   387,   388,   389,   390,   391,
-     392,   393,   394,   395,    -1,    -1,   398,   399,   400,    -1,
-     402,    -1,   404,   405,   406,   407,   408,    -1,   410,   411,
-     412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,
-     422,   423,    -1,    -1,   426,   427,   428,   429,   430,    -1,
-     432,   433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,
-     442,    -1,   444,   445,    -1,   447,   448,   449,    -1,   451,
-      -1,    -1,   454,   455,   456,   457,   458,   459,   460,   461,
-     462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,
-     472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,
-     482,    -1,   484,   485,   486,   487,    -1,   489,   490,   491,
-     492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,
-      -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,
-     512,   513,   514,   515,   516,   517,    -1,    -1,   520,   521,
-      -1,   523,   524,   525,   526,   527,   528,    -1,    -1,   531,
-     532,   533,   534,    -1,   536,   537,    -1,    -1,   540,   541,
-     542,   543,    -1,   545,   546,   547,    -1,   549,   550,   551,
-     552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,
-      -1,   563,   564,   565,   566,    -1,   568,   569,    -1,   571,
-     572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,
-      -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,
-      -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,
-     602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,
-     612,    -1,   614,   615,   616,    -1,    -1,   619,     5,    -1,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    21,   637,    23,    24,    25,    26,
-      27,    28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,
-      -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,
-      47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,
-      57,    58,    59,    60,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,
-      -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,
-     107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,
-      -1,    -1,    -1,   120,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,   165,    -1,
-      -1,   168,   169,   170,   171,   172,    -1,    -1,   175,   176,
-      -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,
-     187,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,
-      -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,    -1,   232,   233,    -1,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,
-      -1,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,    -1,   306,
-     307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-      -1,   328,    -1,   330,    -1,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,
-     347,   348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,
-      -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,   395,    -1,
-      -1,   398,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,   433,    -1,   435,   436,
-     437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,
-     447,   448,   449,    -1,   451,    -1,    -1,   454,   455,   456,
-     457,   458,   459,   460,   461,   462,   463,   464,    -1,   466,
-     467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,
-     487,    -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,   516,
-     517,    -1,    -1,   520,   521,    -1,   523,   524,   525,   526,
-     527,   528,    -1,    -1,   531,   532,   533,   534,    -1,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,   566,
-      -1,   568,   569,    -1,   571,   572,    -1,   574,   575,    -1,
-      -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,
-      -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,
-      -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,
-      -1,    -1,   619,     5,    -1,     7,     8,     9,    10,    11,
-      -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,
-     637,    23,    24,    25,    26,    27,    28,    -1,    30,    -1,
-      -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,
-      42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,
-      -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,
-      62,    63,    64,    65,    66,    67,    -1,    69,    70,    -1,
-      72,    73,    74,    75,    76,    77,    78,    79,    80,    -1,
-      82,    83,    -1,    85,    86,    87,    88,    89,    -1,    -1,
-      -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,
-      -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,
-      -1,    -1,    -1,   115,   116,    -1,    -1,    -1,    -1,   121,
-     122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,
-     132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,
-     142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,
-     152,   153,   154,    -1,    -1,   157,   158,    -1,   160,   161,
-     162,   163,   164,   165,    -1,    -1,   168,   169,   170,   171,
-     172,    -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,
-      -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,
-     192,    -1,   194,   195,   196,   197,    -1,   199,    -1,   201,
-      -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,
-     212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,
-     222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,
-     232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,
-     242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,
-     252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,   261,
-      -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,
-      -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     282,    -1,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,   299,   300,    -1,
-     302,   303,   304,    -1,   306,   307,   308,   309,    -1,   311,
-     312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,
-     322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,
-     332,   333,   334,   335,   336,   337,   338,   339,   340,    -1,
-      -1,   343,   344,    -1,    -1,   347,   348,   349,   350,    -1,
-      -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,
-     362,   363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,
-      -1,   383,   384,    -1,   386,   387,   388,   389,   390,   391,
-     392,   393,   394,   395,    -1,    -1,   398,   399,   400,    -1,
-     402,    -1,   404,   405,   406,   407,   408,    -1,   410,   411,
-     412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,
-     422,   423,    -1,    -1,   426,   427,   428,   429,   430,    -1,
-     432,   433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,
-     442,    -1,   444,   445,    -1,   447,   448,   449,    -1,   451,
-      -1,    -1,   454,   455,   456,   457,   458,   459,   460,   461,
-     462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,
-     472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,
-     482,    -1,   484,   485,   486,   487,    -1,   489,   490,   491,
-     492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,
-      -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,
-     512,   513,   514,   515,   516,   517,    -1,    -1,   520,   521,
-      -1,   523,   524,   525,   526,   527,   528,    -1,    -1,   531,
-     532,   533,   534,    -1,   536,   537,    -1,    -1,   540,   541,
-     542,   543,    -1,   545,   546,   547,    -1,   549,   550,   551,
-     552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,
-      -1,   563,   564,   565,   566,    -1,   568,   569,    -1,   571,
-     572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,
-      -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,
-      -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,
-     602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,
-     612,    -1,   614,   615,   616,    -1,    -1,   619,     5,    -1,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    21,   637,    23,    24,    25,    26,
-      27,    28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,
-      -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,
-      47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,
-      57,    58,    -1,    60,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    81,    82,    83,    -1,    85,    86,
-      87,    88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,
-      -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,
-     107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,
-      -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,   165,    -1,
-      -1,   168,   169,   170,   171,   172,    -1,    -1,   175,   176,
-      -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,
-     187,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,
-      -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,    -1,   232,   233,    -1,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,
-      -1,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,    -1,   306,
-     307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-      -1,   328,    -1,   330,    -1,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,
-     347,   348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,
-      -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,   395,    -1,
-      -1,   398,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,   433,    -1,   435,   436,
-     437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,
-     447,   448,   449,    -1,   451,    -1,    -1,   454,   455,   456,
-     457,   458,   459,   460,   461,   462,   463,   464,    -1,   466,
-     467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,
-     487,    -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,   516,
-     517,    -1,    -1,   520,   521,    -1,   523,   524,   525,   526,
-     527,   528,    -1,    -1,   531,   532,   533,   534,    -1,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,   566,
-      -1,   568,   569,    -1,   571,   572,    -1,   574,   575,    -1,
-      -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,
-      -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,
-      -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,
-      -1,    -1,   619,     5,    -1,     7,     8,     9,    10,    11,
-      -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,
-     637,    23,    24,    25,    26,    27,    28,    -1,    30,    -1,
-      -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,
-      42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,
-      -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,
-      62,    63,    64,    65,    66,    67,    -1,    69,    70,    -1,
-      72,    73,    74,    75,    76,    77,    78,    79,    80,    -1,
-      82,    83,    -1,    85,    86,    87,    88,    89,    -1,    -1,
-      -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,
-      -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,
-      -1,    -1,    -1,   115,   116,    -1,    -1,    -1,    -1,   121,
-     122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,
-     132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,
-     142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,
-     152,   153,   154,    -1,    -1,   157,   158,    -1,   160,   161,
-     162,   163,   164,   165,    -1,    -1,   168,   169,   170,   171,
-     172,    -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,
-      -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,
-     192,    -1,   194,   195,   196,   197,    -1,   199,    -1,   201,
-      -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,
-     212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,
-     222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,
-     232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,
-     242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,
-     252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,    -1,
-      -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,
-      -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     282,    -1,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,   299,   300,    -1,
-     302,   303,   304,    -1,   306,   307,   308,   309,    -1,   311,
-     312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,
-     322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,
-     332,   333,   334,   335,   336,   337,   338,   339,   340,    -1,
-      -1,   343,   344,    -1,    -1,   347,   348,   349,   350,    -1,
-      -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,
-     362,   363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,
-      -1,   383,   384,    -1,   386,   387,   388,   389,   390,   391,
-     392,   393,   394,   395,    -1,    -1,   398,   399,   400,    -1,
-     402,    -1,   404,   405,   406,   407,   408,    -1,   410,   411,
-     412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,
-     422,   423,    -1,    -1,   426,   427,   428,   429,   430,    -1,
-     432,   433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,
-     442,    -1,   444,   445,    -1,   447,   448,   449,    -1,   451,
-      -1,    -1,   454,   455,   456,   457,   458,   459,   460,   461,
-     462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,
-     472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,
-     482,    -1,   484,   485,   486,   487,    -1,   489,   490,   491,
-     492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,
-      -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,
-     512,   513,   514,   515,   516,   517,    -1,    -1,   520,   521,
-      -1,   523,   524,   525,   526,   527,   528,    -1,    -1,   531,
-     532,   533,   534,    -1,   536,   537,    -1,    -1,   540,   541,
-     542,   543,    -1,    -1,   546,   547,    -1,   549,   550,   551,
-     552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,
-      -1,   563,   564,   565,   566,    -1,   568,   569,    -1,   571,
-     572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,
-      -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,
-      -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,
-     602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,
-     612,    -1,   614,   615,   616,    -1,    -1,   619,     5,    -1,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    -1,   637,    23,    24,    25,    26,
-      27,    -1,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,
-      -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,
-      -1,    -1,    -1,    -1,    51,    52,    -1,    54,    55,    -1,
-      57,    -1,    -1,    -1,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    -1,    75,    -1,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    -1,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,
-      -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,
-     107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,    -1,
-      -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,    -1,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,    -1,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,    -1,    -1,
-      -1,   168,   169,   170,   171,   172,    -1,    -1,   175,   176,
-     177,   178,   179,   180,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,    -1,    -1,    -1,   206,
-      -1,    -1,    -1,    -1,    -1,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,   220,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,    -1,   232,    -1,    -1,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,   246,
-      -1,    -1,   249,    -1,    -1,    -1,   253,    -1,    -1,   256,
-     257,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-      -1,    -1,   279,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,    -1,   306,
-     307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-      -1,   328,    -1,   330,    -1,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,
-     347,   348,   349,   350,    -1,    -1,    -1,    -1,   355,    -1,
-      -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   380,   381,    -1,    -1,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,    -1,    -1,
-      -1,    -1,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,    -1,    -1,   435,    -1,
-     437,   438,    -1,   440,    -1,    -1,    -1,   444,    -1,    -1,
-     447,   448,   449,   450,   451,    -1,    -1,    -1,   455,   456,
-     457,   458,   459,   460,   461,    -1,   463,   464,    -1,   466,
-      -1,    -1,    -1,    -1,   471,   472,   473,    -1,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,    -1,   485,    -1,
-     487,    -1,   489,    -1,    -1,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,    -1,   514,   515,   516,
-     517,    -1,    -1,    -1,   521,    -1,   523,   524,   525,   526,
-     527,   528,    -1,    -1,   531,   532,   533,   534,    -1,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,    -1,    -1,    -1,   564,   565,   566,
-      -1,   568,   569,    -1,   571,   572,    -1,    -1,    -1,    -1,
-      -1,   578,    -1,    -1,   581,    -1,    -1,    -1,   585,   586,
-      -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,
-      -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,
-     607,    -1,    -1,    -1,   611,    -1,    -1,   614,    -1,   616,
-      -1,     5,   619,     7,     8,     9,    10,    11,    -1,    -1,
-      14,    -1,    -1,    -1,    18,   632,    -1,    21,    -1,    23,
-      24,    25,    26,    27,    28,    -1,    30,    -1,    -1,    -1,
-      34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,
-      -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,
-      54,    55,    -1,    57,    58,    -1,    60,    -1,    62,    63,
-      64,    65,    66,    67,    -1,    69,    70,    -1,    72,    73,
-      74,    75,    76,    77,    78,    79,    80,    -1,    82,    83,
-      -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,    93,
-      -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,
-      -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,
-      -1,   115,   116,    -1,    -1,    -1,    -1,   121,   122,    -1,
-     124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,
-     134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,
-      -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,
-     154,    -1,    -1,   157,   158,    -1,   160,   161,   162,   163,
-     164,   165,    -1,    -1,   168,   169,   170,   171,   172,    -1,
-      -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,   183,
-      -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,
-     194,   195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,
-      -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,
-      -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,   223,
-     224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,
-      -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,
-     244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,
-      -1,    -1,   256,    -1,    -1,   259,   260,    -1,    -1,    -1,
-      -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,
-     274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,   299,   300,    -1,   302,   303,
-     304,    -1,   306,   307,   308,   309,    -1,   311,   312,    -1,
-      -1,    -1,    -1,   317,   318,   319,   320,   321,   322,    -1,
-      -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,   333,
-     334,   335,   336,   337,   338,   339,   340,    -1,    -1,   343,
-     344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,
-     354,   355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,
-      -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,
-     384,    -1,   386,   387,   388,   389,   390,   391,   392,   393,
-     394,   395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,
-     404,   405,   406,   407,   408,    -1,   410,   411,   412,    -1,
-      -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,   423,
-      -1,    -1,   426,   427,   428,   429,   430,    -1,   432,   433,
-      -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,
-     444,   445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,
-     454,   455,   456,   457,   458,   459,   460,   461,   462,   463,
-     464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,
-     474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,
-     484,   485,   486,   487,    -1,   489,   490,   491,   492,   493,
-      -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,
-     504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,
-     514,   515,   516,   517,    -1,    -1,   520,   521,    -1,   523,
-     524,   525,   526,   527,   528,    -1,    -1,   531,   532,   533,
-     534,    -1,   536,   537,    -1,    -1,   540,   541,   542,   543,
-      -1,    -1,   546,   547,    -1,   549,   550,   551,   552,    -1,
-      -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,
-     564,   565,   566,    -1,   568,   569,    -1,   571,   572,    -1,
-     574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,
-      -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,
-      -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,
-     604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,
-     614,   615,   616,    -1,     5,   619,     7,     8,     9,    10,
-      11,   625,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,
-      21,    -1,    23,    24,    25,    26,    27,    28,    -1,    30,
-      -1,    -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,
-      41,    42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,
-      51,    -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,
-      -1,    62,    63,    64,    65,    66,    67,    -1,    69,    70,
-      -1,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-      -1,    82,    83,    -1,    85,    86,    87,    88,    89,    -1,
-      -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,
-     101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,
-      -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,    -1,
-     121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,
-     131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,
-     141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,
-      -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,   160,
-     161,   162,   163,   164,   165,    -1,    -1,   168,   169,   170,
-     171,   172,    -1,    -1,   175,   176,    -1,   178,   179,   180,
-      -1,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,
-      -1,   192,    -1,   194,   195,   196,   197,    -1,   199,    -1,
-     201,    -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,
-     211,   212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,
-      -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,
-      -1,   232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,
-     241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,
-      -1,   252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,
-      -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,
-     271,    -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   282,    -1,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
-      -1,   302,   303,   304,    -1,   306,   307,   308,   309,    -1,
-     311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,
-     321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,
-      -1,   332,   333,   334,   335,   336,   337,   338,   339,   340,
-      -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,   350,
-      -1,    -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,
-     361,   362,   363,    -1,   365,   366,   367,    -1,   369,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,
-     381,    -1,   383,   384,    -1,   386,   387,   388,   389,   390,
-     391,   392,   393,   394,   395,    -1,    -1,   398,   399,   400,
-      -1,   402,    -1,   404,   405,   406,   407,   408,    -1,   410,
-     411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,
-     421,   422,   423,    -1,    -1,   426,   427,   428,   429,   430,
-      -1,   432,   433,    -1,   435,   436,   437,    -1,    -1,   440,
-      -1,   442,    -1,   444,   445,    -1,   447,   448,   449,    -1,
-     451,    -1,    -1,   454,   455,   456,   457,   458,   459,   460,
-     461,   462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,
-     471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,
-      -1,   482,    -1,   484,   485,   486,   487,    -1,   489,   490,
-     491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,
-     501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,
-      -1,   512,   513,   514,   515,   516,   517,    -1,    -1,   520,
-     521,    -1,   523,   524,   525,   526,   527,   528,    -1,    -1,
-     531,   532,   533,   534,    -1,   536,   537,    -1,    -1,   540,
-     541,   542,   543,    -1,    -1,   546,   547,    -1,   549,   550,
-     551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,
-      -1,    -1,   563,   564,   565,   566,    -1,   568,   569,    -1,
-     571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,
-     581,    -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,
-      -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,
-     601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,
-     611,   612,    -1,   614,   615,   616,    -1,     5,   619,     7,
-       8,     9,    10,    11,   625,    -1,    14,    -1,    -1,    -1,
-      18,    -1,    -1,    21,    -1,    23,    24,    25,    26,    27,
-      28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,    -1,
-      38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,    47,
-      48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,    57,
-      58,    -1,    60,    -1,    62,    63,    64,    65,    66,    67,
-      -1,    69,    70,    -1,    72,    73,    74,    75,    76,    77,
-      78,    79,    80,    -1,    82,    83,    -1,    85,    86,    87,
-      88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,
-      98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,
-      -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,    -1,
-      -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,    -1,
-     128,    -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,
-     138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,
-      -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,   157,
-     158,    -1,   160,   161,   162,   163,   164,   165,    -1,    -1,
-     168,   169,   170,   171,   172,    -1,    -1,   175,   176,    -1,
-     178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,   187,
-     188,    -1,   190,    -1,   192,    -1,   194,   195,   196,   197,
-      -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,    -1,
-     208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,   217,
-     218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,   227,
-      -1,    -1,    -1,    -1,   232,   233,    -1,    -1,    -1,   237,
-      -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,
-      -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,
-      -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,
-      -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,   299,   300,    -1,   302,   303,   304,    -1,   306,   307,
-     308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,
-     318,   319,   320,   321,   322,    -1,    -1,   325,   326,    -1,
-     328,    -1,   330,    -1,   332,   333,   334,   335,   336,   337,
-     338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,
-     348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,    -1,
-      -1,   359,    -1,   361,   362,   363,    -1,   365,   366,   367,
-      -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   379,   380,   381,    -1,   383,   384,    -1,   386,   387,
-     388,   389,   390,   391,   392,   393,   394,   395,    -1,    -1,
-     398,   399,   400,    -1,   402,    -1,   404,   405,   406,   407,
-     408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,
-      -1,   419,   420,   421,   422,   423,    -1,    -1,   426,   427,
-     428,   429,   430,    -1,   432,   433,    -1,   435,   436,   437,
-      -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,   447,
-     448,   449,    -1,   451,    -1,    -1,   454,   455,   456,   457,
-     458,   459,   460,   461,   462,   463,   464,    -1,   466,   467,
-      -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,
-     478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,
-      -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,
-      -1,   499,   500,   501,    -1,   503,   504,    -1,   506,    -1,
-      -1,   509,    -1,    -1,   512,   513,   514,   515,   516,   517,
-      -1,    -1,   520,   521,    -1,   523,   524,   525,   526,   527,
-     528,    -1,    -1,   531,   532,   533,   534,    -1,   536,   537,
-      -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,   547,
-      -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,
-     558,   559,    -1,    -1,    -1,   563,   564,   565,   566,    -1,
-     568,   569,    -1,   571,   572,    -1,   574,   575,    -1,    -1,
-     578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,
-      -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,
-      -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,    -1,
-      -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,
-       5,   619,     7,     8,     9,    10,    11,   625,    -1,    14,
-      -1,    -1,    -1,    18,    -1,    -1,    21,    -1,    23,    24,
-      25,    26,    27,    28,    -1,    30,    -1,    -1,    -1,    34,
-      -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,
-      45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,    54,
-      55,    -1,    57,    58,    -1,    60,    -1,    62,    63,    64,
-      65,    66,    67,    -1,    69,    70,    -1,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    -1,    82,    83,    -1,
-      85,    86,    87,    88,    89,    -1,    -1,    -1,    93,    -1,
-      -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,
-     105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,
-     115,   116,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-      -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,
-      -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,   154,
-      -1,    -1,   157,   158,    -1,   160,   161,   162,   163,   164,
-     165,    -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,
-     175,   176,    -1,   178,   179,   180,    -1,    -1,   183,    -1,
-      -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,
-     195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,
-     205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,    -1,
-      -1,   216,   217,   218,   219,    -1,    -1,   222,   223,   224,
-      -1,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,    -1,
-      -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,
-     245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,
-      -1,   256,    -1,    -1,   259,   260,    -1,    -1,    -1,    -1,
-      -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,   274,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,    -1,   302,   303,   304,
-      -1,   306,   307,   308,   309,    -1,   311,   312,    -1,    -1,
-      -1,    -1,   317,   318,   319,   320,   321,   322,    -1,    -1,
-     325,   326,    -1,   328,    -1,   330,    -1,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,    -1,    -1,   343,   344,
-      -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,   354,
-     355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,
-     365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,   384,
-      -1,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,   404,
-     405,   406,   407,   408,    -1,   410,   411,   412,    -1,    -1,
-     415,    -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,
-      -1,   426,   427,   428,   429,   430,    -1,   432,   433,    -1,
-     435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,   444,
-     445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-      -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,   474,
-      -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,
-     485,   486,   487,    -1,   489,   490,   491,   492,   493,    -1,
-      -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,
-      -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,
-     515,   516,   517,    -1,    -1,   520,   521,    -1,   523,   524,
-     525,   526,   527,   528,    -1,    -1,   531,   532,   533,   534,
-      -1,   536,   537,    -1,    -1,   540,   541,   542,   543,    -1,
-      -1,   546,   547,    -1,   549,   550,   551,   552,    -1,    -1,
-      -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,   564,
-     565,   566,    -1,   568,   569,    -1,   571,   572,    -1,   574,
-     575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,
-     585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,
-      -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,   604,
-      -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,
-     615,   616,    -1,     5,   619,     7,     8,     9,    10,    11,
-     625,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,
-      -1,    23,    24,    25,    26,    27,    28,    -1,    30,    -1,
-      -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,
-      42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,
-      -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,
-      62,    63,    64,    65,    66,    67,    -1,    69,    70,    -1,
-      72,    73,    74,    75,    76,    77,    78,    79,    80,    -1,
-      82,    83,    -1,    85,    86,    87,    88,    89,    -1,    -1,
-      -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,
-      -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,
-      -1,    -1,    -1,   115,   116,   117,    -1,    -1,    -1,   121,
-     122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,
-     132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,
-     142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,
-     152,   153,   154,    -1,    -1,   157,   158,    -1,   160,   161,
-     162,   163,   164,   165,    -1,    -1,   168,   169,   170,   171,
-     172,    -1,    -1,   175,   176,    -1,   178,   179,   180,   181,
-      -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,
-     192,    -1,   194,   195,   196,   197,    -1,   199,    -1,   201,
-      -1,    -1,    -1,   205,   206,    -1,   208,   209,    -1,   211,
-     212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,
-     222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,
-     232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,
-     242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,
-     252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,    -1,
-      -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,
-      -1,   273,   274,    -1,    -1,   277,    -1,    -1,    -1,    -1,
-     282,    -1,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,   299,   300,    -1,
-     302,   303,   304,    -1,   306,   307,   308,   309,    -1,   311,
-     312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,
-     322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,
-     332,   333,   334,   335,   336,   337,   338,   339,   340,    -1,
-      -1,   343,   344,    -1,    -1,   347,   348,   349,   350,   351,
-     352,    -1,   354,   355,    -1,    -1,   358,   359,    -1,   361,
-     362,   363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,
-      -1,   383,   384,    -1,   386,   387,   388,   389,   390,   391,
-     392,   393,   394,   395,    -1,    -1,   398,   399,   400,    -1,
-     402,    -1,   404,   405,   406,   407,   408,    -1,   410,   411,
-     412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,
-     422,   423,    -1,    -1,   426,   427,   428,   429,   430,    -1,
-     432,   433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,
-     442,    -1,   444,   445,    -1,   447,   448,   449,    -1,   451,
-      -1,    -1,   454,   455,   456,   457,   458,   459,   460,   461,
-     462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,
-     472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,
-     482,    -1,   484,   485,   486,   487,    -1,   489,   490,   491,
-     492,   493,    -1,    -1,   496,   497,   498,   499,   500,   501,
-      -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,
-     512,   513,   514,   515,   516,   517,    -1,    -1,   520,   521,
-      -1,   523,   524,   525,   526,   527,   528,    -1,    -1,   531,
-     532,   533,   534,    -1,   536,   537,    -1,    -1,   540,   541,
-     542,   543,    -1,    -1,   546,   547,    -1,   549,   550,   551,
-     552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,
-      -1,   563,   564,   565,   566,   567,   568,   569,    -1,   571,
-     572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,
-      -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,
-      -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,
-     602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,
-     612,    -1,   614,   615,   616,    -1,     5,   619,     7,     8,
-       9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
-      -1,    -1,    21,    -1,    23,    24,    25,    26,    27,    28,
-      -1,    30,    -1,    -1,    33,    34,    -1,    -1,    -1,    38,
-      -1,    -1,    41,    42,    43,    -1,    45,    -1,    47,    48,
-      -1,    -1,    51,    -1,    -1,    54,    55,    -1,    57,    58,
-      -1,    60,    -1,    62,    63,    64,    65,    66,    67,    -1,
-      69,    70,    -1,    72,    73,    74,    75,    76,    77,    78,
-      79,    80,    -1,    82,    83,    -1,    85,    86,    87,    88,
-      89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,
-      -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,
-      -1,   110,    -1,    -1,    -1,    -1,   115,   116,    -1,    -1,
-      -1,   120,   121,   122,    -1,   124,    -1,    -1,    -1,   128,
-      -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,   138,
-      -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,
-     149,   150,    -1,   152,   153,   154,   155,    -1,   157,   158,
-      -1,   160,   161,   162,   163,   164,   165,    -1,    -1,   168,
-     169,   170,   171,   172,    -1,    -1,   175,   176,    -1,   178,
-     179,   180,    -1,    -1,   183,    -1,    -1,    -1,   187,   188,
-      -1,   190,    -1,   192,    -1,   194,   195,   196,   197,    -1,
-     199,    -1,   201,    -1,    -1,    -1,   205,   206,    -1,   208,
-      -1,    -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,
-     219,    -1,    -1,   222,   223,   224,    -1,    -1,   227,    -1,
-      -1,    -1,    -1,   232,   233,    -1,    -1,    -1,   237,    -1,
-      -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,
-     249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,    -1,
-     259,   260,   261,    -1,    -1,    -1,    -1,   266,   267,    -1,
-     269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-     299,   300,    -1,   302,   303,   304,    -1,   306,   307,   308,
-     309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,
-     319,   320,   321,   322,    -1,    -1,   325,   326,    -1,   328,
-      -1,   330,    -1,   332,   333,   334,   335,   336,   337,   338,
-     339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,
-     349,   350,    -1,    -1,    -1,   354,   355,    -1,    -1,    -1,
-     359,    -1,   361,   362,   363,    -1,   365,   366,   367,    -1,
-     369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     379,   380,   381,    -1,   383,   384,    -1,   386,   387,   388,
-     389,   390,   391,   392,   393,   394,   395,    -1,    -1,   398,
-     399,   400,    -1,   402,    -1,   404,   405,   406,   407,   408,
-      -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,
-     419,   420,   421,   422,   423,    -1,    -1,   426,   427,   428,
-     429,   430,    -1,   432,   433,    -1,   435,   436,   437,    -1,
-      -1,   440,    -1,   442,    -1,   444,   445,    -1,   447,   448,
-     449,    -1,   451,    -1,    -1,   454,   455,   456,   457,   458,
-     459,   460,   461,   462,   463,   464,    -1,   466,   467,    -1,
-      -1,    -1,   471,   472,   473,   474,    -1,    -1,   477,   478,
-      -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,
-     489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,
-     499,   500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,
-     509,    -1,    -1,   512,   513,   514,   515,   516,   517,    -1,
-      -1,   520,   521,    -1,   523,   524,   525,   526,   527,   528,
-      -1,    -1,   531,   532,   533,   534,    -1,   536,   537,    -1,
-      -1,   540,   541,   542,   543,    -1,   545,   546,   547,    -1,
-     549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,
-     559,    -1,    -1,    -1,   563,   564,   565,   566,    -1,   568,
-     569,    -1,   571,   572,    -1,   574,   575,    -1,    -1,   578,
-      -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,
-      -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,
-      -1,   600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,
-      -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,     5,
-     619,     7,     8,     9,    10,    11,    -1,    -1,    14,    -1,
-      -1,    -1,    18,    -1,    -1,    21,    -1,    23,    24,    25,
-      26,    27,    28,    -1,    30,    -1,    -1,    33,    34,    -1,
-      -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,
-      -1,    47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,
-      -1,    57,    58,    -1,    60,    -1,    62,    63,    64,    65,
-      66,    67,    -1,    69,    70,    -1,    72,    73,    74,    75,
-      76,    77,    78,    79,    80,    -1,    82,    83,    -1,    85,
-      86,    87,    88,    89,    -1,    -1,    -1,    93,    -1,    -1,
-      96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,
-     106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,
-     116,    -1,    -1,    -1,   120,   121,   122,    -1,   124,    -1,
-      -1,    -1,   128,    -1,   130,   131,   132,   133,   134,    -1,
-      -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,
-      -1,   147,    -1,   149,   150,    -1,   152,   153,   154,    -1,
-      -1,   157,   158,    -1,   160,   161,   162,   163,   164,   165,
-      -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,   175,
-     176,    -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,
-      -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,   195,
-     196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,
-     206,    -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,
-     216,   217,   218,   219,    -1,    -1,   222,   223,   224,    -1,
-      -1,   227,    -1,    -1,    -1,    -1,   232,   233,    -1,    -1,
-      -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,
-      -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,
-     256,    -1,    -1,   259,   260,   261,    -1,    -1,    -1,    -1,
-     266,   267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,   299,   300,    -1,   302,   303,   304,    -1,
-     306,   307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,
-      -1,   317,   318,   319,   320,   321,   322,    -1,    -1,   325,
-     326,    -1,   328,    -1,   330,    -1,   332,   333,   334,   335,
-     336,   337,   338,   339,   340,    -1,    -1,   343,   344,    -1,
-      -1,   347,   348,   349,   350,    -1,    -1,    -1,   354,   355,
-      -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,
-     366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,
-     386,   387,   388,   389,   390,   391,   392,   393,   394,   395,
-      -1,    -1,   398,   399,   400,    -1,   402,    -1,   404,   405,
-     406,   407,   408,    -1,   410,   411,   412,    -1,    -1,   415,
-      -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,
-     426,   427,   428,   429,   430,    -1,   432,   433,    -1,   435,
-     436,   437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,
-      -1,   447,   448,   449,    -1,   451,    -1,    -1,   454,   455,
-     456,   457,   458,   459,   460,   461,   462,   463,   464,    -1,
-     466,   467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,
-      -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,
-     486,   487,    -1,   489,   490,   491,   492,   493,    -1,    -1,
-      -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,
-     506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,
-     516,   517,    -1,    -1,   520,   521,    -1,   523,   524,   525,
-     526,   527,   528,    -1,    -1,   531,   532,   533,   534,    -1,
-     536,   537,    -1,    -1,   540,   541,   542,   543,    -1,   545,
-     546,   547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,
-      -1,    -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,
-     566,    -1,   568,   569,    -1,   571,   572,    -1,   574,   575,
-      -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,
-     586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,
-     596,    -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,
-      -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,
-     616,    -1,     5,   619,     7,     8,     9,    10,    11,    -1,
-      -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,    -1,
-      23,    24,    25,    26,    27,    28,    -1,    30,    -1,    -1,
-      -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,
-      43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,
-      -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,    62,
-      63,    64,    65,    66,    67,    -1,    69,    70,    -1,    72,
-      73,    74,    75,    76,    77,    78,    79,    80,    -1,    82,
-      83,    -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,
-      93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,
-      -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,
-      -1,    -1,   115,   116,    -1,    -1,    -1,    -1,   121,   122,
-      -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,
-     133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,
-     143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,
-     153,   154,    -1,    -1,   157,   158,    -1,   160,   161,   162,
-     163,   164,   165,    -1,    -1,   168,   169,   170,   171,   172,
-      -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,
-     183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,
-      -1,   194,   195,   196,   197,    -1,   199,    -1,   201,    -1,
-      -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,
-      -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,
-     223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,
-     233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,
-      -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,
-     253,    -1,    -1,   256,    -1,    -1,   259,   260,    -1,    -1,
-      -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,
-     273,   274,    -1,    -1,   277,    -1,    -1,    -1,    -1,   282,
-      -1,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,   299,   300,    -1,   302,
-     303,   304,    -1,   306,   307,   308,   309,    -1,   311,   312,
-      -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,   322,
-      -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,
-     333,   334,   335,   336,   337,   338,   339,   340,    -1,    -1,
-     343,   344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,
-      -1,   354,   355,    -1,    -1,   358,   359,    -1,   361,   362,
-     363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,   382,
-     383,   384,    -1,   386,   387,   388,   389,   390,   391,   392,
-     393,   394,   395,    -1,    -1,   398,   399,   400,    -1,   402,
-      -1,   404,   405,   406,   407,   408,    -1,   410,   411,   412,
-      -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,
-     423,    -1,    -1,   426,   427,   428,   429,   430,    -1,   432,
-     433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,
-      -1,   444,   445,    -1,   447,   448,   449,    -1,   451,    -1,
-      -1,   454,   455,   456,   457,   458,   459,   460,   461,   462,
-     463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,
-     473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,
-      -1,   484,   485,   486,   487,    -1,   489,   490,   491,   492,
-     493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,
-     503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,
-     513,   514,   515,   516,   517,    -1,    -1,   520,   521,    -1,
-     523,   524,   525,   526,   527,   528,    -1,    -1,   531,   532,
-     533,   534,    -1,   536,   537,    -1,    -1,   540,   541,   542,
-     543,    -1,    -1,   546,   547,    -1,   549,   550,   551,   552,
-      -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,
-     563,   564,   565,   566,   567,   568,   569,    -1,   571,   572,
-      -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,
-     583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,
-     593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,
-     603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,
-      -1,   614,   615,   616,    -1,     5,   619,     7,     8,     9,
-      10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,
-      -1,    21,    -1,    23,    24,    25,    26,    27,    28,    -1,
-      30,    -1,    -1,    33,    34,    -1,    -1,    -1,    38,    -1,
-      -1,    41,    42,    43,    -1,    45,    -1,    47,    48,    -1,
-      -1,    51,    -1,    -1,    54,    55,    -1,    57,    58,    -1,
-      60,    -1,    62,    63,    64,    65,    66,    67,    -1,    69,
-      70,    -1,    72,    73,    74,    75,    76,    77,    78,    79,
-      80,    -1,    82,    83,    -1,    85,    86,    87,    88,    89,
-      -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,
-      -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,
-     110,    -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,
-     120,   121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,
-     130,   131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,
-      -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,
-     150,    -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,
-     160,   161,   162,   163,   164,   165,    -1,    -1,   168,   169,
-     170,   171,   172,    -1,    -1,   175,   176,    -1,   178,   179,
-     180,    -1,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,
-     190,    -1,   192,    -1,   194,   195,   196,   197,    -1,   199,
-      -1,   201,    -1,    -1,    -1,   205,   206,    -1,   208,    -1,
-      -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,   219,
-      -1,    -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,
-      -1,    -1,   232,   233,    -1,    -1,    -1,   237,    -1,    -1,
-      -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,
-      -1,    -1,   252,   253,    -1,    -1,   256,    -1,    -1,   259,
-     260,   261,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,
-      -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   282,    -1,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,   299,
-     300,    -1,   302,   303,   304,    -1,   306,   307,   308,   309,
-      -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,
-     320,   321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,
-     330,    -1,   332,   333,   334,   335,   336,   337,   338,   339,
-     340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,
-     350,    -1,    -1,    -1,   354,   355,    -1,    -1,    -1,   359,
-      -1,   361,   362,   363,    -1,   365,   366,   367,    -1,   369,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,
-     380,   381,    -1,   383,   384,    -1,   386,   387,   388,   389,
-     390,   391,   392,   393,   394,   395,    -1,    -1,   398,   399,
-     400,    -1,   402,    -1,   404,   405,   406,   407,   408,    -1,
-     410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,
-     420,   421,   422,   423,    -1,    -1,   426,   427,   428,   429,
-     430,    -1,   432,   433,    -1,   435,   436,   437,    -1,    -1,
-     440,    -1,   442,    -1,   444,   445,    -1,   447,   448,   449,
-      -1,   451,    -1,    -1,   454,   455,   456,   457,   458,   459,
-     460,   461,   462,   463,   464,    -1,   466,   467,    -1,    -1,
-      -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,
-      -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,   489,
-     490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,
-     500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,
-      -1,    -1,   512,   513,   514,   515,   516,   517,    -1,    -1,
-     520,   521,    -1,   523,   524,   525,   526,   527,   528,    -1,
-      -1,   531,   532,   533,   534,    -1,   536,   537,    -1,    -1,
-     540,   541,   542,   543,    -1,   545,   546,   547,    -1,   549,
-     550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,
-      -1,    -1,    -1,   563,   564,   565,   566,    -1,   568,   569,
-      -1,   571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,
-      -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,    -1,
-      -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,
-     600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,
-      -1,   611,   612,    -1,   614,   615,   616,    -1,     5,   619,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    21,    -1,    23,    24,    25,    26,
-      27,    28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,
-      -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,
-      47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,
-      57,    58,    -1,    60,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,
-      -1,    98,    99,    -1,   101,    -1,    -1,    -1,   105,   106,
-     107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,
-      -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,   165,    -1,
-      -1,   168,   169,   170,   171,   172,    -1,    -1,   175,   176,
-      -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,
-     187,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,
-      -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,    -1,   232,   233,    -1,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,
-      -1,    -1,   259,   260,   261,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,    -1,   306,
-     307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-      -1,   328,    -1,   330,    -1,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,
-     347,   348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,
-      -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,   395,    -1,
-      -1,   398,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,   433,    -1,   435,   436,
-     437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,
-     447,   448,   449,    -1,   451,    -1,    -1,   454,   455,   456,
-     457,   458,   459,   460,   461,   462,   463,   464,    -1,   466,
-     467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,
-     487,    -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,   516,
-     517,    -1,    -1,   520,   521,    -1,   523,   524,   525,   526,
-     527,   528,    -1,    -1,   531,   532,   533,   534,    -1,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,   545,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,   566,
-      -1,   568,   569,    -1,   571,   572,    -1,   574,   575,    -1,
-      -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,
-      -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,
-      -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,
-      -1,     5,   619,     7,     8,     9,    10,    11,    12,    -1,
-      14,    -1,    -1,    -1,    18,    -1,    -1,    21,    -1,    23,
-      24,    25,    26,    27,    28,    -1,    30,    -1,    -1,    -1,
-      34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,
-      -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,
-      54,    55,    -1,    57,    58,    -1,    60,    -1,    62,    63,
-      64,    65,    66,    67,    -1,    69,    70,    -1,    72,    73,
-      74,    75,    76,    77,    78,    79,    80,    -1,    82,    83,
-      -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,    93,
-      -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,
-      -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,
-      -1,   115,   116,    -1,    -1,    -1,    -1,   121,   122,    -1,
-     124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,
-     134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,
-      -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,
-     154,    -1,    -1,   157,   158,    -1,   160,   161,   162,   163,
-     164,   165,    -1,    -1,   168,   169,   170,   171,   172,    -1,
-      -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,   183,
-      -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,
-     194,   195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,
-      -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,
-      -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,   223,
-     224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,
-      -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,
-     244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,
-      -1,    -1,   256,    -1,    -1,   259,   260,   261,    -1,    -1,
-      -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,
-     274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,   299,   300,    -1,   302,   303,
-     304,    -1,   306,   307,   308,   309,    -1,   311,   312,    -1,
-      -1,    -1,    -1,   317,   318,   319,   320,   321,   322,    -1,
-      -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,   333,
-     334,   335,   336,   337,   338,   339,   340,    -1,    -1,   343,
-     344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,
-     354,   355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,
-      -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,
-     384,    -1,   386,   387,   388,   389,   390,   391,   392,   393,
-     394,   395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,
-     404,   405,   406,   407,   408,    -1,   410,   411,   412,    -1,
-      -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,   423,
-      -1,    -1,   426,   427,   428,   429,   430,    -1,   432,   433,
-      -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,
-     444,   445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,
-     454,   455,   456,   457,   458,   459,   460,   461,   462,   463,
-     464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,
-     474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,
-     484,   485,   486,   487,    -1,   489,   490,   491,   492,   493,
-      -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,
-     504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,
-     514,   515,   516,   517,    -1,    -1,   520,   521,    -1,   523,
-     524,   525,   526,   527,   528,    -1,    -1,   531,   532,   533,
-     534,    -1,   536,   537,    -1,    -1,   540,   541,   542,   543,
-      -1,   545,   546,   547,    -1,   549,   550,   551,   552,    -1,
-      -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,
-     564,   565,   566,    -1,   568,   569,    -1,   571,   572,    -1,
-     574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,
-      -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,
-      -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,
-     604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,
-     614,   615,   616,    -1,     5,   619,     7,     8,     9,    10,
-      11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,
-      21,    -1,    23,    24,    25,    26,    27,    28,    -1,    30,
-      -1,    -1,    -1,    34,    35,    -1,    -1,    38,    -1,    -1,
-      41,    42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,
-      51,    -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,
-      -1,    62,    63,    64,    65,    66,    67,    -1,    69,    70,
-      -1,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-      -1,    82,    83,    -1,    85,    86,    87,    88,    89,    -1,
-      -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,
-     101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,
-      -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,    -1,
-     121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,
-     131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,
-     141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,
-      -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,   160,
-     161,   162,   163,   164,   165,    -1,    -1,   168,   169,   170,
-     171,   172,    -1,    -1,   175,   176,    -1,   178,   179,   180,
-      -1,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,
-      -1,   192,    -1,   194,   195,   196,   197,    -1,   199,    -1,
-     201,    -1,    -1,    -1,   205,   206,    -1,   208,   209,    -1,
-     211,   212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,
-      -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,
-      -1,   232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,
-     241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,
-      -1,   252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,
-      -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,
-     271,    -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   282,    -1,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
-      -1,   302,   303,   304,    -1,   306,   307,   308,   309,    -1,
-     311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,
-     321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,
-      -1,   332,   333,   334,   335,   336,   337,   338,   339,   340,
-      -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,   350,
-      -1,    -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,
-     361,   362,   363,    -1,   365,   366,   367,    -1,   369,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,
-     381,    -1,   383,   384,    -1,   386,   387,   388,   389,   390,
-     391,   392,   393,   394,   395,    -1,    -1,   398,   399,   400,
-      -1,   402,    -1,   404,   405,   406,   407,   408,    -1,   410,
-     411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,
-     421,   422,   423,    -1,    -1,   426,   427,   428,   429,   430,
-      -1,   432,   433,    -1,   435,   436,   437,    -1,    -1,   440,
-      -1,   442,    -1,   444,   445,    -1,   447,   448,   449,    -1,
-     451,    -1,    -1,   454,   455,   456,   457,   458,   459,   460,
-     461,   462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,
-     471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,
-      -1,   482,    -1,   484,   485,   486,   487,    -1,   489,   490,
-     491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,
-     501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,
-      -1,   512,   513,   514,   515,   516,   517,    -1,    -1,   520,
-     521,    -1,   523,   524,   525,   526,   527,   528,    -1,    -1,
-     531,   532,   533,   534,    -1,   536,   537,    -1,    -1,   540,
-     541,   542,   543,    -1,   545,   546,   547,    -1,   549,   550,
-     551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,
-      -1,    -1,   563,   564,   565,   566,    -1,   568,   569,    -1,
-     571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,
-     581,    -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,
-      -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,
-     601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,
-     611,   612,    -1,   614,   615,   616,    -1,     5,   619,     7,
-       8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,
-      18,    -1,    -1,    21,    -1,    23,    24,    25,    26,    27,
-      28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,    -1,
-      38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,    47,
-      48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,    57,
-      58,    -1,    60,    -1,    62,    63,    64,    65,    66,    67,
-      -1,    69,    70,    -1,    72,    73,    74,    75,    76,    77,
-      78,    79,    80,    -1,    82,    83,    -1,    85,    86,    87,
-      88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,
-      98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,
-      -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,    -1,
-      -1,    -1,   120,   121,   122,    -1,   124,    -1,    -1,    -1,
-     128,    -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,
-     138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,
-      -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,   157,
-     158,    -1,   160,   161,   162,   163,   164,   165,    -1,    -1,
-     168,   169,   170,   171,   172,    -1,    -1,   175,   176,    -1,
-     178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,   187,
-     188,    -1,   190,    -1,   192,    -1,   194,   195,   196,   197,
-      -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,    -1,
-     208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,   217,
-     218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,   227,
-      -1,    -1,    -1,    -1,   232,   233,    -1,    -1,    -1,   237,
-      -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,
-      -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,
-      -1,   259,   260,   261,    -1,    -1,    -1,    -1,   266,   267,
-      -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,   299,   300,    -1,   302,   303,   304,    -1,   306,   307,
-     308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,
-     318,   319,   320,   321,   322,    -1,    -1,   325,   326,    -1,
-     328,    -1,   330,    -1,   332,   333,   334,   335,   336,   337,
-     338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,
-     348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,    -1,
-      -1,   359,    -1,   361,   362,   363,    -1,   365,   366,   367,
-      -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   379,   380,   381,    -1,   383,   384,    -1,   386,   387,
-     388,   389,   390,   391,   392,   393,   394,   395,    -1,    -1,
-     398,   399,   400,    -1,   402,    -1,   404,   405,   406,   407,
-     408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,
-      -1,   419,   420,   421,   422,   423,    -1,    -1,   426,   427,
-     428,   429,   430,    -1,   432,   433,    -1,   435,   436,   437,
-      -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,   447,
-     448,   449,    -1,   451,    -1,    -1,   454,   455,   456,   457,
-     458,   459,   460,   461,   462,   463,   464,    -1,   466,   467,
-      -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,
-     478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,
-      -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,
-      -1,   499,   500,   501,    -1,   503,   504,    -1,   506,    -1,
-      -1,   509,    -1,    -1,   512,   513,   514,   515,   516,   517,
-      -1,    -1,   520,   521,    -1,   523,   524,   525,   526,   527,
-     528,    -1,    -1,   531,   532,   533,   534,    -1,   536,   537,
-      -1,    -1,   540,   541,   542,   543,    -1,   545,   546,   547,
-      -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,
-     558,   559,    -1,    -1,    -1,   563,   564,   565,   566,    -1,
-     568,   569,    -1,   571,   572,    -1,   574,   575,    -1,    -1,
-     578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,
-      -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,
-      -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,    -1,
-      -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,
-       5,   619,     7,     8,     9,    10,    11,    -1,    -1,    14,
-      -1,    -1,    -1,    18,    -1,    -1,    21,    -1,    23,    24,
-      25,    26,    27,    28,    -1,    30,    -1,    -1,    33,    34,
-      -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,
-      45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,    54,
-      55,    -1,    57,    58,    -1,    60,    -1,    62,    63,    64,
-      65,    66,    67,    -1,    69,    70,    -1,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    -1,    82,    83,    -1,
-      85,    86,    87,    88,    89,    -1,    -1,    -1,    93,    -1,
-      -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,
-     105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,
-     115,   116,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-      -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,
-      -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,   154,
-      -1,    -1,   157,   158,    -1,   160,   161,   162,   163,   164,
-     165,    -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,
-     175,   176,    -1,   178,   179,   180,    -1,    -1,   183,    -1,
-      -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,
-     195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,
-     205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,    -1,
-      -1,   216,   217,   218,   219,    -1,    -1,   222,   223,   224,
-      -1,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,    -1,
-      -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,
-     245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,
-      -1,   256,    -1,    -1,   259,   260,   261,    -1,    -1,    -1,
-      -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,   274,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,    -1,   302,   303,   304,
-      -1,   306,   307,   308,   309,    -1,   311,   312,    -1,    -1,
-      -1,    -1,   317,   318,   319,   320,   321,   322,    -1,    -1,
-     325,   326,    -1,   328,    -1,   330,    -1,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,    -1,    -1,   343,   344,
-      -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,   354,
-     355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,
-     365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,   384,
-      -1,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,   404,
-     405,   406,   407,   408,    -1,   410,   411,   412,    -1,    -1,
-     415,    -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,
-      -1,   426,   427,   428,   429,   430,    -1,   432,   433,    -1,
-     435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,   444,
-     445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-      -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,   474,
-      -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,
-     485,   486,   487,    -1,   489,   490,   491,   492,   493,    -1,
-      -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,
-      -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,
-     515,   516,   517,    -1,    -1,   520,   521,    -1,   523,   524,
-     525,   526,   527,   528,    -1,    -1,   531,   532,   533,   534,
-      -1,   536,   537,    -1,    -1,   540,   541,   542,   543,    -1,
-     545,   546,   547,    -1,   549,   550,   551,   552,    -1,    -1,
-      -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,   564,
-     565,   566,    -1,   568,   569,    -1,   571,   572,    -1,   574,
-     575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,
-     585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,
-      -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,   604,
-      -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,
-     615,   616,    -1,     5,   619,     7,     8,     9,    10,    11,
-      -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,
-      -1,    23,    24,    25,    26,    27,    28,    -1,    30,    -1,
-      -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,
-      42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,
-      -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,
-      62,    63,    64,    65,    66,    67,    -1,    69,    70,    -1,
-      72,    73,    74,    75,    76,    77,    78,    79,    80,    -1,
-      82,    83,    -1,    85,    86,    87,    88,    89,    -1,    -1,
-      -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,
-      -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,
-      -1,    -1,    -1,   115,   116,    -1,    -1,    -1,    -1,   121,
-     122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,
-     132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,
-     142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,
-     152,   153,   154,    -1,    -1,   157,   158,    -1,   160,   161,
-     162,   163,   164,   165,    -1,    -1,   168,   169,   170,   171,
-     172,    -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,
-      -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,
-     192,    -1,   194,   195,   196,   197,    -1,   199,    -1,   201,
-      -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,
-     212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,
-     222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,
-     232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,
-     242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,
-     252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,   261,
-      -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,
-      -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     282,    -1,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,   299,   300,    -1,
-     302,   303,   304,    -1,   306,   307,   308,   309,    -1,   311,
-     312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,
-     322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,
-     332,   333,   334,   335,   336,   337,   338,   339,   340,    -1,
-      -1,   343,   344,    -1,    -1,   347,   348,   349,   350,    -1,
-      -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,
-     362,   363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,
-      -1,   383,   384,    -1,   386,   387,   388,   389,   390,   391,
-     392,   393,   394,   395,    -1,    -1,   398,   399,   400,    -1,
-     402,    -1,   404,   405,   406,   407,   408,    -1,   410,   411,
-     412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,
-     422,   423,    -1,    -1,   426,   427,   428,   429,   430,    -1,
-     432,   433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,
-     442,    -1,   444,   445,    -1,   447,   448,   449,    -1,   451,
-      -1,    -1,   454,   455,   456,   457,   458,   459,   460,   461,
-     462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,
-     472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,
-     482,    -1,   484,   485,   486,   487,    -1,   489,   490,   491,
-     492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,
-      -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,
-     512,   513,   514,   515,   516,   517,    -1,    -1,   520,   521,
-      -1,   523,   524,   525,   526,   527,   528,    -1,    -1,   531,
-     532,   533,   534,    -1,   536,   537,    -1,    -1,   540,   541,
-     542,   543,    -1,   545,   546,   547,    -1,   549,   550,   551,
-     552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,
-      -1,   563,   564,   565,   566,    -1,   568,   569,    -1,   571,
-     572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,
-      -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,
-      -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,
-     602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,
-     612,    -1,   614,   615,   616,    -1,     5,   619,     7,     8,
-       9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
-      19,    -1,    21,    -1,    23,    24,    25,    26,    27,    28,
-      -1,    30,    -1,    -1,    -1,    34,    -1,    -1,    -1,    38,
-      -1,    -1,    41,    42,    43,    -1,    45,    -1,    47,    48,
-      -1,    -1,    51,    -1,    -1,    54,    55,    -1,    57,    58,
-      -1,    60,    -1,    62,    63,    64,    65,    66,    67,    -1,
-      69,    70,    -1,    72,    73,    74,    75,    76,    77,    78,
-      79,    80,    -1,    82,    83,    -1,    85,    86,    87,    88,
-      89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,
-      -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,
-      -1,   110,    -1,    -1,    -1,    -1,   115,   116,    -1,    -1,
-      -1,    -1,   121,   122,    -1,   124,    -1,    -1,    -1,   128,
-      -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,   138,
-      -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,
-     149,   150,    -1,   152,   153,   154,    -1,    -1,   157,   158,
-      -1,   160,   161,   162,   163,   164,   165,    -1,    -1,   168,
-     169,   170,   171,   172,    -1,    -1,   175,   176,    -1,   178,
-     179,   180,    -1,    -1,   183,    -1,    -1,    -1,   187,   188,
-      -1,   190,    -1,   192,    -1,   194,   195,   196,   197,    -1,
-     199,    -1,   201,    -1,    -1,    -1,   205,   206,    -1,   208,
-      -1,    -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,
-     219,    -1,    -1,   222,   223,   224,    -1,    -1,   227,    -1,
-      -1,    -1,    -1,   232,   233,    -1,    -1,    -1,   237,    -1,
-      -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,
-     249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,    -1,
-     259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,
-     269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-     299,   300,    -1,   302,   303,   304,    -1,   306,   307,   308,
-     309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,
-     319,   320,   321,   322,    -1,    -1,   325,   326,    -1,   328,
-      -1,   330,    -1,   332,   333,   334,   335,   336,   337,   338,
-     339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,
-     349,   350,    -1,    -1,    -1,   354,   355,    -1,    -1,    -1,
-     359,    -1,   361,   362,   363,    -1,   365,   366,   367,    -1,
-     369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     379,   380,   381,    -1,   383,   384,    -1,   386,   387,   388,
-     389,   390,   391,   392,   393,   394,   395,    -1,    -1,   398,
-     399,   400,    -1,   402,    -1,   404,   405,   406,   407,   408,
-      -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,
-     419,   420,   421,   422,   423,    -1,    -1,   426,   427,   428,
-     429,   430,    -1,   432,   433,    -1,   435,   436,   437,    -1,
-      -1,   440,    -1,   442,    -1,   444,   445,    -1,   447,   448,
-     449,    -1,   451,    -1,    -1,   454,   455,   456,   457,   458,
-     459,   460,   461,   462,   463,   464,    -1,   466,   467,    -1,
-      -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,
-      -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,
-     489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,
-     499,   500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,
-     509,    -1,    -1,   512,   513,   514,   515,   516,   517,    -1,
-      -1,   520,   521,    -1,   523,   524,   525,   526,   527,   528,
-      -1,    -1,   531,   532,   533,   534,    -1,   536,   537,    -1,
-      -1,   540,   541,   542,   543,    -1,   545,   546,   547,    -1,
-     549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,
-     559,    -1,    -1,    -1,   563,   564,   565,   566,    -1,   568,
-     569,    -1,   571,   572,    -1,   574,   575,    -1,    -1,   578,
-      -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,
-      -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,
-      -1,   600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,
-      -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,     5,
-     619,     7,     8,     9,    10,    11,    -1,    -1,    14,    -1,
-      -1,    -1,    18,    -1,    -1,    21,    -1,    23,    24,    25,
-      26,    27,    28,    -1,    30,    -1,    -1,    -1,    34,    -1,
-      -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,
-      -1,    47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,
-      -1,    57,    58,    -1,    60,    -1,    62,    63,    64,    65,
-      66,    67,    -1,    69,    70,    -1,    72,    73,    74,    75,
-      76,    77,    78,    79,    80,    -1,    82,    83,    -1,    85,
-      86,    87,    88,    89,    90,    -1,    -1,    93,    -1,    -1,
-      96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,
-     106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,
-     116,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,
-      -1,    -1,   128,    -1,   130,   131,   132,   133,   134,    -1,
-      -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,
-      -1,   147,    -1,   149,   150,    -1,   152,   153,   154,    -1,
-      -1,   157,   158,    -1,   160,   161,   162,   163,   164,   165,
-      -1,   167,   168,   169,   170,   171,   172,    -1,    -1,   175,
-     176,    -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,
-      -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,   195,
-     196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,
-     206,    -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,
-     216,   217,   218,   219,    -1,    -1,   222,   223,   224,    -1,
-      -1,   227,    -1,    -1,    -1,    -1,   232,   233,    -1,    -1,
-      -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,
-      -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,
-     256,    -1,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,
-     266,   267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,   299,   300,    -1,   302,   303,   304,    -1,
-     306,   307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,
-      -1,   317,   318,   319,   320,   321,   322,    -1,    -1,   325,
-     326,    -1,   328,    -1,   330,    -1,   332,   333,   334,   335,
-     336,   337,   338,   339,   340,    -1,    -1,   343,   344,    -1,
-      -1,   347,   348,   349,   350,    -1,    -1,    -1,   354,   355,
-      -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,
-     366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,
-     386,   387,   388,   389,   390,   391,   392,   393,   394,   395,
-      -1,    -1,   398,   399,   400,    -1,   402,    -1,   404,   405,
-     406,   407,   408,    -1,   410,   411,   412,    -1,    -1,   415,
-      -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,
-     426,   427,   428,   429,   430,    -1,   432,   433,    -1,   435,
-     436,   437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,
-      -1,   447,   448,   449,    -1,   451,    -1,    -1,   454,   455,
-     456,   457,   458,   459,   460,   461,   462,   463,   464,    -1,
-     466,   467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,
-      -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,
-     486,   487,    -1,   489,   490,   491,   492,   493,    -1,    -1,
-      -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,
-     506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,
-     516,   517,    -1,    -1,   520,   521,    -1,   523,   524,   525,
-     526,   527,   528,    -1,    -1,   531,   532,   533,   534,    -1,
-     536,   537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,
-     546,   547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,
-      -1,    -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,
-     566,    -1,   568,   569,    -1,   571,   572,    -1,   574,   575,
-      -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,
-     586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,
-     596,    -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,
-      -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,
-     616,    -1,     5,   619,     7,     8,     9,    10,    11,    -1,
-      -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,    -1,
-      23,    24,    25,    26,    27,    28,    -1,    30,    -1,    -1,
-      -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,
-      43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,
-      -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,    62,
-      63,    64,    65,    66,    67,    -1,    69,    70,    -1,    72,
-      73,    74,    75,    76,    77,    78,    79,    80,    -1,    82,
-      83,    -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,
-      93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,
-      -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,
-      -1,    -1,   115,   116,    -1,    -1,    -1,    -1,   121,   122,
-      -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,
-     133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,
-     143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,
-     153,   154,    -1,    -1,   157,   158,    -1,   160,   161,   162,
-     163,   164,   165,    -1,    -1,   168,   169,   170,   171,   172,
-      -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,
-     183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,
-      -1,   194,   195,   196,   197,    -1,   199,    -1,   201,    -1,
-      -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,
-      -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,
-     223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,
-     233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,
-      -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,
-     253,    -1,    -1,   256,    -1,    -1,   259,   260,    -1,    -1,
-      -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,
-     273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,
-      -1,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,   299,   300,    -1,   302,
-     303,   304,    -1,   306,   307,   308,   309,    -1,   311,   312,
-      -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,   322,
-      -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,
-     333,   334,   335,   336,   337,   338,   339,   340,    -1,    -1,
-     343,   344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,
-      -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,   362,
-     363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,    -1,
-     383,   384,    -1,   386,   387,   388,   389,   390,   391,   392,
-     393,   394,   395,    -1,    -1,   398,   399,   400,    -1,   402,
-      -1,   404,   405,   406,   407,   408,    -1,   410,   411,   412,
-      -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,
-     423,    -1,    -1,   426,   427,   428,   429,   430,    -1,   432,
-     433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,
-      -1,   444,   445,    -1,   447,   448,   449,    -1,   451,    -1,
-      -1,   454,   455,   456,   457,   458,   459,   460,   461,   462,
-     463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,
-     473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,
-      -1,   484,   485,   486,   487,    -1,   489,   490,   491,   492,
-     493,    -1,    -1,    -1,   497,    -1,   499,   500,   501,    -1,
-     503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,
-     513,   514,   515,   516,   517,    -1,    -1,   520,   521,    -1,
-     523,   524,   525,   526,   527,   528,    -1,    -1,   531,   532,
-     533,   534,    -1,   536,   537,    -1,    -1,   540,   541,   542,
-     543,    -1,    -1,   546,   547,    -1,   549,   550,   551,   552,
-      -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,
-     563,   564,   565,   566,    -1,   568,   569,    -1,   571,   572,
-      -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,
-     583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,
-     593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,
-     603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,
-      -1,   614,   615,   616,    -1,     5,   619,     7,     8,     9,
-      10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,
-      -1,    21,    -1,    23,    24,    25,    26,    27,    28,    -1,
-      30,    -1,    -1,    -1,    34,    -1,    -1,    -1,    38,    -1,
-      -1,    41,    42,    43,    -1,    45,    -1,    47,    48,    -1,
-      -1,    51,    -1,    -1,    54,    55,    -1,    57,    58,    -1,
-      60,    -1,    62,    63,    64,    65,    66,    67,    -1,    69,
-      70,    -1,    72,    73,    74,    75,    76,    77,    78,    79,
-      80,    -1,    82,    83,    -1,    85,    86,    87,    88,    89,
-      -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,
-      -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,
-     110,    -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,
-      -1,   121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,
-     130,   131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,
-      -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,
-     150,    -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,
-     160,   161,   162,   163,   164,   165,    -1,    -1,   168,   169,
-     170,   171,   172,    -1,    -1,   175,   176,    -1,   178,   179,
-     180,    -1,    -1,   183,    -1,    -1,    -1,   187,   188,   189,
-     190,    -1,   192,    -1,   194,   195,   196,   197,    -1,   199,
-      -1,   201,    -1,    -1,    -1,   205,   206,    -1,   208,    -1,
-      -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,   219,
-      -1,    -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,
-      -1,    -1,   232,   233,    -1,    -1,    -1,   237,    -1,    -1,
-      -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,
-      -1,    -1,   252,   253,    -1,    -1,   256,    -1,    -1,   259,
-     260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,
-      -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   282,    -1,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,   299,
-     300,    -1,   302,   303,   304,    -1,   306,   307,   308,   309,
-      -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,
-     320,   321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,
-     330,    -1,   332,   333,   334,   335,   336,   337,   338,   339,
-     340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,
-     350,    -1,    -1,    -1,   354,   355,    -1,    -1,    -1,   359,
-      -1,   361,   362,   363,    -1,   365,   366,   367,    -1,   369,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,
-     380,   381,    -1,   383,   384,    -1,   386,   387,   388,   389,
-     390,   391,   392,   393,   394,   395,    -1,    -1,   398,   399,
-     400,    -1,   402,    -1,   404,   405,   406,   407,   408,    -1,
-     410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,
-     420,   421,   422,   423,    -1,    -1,   426,   427,   428,   429,
-     430,    -1,   432,   433,    -1,   435,   436,   437,    -1,    -1,
-     440,    -1,   442,    -1,   444,   445,    -1,   447,   448,   449,
-      -1,   451,    -1,    -1,   454,   455,   456,   457,   458,   459,
-     460,   461,   462,   463,   464,    -1,   466,   467,    -1,    -1,
-      -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,
-      -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,   489,
-     490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,
-     500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,
-      -1,    -1,   512,   513,   514,   515,   516,   517,    -1,    -1,
-     520,   521,    -1,   523,   524,   525,   526,   527,   528,    -1,
-      -1,   531,   532,   533,   534,    -1,   536,   537,    -1,    -1,
-     540,   541,   542,   543,    -1,    -1,   546,   547,    -1,   549,
-     550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,
-      -1,    -1,    -1,   563,   564,   565,   566,    -1,   568,   569,
-      -1,   571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,
-      -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,    -1,
-      -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,
-     600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,
-      -1,   611,   612,    -1,   614,   615,   616,    -1,     5,   619,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    21,    -1,    23,    24,    25,    26,
-      27,    28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,
-      -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,
-      47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,
-      57,    58,    -1,    60,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,
-      -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,
-     107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,
-      -1,    -1,    -1,   120,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,   165,    -1,
-      -1,   168,   169,   170,   171,   172,    -1,    -1,   175,   176,
-      -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,
-     187,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,
-      -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,    -1,   232,   233,    -1,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,
-      -1,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,    -1,   306,
-     307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-      -1,   328,    -1,   330,    -1,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,
-     347,   348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,
-      -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,   395,    -1,
-      -1,   398,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,   433,    -1,   435,   436,
-     437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,
-     447,   448,   449,    -1,   451,    -1,    -1,   454,   455,   456,
-     457,   458,   459,   460,   461,   462,   463,   464,    -1,   466,
-     467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,
-     487,    -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,   516,
-     517,    -1,    -1,   520,   521,    -1,   523,   524,   525,   526,
-     527,   528,    -1,    -1,   531,   532,   533,   534,    -1,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,   566,
-      -1,   568,   569,    -1,   571,   572,    -1,   574,   575,    -1,
-      -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,
-      -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,
-      -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,
-      -1,     5,   619,     7,     8,     9,    10,    11,    -1,    -1,
-      14,    -1,    -1,    -1,    18,    -1,    -1,    21,    -1,    23,
-      24,    25,    26,    27,    28,    -1,    30,    -1,    -1,    -1,
-      34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,
-      -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,
-      54,    55,    -1,    57,    58,    -1,    60,    -1,    62,    63,
-      64,    65,    66,    67,    -1,    69,    70,    -1,    72,    73,
-      74,    75,    76,    77,    78,    79,    80,    -1,    82,    83,
-      -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,    93,
-      -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,
-      -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,
-      -1,   115,   116,    -1,    -1,    -1,   120,   121,   122,    -1,
-     124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,
-     134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,
-      -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,
-     154,    -1,    -1,   157,   158,    -1,   160,   161,   162,   163,
-     164,   165,    -1,    -1,   168,   169,   170,   171,   172,    -1,
-      -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,   183,
-      -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,
-     194,   195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,
-      -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,
-      -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,   223,
-     224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,
-      -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,
-     244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,
-      -1,    -1,   256,    -1,    -1,   259,   260,    -1,    -1,    -1,
-      -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,
-     274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,   299,   300,    -1,   302,   303,
-     304,    -1,   306,   307,   308,   309,    -1,   311,   312,    -1,
-      -1,    -1,    -1,   317,   318,   319,   320,   321,   322,    -1,
-      -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,   333,
-     334,   335,   336,   337,   338,   339,   340,    -1,    -1,   343,
-     344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,
-     354,   355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,
-      -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,
-     384,    -1,   386,   387,   388,   389,   390,   391,   392,   393,
-     394,   395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,
-     404,   405,   406,   407,   408,    -1,   410,   411,   412,    -1,
-      -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,   423,
-      -1,    -1,   426,   427,   428,   429,   430,    -1,   432,   433,
-      -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,
-     444,   445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,
-     454,   455,   456,   457,   458,   459,   460,   461,   462,   463,
-     464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,
-     474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,
-     484,   485,   486,   487,    -1,   489,   490,   491,   492,   493,
-      -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,
-     504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,
-     514,   515,   516,   517,    -1,    -1,   520,   521,    -1,   523,
-     524,   525,   526,   527,   528,    -1,    -1,   531,   532,   533,
-     534,    -1,   536,   537,    -1,    -1,   540,   541,   542,   543,
-      -1,    -1,   546,   547,    -1,   549,   550,   551,   552,    -1,
-      -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,
-     564,   565,   566,    -1,   568,   569,    -1,   571,   572,    -1,
-     574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,
-      -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,
-      -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,
-     604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,
-     614,   615,   616,    -1,     5,   619,     7,     8,     9,    10,
-      11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,
-      21,    -1,    23,    24,    25,    26,    27,    28,    -1,    30,
-      -1,    -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,
-      41,    42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,
-      51,    -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,
-      -1,    62,    63,    64,    65,    66,    67,    -1,    69,    70,
-      -1,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-      -1,    82,    83,    -1,    85,    86,    87,    88,    89,    -1,
-      -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,
-     101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,
-      -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,   120,
-     121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,
-     131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,
-     141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,
-      -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,   160,
-     161,   162,   163,   164,   165,    -1,    -1,   168,   169,   170,
-     171,   172,    -1,    -1,   175,   176,    -1,   178,   179,   180,
-      -1,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,
-      -1,   192,    -1,   194,   195,   196,   197,    -1,   199,    -1,
-     201,    -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,
-     211,   212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,
-      -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,
-      -1,   232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,
-     241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,
-      -1,   252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,
-      -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,
-     271,    -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   282,    -1,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
-      -1,   302,   303,   304,    -1,   306,   307,   308,   309,    -1,
-     311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,
-     321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,
-      -1,   332,   333,   334,   335,   336,   337,   338,   339,   340,
-      -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,   350,
-      -1,    -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,
-     361,   362,   363,    -1,   365,   366,   367,    -1,   369,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,
-     381,    -1,   383,   384,    -1,   386,   387,   388,   389,   390,
-     391,   392,   393,   394,   395,    -1,    -1,   398,   399,   400,
-      -1,   402,    -1,   404,   405,   406,   407,   408,    -1,   410,
-     411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,
-     421,   422,   423,    -1,    -1,   426,   427,   428,   429,   430,
-      -1,   432,   433,    -1,   435,   436,   437,    -1,    -1,   440,
-      -1,   442,    -1,   444,   445,    -1,   447,   448,   449,    -1,
-     451,    -1,    -1,   454,   455,   456,   457,   458,   459,   460,
-     461,   462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,
-     471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,
-      -1,   482,    -1,   484,   485,   486,   487,    -1,   489,   490,
-     491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,
-     501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,
-      -1,   512,   513,   514,   515,   516,   517,    -1,    -1,   520,
-     521,    -1,   523,   524,   525,   526,   527,   528,    -1,    -1,
-     531,   532,   533,   534,    -1,   536,   537,    -1,    -1,   540,
-     541,   542,   543,    -1,    -1,   546,   547,    -1,   549,   550,
-     551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,
-      -1,    -1,   563,   564,   565,   566,    -1,   568,   569,    -1,
-     571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,
-     581,    -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,
-      -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,
-     601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,
-     611,   612,    -1,   614,   615,   616,    -1,     5,   619,     7,
-       8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,
-      18,    -1,    -1,    21,    -1,    23,    24,    25,    26,    27,
-      28,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,    -1,
-      38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,    47,
-      48,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,    57,
-      58,    -1,    60,    -1,    62,    63,    64,    65,    66,    67,
-      -1,    69,    70,    -1,    72,    73,    74,    75,    76,    77,
-      78,    79,    80,    -1,    82,    83,    -1,    85,    86,    87,
-      88,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,
-      98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,
-      -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,    -1,
-      -1,    -1,   120,   121,   122,    -1,   124,    -1,    -1,    -1,
-     128,    -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,
-     138,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,
-      -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,   157,
-     158,    -1,   160,   161,   162,   163,   164,   165,    -1,    -1,
-     168,   169,   170,   171,   172,    -1,    -1,   175,   176,    -1,
-     178,   179,   180,    -1,    -1,   183,    -1,    -1,    -1,   187,
-     188,    -1,   190,    -1,   192,    -1,   194,   195,   196,   197,
-      -1,   199,    -1,   201,    -1,    -1,    -1,   205,   206,    -1,
-     208,    -1,    -1,   211,   212,    -1,    -1,    -1,   216,   217,
-     218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,   227,
-      -1,    -1,    -1,    -1,   232,   233,    -1,    -1,    -1,   237,
-      -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,
-      -1,   249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,
-      -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,
-      -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,   299,   300,    -1,   302,   303,   304,    -1,   306,   307,
-     308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,
-     318,   319,   320,   321,   322,    -1,    -1,   325,   326,    -1,
-     328,    -1,   330,    -1,   332,   333,   334,   335,   336,   337,
-     338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,
-     348,   349,   350,    -1,    -1,    -1,   354,   355,    -1,    -1,
-      -1,   359,    -1,   361,   362,   363,    -1,   365,   366,   367,
-      -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   379,   380,   381,    -1,   383,   384,    -1,   386,   387,
-     388,   389,   390,   391,   392,   393,   394,   395,    -1,    -1,
-     398,   399,   400,    -1,   402,    -1,   404,   405,   406,   407,
-     408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,
-      -1,   419,   420,   421,   422,   423,    -1,    -1,   426,   427,
-     428,   429,   430,    -1,   432,   433,    -1,   435,   436,   437,
-      -1,    -1,   440,    -1,   442,    -1,   444,   445,    -1,   447,
-     448,   449,    -1,   451,    -1,    -1,   454,   455,   456,   457,
-     458,   459,   460,   461,   462,   463,   464,    -1,   466,   467,
-      -1,    -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,
-     478,    -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,
-      -1,   489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,
-      -1,   499,   500,   501,    -1,   503,   504,    -1,   506,    -1,
-      -1,   509,    -1,    -1,   512,   513,   514,   515,   516,   517,
-      -1,    -1,   520,   521,    -1,   523,   524,   525,   526,   527,
-     528,    -1,    -1,   531,   532,   533,   534,    -1,   536,   537,
-      -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,   547,
-      -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,
-     558,   559,    -1,    -1,    -1,   563,   564,   565,   566,    -1,
-     568,   569,    -1,   571,   572,    -1,   574,   575,    -1,    -1,
-     578,    -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,
-      -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,
-      -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,    -1,
-      -1,    -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,
-       5,   619,     7,     8,     9,    10,    11,    12,    -1,    14,
-      -1,    -1,    -1,    18,    -1,    -1,    21,    -1,    23,    24,
-      25,    26,    27,    28,    -1,    30,    -1,    -1,    -1,    34,
-      -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,
-      45,    -1,    47,    48,    -1,    -1,    51,    -1,    -1,    54,
-      55,    -1,    57,    58,    -1,    60,    -1,    62,    63,    64,
-      65,    66,    67,    -1,    69,    70,    -1,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    -1,    82,    83,    -1,
-      85,    86,    87,    88,    89,    -1,    -1,    -1,    93,    -1,
-      -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,
-     105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,
-     115,   116,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-      -1,    -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,
-      -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,   154,
-      -1,    -1,   157,   158,    -1,   160,   161,   162,   163,   164,
-     165,    -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,
-     175,   176,    -1,   178,   179,   180,    -1,    -1,   183,    -1,
-      -1,    -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,
-     195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,
-     205,   206,    -1,   208,    -1,    -1,   211,   212,    -1,    -1,
-      -1,   216,   217,   218,   219,    -1,    -1,   222,   223,   224,
-      -1,    -1,   227,    -1,    -1,    -1,    -1,   232,   233,    -1,
-      -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,
-     245,    -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,
-      -1,   256,    -1,    -1,   259,   260,    -1,    -1,    -1,    -1,
-      -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,   274,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,    -1,   302,   303,   304,
-      -1,   306,   307,   308,   309,    -1,   311,   312,    -1,    -1,
-      -1,    -1,   317,   318,   319,   320,   321,   322,    -1,    -1,
-     325,   326,    -1,   328,    -1,   330,    -1,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,    -1,    -1,   343,   344,
-      -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,   354,
-     355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,
-     365,   366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   379,   380,   381,    -1,   383,   384,
-      -1,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,    -1,    -1,   398,   399,   400,    -1,   402,    -1,   404,
-     405,   406,   407,   408,    -1,   410,   411,   412,    -1,    -1,
-     415,    -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,
-      -1,   426,   427,   428,   429,   430,    -1,   432,   433,    -1,
-     435,   436,   437,    -1,    -1,   440,    -1,   442,    -1,   444,
-     445,    -1,   447,   448,   449,    -1,   451,    -1,    -1,   454,
-     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
-      -1,   466,   467,    -1,    -1,    -1,   471,   472,   473,   474,
-      -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,
-     485,   486,   487,    -1,   489,   490,   491,   492,   493,    -1,
-      -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,
-      -1,   506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,
-     515,   516,   517,    -1,    -1,   520,   521,    -1,   523,   524,
-     525,   526,   527,   528,    -1,    -1,   531,   532,   533,   534,
-      -1,   536,   537,    -1,    -1,   540,   541,   542,   543,    -1,
-      -1,   546,   547,    -1,   549,   550,   551,   552,    -1,    -1,
-      -1,    -1,    -1,   558,   559,    -1,    -1,    -1,   563,   564,
-     565,   566,    -1,   568,   569,    -1,   571,   572,    -1,   574,
-     575,    -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,
-     585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,
-      -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,   604,
-      -1,    -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,
-     615,   616,    -1,     5,   619,     7,     8,     9,    10,    11,
-      -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,
-      -1,    23,    24,    25,    26,    27,    28,    -1,    30,    -1,
-      -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,
-      42,    43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,
-      -1,    -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,
-      62,    63,    64,    65,    66,    67,    -1,    69,    70,    -1,
-      72,    73,    74,    75,    76,    77,    78,    79,    80,    -1,
-      82,    83,    -1,    85,    86,    87,    88,    89,    -1,    -1,
-      -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,
-      -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,
-      -1,    -1,    -1,   115,   116,    -1,    -1,    -1,   120,   121,
-     122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,
-     132,   133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,
-     142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,
-     152,   153,   154,    -1,    -1,   157,   158,    -1,   160,   161,
-     162,   163,   164,   165,    -1,    -1,   168,   169,   170,   171,
-     172,    -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,
-      -1,   183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,
-     192,    -1,   194,   195,   196,   197,    -1,   199,    -1,   201,
-      -1,    -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,
-     212,    -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,
-     222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,
-     232,   233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,
-     242,    -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,
-     252,   253,    -1,    -1,   256,    -1,    -1,   259,   260,    -1,
-      -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,
-      -1,   273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     282,    -1,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,   299,   300,    -1,
-     302,   303,   304,    -1,   306,   307,   308,   309,    -1,   311,
-     312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,
-     322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,
-     332,   333,   334,   335,   336,   337,   338,   339,   340,    -1,
-      -1,   343,   344,    -1,    -1,   347,   348,   349,   350,    -1,
-      -1,    -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,
-     362,   363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,
-      -1,   383,   384,    -1,   386,   387,   388,   389,   390,   391,
-     392,   393,   394,   395,    -1,    -1,   398,   399,   400,    -1,
-     402,    -1,   404,   405,   406,   407,   408,    -1,   410,   411,
-     412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,
-     422,   423,    -1,    -1,   426,   427,   428,   429,   430,    -1,
-     432,   433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,
-     442,    -1,   444,   445,    -1,   447,   448,   449,    -1,   451,
-      -1,    -1,   454,   455,   456,   457,   458,   459,   460,   461,
-     462,   463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,
-     472,   473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,
-     482,    -1,   484,   485,   486,   487,    -1,   489,   490,   491,
-     492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,
-      -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,
-     512,   513,   514,   515,   516,   517,    -1,    -1,   520,   521,
-      -1,   523,   524,   525,   526,   527,   528,    -1,    -1,   531,
-     532,   533,   534,    -1,   536,   537,    -1,    -1,   540,   541,
-     542,   543,    -1,    -1,   546,   547,    -1,   549,   550,   551,
-     552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,
-      -1,   563,   564,   565,   566,    -1,   568,   569,    -1,   571,
-     572,    -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,
-      -1,   583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,
-      -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,
-     602,   603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,
-     612,    -1,   614,   615,   616,    -1,     5,   619,     7,     8,
-       9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
-      -1,    -1,    21,    -1,    23,    24,    25,    26,    27,    28,
-      -1,    30,    -1,    -1,    -1,    34,    -1,    -1,    -1,    38,
-      -1,    -1,    41,    42,    43,    -1,    45,    -1,    47,    48,
-      -1,    -1,    51,    -1,    -1,    54,    55,    -1,    57,    58,
-      -1,    60,    -1,    62,    63,    64,    65,    66,    67,    -1,
-      69,    70,    -1,    72,    73,    74,    75,    76,    77,    78,
-      79,    80,    -1,    82,    83,    -1,    85,    86,    87,    88,
-      89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,
-      -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,
-      -1,   110,    -1,    -1,    -1,    -1,   115,   116,    -1,    -1,
-      -1,    -1,   121,   122,    -1,   124,    -1,    -1,    -1,   128,
-      -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,   138,
-      -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,
-     149,   150,    -1,   152,   153,   154,    -1,    -1,   157,   158,
-      -1,   160,   161,   162,   163,   164,   165,    -1,    -1,   168,
-     169,   170,   171,   172,    -1,    -1,   175,   176,    -1,   178,
-     179,   180,    -1,    -1,   183,    -1,    -1,    -1,   187,   188,
-      -1,   190,    -1,   192,    -1,   194,   195,   196,   197,    -1,
-     199,    -1,   201,    -1,    -1,    -1,   205,   206,    -1,   208,
-      -1,    -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,
-     219,    -1,    -1,   222,   223,   224,    -1,    -1,   227,    -1,
-      -1,    -1,    -1,   232,   233,    -1,    -1,    -1,   237,    -1,
-      -1,    -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,
-     249,    -1,    -1,   252,   253,    -1,    -1,   256,    -1,    -1,
-     259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,
-     269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   282,    -1,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-     299,   300,    -1,   302,   303,   304,    -1,   306,   307,   308,
-     309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,
-     319,   320,   321,   322,    -1,    -1,   325,   326,    -1,   328,
-      -1,   330,    -1,   332,   333,   334,   335,   336,   337,   338,
-     339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,
-     349,   350,    -1,    -1,    -1,   354,   355,    -1,    -1,    -1,
-     359,    -1,   361,   362,   363,    -1,   365,   366,   367,    -1,
-     369,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     379,   380,   381,    -1,   383,   384,    -1,   386,   387,   388,
-     389,   390,   391,   392,   393,   394,   395,    -1,    -1,   398,
-     399,   400,   401,   402,    -1,   404,   405,   406,   407,   408,
-      -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,
-     419,   420,   421,   422,   423,    -1,    -1,   426,   427,   428,
-     429,   430,    -1,   432,   433,    -1,   435,   436,   437,    -1,
-      -1,   440,    -1,   442,    -1,   444,   445,    -1,   447,   448,
-     449,    -1,   451,    -1,    -1,   454,   455,   456,   457,   458,
-     459,   460,   461,   462,   463,   464,    -1,   466,   467,    -1,
-      -1,    -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,
-      -1,    -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,
-     489,   490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,
-     499,   500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,
-     509,    -1,    -1,   512,   513,   514,   515,   516,   517,    -1,
-      -1,   520,   521,    -1,   523,   524,   525,   526,   527,   528,
-      -1,    -1,   531,   532,   533,   534,    -1,   536,   537,    -1,
-      -1,   540,   541,   542,   543,    -1,    -1,   546,   547,    -1,
-     549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,
-     559,    -1,    -1,    -1,   563,   564,   565,   566,    -1,   568,
-     569,    -1,   571,   572,    -1,   574,   575,    -1,    -1,   578,
-      -1,    -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,
-      -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,
-      -1,   600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,
-      -1,    -1,   611,   612,    -1,   614,   615,   616,    -1,     5,
-     619,     7,     8,     9,    10,    11,    -1,    -1,    14,    -1,
-      -1,    -1,    18,    -1,    -1,    21,    -1,    23,    24,    25,
-      26,    27,    28,    -1,    30,    -1,    -1,    -1,    34,    -1,
-      -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,
-      -1,    47,    48,    -1,    -1,    51,    -1,    -1,    54,    55,
-      -1,    57,    58,    -1,    60,    -1,    62,    63,    64,    65,
-      66,    67,    -1,    69,    70,    -1,    72,    73,    74,    75,
-      76,    77,    78,    79,    80,    -1,    82,    83,    -1,    85,
-      86,    87,    88,    89,    -1,    -1,    -1,    93,    -1,    -1,
-      96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,
-     106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,
-     116,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,
-      -1,    -1,   128,    -1,   130,   131,   132,   133,   134,    -1,
-      -1,    -1,   138,    -1,    -1,   141,   142,   143,    -1,    -1,
-      -1,   147,    -1,   149,   150,    -1,   152,   153,   154,    -1,
-      -1,   157,   158,    -1,   160,   161,   162,   163,   164,   165,
-      -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,   175,
-     176,    -1,   178,   179,   180,    -1,    -1,   183,    -1,    -1,
-      -1,   187,   188,    -1,   190,    -1,   192,    -1,   194,   195,
-     196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,   205,
-     206,    -1,   208,    -1,    -1,   211,   212,    -1,    -1,    -1,
-     216,   217,   218,   219,    -1,    -1,   222,   223,   224,    -1,
-      -1,   227,    -1,    -1,    -1,    -1,   232,   233,    -1,    -1,
-      -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,
-      -1,    -1,    -1,   249,    -1,    -1,   252,   253,    -1,    -1,
-     256,    -1,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,
-     266,   267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,   299,   300,    -1,   302,   303,   304,    -1,
-     306,   307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,
-      -1,   317,   318,   319,   320,   321,   322,    -1,    -1,   325,
-     326,    -1,   328,    -1,   330,    -1,   332,   333,   334,   335,
-     336,   337,   338,   339,   340,    -1,    -1,   343,   344,    -1,
-      -1,   347,   348,   349,   350,    -1,    -1,    -1,   354,   355,
-      -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,
-     366,   367,    -1,   369,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   379,   380,   381,    -1,   383,   384,    -1,
-     386,   387,   388,   389,   390,   391,   392,   393,   394,   395,
-      -1,    -1,   398,   399,   400,    -1,   402,    -1,   404,   405,
-     406,   407,   408,    -1,   410,   411,   412,    -1,    -1,   415,
-      -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,
-     426,   427,   428,   429,   430,    -1,   432,   433,    -1,   435,
-     436,   437,    -1,    -1,   440,    -1,   442,    -1,   444,   445,
-      -1,   447,   448,   449,    -1,   451,    -1,    -1,   454,   455,
-     456,   457,   458,   459,   460,   461,   462,   463,   464,    -1,
-     466,   467,    -1,    -1,    -1,   471,   472,   473,   474,    -1,
-      -1,    -1,   478,    -1,    -1,    -1,   482,    -1,   484,   485,
-     486,   487,    -1,   489,   490,   491,   492,   493,    -1,    -1,
-      -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,
-     506,    -1,    -1,   509,    -1,    -1,   512,   513,   514,   515,
-     516,   517,    -1,    -1,   520,   521,    -1,   523,   524,   525,
-     526,   527,   528,    -1,    -1,   531,   532,   533,   534,    -1,
-     536,   537,    -1,    -1,   540,   541,   542,   543,    -1,   545,
-     546,   547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,
-      -1,    -1,   558,   559,    -1,    -1,    -1,   563,   564,   565,
-     566,    -1,   568,   569,    -1,   571,   572,    -1,   574,   575,
-      -1,    -1,   578,    -1,    -1,   581,    -1,   583,    -1,   585,
-     586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,
-     596,    -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,
-      -1,    -1,    -1,    -1,    -1,   611,   612,    -1,   614,   615,
-     616,    -1,     5,   619,     7,     8,     9,    10,    11,    -1,
-      -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    21,    -1,
-      23,    24,    25,    26,    27,    28,    -1,    30,    -1,    -1,
-      -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,
-      43,    -1,    45,    -1,    47,    48,    -1,    -1,    51,    -1,
-      -1,    54,    55,    -1,    57,    58,    -1,    60,    -1,    62,
-      63,    64,    65,    66,    67,    -1,    69,    70,    -1,    72,
-      73,    74,    75,    76,    77,    78,    79,    80,    -1,    82,
-      83,    -1,    85,    86,    87,    88,    89,    -1,    -1,    -1,
-      93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,
-      -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,
-      -1,    -1,   115,   116,    -1,    -1,    -1,    -1,   121,   122,
-      -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,
-     133,   134,    -1,    -1,    -1,   138,    -1,    -1,   141,   142,
-     143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,   152,
-     153,   154,    -1,    -1,   157,   158,    -1,   160,   161,   162,
-     163,   164,   165,    -1,    -1,   168,   169,   170,   171,   172,
-      -1,    -1,   175,   176,    -1,   178,   179,   180,    -1,    -1,
-     183,    -1,    -1,    -1,   187,   188,    -1,   190,    -1,   192,
-      -1,   194,   195,   196,   197,    -1,   199,    -1,   201,    -1,
-      -1,    -1,   205,   206,    -1,   208,    -1,    -1,   211,   212,
-      -1,    -1,    -1,   216,   217,   218,   219,    -1,    -1,   222,
-     223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,
-     233,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,
-      -1,   244,   245,    -1,    -1,    -1,   249,    -1,    -1,   252,
-     253,    -1,    -1,   256,    -1,    -1,   259,   260,    -1,    -1,
-      -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,
-     273,   274,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   282,
-      -1,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,   299,   300,    -1,   302,
-     303,   304,    -1,   306,   307,   308,   309,    -1,   311,   312,
-      -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,   322,
-      -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,
-     333,   334,   335,   336,   337,   338,   339,   340,    -1,    -1,
-     343,   344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,
-      -1,   354,   355,    -1,    -1,    -1,   359,    -1,   361,   362,
-     363,    -1,   365,   366,   367,    -1,   369,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   379,   380,   381,    -1,
-     383,   384,    -1,   386,   387,   388,   389,   390,   391,   392,
-     393,   394,   395,    -1,    -1,   398,   399,   400,    -1,   402,
-      -1,   404,   405,   406,   407,   408,    -1,   410,   411,   412,
-      -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,
-     423,    -1,    -1,   426,   427,   428,   429,   430,    -1,   432,
-     433,    -1,   435,   436,   437,    -1,    -1,   440,    -1,   442,
-      -1,   444,   445,    -1,   447,   448,   449,    -1,   451,    -1,
-      -1,   454,   455,   456,   457,   458,   459,   460,   461,   462,
-     463,   464,    -1,   466,   467,    -1,    -1,    -1,   471,   472,
-     473,   474,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,
-      -1,   484,   485,   486,   487,    -1,   489,   490,   491,   492,
-     493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,
-     503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,
-     513,   514,   515,   516,   517,    -1,    -1,   520,   521,    -1,
-     523,   524,   525,   526,   527,   528,    -1,    -1,   531,   532,
-     533,   534,    -1,   536,   537,    -1,    -1,   540,   541,   542,
-     543,    -1,    -1,   546,   547,    -1,   549,   550,   551,   552,
-      -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,
-     563,   564,   565,   566,    -1,   568,   569,    -1,   571,   572,
-      -1,   574,   575,    -1,    -1,   578,    -1,    -1,   581,    -1,
-     583,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,
-     593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,
-     603,   604,    -1,    -1,    -1,    -1,    -1,    -1,   611,   612,
-      -1,   614,   615,   616,    -1,     5,   619,     7,     8,     9,
-      10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,
-      -1,    21,    -1,    23,    24,    25,    26,    27,    28,    -1,
-      30,    -1,    -1,    -1,    34,    -1,    -1,    -1,    38,    -1,
-      -1,    41,    42,    43,    -1,    45,    -1,    47,    48,    -1,
-      -1,    51,    -1,    -1,    54,    55,    -1,    57,    58,    -1,
-      60,    -1,    62,    63,    64,    65,    66,    67,    -1,    69,
-      70,    -1,    72,    73,    74,    75,    76,    77,    78,    79,
-      80,    -1,    82,    83,    -1,    85,    86,    87,    88,    89,
-      -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,
-      -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,
-     110,    -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,
-      -1,   121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,
-     130,   131,   132,   133,   134,    -1,    -1,    -1,   138,    -1,
-      -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,   149,
-     150,    -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,
-     160,   161,   162,   163,   164,   165,    -1,    -1,   168,   169,
-     170,   171,   172,    -1,    -1,   175,   176,    -1,   178,   179,
-     180,    -1,    -1,   183,    -1,    -1,    -1,   187,   188,    -1,
-     190,    -1,   192,    -1,   194,   195,   196,   197,    -1,   199,
-      -1,   201,    -1,    -1,    -1,   205,   206,    -1,   208,    -1,
-      -1,   211,   212,    -1,    -1,    -1,   216,   217,   218,   219,
-      -1,    -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,
-      -1,    -1,   232,   233,    -1,    -1,    -1,   237,    -1,    -1,
-      -1,   241,   242,    -1,   244,   245,    -1,    -1,    -1,   249,
-      -1,    -1,   252,   253,    -1,    -1,   256,    -1,    -1,   259,
-     260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,
-      -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   282,    -1,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,   299,
-     300,    -1,   302,   303,   304,    -1,   306,   307,   308,   309,
-      -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,
-     320,   321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,
-     330,    -1,   332,   333,   334,   335,   336,   337,   338,   339,
-     340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,
-     350,    -1,    -1,    -1,   354,   355,    -1,    -1,    -1,   359,
-      -1,   361,   362,   363,    -1,   365,   366,   367,    -1,   369,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   379,
-     380,   381,    -1,   383,   384,    -1,   386,   387,   388,   389,
-     390,   391,   392,   393,   394,   395,    -1,    -1,   398,   399,
-     400,    -1,   402,    -1,   404,   405,   406,   407,   408,    -1,
-     410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,
-     420,   421,   422,   423,    -1,    -1,   426,   427,   428,   429,
-     430,    -1,   432,   433,    -1,   435,   436,   437,    -1,    -1,
-     440,    -1,   442,    -1,   444,   445,    -1,   447,   448,   449,
-      -1,   451,    -1,    -1,   454,   455,   456,   457,   458,   459,
-     460,   461,   462,   463,   464,    -1,   466,   467,    -1,    -1,
-      -1,   471,   472,   473,   474,    -1,    -1,    -1,   478,    -1,
-      -1,    -1,   482,    -1,   484,   485,   486,   487,    -1,   489,
-     490,   491,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,
-     500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,
-      -1,    -1,   512,   513,   514,   515,   516,   517,    -1,    -1,
-     520,   521,    -1,   523,   524,   525,   526,   527,   528,    -1,
-      -1,   531,   532,   533,   534,    -1,   536,   537,    -1,    -1,
-     540,   541,   542,   543,    -1,    -1,   546,   547,    -1,   549,
-     550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,
-      -1,    -1,    -1,   563,   564,   565,   566,    -1,   568,   569,
-      -1,   571,   572,    -1,   574,   575,    -1,    -1,   578,    -1,
-      -1,   581,    -1,   583,    -1,   585,   586,    -1,    -1,    -1,
-      -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,
-     600,   601,   602,   603,   604,    -1,    -1,    -1,    -1,    -1,
-      -1,   611,   612,    -1,   614,   615,   616,    -1,     5,   619,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    -1,    -1,    23,    24,    25,    26,
-      27,    -1,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,
-      -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,
-      -1,    -1,    -1,    -1,    51,    52,    -1,    54,    55,    -1,
-      57,    -1,    -1,    -1,    -1,    62,    63,    64,    65,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    -1,    75,    -1,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    -1,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,
-      -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,
-     107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,    -1,
-      -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,    -1,    -1,    -1,   141,   142,   143,    -1,   145,   146,
-     147,    -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,    -1,    -1,
-      -1,   168,   169,   170,   171,   172,    -1,    -1,   175,   176,
-     177,   178,   179,   180,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,    -1,    -1,    -1,   206,
-      -1,    -1,    -1,    -1,    -1,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,   220,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,    -1,   232,    -1,    -1,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,   246,
-      -1,    -1,   249,    -1,    -1,    -1,   253,    -1,    -1,   256,
-     257,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-      -1,    -1,   279,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,    -1,   306,
-     307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-      -1,   328,    -1,   330,    -1,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,
-     347,   348,   349,   350,    -1,    -1,    -1,    -1,   355,    -1,
-      -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,   366,
-     367,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   380,   381,    -1,    -1,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,    -1,    -1,
-      -1,    -1,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,    -1,    -1,   435,    -1,
-     437,   438,    -1,   440,    -1,    -1,    -1,   444,    -1,    -1,
-     447,   448,   449,   450,   451,    -1,    -1,    -1,   455,   456,
-     457,   458,   459,   460,   461,    -1,   463,   464,    -1,   466,
-      -1,    -1,    -1,    -1,   471,   472,   473,    -1,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,    -1,   485,    -1,
-     487,    -1,   489,    -1,    -1,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,    -1,   514,   515,   516,
-     517,    -1,    -1,    -1,   521,    -1,   523,   524,   525,   526,
-     527,   528,    -1,    -1,   531,   532,   533,   534,    -1,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,    -1,    -1,    -1,   564,   565,   566,
-      -1,   568,   569,    -1,   571,   572,    -1,    -1,    -1,    -1,
-      -1,   578,    -1,    -1,   581,    -1,    -1,    -1,   585,   586,
-      -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,
-      -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,
-     607,    -1,    -1,    -1,   611,    -1,    -1,   614,    -1,   616,
-      -1,     5,   619,     7,     8,     9,    10,    11,    -1,    -1,
-      14,    -1,    -1,    -1,    18,    -1,    -1,    -1,    -1,    23,
-      24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,    -1,
-      34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,
-      -1,    45,    -1,    -1,    -1,    -1,    -1,    51,    52,    -1,
-      54,    55,    -1,    57,    -1,    -1,    -1,    -1,    62,    63,
-      64,    65,    66,    67,    -1,    69,    70,    -1,    72,    73,
-      -1,    75,    -1,    77,    78,    79,    80,    -1,    82,    83,
-      -1,    85,    86,    87,    -1,    89,    -1,    -1,    -1,    93,
-      -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,
-      -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,
-      -1,   115,    -1,    -1,    -1,    -1,    -1,   121,   122,    -1,
-     124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,
-     134,    -1,    -1,    -1,    -1,    -1,    -1,   141,   142,   143,
-      -1,   145,    -1,   147,    -1,   149,   150,    -1,   152,   153,
-     154,    -1,    -1,   157,   158,    -1,   160,   161,   162,   163,
-     164,    -1,    -1,    -1,   168,   169,   170,   171,   172,    -1,
-      -1,   175,   176,   177,   178,   179,   180,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   188,    -1,   190,    -1,   192,    -1,
-     194,   195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,
-      -1,    -1,   206,    -1,    -1,    -1,    -1,    -1,   212,    -1,
-      -1,    -1,   216,   217,   218,   219,   220,    -1,   222,   223,
-     224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,    -1,
-      -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,
-     244,   245,   246,    -1,    -1,   249,    -1,    -1,    -1,   253,
-      -1,    -1,   256,   257,    -1,   259,   260,    -1,    -1,    -1,
-      -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,
-     274,    -1,    -1,    -1,    -1,   279,    -1,    -1,   282,    -1,
-     284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
-     294,   295,   296,   297,   298,   299,   300,    -1,   302,   303,
-     304,    -1,   306,   307,   308,   309,    -1,   311,   312,    -1,
-      -1,    -1,    -1,   317,   318,   319,   320,   321,   322,    -1,
-      -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,   333,
-     334,   335,   336,   337,   338,   339,   340,    -1,    -1,   343,
-     344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,
-      -1,   355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,
-      -1,   365,   366,   367,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   380,   381,    -1,    -1,
-     384,    -1,   386,   387,   388,   389,   390,   391,   392,   393,
-     394,    -1,    -1,    -1,    -1,   399,   400,    -1,   402,    -1,
-     404,   405,   406,   407,   408,    -1,   410,   411,   412,    -1,
-      -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,   423,
-      -1,    -1,   426,   427,   428,   429,   430,    -1,   432,    -1,
-      -1,   435,    -1,   437,   438,    -1,   440,    -1,    -1,    -1,
-     444,    -1,    -1,   447,   448,   449,   450,   451,    -1,    -1,
-      -1,   455,   456,   457,   458,   459,   460,   461,    -1,   463,
-     464,    -1,   466,    -1,    -1,    -1,    -1,   471,   472,   473,
-      -1,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,
-      -1,   485,    -1,   487,    -1,   489,    -1,    -1,   492,   493,
-      -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,
-     504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,    -1,
-     514,   515,   516,   517,    -1,    -1,    -1,   521,    -1,   523,
-     524,   525,   526,   527,   528,    -1,    -1,   531,   532,   533,
-     534,    -1,   536,   537,    -1,    -1,   540,   541,   542,   543,
-      -1,    -1,   546,   547,    -1,   549,   550,   551,   552,    -1,
-      -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,    -1,
-     564,   565,   566,    -1,   568,   569,    -1,   571,   572,    -1,
-      -1,    -1,    -1,    -1,   578,    -1,    -1,   581,    -1,    -1,
-      -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,
-      -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,
-     604,   605,    -1,   607,    -1,    -1,    -1,   611,    -1,    -1,
-     614,    -1,   616,    -1,     5,   619,     7,     8,     9,    10,
-      11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,
-      -1,    -1,    23,    24,    25,    26,    27,    -1,    -1,    30,
-      -1,    -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,
-      41,    42,    43,    -1,    45,    -1,    -1,    -1,    -1,    -1,
-      51,    52,    -1,    54,    55,    -1,    57,    -1,    -1,    -1,
-      -1,    62,    63,    64,    65,    66,    67,    -1,    69,    70,
-      -1,    72,    73,    -1,    75,    -1,    77,    78,    79,    80,
-      -1,    82,    83,    -1,    85,    86,    87,    -1,    89,    -1,
-      -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,
-     101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,
-      -1,    -1,    -1,    -1,   115,    -1,    -1,    -1,    -1,    -1,
-     121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,
-     131,   132,   133,   134,    -1,    -1,    -1,    -1,    -1,    -1,
-     141,   142,   143,    -1,   145,    -1,   147,    -1,   149,   150,
-      -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,   160,
-     161,   162,   163,   164,    -1,    -1,    -1,   168,   169,   170,
-     171,   172,    -1,    -1,   175,   176,   177,   178,   179,   180,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   188,    -1,   190,
-      -1,   192,    -1,   194,   195,   196,   197,    -1,   199,    -1,
-     201,    -1,    -1,    -1,    -1,   206,    -1,    -1,    -1,    -1,
-      -1,   212,    -1,    -1,    -1,   216,   217,   218,   219,   220,
-      -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,
-      -1,   232,    -1,    -1,    -1,    -1,   237,    -1,    -1,    -1,
-     241,   242,    -1,   244,   245,   246,    -1,    -1,   249,    -1,
-      -1,    -1,   253,    -1,    -1,   256,   257,    -1,   259,   260,
-      -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,
-     271,    -1,   273,   274,    -1,    -1,    -1,    -1,   279,    -1,
-      -1,   282,    -1,   284,   285,   286,   287,   288,   289,   290,
-     291,   292,   293,   294,   295,   296,   297,   298,   299,   300,
-      -1,   302,   303,   304,    -1,   306,   307,   308,   309,    -1,
-     311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,
-     321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,
-      -1,   332,   333,   334,   335,   336,   337,   338,   339,   340,
-      -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,   350,
-      -1,    -1,    -1,    -1,   355,    -1,    -1,    -1,   359,    -1,
-     361,   362,   363,    -1,   365,   366,   367,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   380,
-     381,    -1,    -1,   384,    -1,   386,   387,   388,   389,   390,
-     391,   392,   393,   394,    -1,    -1,    -1,    -1,   399,   400,
-      -1,   402,    -1,   404,   405,   406,   407,   408,    -1,   410,
-     411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,
-     421,   422,   423,    -1,    -1,   426,   427,   428,   429,   430,
-      -1,   432,    -1,    -1,   435,    -1,   437,   438,    -1,   440,
-      -1,    -1,    -1,   444,    -1,    -1,   447,   448,   449,   450,
-     451,    -1,    -1,    -1,   455,   456,   457,   458,   459,   460,
-     461,    -1,   463,   464,    -1,   466,    -1,    -1,    -1,    -1,
-     471,   472,   473,    -1,    -1,    -1,    -1,   478,    -1,    -1,
-      -1,   482,    -1,    -1,   485,    -1,   487,    -1,   489,    -1,
-      -1,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,
-     501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,
-      -1,   512,    -1,   514,   515,   516,   517,    -1,    -1,    -1,
-     521,    -1,   523,   524,   525,   526,   527,   528,    -1,    -1,
-     531,   532,   533,   534,    -1,   536,   537,    -1,    -1,   540,
-     541,   542,   543,    -1,    -1,   546,   547,    -1,   549,   550,
-     551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,
-      -1,    -1,    -1,   564,   565,   566,    -1,   568,   569,    -1,
-     571,   572,    -1,    -1,    -1,    -1,    -1,   578,    -1,    -1,
-     581,    -1,    -1,    -1,   585,   586,    -1,    -1,    -1,    -1,
-      -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,
-     601,   602,   603,   604,   605,    -1,   607,    -1,    -1,    -1,
-     611,    -1,    -1,   614,    -1,   616,    -1,     5,   619,     7,
-       8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,
-      18,    -1,    -1,    -1,    -1,    23,    24,    25,    26,    27,
-      -1,    -1,    30,    -1,    -1,    -1,    34,    -1,    -1,    -1,
-      38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,    -1,
-      -1,    -1,    -1,    51,    52,    -1,    54,    55,    -1,    57,
-      -1,    -1,    -1,    -1,    62,    63,    64,    65,    66,    67,
-      -1,    69,    70,    -1,    72,    73,    -1,    75,    -1,    77,
-      78,    79,    80,    -1,    82,    83,    -1,    85,    86,    87,
-      -1,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,
-      98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,
-      -1,    -1,   110,    -1,    -1,    -1,    -1,   115,    -1,    -1,
-      -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,    -1,
-     128,    -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,
-      -1,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,
-      -1,   149,   150,    -1,   152,   153,   154,    -1,    -1,   157,
-     158,    -1,   160,   161,   162,   163,   164,    -1,    -1,    -1,
-     168,   169,   170,   171,   172,    -1,    -1,   175,   176,   177,
-     178,   179,   180,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     188,    -1,   190,    -1,   192,    -1,   194,   195,   196,   197,
-      -1,   199,    -1,   201,    -1,    -1,    -1,    -1,   206,    -1,
-      -1,    -1,    -1,    -1,   212,    -1,    -1,    -1,   216,   217,
-     218,   219,   220,    -1,   222,   223,   224,    -1,    -1,   227,
-      -1,    -1,    -1,    -1,   232,    -1,    -1,    -1,    -1,   237,
-      -1,    -1,    -1,   241,   242,    -1,   244,   245,   246,    -1,
-      -1,   249,    -1,    -1,    -1,   253,    -1,    -1,   256,   257,
-      -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,
-      -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,
-      -1,   279,    -1,    -1,   282,    -1,   284,   285,   286,   287,
-     288,   289,   290,   291,   292,   293,   294,   295,   296,   297,
-     298,   299,   300,    -1,   302,   303,   304,    -1,   306,   307,
-     308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,
-     318,   319,   320,   321,   322,    -1,    -1,   325,   326,    -1,
-     328,    -1,   330,    -1,   332,   333,   334,   335,   336,   337,
-     338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,
-     348,   349,   350,    -1,    -1,    -1,    -1,   355,    -1,    -1,
-      -1,   359,    -1,   361,   362,   363,    -1,   365,   366,   367,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   380,   381,    -1,    -1,   384,    -1,   386,   387,
-     388,   389,   390,   391,   392,   393,   394,    -1,    -1,    -1,
-      -1,   399,   400,    -1,   402,    -1,   404,   405,   406,   407,
-     408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,
-      -1,   419,   420,   421,   422,   423,    -1,    -1,   426,   427,
-     428,   429,   430,    -1,   432,    -1,    -1,   435,    -1,   437,
-     438,    -1,   440,    -1,    -1,    -1,   444,    -1,    -1,   447,
-     448,   449,   450,   451,    -1,    -1,    -1,   455,   456,   457,
-     458,   459,   460,   461,    -1,   463,   464,    -1,   466,    -1,
-      -1,    -1,    -1,   471,   472,   473,    -1,    -1,    -1,    -1,
-     478,    -1,    -1,    -1,   482,    -1,    -1,   485,    -1,   487,
-      -1,   489,    -1,    -1,   492,   493,    -1,    -1,    -1,    -1,
-      -1,   499,   500,   501,    -1,   503,   504,    -1,   506,    -1,
-      -1,   509,    -1,    -1,   512,    -1,   514,   515,   516,   517,
-      -1,    -1,    -1,   521,    -1,   523,   524,   525,   526,   527,
-     528,    -1,    -1,   531,   532,   533,   534,    -1,   536,   537,
-      -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,   547,
-      -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,
-     558,   559,    -1,    -1,    -1,    -1,   564,   565,   566,    -1,
-     568,   569,    -1,   571,   572,    -1,    -1,    -1,    -1,    -1,
-     578,    -1,    -1,   581,    -1,    -1,    -1,   585,   586,    -1,
-      -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,
-      -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,   607,
-      -1,    -1,    -1,   611,    -1,    -1,   614,    -1,   616,    -1,
-       5,   619,     7,     8,     9,    10,    11,    -1,    -1,    14,
-      -1,    -1,    -1,    18,    -1,    -1,    -1,    -1,    23,    24,
-      25,    26,    27,    -1,    -1,    30,    -1,    -1,    -1,    34,
-      -1,    -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,
-      45,    -1,    -1,    -1,    -1,    -1,    51,    52,    -1,    54,
-      55,    -1,    57,    -1,    -1,    -1,    -1,    62,    63,    64,
-      65,    66,    67,    -1,    69,    70,    -1,    72,    73,    -1,
-      75,    -1,    77,    78,    79,    80,    -1,    82,    83,    -1,
-      85,    86,    87,    -1,    89,    -1,    -1,    -1,    93,    -1,
-      -1,    96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,
-     105,   106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,
-     115,    -1,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-      -1,    -1,    -1,    -1,    -1,    -1,   141,   142,   143,    -1,
-      -1,    -1,   147,    -1,   149,   150,    -1,   152,   153,   154,
-      -1,    -1,   157,   158,    -1,   160,   161,   162,   163,   164,
-      -1,    -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,
-     175,   176,   177,   178,   179,   180,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   188,    -1,   190,    -1,   192,    -1,   194,
-     195,   196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,
-      -1,   206,    -1,    -1,    -1,    -1,    -1,   212,    -1,    -1,
-      -1,   216,   217,   218,   219,   220,    -1,   222,   223,   224,
-      -1,    -1,   227,    -1,    -1,    -1,    -1,   232,    -1,    -1,
-      -1,    -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,
-     245,   246,    -1,    -1,   249,    -1,    -1,    -1,   253,    -1,
-      -1,   256,   257,    -1,   259,   260,    -1,    -1,    -1,    -1,
-      -1,   266,   267,    -1,   269,    -1,   271,    -1,   273,   274,
-      -1,    -1,    -1,    -1,   279,    -1,    -1,   282,    -1,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,    -1,   302,   303,   304,
-      -1,   306,   307,   308,   309,    -1,   311,   312,    -1,    -1,
-      -1,    -1,   317,   318,   319,   320,   321,   322,    -1,    -1,
-     325,   326,    -1,   328,    -1,   330,    -1,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,    -1,    -1,   343,   344,
-      -1,    -1,   347,   348,   349,   350,    -1,    -1,    -1,    -1,
-     355,    -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,
-     365,   366,   367,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   380,   381,    -1,    -1,   384,
-      -1,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-      -1,    -1,    -1,    -1,   399,   400,    -1,   402,    -1,   404,
-     405,   406,   407,   408,    -1,   410,   411,   412,    -1,    -1,
-     415,    -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,
-      -1,   426,   427,   428,   429,   430,    -1,   432,    -1,    -1,
-     435,    -1,   437,   438,    -1,   440,    -1,    -1,    -1,   444,
-      -1,    -1,   447,   448,   449,   450,   451,    -1,    -1,    -1,
-     455,   456,   457,   458,   459,   460,   461,    -1,   463,   464,
-      -1,   466,    -1,    -1,    -1,    -1,   471,   472,   473,    -1,
-      -1,    -1,    -1,   478,    -1,    -1,    -1,   482,    -1,    -1,
-     485,    -1,   487,    -1,   489,    -1,    -1,   492,   493,    -1,
-      -1,    -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,
-      -1,   506,    -1,    -1,   509,    -1,    -1,   512,    -1,   514,
-     515,   516,   517,    -1,    -1,    -1,   521,    -1,   523,   524,
-     525,   526,   527,   528,    -1,    -1,   531,   532,   533,   534,
-      -1,   536,   537,    -1,    -1,   540,   541,   542,   543,    -1,
-      -1,   546,   547,    -1,   549,   550,   551,   552,    -1,    -1,
-      -1,    -1,    -1,   558,   559,    -1,    -1,    -1,    -1,   564,
-     565,   566,    -1,   568,   569,    -1,   571,   572,    -1,    -1,
-      -1,    -1,    -1,   578,    -1,    -1,   581,    -1,    -1,    -1,
-     585,   586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,
-      -1,   596,    -1,    -1,    -1,   600,   601,   602,   603,   604,
-      -1,    -1,   607,    -1,    -1,    -1,   611,    -1,    -1,   614,
-      -1,   616,    -1,     5,   619,     7,     8,     9,    10,    11,
-      -1,    -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    -1,
-      -1,    23,    24,    25,    26,    27,    -1,    -1,    30,    -1,
-      -1,    -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,
-      42,    43,    -1,    45,    -1,    -1,    -1,    -1,    -1,    51,
-      52,    -1,    54,    55,    -1,    57,    -1,    -1,    -1,    -1,
-      62,    63,    64,    65,    66,    67,    -1,    69,    70,    -1,
-      72,    73,    -1,    75,    -1,    77,    78,    79,    80,    -1,
-      82,    83,    -1,    85,    86,    87,    -1,    89,    -1,    -1,
-      -1,    93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,
-      -1,    -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,
-      -1,    -1,    -1,   115,    -1,    -1,    -1,    -1,    -1,   121,
-     122,    -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,
-     132,   133,   134,    -1,    -1,    -1,    -1,    -1,    -1,   141,
-     142,   143,    -1,    -1,    -1,   147,    -1,   149,   150,    -1,
-     152,   153,   154,    -1,    -1,   157,   158,    -1,   160,   161,
-     162,   163,   164,    -1,    -1,    -1,   168,   169,   170,   171,
-     172,    -1,    -1,   175,   176,   177,   178,   179,   180,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   188,    -1,   190,    -1,
-     192,    -1,   194,   195,   196,   197,    -1,   199,    -1,   201,
-      -1,    -1,    -1,    -1,   206,    -1,    -1,    -1,    -1,    -1,
-     212,    -1,    -1,    -1,   216,   217,   218,   219,   220,    -1,
-     222,   223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,
-     232,    -1,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,
-     242,    -1,   244,   245,   246,    -1,    -1,   249,    -1,    -1,
-      -1,   253,    -1,    -1,   256,   257,    -1,   259,   260,    -1,
-      -1,    -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,
-      -1,   273,   274,    -1,    -1,    -1,    -1,   279,    -1,    -1,
-     282,    -1,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,   299,   300,    -1,
-     302,   303,   304,    -1,   306,   307,   308,   309,    -1,   311,
-     312,    -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,
-     322,    -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,
-     332,   333,   334,   335,   336,   337,   338,   339,   340,    -1,
-      -1,   343,   344,    -1,    -1,   347,   348,   349,   350,    -1,
-      -1,    -1,    -1,   355,    -1,    -1,    -1,   359,    -1,   361,
-     362,   363,    -1,   365,   366,   367,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   380,   381,
-      -1,    -1,   384,    -1,   386,   387,   388,   389,   390,   391,
-     392,   393,   394,    -1,    -1,    -1,    -1,   399,   400,    -1,
-     402,    -1,   404,   405,   406,   407,   408,    -1,   410,   411,
-     412,    -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,
-     422,   423,    -1,    -1,   426,   427,   428,   429,   430,    -1,
-     432,    -1,    -1,   435,    -1,   437,   438,    -1,   440,    -1,
-      -1,    -1,   444,    -1,    -1,   447,   448,   449,   450,   451,
-      -1,    -1,    -1,   455,   456,   457,   458,   459,   460,   461,
-      -1,   463,   464,    -1,   466,    -1,    -1,    -1,    -1,   471,
-     472,   473,    -1,    -1,    -1,    -1,   478,    -1,    -1,    -1,
-     482,    -1,    -1,   485,    -1,   487,    -1,   489,    -1,    -1,
-     492,   493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,
-      -1,   503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,
-     512,    -1,   514,   515,   516,   517,    -1,    -1,    -1,   521,
-      -1,   523,   524,   525,   526,   527,   528,    -1,    -1,   531,
-     532,   533,   534,    -1,   536,   537,    -1,    -1,   540,   541,
-     542,   543,    -1,    -1,   546,   547,    -1,   549,   550,   551,
-     552,    -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,
-      -1,    -1,   564,   565,   566,    -1,   568,   569,    -1,   571,
-     572,    -1,    -1,    -1,    -1,    -1,   578,    -1,    -1,   581,
-      -1,    -1,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,
-      -1,   593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,
-     602,   603,   604,    -1,    -1,   607,    -1,    -1,    -1,   611,
-      -1,    -1,   614,    -1,   616,    -1,     5,   619,     7,     8,
-       9,    10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
-      -1,    -1,    -1,    -1,    23,    24,    25,    26,    27,    -1,
-      -1,    30,    -1,    -1,    -1,    34,    -1,    -1,    -1,    38,
-      -1,    -1,    41,    42,    43,    -1,    45,    -1,    -1,    -1,
-      -1,    -1,    51,    52,    -1,    54,    55,    -1,    57,    -1,
-      -1,    -1,    -1,    62,    63,    64,    65,    66,    67,    -1,
-      69,    70,    -1,    72,    73,    -1,    75,    -1,    77,    78,
-      79,    80,    -1,    82,    83,    -1,    85,    86,    87,    -1,
-      89,    -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,
-      -1,    -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,
-      -1,   110,    -1,    -1,    -1,    -1,   115,    -1,    -1,    -1,
-      -1,    -1,   121,   122,    -1,   124,    -1,    -1,    -1,   128,
-      -1,   130,   131,   132,   133,   134,    -1,    -1,    -1,    -1,
-      -1,    -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,
-     149,   150,    -1,   152,   153,   154,    -1,    -1,   157,   158,
-      -1,   160,   161,   162,   163,   164,    -1,    -1,    -1,   168,
-     169,   170,   171,   172,    -1,    -1,   175,   176,   177,   178,
-     179,   180,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   188,
-      -1,   190,    -1,   192,    -1,   194,   195,   196,   197,    -1,
-     199,    -1,   201,    -1,    -1,    -1,    -1,   206,    -1,    -1,
-      -1,    -1,    -1,   212,    -1,    -1,    -1,   216,   217,   218,
-     219,   220,    -1,   222,   223,   224,    -1,    -1,   227,    -1,
-      -1,    -1,    -1,   232,    -1,    -1,    -1,    -1,   237,    -1,
-      -1,    -1,   241,   242,    -1,   244,   245,   246,    -1,    -1,
-     249,    -1,    -1,    -1,   253,    -1,    -1,   256,   257,    -1,
-     259,   260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,
-     269,    -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,
-     279,    -1,    -1,   282,    -1,   284,   285,   286,   287,   288,
-     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
-     299,   300,    -1,   302,   303,   304,    -1,   306,   307,   308,
-     309,    -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,
-     319,   320,   321,   322,    -1,    -1,   325,   326,    -1,   328,
-      -1,   330,    -1,   332,   333,   334,   335,   336,   337,   338,
-     339,   340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,
-     349,   350,    -1,    -1,    -1,    -1,   355,    -1,    -1,    -1,
-     359,    -1,   361,   362,   363,    -1,   365,   366,   367,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   380,   381,    -1,    -1,   384,    -1,   386,   387,   388,
-     389,   390,   391,   392,   393,   394,    -1,    -1,    -1,    -1,
-     399,   400,    -1,   402,    -1,   404,   405,   406,   407,   408,
-      -1,   410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,
-     419,   420,   421,   422,   423,    -1,    -1,   426,   427,   428,
-     429,   430,    -1,   432,    -1,    -1,   435,    -1,   437,   438,
-      -1,   440,    -1,    -1,    -1,   444,    -1,    -1,   447,   448,
-     449,   450,   451,    -1,    -1,    -1,   455,   456,   457,   458,
-     459,   460,   461,    -1,   463,   464,    -1,   466,    -1,    -1,
-      -1,    -1,   471,   472,   473,    -1,    -1,    -1,    -1,   478,
-      -1,    -1,    -1,   482,    -1,    -1,   485,    -1,   487,    -1,
-     489,    -1,    -1,   492,   493,    -1,    -1,    -1,    -1,    -1,
-     499,   500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,
-     509,    -1,    -1,   512,    -1,   514,   515,   516,   517,    -1,
-      -1,    -1,   521,    -1,   523,   524,   525,   526,   527,   528,
-      -1,    -1,   531,   532,   533,   534,    -1,   536,   537,    -1,
-      -1,   540,   541,   542,   543,    -1,    -1,   546,   547,    -1,
-     549,   550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,
-     559,    -1,    -1,    -1,    -1,   564,   565,   566,    -1,   568,
-     569,    -1,   571,   572,    -1,    -1,    -1,    -1,    -1,   578,
-      -1,    -1,   581,    -1,    -1,    -1,   585,   586,    -1,    -1,
-      -1,    -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,
-      -1,   600,   601,   602,   603,   604,    -1,    -1,   607,    -1,
-      -1,    -1,   611,    -1,    -1,   614,    -1,   616,    -1,     5,
-     619,     7,     8,     9,    10,    11,    -1,    -1,    14,    -1,
-      -1,    -1,    18,    -1,    -1,    -1,    -1,    23,    24,    25,
-      26,    27,    -1,    -1,    30,    -1,    -1,    -1,    34,    -1,
-      -1,    -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,
-      -1,    -1,    -1,    -1,    -1,    51,    52,    -1,    54,    55,
-      -1,    57,    -1,    -1,    -1,    -1,    62,    63,    64,    65,
-      66,    67,    -1,    69,    70,    -1,    72,    73,    -1,    75,
-      -1,    77,    78,    79,    80,    -1,    82,    83,    -1,    85,
-      86,    87,    -1,    89,    -1,    -1,    -1,    93,    -1,    -1,
-      96,    -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,
-     106,   107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,
-      -1,    -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,
-      -1,    -1,   128,    -1,   130,   131,   132,   133,   134,    -1,
-      -1,    -1,    -1,    -1,    -1,   141,   142,   143,    -1,    -1,
-      -1,   147,    -1,   149,   150,    -1,   152,   153,   154,    -1,
-      -1,   157,   158,    -1,   160,   161,   162,   163,   164,    -1,
-      -1,    -1,   168,   169,   170,   171,   172,    -1,    -1,   175,
-     176,   177,   178,   179,   180,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   188,    -1,   190,    -1,   192,    -1,   194,   195,
-     196,   197,    -1,   199,    -1,   201,    -1,    -1,    -1,    -1,
-     206,    -1,    -1,    -1,    -1,    -1,   212,    -1,    -1,    -1,
-     216,   217,   218,   219,   220,    -1,   222,   223,   224,    -1,
-      -1,   227,    -1,    -1,    -1,    -1,   232,    -1,    -1,    -1,
-      -1,   237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,
-     246,    -1,    -1,   249,    -1,    -1,    -1,   253,    -1,    -1,
-     256,   257,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,
-     266,   267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,
-      -1,    -1,    -1,   279,    -1,    -1,   282,    -1,   284,   285,
-     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
-     296,   297,   298,   299,   300,    -1,   302,   303,   304,    -1,
-     306,   307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,
-      -1,   317,   318,   319,   320,   321,   322,    -1,    -1,   325,
-     326,    -1,   328,    -1,   330,    -1,   332,   333,   334,   335,
-     336,   337,   338,   339,   340,    -1,    -1,   343,   344,    -1,
-      -1,   347,   348,   349,   350,    -1,    -1,    -1,    -1,   355,
-      -1,    -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,
-     366,   367,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,   380,   381,    -1,    -1,   384,    -1,
-     386,   387,   388,   389,   390,   391,   392,   393,   394,    -1,
-      -1,    -1,    -1,   399,   400,    -1,   402,    -1,   404,   405,
-     406,   407,   408,    -1,   410,   411,   412,    -1,    -1,   415,
-      -1,    -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,
-     426,   427,   428,   429,   430,    -1,   432,    -1,    -1,   435,
-      -1,   437,   438,    -1,   440,    -1,    -1,    -1,   444,    -1,
-      -1,   447,   448,   449,   450,   451,    -1,    -1,    -1,   455,
-     456,   457,   458,   459,   460,   461,    -1,   463,   464,    -1,
-     466,    -1,    -1,    -1,    -1,   471,   472,   473,    -1,    -1,
-      -1,    -1,   478,    -1,    -1,    -1,   482,    -1,    -1,   485,
-      -1,   487,    -1,   489,    -1,    -1,   492,   493,    -1,    -1,
-      -1,    -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,
-     506,    -1,    -1,   509,    -1,    -1,   512,    -1,   514,   515,
-     516,   517,    -1,    -1,    -1,   521,    -1,   523,   524,   525,
-     526,   527,   528,    -1,    -1,   531,   532,   533,   534,    -1,
-     536,   537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,
-     546,   547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,
-      -1,    -1,   558,   559,    -1,    -1,    -1,    -1,   564,   565,
-     566,    -1,   568,   569,    -1,   571,   572,    -1,    -1,    -1,
-      -1,    -1,   578,    -1,    -1,   581,    -1,    -1,    -1,   585,
-     586,    -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,
-     596,    -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,
-      -1,   607,    -1,    -1,    -1,   611,    -1,    -1,   614,    -1,
-     616,    -1,     5,   619,     7,     8,     9,    10,    11,    -1,
-      -1,    14,    -1,    -1,    -1,    18,    -1,    -1,    -1,    -1,
-      23,    24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,
-      -1,    34,    -1,    -1,    -1,    38,    -1,    -1,    41,    42,
-      43,    -1,    45,    -1,    -1,    -1,    -1,    -1,    51,    52,
-      -1,    54,    55,    -1,    57,    -1,    -1,    -1,    -1,    62,
-      63,    64,    65,    66,    67,    -1,    69,    70,    -1,    72,
-      73,    -1,    75,    -1,    77,    78,    79,    80,    -1,    82,
-      83,    -1,    85,    86,    87,    -1,    89,    -1,    -1,    -1,
-      93,    -1,    -1,    96,    -1,    98,    -1,    -1,   101,    -1,
-      -1,    -1,   105,   106,   107,    -1,    -1,   110,    -1,    -1,
-      -1,    -1,   115,    -1,    -1,    -1,    -1,    -1,   121,   122,
-      -1,   124,    -1,    -1,    -1,   128,    -1,   130,   131,   132,
-     133,   134,    -1,    -1,    -1,    -1,    -1,    -1,   141,   142,
-     143,    -1,    -1,    -1,   147,    -1,    -1,   150,    -1,   152,
-     153,   154,    -1,    -1,   157,   158,    -1,   160,   161,   162,
-     163,   164,    -1,    -1,    -1,   168,   169,   170,   171,   172,
-      -1,    -1,   175,   176,   177,   178,   179,   180,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   188,    -1,   190,    -1,   192,
-      -1,   194,   195,   196,   197,    -1,   199,    -1,   201,    -1,
-      -1,    -1,    -1,   206,    -1,    -1,    -1,    -1,    -1,   212,
-      -1,    -1,    -1,   216,   217,   218,   219,   220,    -1,   222,
-     223,   224,    -1,    -1,   227,    -1,    -1,    -1,    -1,   232,
-      -1,    -1,    -1,    -1,   237,    -1,    -1,    -1,   241,   242,
-      -1,   244,   245,   246,    -1,    -1,   249,    -1,    -1,    -1,
-     253,    -1,    -1,   256,   257,    -1,   259,   260,    -1,    -1,
-      -1,    -1,    -1,   266,   267,    -1,   269,    -1,   271,    -1,
-     273,   274,    -1,    -1,    -1,    -1,   279,    -1,    -1,   282,
-      -1,   284,   285,   286,   287,   288,   289,   290,   291,   292,
-     293,   294,   295,   296,   297,   298,   299,   300,    -1,   302,
-     303,   304,    -1,   306,   307,   308,   309,    -1,   311,   312,
-      -1,    -1,    -1,    -1,   317,   318,   319,   320,   321,   322,
-      -1,    -1,   325,   326,    -1,   328,    -1,   330,    -1,   332,
-     333,   334,   335,   336,   337,   338,   339,   340,    -1,    -1,
-     343,   344,    -1,    -1,   347,   348,   349,   350,    -1,    -1,
-      -1,    -1,   355,    -1,    -1,    -1,   359,    -1,   361,   362,
-     363,    -1,   365,   366,   367,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,   380,   381,    -1,
-      -1,   384,    -1,   386,   387,   388,   389,   390,   391,   392,
-     393,   394,    -1,    -1,    -1,    -1,   399,   400,    -1,   402,
-      -1,   404,   405,   406,   407,   408,    -1,   410,   411,   412,
-      -1,    -1,   415,    -1,    -1,    -1,   419,   420,   421,   422,
-     423,    -1,    -1,   426,   427,   428,   429,   430,    -1,   432,
-      -1,    -1,   435,    -1,   437,   438,    -1,   440,    -1,    -1,
-      -1,   444,    -1,    -1,   447,   448,   449,   450,   451,    -1,
-      -1,    -1,   455,   456,   457,   458,   459,   460,   461,    -1,
-     463,   464,    -1,   466,    -1,    -1,    -1,    -1,   471,   472,
-     473,    -1,    -1,    -1,    -1,   478,    -1,    -1,    -1,   482,
-      -1,    -1,   485,    -1,   487,    -1,   489,    -1,    -1,   492,
-     493,    -1,    -1,    -1,    -1,    -1,   499,   500,   501,    -1,
-     503,   504,    -1,   506,    -1,    -1,   509,    -1,    -1,   512,
-      -1,   514,   515,   516,   517,    -1,    -1,    -1,   521,    -1,
-     523,   524,   525,   526,   527,   528,    -1,    -1,   531,   532,
-     533,   534,    -1,   536,   537,    -1,    -1,   540,   541,   542,
-     543,    -1,    -1,   546,   547,    -1,   549,   550,   551,   552,
-      -1,    -1,    -1,    -1,    -1,   558,   559,    -1,    -1,    -1,
-      -1,   564,   565,   566,    -1,   568,   569,    -1,   571,   572,
-      -1,    -1,    -1,    -1,    -1,   578,    -1,    -1,   581,    -1,
-      -1,    -1,   585,   586,    -1,    -1,    -1,    -1,    -1,    -1,
-     593,    -1,    -1,   596,    -1,    -1,    -1,   600,   601,   602,
-     603,   604,    -1,    -1,   607,    -1,    -1,    -1,   611,    -1,
-      -1,   614,    -1,   616,    -1,     5,   619,     7,     8,     9,
-      10,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,    -1,
-      -1,    -1,    -1,    23,    24,    25,    26,    27,    -1,    -1,
-      30,    -1,    -1,    -1,    34,    -1,    -1,    -1,    38,    -1,
-      -1,    41,    42,    43,    -1,    45,    -1,    -1,    -1,    -1,
-      -1,    51,    52,    -1,    54,    55,    -1,    57,    -1,    -1,
-      -1,    -1,    62,    63,    64,    65,    66,    67,    -1,    69,
-      70,    -1,    72,    73,    -1,    75,    -1,    77,    78,    79,
-      80,    -1,    82,    83,    -1,    85,    86,    87,    -1,    89,
-      -1,    -1,    -1,    93,    -1,    -1,    96,    -1,    98,    -1,
-      -1,   101,    -1,    -1,    -1,   105,   106,   107,    -1,    -1,
-     110,    -1,    -1,    -1,    -1,   115,    -1,    -1,    -1,    -1,
-      -1,   121,   122,    -1,   124,    -1,    -1,    -1,   128,    -1,
-     130,   131,   132,   133,   134,    -1,    -1,    -1,    -1,    -1,
-      -1,   141,   142,   143,    -1,    -1,    -1,   147,    -1,    -1,
-     150,    -1,   152,   153,   154,    -1,    -1,   157,   158,    -1,
-     160,   161,   162,   163,   164,    -1,    -1,    -1,   168,   169,
-     170,   171,   172,    -1,    -1,   175,   176,   177,   178,   179,
-     180,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   188,    -1,
-     190,    -1,   192,    -1,   194,   195,   196,   197,    -1,   199,
-      -1,   201,    -1,    -1,    -1,    -1,   206,    -1,    -1,    -1,
-      -1,    -1,   212,    -1,    -1,    -1,   216,   217,   218,   219,
-     220,    -1,   222,   223,   224,    -1,    -1,   227,    -1,    -1,
-      -1,    -1,   232,    -1,    -1,    -1,    -1,   237,    -1,    -1,
-      -1,   241,   242,    -1,   244,   245,   246,    -1,    -1,   249,
-      -1,    -1,    -1,   253,    -1,    -1,   256,   257,    -1,   259,
-     260,    -1,    -1,    -1,    -1,    -1,   266,   267,    -1,   269,
-      -1,   271,    -1,   273,   274,    -1,    -1,    -1,    -1,   279,
-      -1,    -1,   282,    -1,   284,   285,   286,   287,   288,   289,
-     290,   291,   292,   293,   294,   295,   296,   297,   298,   299,
-     300,    -1,   302,   303,   304,    -1,   306,   307,   308,   309,
-      -1,   311,   312,    -1,    -1,    -1,    -1,   317,   318,   319,
-     320,   321,   322,    -1,    -1,   325,   326,    -1,   328,    -1,
-     330,    -1,   332,   333,   334,   335,   336,   337,   338,   339,
-     340,    -1,    -1,   343,   344,    -1,    -1,   347,   348,   349,
-     350,    -1,    -1,    -1,    -1,   355,    -1,    -1,    -1,   359,
-      -1,   361,   362,   363,    -1,   365,   366,   367,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     380,   381,    -1,    -1,   384,    -1,   386,   387,   388,   389,
-     390,   391,   392,   393,   394,    -1,    -1,    -1,    -1,   399,
-     400,    -1,   402,    -1,   404,   405,   406,   407,   408,    -1,
-     410,   411,   412,    -1,    -1,   415,    -1,    -1,    -1,   419,
-     420,   421,   422,   423,    -1,    -1,   426,   427,   428,   429,
-     430,    -1,   432,    -1,    -1,   435,    -1,   437,   438,    -1,
-     440,    -1,    -1,    -1,   444,    -1,    -1,   447,   448,   449,
-     450,   451,    -1,    -1,    -1,   455,   456,   457,   458,   459,
-     460,   461,    -1,   463,   464,    -1,   466,    -1,    -1,    -1,
-      -1,   471,   472,   473,    -1,    -1,    -1,    -1,   478,    -1,
-      -1,    -1,   482,    -1,    -1,   485,    -1,   487,    -1,   489,
-      -1,    -1,   492,   493,    -1,    -1,    -1,    -1,    -1,   499,
-     500,   501,    -1,   503,   504,    -1,   506,    -1,    -1,   509,
-      -1,    -1,   512,    -1,   514,   515,   516,   517,    -1,    -1,
-      -1,   521,    -1,   523,   524,   525,   526,   527,   528,    -1,
-      -1,   531,   532,   533,   534,    -1,   536,   537,    -1,    -1,
-     540,   541,   542,   543,    -1,    -1,   546,   547,    -1,   549,
-     550,   551,   552,    -1,    -1,    -1,    -1,    -1,   558,   559,
-      -1,    -1,    -1,    -1,   564,   565,   566,    -1,   568,   569,
-      -1,   571,   572,    -1,    -1,    -1,    -1,    -1,   578,    -1,
-      -1,   581,    -1,    -1,    -1,   585,   586,    -1,    -1,    -1,
-      -1,    -1,    -1,   593,    -1,    -1,   596,    -1,    -1,    -1,
-     600,   601,   602,   603,   604,    -1,    -1,   607,    -1,    -1,
-      -1,   611,    -1,    -1,   614,    -1,   616,    -1,     5,   619,
-       7,     8,     9,    10,    11,    -1,    -1,    14,    -1,    -1,
-      -1,    18,    -1,    -1,    -1,    -1,    23,    24,    25,    26,
-      27,    -1,    -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,
-      -1,    38,    -1,    -1,    41,    42,    43,    -1,    45,    -1,
-      -1,    -1,    -1,    -1,    51,    -1,    -1,    54,    55,    -1,
-      57,    -1,    -1,    -1,    -1,    62,    63,    64,    -1,    66,
-      67,    -1,    69,    70,    -1,    72,    73,    -1,    75,    -1,
-      77,    78,    79,    80,    -1,    82,    83,    -1,    85,    86,
-      87,    -1,    89,    -1,    -1,    -1,    93,    -1,    -1,    96,
-      -1,    98,    -1,    -1,   101,    -1,    -1,    -1,   105,   106,
-     107,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,    -1,
-      -1,    -1,    -1,    -1,   121,   122,    -1,   124,    -1,    -1,
-      -1,   128,    -1,   130,   131,   132,   133,   134,    -1,    -1,
-      -1,    -1,    -1,    -1,   141,   142,   143,    -1,    -1,    -1,
-     147,    -1,    -1,   150,    -1,   152,   153,   154,    -1,    -1,
-     157,   158,    -1,   160,   161,   162,   163,   164,    -1,    -1,
-      -1,   168,   169,   170,   171,   172,    -1,    -1,   175,   176,
-      -1,   178,   179,   180,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   188,    -1,   190,    -1,   192,    -1,   194,   195,   196,
-     197,    -1,   199,    -1,   201,    -1,    -1,    -1,    -1,   206,
-      -1,    -1,    -1,    -1,    -1,   212,    -1,    -1,    -1,   216,
-     217,   218,   219,    -1,    -1,   222,   223,   224,    -1,    -1,
-     227,    -1,    -1,    -1,    -1,   232,    -1,    -1,    -1,    -1,
-     237,    -1,    -1,    -1,   241,   242,    -1,   244,   245,    -1,
-      -1,    -1,   249,    -1,    -1,    -1,   253,    -1,    -1,   256,
-      -1,    -1,   259,   260,    -1,    -1,    -1,    -1,    -1,   266,
-     267,    -1,   269,    -1,   271,    -1,   273,   274,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   282,    -1,   284,   285,   286,
-     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
-     297,   298,   299,   300,    -1,   302,   303,   304,    -1,   306,
-     307,   308,   309,    -1,   311,   312,    -1,    -1,    -1,    -1,
-     317,   318,   319,   320,   321,   322,    -1,    -1,   325,   326,
-      -1,   328,    -1,   330,    -1,   332,   333,   334,   335,   336,
-     337,   338,   339,   340,    -1,    -1,   343,   344,    -1,    -1,
-     347,   348,   349,   350,    -1,    -1,    -1,    -1,   355,    -1,
-      -1,    -1,   359,    -1,   361,   362,   363,    -1,   365,   366,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,   380,   381,    -1,    -1,   384,    -1,   386,
-     387,   388,   389,   390,   391,   392,   393,   394,    -1,    -1,
-      -1,    -1,   399,   400,    -1,   402,    -1,   404,   405,   406,
-     407,   408,    -1,   410,   411,   412,    -1,    -1,   415,    -1,
-      -1,    -1,   419,   420,   421,   422,   423,    -1,    -1,   426,
-     427,   428,   429,   430,    -1,   432,    -1,    -1,   435,    -1,
-     437,    -1,    -1,   440,    -1,    -1,    -1,   444,    -1,    -1,
-     447,   448,   449,    -1,   451,    -1,    -1,    -1,   455,   456,
-     457,   458,   459,   460,   461,    -1,   463,   464,    -1,   466,
-      -1,    -1,    -1,    -1,   471,   472,   473,    -1,    -1,    -1,
-      -1,   478,    -1,    -1,    -1,   482,    -1,    -1,   485,    -1,
-     487,    -1,   489,    -1,    -1,   492,   493,    -1,    -1,    -1,
-      -1,    -1,   499,   500,   501,    -1,   503,   504,    -1,   506,
-      -1,    -1,   509,    -1,    -1,   512,    -1,   514,   515,   516,
-     517,    -1,    -1,    -1,   521,    -1,   523,   524,   525,   526,
-     527,   528,    -1,    -1,   531,   532,   533,   534,    -1,   536,
-     537,    -1,    -1,   540,   541,   542,   543,    -1,    -1,   546,
-     547,    -1,   549,   550,   551,   552,    -1,    -1,    -1,    -1,
-      -1,   558,   559,    -1,    -1,    -1,    -1,   564,   565,   566,
-      -1,   568,   569,    -1,   571,   572,    -1,    -1,    -1,    -1,
-      -1,   578,    -1,    -1,   581,    -1,    -1,    -1,   585,   586,
-      -1,    -1,    -1,    -1,    -1,    -1,   593,    -1,    -1,   596,
-      -1,    -1,    -1,   600,   601,   602,   603,   604,    -1,    -1,
-      -1,    -1,    -1,    -1,   611,    -1,    -1,   614,    -1,   616,
-      -1,    -1,   619
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const yytype_uint16 yystos[] =
-{
-       0,    13,    15,    30,    34,    48,    49,    56,    60,    61,
-      76,    94,   116,   125,   126,   127,   138,   139,   151,   165,
-     183,   198,   200,   205,   208,   231,   233,   251,   268,   272,
-     368,   385,   398,   409,   431,   434,   436,   439,   442,   443,
-     452,   454,   462,   468,   476,   481,   483,   513,   520,   563,
-     575,   579,   582,   587,   615,   630,   641,   644,   645,   646,
-     647,   648,   650,   655,   657,   664,   697,   724,   731,   732,
-     851,  1016,  1058,  1060,  1074,  1077,  1082,  1084,  1085,  1090,
-    1093,  1098,  1105,  1117,  1118,  1276,  1278,  1293,  1296,  1321,
-    1329,  1340,  1347,  1361,  1365,  1368,  1378,  1384,  1388,  1390,
-    1391,  1443,  1471,  1477,  1479,  1486,  1489,  1516,  1522,  1523,
-    1524,  1525,  1582,  1590,  1591,    11,   103,   122,   192,   221,
-     273,   403,   474,   537,   585,  1054,  1547,  1548,  1549,  1552,
-     269,   356,  1092,  1517,   545,  1434,   225,     5,     7,     8,
-       9,    10,    11,    14,    18,    21,    23,    24,    25,    26,
-      27,    28,    30,    34,    38,    41,    42,    43,    45,    47,
-      48,    51,    54,    55,    57,    58,    60,    62,    63,    64,
-      65,    66,    67,    69,    70,    72,    73,    74,    75,    76,
-      77,    78,    79,    80,    82,    83,    85,    86,    87,    88,
-      89,    93,    96,    98,   101,   105,   106,   107,   110,   115,
-     116,   121,   122,   124,   128,   130,   131,   132,   133,   134,
-     138,   141,   142,   143,   147,   149,   150,   152,   153,   154,
-     157,   158,   160,   161,   162,   163,   164,   165,   168,   169,
-     170,   171,   172,   175,   176,   178,   179,   180,   183,   187,
-     188,   190,   192,   194,   195,   196,   197,   199,   201,   205,
-     206,   208,   211,   212,   216,   217,   218,   219,   222,   223,
-     224,   227,   232,   233,   237,   241,   242,   244,   245,   249,
-     252,   253,   256,   259,   260,   266,   267,   269,   271,   273,
-     274,   282,   284,   285,   286,   287,   288,   289,   290,   291,
-     292,   293,   294,   295,   296,   297,   298,   299,   300,   302,
-     303,   304,   306,   307,   308,   309,   311,   312,   317,   318,
-     319,   320,   321,   322,   325,   326,   328,   330,   332,   333,
-     334,   335,   336,   337,   338,   339,   340,   343,   344,   347,
-     348,   349,   350,   354,   355,   359,   361,   362,   363,   365,
-     366,   367,   369,   379,   380,   381,   383,   384,   386,   387,
-     388,   389,   390,   391,   392,   393,   394,   395,   398,   399,
-     400,   402,   404,   405,   406,   407,   408,   410,   411,   412,
-     415,   419,   420,   421,   422,   423,   426,   427,   428,   429,
-     430,   432,   433,   435,   436,   437,   440,   442,   444,   445,
-     447,   448,   449,   451,   454,   455,   456,   457,   458,   459,
-     460,   461,   462,   463,   464,   466,   467,   471,   472,   473,
-     474,   478,   482,   484,   485,   486,   487,   489,   490,   491,
-     492,   493,   499,   500,   501,   503,   504,   506,   509,   512,
-     513,   514,   515,   516,   517,   520,   521,   523,   524,   525,
-     526,   527,   528,   531,   532,   533,   534,   536,   537,   540,
-     541,   542,   543,   546,   547,   549,   550,   551,   552,   558,
-     559,   563,   564,   565,   566,   568,   569,   571,   572,   574,
-     575,   578,   581,   583,   585,   586,   593,   596,   600,   601,
-     602,   603,   604,   611,   612,   614,   615,   616,   619,   691,
-    1432,  1437,  1441,  1442,   302,   536,   539,  1473,  1473,   611,
-    1518,   103,   191,   273,   474,   494,   537,   542,   577,   585,
-     673,   674,   903,   904,   905,   994,   995,   996,  1330,  1277,
-     103,   162,   192,   225,   273,   403,   474,   537,   542,   560,
-     585,   600,  1289,  1437,  1092,    98,   733,   690,   638,  1429,
-    1431,  1437,   656,  1294,   391,    82,   411,  1389,   106,   225,
-     616,  1396,  1473,  1092,   852,  1437,  1385,   462,   585,  1473,
-    1092,  1297,  1379,   497,   721,   725,   726,  1437,   690,  1518,
-    1437,  1121,  1123,  1124,  1444,  1348,   725,   486,   558,   486,
-     539,  1342,   391,  1478,  1322,  1437,    30,    76,   149,   398,
-     420,   454,   513,  1584,   468,   630,  1119,     0,   151,   642,
-     398,   171,   187,   386,  1366,  1429,  1437,   155,  1028,  1437,
-     155,   691,   202,   691,   261,  1434,  1437,  1439,   799,   800,
-     803,   826,  1437,   690,   539,   162,  1022,  1547,  1473,  1518,
-    1099,   698,   638,   556,  1075,  1086,    17,  1519,   220,   906,
-     202,  1439,   801,   826,   690,   375,  1544,  1548,  1549,  1550,
-    1551,  1552,   539,   904,   225,   225,   225,   221,   280,   412,
-    1338,  1339,     7,    21,    27,    33,    35,    36,    37,    39,
-      52,    53,    58,    59,    66,    69,    88,    91,    92,    97,
-      99,   102,   103,   108,   109,   110,   115,   117,   120,   166,
-     173,   174,   181,   187,   195,   197,   203,   209,   216,   220,
-     231,   234,   258,   266,   277,   305,   310,   321,   325,   327,
-     331,   332,   333,   334,   335,   342,   351,   352,   353,   357,
-     358,   363,   382,   388,   393,   394,   396,   410,   438,   439,
-     451,   453,   459,   460,   466,   518,   519,   525,   529,   530,
-     535,   545,   549,   550,   551,   552,   561,   562,   563,   567,
-     570,   585,   589,   590,   591,   592,   597,   599,   603,   604,
-     619,   623,   624,   629,   630,   633,   634,   637,   638,   955,
-    1138,  1139,  1140,  1141,  1145,  1148,  1149,  1150,  1151,  1152,
-    1153,  1161,  1165,  1177,  1415,  1417,  1419,  1420,  1421,  1425,
-    1427,  1432,  1437,   220,  1288,  1288,  1288,  1437,   202,  1288,
-    1288,   826,  1288,   690,  1288,  1473,   651,  1369,   130,  1490,
-    1437,   367,    65,   416,   638,  1439,   123,   210,   280,  1299,
-    1437,  1138,   235,  1392,  1472,  1473,    46,   853,   189,    33,
-     302,  1353,  1386,  1437,   690,  1094,  1473,   123,   280,  1300,
-    1328,   302,   411,   486,  1380,  1381,   593,   722,   476,   727,
-    1487,   556,  1519,  1122,    12,   135,   210,   502,   503,   504,
-     505,   506,   507,   522,  1128,  1129,  1130,  1543,    58,    59,
-     120,   199,   269,   338,   388,   473,   558,   637,   957,  1437,
-    1445,  1457,  1461,  1463,    34,    58,    69,    92,    94,   104,
-     153,   158,   161,   190,   192,   199,   201,   224,   225,   248,
-     269,   302,   367,   392,   402,   403,   406,   407,   427,   473,
-     486,   521,   539,   602,   957,   993,  1349,  1353,  1354,  1356,
-    1458,   727,   430,   509,  1069,  1070,  1071,   416,   608,  1061,
-    1062,  1063,  1069,  1341,  1437,  1473,  1328,    35,   209,   545,
-    1416,  1435,  1583,  1583,  1583,  1583,  1583,  1123,  1119,   631,
-     636,  1437,   155,  1363,  1362,   319,   543,   569,  1018,   583,
-      99,  1439,  1440,  1020,   805,   827,  1437,  1019,   369,     6,
-      56,   139,   352,   415,   417,   828,  1024,  1440,  1429,   691,
-     508,  1553,  1554,  1021,  1083,  1100,  1101,  1102,  1103,  1429,
-     630,   699,  1437,   658,  1283,  1284,  1429,  1283,    55,   354,
-     354,   431,  1520,   351,   352,  1144,  1437,   804,   827,   185,
-       6,  1440,  1506,  1507,   439,    10,   403,   560,   677,  1134,
-    1546,  1554,  1566,  1570,  1571,  1577,   677,  1134,  1545,  1554,
-    1566,  1571,  1577,  1547,  1552,   906,  1437,  1437,  1437,   189,
-    1331,  1335,  1336,  1437,  1338,   630,   630,   630,  1148,   630,
-     630,   630,  1138,  1180,   630,   630,   630,   630,   630,   630,
-     630,   630,   630,  1137,  1137,   630,   944,   630,   630,   630,
-     545,   630,   630,   630,   630,   630,   630,   630,   630,   630,
-     630,   630,   630,   630,  1138,   630,   630,   630,  1178,  1179,
-    1425,  1437,   630,   630,   630,   630,   630,   630,   630,   630,
-     630,  1138,   944,   630,   630,   630,   630,   630,   630,   630,
-     630,   630,   630,   630,   630,   630,   630,   630,   630,   630,
-     630,   944,   545,   630,   630,   630,   545,   630,   630,   630,
-      35,   209,   545,   630,  1137,   944,   944,   630,   630,   630,
-     630,   630,   630,  1148,  1148,  1148,  1138,  1538,  1539,  1437,
-    1166,  1437,    16,    17,   372,   375,   617,  1142,  1143,   155,
-     156,   193,   204,   243,   254,   281,   345,  1146,    31,   136,
-     238,   262,   331,   425,   479,   480,   492,   621,   622,   623,
-     624,   625,   626,   627,   628,  1144,  1148,    68,   374,   632,
-    1435,   630,   638,   166,  1437,   691,  1437,   364,   827,   691,
-    1439,   355,   601,   837,   838,  1290,  1291,  1292,  1354,   691,
-    1440,  1505,  1282,  1288,   588,   652,    33,   128,   153,   157,
-     194,   212,   274,   402,   411,   426,   444,   487,   517,  1370,
-    1375,  1376,  1473,    81,   637,   734,   735,   736,   737,  1437,
-      12,    13,    94,   125,   139,   162,   165,   178,   200,   225,
-     231,   272,   404,   408,   424,   432,   440,   468,   481,   482,
-     531,   560,   582,   584,  1491,  1493,  1495,  1496,    19,   155,
-    1232,  1233,  1480,  1437,  1054,   491,    48,    80,   280,  1398,
-    1429,  1474,  1475,  1091,   264,   267,   413,   854,   856,   637,
-     649,  1434,   274,  1095,  1440,  1096,  1097,  1429,  1078,   235,
-    1285,  1301,  1302,  1429,    48,  1382,   632,  1435,    54,    63,
-      73,    85,    86,    87,   101,   320,   337,   464,   524,   541,
-     728,   730,    12,   408,  1488,  1493,   462,  1521,  1520,   576,
-    1526,  1527,   625,  1132,  1133,  1134,  1130,   476,   638,    33,
-     120,   155,   477,   958,   959,  1312,  1439,   186,  1312,  1447,
-     637,  1439,    33,   120,   961,   962,  1439,   638,  1448,  1446,
-    1312,   161,   262,   606,  1360,   630,   103,   162,   192,   403,
-     539,   560,   600,  1360,    12,   915,  1439,   263,  1251,  1253,
-     189,   238,  1355,  1357,    67,   517,   186,   517,   536,    67,
-     517,    12,    41,    89,    93,   242,   318,   381,   493,   533,
-    1343,  1344,  1345,   161,   212,   517,   517,  1251,  1360,  1357,
-     274,   152,    70,   405,   536,   559,   517,   596,  1059,   632,
-     366,   613,    83,   632,  1284,  1054,   632,   365,  1586,   532,
-    1587,   247,   447,  1585,   631,  1527,  1529,  1531,  1532,   151,
-     643,  1439,  1117,  1293,  1296,  1321,  1329,  1364,  1367,  1416,
-    1437,   120,   901,   902,   912,   913,   966,   106,  1137,   637,
-     692,     6,   806,   692,   630,   105,   823,   823,   823,     4,
-     632,   388,  1017,  1023,   467,   600,  1554,  1283,   238,   632,
-     385,  1111,  1113,  1114,   700,   701,  1138,   222,   282,   283,
-     284,   285,   286,   287,   288,   289,   290,   291,   293,   294,
-     295,   296,   297,   298,   299,   300,   301,   303,   304,   428,
-     429,   659,   660,   663,   171,   412,   632,  1076,    57,   171,
-     175,   186,   317,   412,  1087,  1088,  1089,    55,   431,   166,
-     672,   806,   106,   823,   218,   632,  1134,  1134,  1134,   162,
-     192,   192,  1554,  1429,   997,   998,   997,   997,  1286,  1287,
-    1429,  1430,  1437,   632,  1333,   638,  1337,  1138,  1138,    12,
-     135,  1173,  1234,  1173,  1173,  1173,   605,  1182,  1138,  1138,
-    1177,  1177,  1138,  1138,  1138,   135,  1173,  1234,   631,   358,
-     631,   631,  1138,  1138,  1138,  1138,  1425,  1538,   111,   112,
-     113,   114,   115,   213,   214,   215,   216,   321,   323,   324,
-     325,   332,   410,   465,   466,   603,   618,   619,  1229,  1230,
-    1138,  1177,   107,   110,   549,   552,  1231,   135,  1168,  1138,
-    1138,  1138,  1138,  1229,  1138,  1177,  1179,     9,   632,   638,
-     135,  1173,  1138,  1138,   135,  1173,  1138,  1138,  1177,  1177,
-    1177,  1138,  1138,  1138,  1177,  1141,  1138,  1138,  1138,  1138,
-    1138,  1138,   631,  1138,  1173,  1173,  1138,  1138,   135,  1173,
-    1138,  1230,  1230,  1138,    44,   255,   557,  1138,  1138,   631,
-    1426,  1427,  1437,  1173,  1173,  1138,  1138,  1138,   631,   632,
-     631,   468,   630,  1535,  1536,  1138,   637,  1167,  1439,   638,
-    1138,  1138,  1138,  1140,   174,   357,   562,   578,  1144,    12,
-      18,  1140,  1147,  1141,  1141,   630,  1148,  1141,  1141,  1141,
-    1141,   262,  1141,  1141,   234,  1141,   234,  1141,  1141,  1141,
-    1141,  1141,    31,   238,   262,   425,  1439,  1148,  1138,  1154,
-    1437,   638,  1429,  1290,   632,  1292,   153,   632,  1283,  1279,
-     637,   653,   654,   274,   274,   274,   274,    48,   274,   274,
-     632,  1371,   110,   549,   552,   729,   739,  1165,  1419,  1425,
-    1439,   632,   155,   402,  1494,   456,   456,   537,   542,   585,
-     600,   370,  1498,   536,   364,  1500,    64,   486,  1497,   104,
-     600,  1499,   364,   632,  1437,   179,   348,  1437,  1481,  1482,
-    1301,  1434,  1106,   269,  1397,  1233,   632,  1283,    70,   630,
-     861,   862,   861,   862,   386,   864,   206,   250,  1439,    29,
-     556,  1387,   632,   556,   632,   556,  1283,  1302,  1298,   385,
-    1196,  1197,    12,  1383,  1381,   632,   155,  1494,   364,   364,
-    1437,    12,   135,  1534,   632,  1125,  1138,  1423,  1437,  1437,
-      68,   964,  1138,  1440,   363,   388,   545,  1469,   244,   416,
-    1464,  1465,  1466,  1467,   199,   269,   473,  1459,  1312,  1437,
-     558,  1449,  1460,  1463,   632,  1451,  1462,   238,  1358,  1434,
-    1138,   625,   906,   691,   691,   691,  1429,   691,  1429,   274,
-     336,   517,  1352,  1352,   277,   358,   567,  1254,  1255,  1417,
-    1437,  1360,  1437,   691,  1360,  1440,  1355,   691,  1360,   241,
-     534,   176,   186,  1346,   632,  1358,  1355,  1429,  1357,  1355,
-    1355,  1360,  1360,   581,  1072,  1071,   489,  1063,   468,   630,
-     634,  1183,  1184,  1185,  1186,  1187,  1198,  1199,  1213,  1416,
-     389,  1588,   373,  1247,  1253,  1533,   902,    68,   957,   131,
-    1439,    74,    88,   252,   329,   354,   414,   508,   694,   696,
-     421,   571,   824,   825,   227,   820,   821,   822,   829,   837,
-     838,   103,   211,   379,   388,   395,   490,   585,   675,   676,
-    1434,    24,   309,   814,   815,   816,   829,   830,   831,   837,
-     838,   807,   808,   814,  1440,   169,     6,    11,    13,    15,
-      25,    26,    56,    60,    61,    66,    74,    82,    91,   106,
-     124,   132,   133,   139,   147,   153,   164,   184,   223,   225,
-     232,   249,   272,   308,   326,   330,   368,   373,   380,   385,
-     388,   419,   433,   434,   435,   436,   458,   514,   515,   516,
-     521,   537,   540,   563,   576,   848,   908,   910,   912,   913,
-    1029,  1033,  1035,  1038,  1044,  1045,  1046,  1051,  1052,  1243,
-     364,   685,  1025,   122,   237,  1429,   120,  1104,  1437,  1102,
-    1429,   850,  1113,   225,   250,   991,  1115,   631,   632,   155,
-     155,   155,   155,   155,   155,   155,   155,   155,   155,   155,
-     155,   155,   155,   155,   155,   155,   155,   155,   155,   155,
-     155,   155,   155,   632,  1284,   583,  1088,   900,   901,    74,
-     349,   422,   572,   817,   818,   819,   829,   833,   834,   835,
-     836,   837,   838,   612,   587,   802,    46,   608,  1507,   192,
-     691,   691,   906,   691,  1437,   665,   565,   588,  1005,   364,
-     364,   364,   632,  1334,  1196,   638,  1337,  1336,   189,   625,
-    1437,   632,   631,  1173,   631,  1174,   631,   631,   631,  1138,
-     145,   605,  1181,    19,   631,   588,   631,   631,   631,   632,
-     588,   632,  1162,   631,   625,   631,   632,   632,   631,   631,
-     631,   631,   189,   632,   631,   632,  1164,   631,   632,   632,
-     632,   624,   632,   631,   631,   630,  1425,  1437,  1173,   631,
-     631,   631,  1173,   631,   632,   631,   631,   631,   631,   631,
-     631,   632,   631,   238,   631,   632,   632,   631,   632,   632,
-     631,   631,   631,   632,   189,   632,  1173,   631,   631,   632,
-     632,   632,   631,   189,  1138,   189,  1138,   189,  1138,   189,
-     631,   632,   631,   631,   631,   631,   632,    19,   260,   632,
-     981,   631,  1177,  1203,  1204,  1205,   468,   630,  1120,  1530,
-    1531,   576,  1540,   635,  1459,   477,  1437,   174,   357,   562,
-     578,   630,    17,  1138,  1538,   160,  1239,  1141,  1138,  1138,
-    1141,   630,  1148,  1141,  1134,  1158,  1159,  1160,   630,   638,
-    1437,  1280,  1292,  1312,  1313,  1440,    50,   446,  1055,  1283,
-    1439,   632,  1376,  1283,  1377,   737,   740,   741,   736,   359,
-     460,   738,   536,   630,  1508,  1440,  1508,  1508,  1508,   192,
-     403,   539,  1492,  1496,   155,   179,   193,   204,   253,   254,
-     281,   348,   400,  1483,  1485,   606,  1235,  1295,  1107,  1108,
-    1109,  1110,  1429,   226,   280,   416,   613,  1476,  1475,   630,
-    1134,   117,   181,   209,   277,   358,   567,  1258,  1261,  1262,
-     528,   865,   855,    11,   857,  1138,  1434,  1440,  1440,  1097,
-    1429,   171,   412,   586,  1079,  1080,  1081,   468,   476,   592,
-     593,   630,   896,  1303,  1306,   630,   730,   729,   632,  1440,
-     192,   403,  1492,  1528,  1133,   189,   235,  1126,  1127,  1246,
-    1247,  1271,  1135,  1135,   638,   120,   963,   965,  1439,  1312,
-     630,   630,   260,   366,   613,   632,   632,   638,   638,   638,
-    1463,  1138,  1464,  1450,  1312,  1452,  1453,    12,    33,   120,
-     364,  1138,  1470,  1434,   189,  1359,   631,  1437,   362,   632,
-    1360,   411,  1251,  1345,  1359,  1360,  1355,  1429,  1360,  1360,
-     499,   500,   501,   663,  1073,   585,  1064,  1065,  1212,  1437,
-      95,   228,   247,   258,   341,   453,   522,  1195,   476,   632,
-    1429,  1212,   632,   186,  1589,    46,  1251,  1313,  1313,   339,
-    1434,   508,   508,   508,   508,   508,   467,  1434,  1434,  1313,
-     632,   822,  1434,  1434,  1434,  1434,   117,   181,   209,   277,
-     358,   567,  1257,  1434,  1434,   631,   632,  1313,  1313,   632,
-     816,   809,   810,   829,   830,   831,   388,    71,    84,   385,
-     924,   927,   928,   989,   991,   995,   996,  1053,  1313,  1053,
-     385,  1313,  1313,  1053,  1313,   385,   385,  1313,  1313,   556,
-     131,  1313,   248,   537,   185,   385,   401,   991,  1053,   248,
-    1313,   385,   537,   131,  1313,  1313,  1313,  1313,  1313,  1053,
-     385,    46,  1313,   850,  1313,   385,   387,    19,   155,   556,
-    1057,   385,   385,  1313,  1313,  1313,  1313,   134,   318,  1437,
-    1313,   385,  1313,   908,   632,   847,   848,  1033,   630,   638,
-     923,   929,  1428,  1437,    78,   463,   434,  1026,  1555,  1112,
-     630,  1138,   630,  1257,  1433,  1434,  1257,  1257,  1433,  1433,
-     117,   181,   277,   358,   567,  1259,  1433,  1257,  1257,  1433,
-    1433,  1433,  1433,  1433,  1433,  1433,  1257,  1257,  1433,  1420,
-    1433,  1257,   660,  1313,  1313,  1313,  1313,   632,   819,  1439,
-     273,   172,   811,   812,   813,   829,   830,   831,   832,   835,
-     836,   837,   838,   388,   545,  1439,  1437,  1578,     8,    29,
-     797,   691,   630,   449,   262,   630,   840,   907,   909,   910,
-      45,   206,   461,  1010,  1010,  1429,  1429,  1429,  1287,  1437,
-     588,  1332,  1437,  1184,   638,  1337,   234,  1138,   631,  1138,
-     548,  1138,  1138,   149,    33,    59,   107,   110,   118,   343,
-     484,   552,   580,  1175,   958,  1138,   958,  1175,  1177,   631,
-     234,   234,  1138,  1138,  1138,  1177,  1138,  1138,  1138,  1138,
-    1138,  1141,   631,   631,  1138,  1138,  1138,  1138,  1138,  1138,
-    1177,   234,  1138,  1138,  1138,   631,  1138,  1138,  1138,  1138,
-     189,  1138,   189,  1138,   189,  1138,  1138,  1138,    33,    59,
-     976,   977,   978,   979,   980,  1258,  1257,   631,   631,  1541,
-    1542,  1543,  1204,  1120,   631,  1534,  1439,  1138,  1538,  1140,
-     631,   632,   631,  1148,  1229,  1229,    17,  1138,  1538,  1239,
-    1138,   631,   632,  1176,  1177,  1437,  1281,   914,  1439,  1055,
-     654,  1372,   155,   632,  1437,  1509,  1510,   556,   625,  1429,
-    1437,  1504,  1504,  1504,  1484,  1236,  1252,  1253,  1303,   632,
-    1111,  1113,   545,  1436,   613,   269,   858,   859,   860,  1437,
-     870,  1141,    46,   630,   872,   862,   155,   630,   556,  1080,
-     897,  1304,   630,  1309,  1314,  1309,   631,   896,  1305,  1422,
-    1423,  1426,  1437,  1307,  1228,  1437,   155,   200,   189,  1504,
-    1504,  1504,  1118,   140,  1184,  1272,   186,   272,  1131,  1271,
-    1252,  1127,    19,  1136,  1434,  1437,   625,  1437,  1469,   545,
-     545,   416,   437,   471,  1468,  1466,  1465,  1312,  1451,  1470,
-     632,  1455,  1457,  1461,  1259,  1350,   158,   602,  1255,  1255,
-     358,  1351,  1235,  1355,   155,   155,   632,   155,   388,  1066,
-    1200,  1207,  1212,  1183,   247,   247,   376,  1214,   247,   258,
-     453,  1214,  1198,  1183,  1324,  1325,  1426,  1185,  1196,  1209,
-    1210,  1257,   322,  1248,   965,   959,   106,   106,   122,   237,
-     277,   358,   567,   839,  1260,  1261,  1432,   822,   676,   839,
-     839,   816,   632,   810,   169,  1013,  1428,  1092,    61,   185,
-     401,   577,   926,   990,  1013,   991,   992,   992,   120,  1437,
-    1428,  1092,  1259,  1257,  1428,  1257,    12,  1034,  1042,  1043,
-    1437,  1092,  1434,  1434,   957,  1313,  1257,   250,  1042,   250,
-    1428,  1428,   914,  1043,  1313,   179,   253,   354,   917,  1257,
-     120,  1437,  1259,  1259,  1428,  1092,  1244,  1245,  1426,   120,
-    1257,   849,  1434,  1092,   850,  1429,  1092,  1092,    77,    79,
-     120,   143,   180,   423,   916,   120,  1257,   120,  1257,   120,
-    1257,  1257,  1034,   911,     6,   139,  1046,   920,   921,   922,
-     923,   924,  1437,     8,   179,  1056,   424,   925,   926,   983,
-     930,   638,   352,   399,    23,   163,   679,   556,   132,   147,
-     681,   630,  1556,   630,   401,  1225,  1226,  1227,  1437,   661,
-     662,  1257,  1434,  1258,   839,   839,   819,   369,   202,  1313,
-     632,   813,   545,    19,   449,   630,   125,   231,   582,   798,
-     678,  1572,   118,   236,   418,   523,   919,  1429,   262,   841,
-     846,   847,   920,   846,   632,   909,   666,   668,   670,   638,
-    1184,  1235,  1337,  1235,  1138,   631,  1138,   548,   630,   948,
-     949,   949,   630,   943,   630,   941,   942,   948,   949,   236,
-     943,   236,   631,   631,   631,   631,   631,  1163,  1138,  1138,
-     631,   631,   632,   631,   373,  1170,   632,   632,   631,   632,
-     631,   238,  1155,  1156,   631,   631,   631,   631,   632,   631,
-     631,  1138,   631,   186,   631,   631,   632,   631,   632,   632,
-     631,  1138,   631,  1138,   631,  1138,   631,   631,   631,   630,
-     971,   971,    20,   126,   451,   623,   973,   974,   975,   632,
-     632,  1132,  1543,   631,  1537,   638,  1014,   631,  1177,  1140,
-     631,   632,   631,  1135,  1160,   631,  1050,  1051,  1052,   186,
-     608,  1373,    54,    63,    73,    85,    86,    87,   101,   320,
-     337,   448,   464,   524,   541,   742,   741,   631,   632,  1506,
-     638,   638,   556,   556,   556,   630,  1138,   364,  1319,  1109,
-    1429,  1113,   221,  1116,  1393,   631,   632,  1135,   856,   385,
-     873,   874,  1258,   858,  1440,  1128,  1310,  1311,  1426,  1315,
-     632,   630,  1306,   631,   631,   632,   638,  1526,   631,   632,
-     729,   370,  1506,   189,   189,   189,  1235,  1235,   141,   377,
-    1267,  1268,  1273,   582,   238,  1434,  1437,   638,   631,   631,
-      75,   568,   416,  1470,  1454,  1456,  1251,  1251,  1360,  1434,
-    1434,   663,  1434,   155,   121,  1067,   576,   631,  1530,  1208,
-     635,   247,  1198,  1214,  1214,   247,   364,   364,   588,   632,
-    1323,  1312,  1233,  1128,  1138,  1249,  1424,   810,  1036,   630,
-     250,   250,   992,  1013,   998,  1013,  1013,   139,   476,  1034,
-    1047,  1031,   632,  1258,   959,  1434,  1428,  1055,   608,  1434,
-    1048,  1034,   632,    20,   126,  1250,   853,  1034,  1039,  1034,
-     630,   631,   632,  1437,  1429,    32,    33,    38,    40,    42,
-      43,    59,   107,   110,   118,   137,   154,   180,   182,   195,
-     196,   236,   266,   275,   276,   278,   314,   315,   316,   333,
-     334,   335,   340,   343,   360,   361,   393,   394,   418,   472,
-     476,   488,   546,   549,   552,   553,   554,   555,   594,   595,
-     619,   931,   934,   935,   936,   937,   938,   939,   940,  1437,
-     399,  1138,  1138,   364,   685,   691,   364,    74,   686,  1437,
-    1557,    19,  1034,   631,   632,   631,   632,   630,  1437,   839,
-     813,  1434,   919,  1579,   364,   364,   702,   703,   705,  1437,
-     491,  1429,   896,   631,   221,   439,   843,  1399,   909,   630,
-     630,   630,  1437,  1235,  1246,  1229,  1138,   117,   277,   358,
-     567,    21,    33,    47,   574,   957,   967,   968,   969,   358,
-     358,   631,  1229,  1229,  1138,    46,   470,  1169,  1138,  1138,
-    1177,    42,   341,   631,   608,  1157,  1138,  1229,  1138,  1138,
-    1138,  1138,   631,   631,   631,  1258,   631,   981,   976,   974,
-     976,   977,  1257,  1206,  1535,  1437,   631,  1177,  1136,  1052,
-    1051,  1374,   416,  1510,   608,  1513,   625,   625,  1506,  1506,
-    1506,   120,  1138,  1317,  1318,   142,  1116,   256,  1399,   860,
-     631,   206,   250,   875,   631,   632,   631,  1132,   632,  1312,
-    1316,  1317,  1314,  1308,  1306,  1422,  1437,   850,  1437,   189,
-    1506,  1506,  1506,  1252,   202,  1240,  1436,  1436,   637,  1269,
-    1270,  1439,   478,   625,  1455,  1460,  1434,   155,   390,  1068,
-    1534,  1233,  1186,  1183,  1198,   247,   247,  1183,  1198,  1189,
-    1188,  1190,  1325,  1235,  1318,  1223,  1224,  1132,   632,  1250,
-     386,   630,  1037,  1138,  1013,   998,   630,   997,   997,   120,
-     120,   929,  1087,  1043,   964,   539,   931,  1030,  1245,  1040,
-    1042,  1032,  1377,   922,   630,   984,   948,   948,   949,   943,
-     941,   397,   932,   941,   941,   969,    59,   594,   935,   937,
-     969,   969,    59,   595,   595,   598,   941,   933,   949,   943,
-     943,   969,   948,   949,    25,    68,    72,    74,   120,   357,
-     364,   401,   472,   521,   577,   951,   952,   953,   982,  1144,
-     598,   948,   969,    33,   948,   970,   948,   948,   949,   630,
-     942,   950,   638,  1229,   486,  1434,   138,  1027,   631,   632,
-    1558,  1559,   631,  1226,   662,   675,   491,   229,   238,   378,
-     706,   707,   708,   709,  1134,   463,   631,   632,   704,  1434,
-     631,   631,   907,    19,   899,  1011,  1012,  1437,  1011,  1011,
-     263,  1256,   631,   631,   631,   631,   631,    33,    21,   574,
-     957,    33,   958,   631,   632,   631,   631,   631,  1171,  1416,
-     631,   631,   632,   631,   328,   252,   411,   631,   631,   631,
-     631,   631,   631,   972,   631,   632,   918,  1127,  1252,  1530,
-     631,   170,   272,   200,   441,  1511,  1511,  1511,   631,   632,
-    1320,   235,   630,   863,   857,   876,  1437,   874,   898,  1311,
-    1318,   631,  1529,  1506,    46,   207,  1237,  1274,  1439,   632,
-     328,  1434,   155,  1201,   364,  1192,  1198,  1198,   364,  1194,
-    1138,  1138,   630,  1246,  1221,  1222,  1211,  1424,  1258,   873,
-     631,   630,   630,  1011,   630,   630,   110,   549,   552,   623,
-     624,  1418,  1419,  1056,  1429,   951,  1092,  1041,  1079,   631,
-     985,  1437,   305,   986,   484,   580,   620,   945,   946,   947,
-     630,   945,   945,   969,   598,   945,   630,   969,   945,   963,
-     120,   143,   180,  1434,   955,   956,  1418,   582,   120,   120,
-     134,   318,   250,   953,   250,   357,   969,   970,   969,   970,
-     945,   358,   945,  1437,   680,   687,   688,  1437,   468,   630,
-    1560,  1563,   631,  1434,   631,   632,   704,  1567,   679,  1573,
-     705,   931,   954,   842,   846,   630,   896,   631,   632,  1250,
-     630,   631,   631,  1255,   958,   970,   358,  1172,  1424,  1138,
-     328,   168,   631,  1257,  1131,  1131,   370,    62,   245,   350,
-     510,   526,   614,  1502,  1503,   608,  1512,  1512,  1512,  1318,
-     250,   539,  1134,   866,   630,   592,   877,   918,  1241,  1424,
-    1238,  1246,   957,   960,  1270,  1434,  1535,  1191,   588,  1193,
-     588,  1228,  1256,   184,   221,   587,  1216,  1217,  1220,   918,
-    1250,   631,  1011,  1011,   631,  1011,  1011,  1420,  1420,   850,
-    1049,   235,   631,   632,   190,   384,   485,   364,   987,   947,
-    1015,  1416,  1015,   955,   593,   512,   682,    52,    65,   177,
-     220,   246,   257,   367,   450,   689,   747,   749,   750,   751,
-     753,   754,   755,   756,   757,   758,   760,   768,   769,   772,
-     783,   786,   788,   789,  1432,  1438,  1442,  1564,   630,  1562,
-    1563,   608,  1565,  1561,  1580,   708,  1437,  1429,   684,   685,
-     449,   964,  1529,   843,   896,   844,    74,   249,   999,  1002,
-    1005,  1006,  1007,  1012,   358,   608,  1000,  1004,  1006,  1009,
-    1001,  1003,  1006,  1008,   631,   632,  1250,   631,   631,   545,
-     545,   545,    17,  1501,   200,   306,   307,   311,   312,  1514,
-    1515,   582,  1429,   870,   527,   871,   868,   869,  1437,   238,
-     259,    74,   106,   225,   308,   326,   349,   537,   893,   894,
-     895,  1354,   609,   610,   632,  1242,  1250,  1138,  1252,   959,
-    1275,  1202,  1138,   630,  1138,   630,   631,   991,   991,  1217,
-     631,   631,   999,   631,   631,  1056,   630,  1437,   125,   582,
-     631,   632,   631,  1138,   150,   683,   770,   773,  1437,   189,
-     348,   761,   748,  1438,  1438,  1437,   752,   645,   279,   438,
-     607,   792,    30,   790,   639,  1123,  1562,   631,    51,    61,
-     269,  1526,   693,   954,   186,   681,  1574,   631,  1526,  1434,
-    1313,   667,  1007,  1250,   631,   383,   669,  1009,   671,  1008,
-    1424,  1502,   370,  1257,  1257,  1257,  1257,  1515,  1326,  1327,
-    1426,  1196,  1135,  1258,   631,   632,   879,   547,  1313,   131,
-     131,  1313,  1313,  1313,  1313,   630,   888,   895,   153,  1424,
-     403,  1263,    70,  1400,  1530,  1228,  1228,   186,  1215,  1215,
-     983,   999,  1000,  1001,   873,    50,   354,   446,   476,   988,
-     988,   969,  1416,   969,  1138,  1138,   605,   775,   779,   189,
-    1437,   763,   764,  1138,   711,   746,   747,   749,   751,   753,
-     755,   756,   757,   758,   760,   768,   783,   786,   788,   711,
-     793,   791,   784,   787,   631,  1529,    61,   370,    61,   129,
-     694,   695,  1144,  1581,  1134,   686,   954,   845,  1257,  1050,
-    1432,  1050,  1050,  1250,   632,  1312,  1394,   631,   867,   869,
-     630,   881,   883,   878,  1434,  1313,  1313,  1260,  1260,  1258,
-    1439,   528,   889,   890,  1313,  1250,    14,   148,   159,   371,
-     544,  1401,  1402,   265,  1403,   631,   631,   202,   247,   373,
-    1219,  1218,   631,     5,   120,   357,   364,   364,   771,   780,
-     145,   779,   782,   235,   149,  1138,   149,   746,   636,   581,
-    1138,   712,   792,   790,   370,   370,   129,   746,  1568,   138,
-    1575,  1529,  1327,  1318,   960,   871,   630,   882,   883,   884,
-     313,   880,   883,  1434,  1434,   891,   631,   632,   914,  1264,
-      46,    46,   148,    46,  1402,   511,   544,  1404,  1405,    46,
-      46,   630,   630,   582,   125,   605,   774,   776,  1138,   711,
-     149,   759,   220,   765,   279,   636,   795,   794,   119,   710,
-     713,   785,  1438,   785,   144,   687,   693,  1395,   631,   632,
-     313,   886,   887,  1141,   892,  1439,   890,   630,  1416,  1416,
-      46,  1416,    46,    46,  1405,  1225,  1227,   988,   988,   777,
-     776,   782,   781,    52,   762,  1437,   548,  1138,   138,    90,
-     167,   717,   743,  1437,   149,   746,   636,   459,  1576,   457,
-    1406,   883,   632,   885,   893,   358,  1265,  1266,  1416,  1416,
-    1416,   631,   631,  1138,   149,   548,   632,   711,   796,   711,
-     205,   632,   714,    81,   100,   636,  1569,   746,   218,  1400,
-     887,   631,   631,   632,   778,    52,   711,  1437,   766,   149,
-     149,   186,  1437,   954,   186,   186,   746,    46,  1403,  1266,
-     548,   145,   146,   767,   438,   607,   715,   120,   744,   720,
-     721,  1257,   716,  1416,   221,  1407,   711,   711,   763,   496,
-     498,   718,   719,   720,   723,  1144,  1437,   745,  1117,   358,
-     630,  1409,   632,   746,   188,  1138,   265,   457,  1408,   631,
-     637,  1410,  1411,  1426,   476,  1412,   719,  1439,   631,   632,
-    1413,  1414,  1426,  1411,   632,  1312,  1414,  1134,  1318,  1135
-};
-
-#define yyerrok                (yyerrstatus = 0)
-#define yyclearin      (yychar = YYEMPTY)
-#define YYEMPTY                (-2)
-#define YYEOF          0
-
-#define YYACCEPT       goto yyacceptlab
-#define YYABORT                goto yyabortlab
-#define YYERROR                goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-
-#define YYFAIL         goto yyerrlab
-
-#define YYRECOVERING()  (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)                                 \
-do                                                             \
-  if (yychar == YYEMPTY && yylen == 1)                         \
-    {                                                          \
-      yychar = (Token);                                                \
-      yylval = (Value);                                                \
-      yytoken = YYTRANSLATE (yychar);                          \
-      YYPOPSTACK (1);                                          \
-      goto yybackup;                                           \
-    }                                                          \
-  else                                                         \
-    {                                                          \
-      yyerror (YYTHD, YY_("syntax error: cannot back up")); \
-      YYERROR;                                                 \
-    }                                                          \
-while (YYID (0))
-
-
-#define YYTERROR       1
-#define YYERRCODE      256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
-   If N is 0, then set CURRENT to the empty location which ends
-   the previous symbol: RHS[0] (always defined).  */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
-    do                                                                 \
-      if (YYID (N))                                                    \
-       {                                                               \
-         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
-         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
-         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
-         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
-       }                                                               \
-      else                                                             \
-       {                                                               \
-         (Current).first_line   = (Current).last_line   =              \
-           YYRHSLOC (Rhs, 0).last_line;                                \
-         (Current).first_column = (Current).last_column =              \
-           YYRHSLOC (Rhs, 0).last_column;                              \
-       }                                                               \
-    while (YYID (0))
-#endif
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
-   This macro was not mandated originally: define only if we know
-   we won't break user code: when these are the locations we know.  */
-
-#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-#  define YY_LOCATION_PRINT(File, Loc)                 \
-     fprintf (File, "%d.%d-%d.%d",                     \
-             (Loc).first_line, (Loc).first_column,     \
-             (Loc).last_line,  (Loc).last_column)
-# else
-#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments.  */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval, YYTHD)
-#endif
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)                       \
-do {                                           \
-  if (yydebug)                                 \
-    YYFPRINTF Args;                            \
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
-do {                                                                     \
-  if (yydebug)                                                           \
-    {                                                                    \
-      YYFPRINTF (stderr, "%s ", Title);                                          \
-      yy_symbol_print (stderr,                                           \
-                 Type, Value, YYTHD); \
-      YYFPRINTF (stderr, "\n");                                                  \
-    }                                                                    \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, class THD *YYTHD)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, YYTHD)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    class THD *YYTHD;
-#endif
-{
-  if (!yyvaluep)
-    return;
-  YYUSE (YYTHD);
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
-# endif
-  switch (yytype)
-    {
-      default:
-       break;
-    }
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, class THD *YYTHD)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, YYTHD)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    class THD *YYTHD;
-#endif
-{
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep, YYTHD);
-  YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
-    yytype_int16 *yybottom;
-    yytype_int16 *yytop;
-#endif
-{
-  YYFPRINTF (stderr, "Stack now");
-  for (; yybottom <= yytop; yybottom++)
-    {
-      int yybot = *yybottom;
-      YYFPRINTF (stderr, " %d", yybot);
-    }
-  YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top)                           \
-do {                                                           \
-  if (yydebug)                                                 \
-    yy_stack_print ((Bottom), (Top));                          \
-} while (YYID (0))
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule, class THD *YYTHD)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule, YYTHD)
-    YYSTYPE *yyvsp;
-    int yyrule;
-    class THD *YYTHD;
-#endif
-{
-  int yynrhs = yyr2[yyrule];
-  int yyi;
-  unsigned long int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-            yyrule - 1, yylno);
-  /* The symbols being reduced.  */
-  for (yyi = 0; yyi < yynrhs; yyi++)
-    {
-      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-                      &(yyvsp[(yyi + 1) - (yynrhs)])
-                                      , YYTHD);
-      YYFPRINTF (stderr, "\n");
-    }
-}
-
-# define YY_REDUCE_PRINT(Rule)         \
-do {                                   \
-  if (yydebug)                         \
-    yy_reduce_print (yyvsp, Rule, YYTHD); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef        YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-\f
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-#  if defined __GLIBC__ && defined _STRING_H
-#   define yystrlen strlen
-#  else
-/* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
-{
-  YYSIZE_T yylen;
-  for (yylen = 0; yystr[yylen]; yylen++)
-    continue;
-  return yylen;
-}
-#  endif
-# endif
-
-# ifndef yystpcpy
-#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#   define yystpcpy stpcpy
-#  else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
-{
-  char *yyd = yydest;
-  const char *yys = yysrc;
-
-  while ((*yyd++ = *yys++) != '\0')
-    continue;
-
-  return yyd - 1;
-}
-#  endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
-  if (*yystr == '"')
-    {
-      YYSIZE_T yyn = 0;
-      char const *yyp = yystr;
-
-      for (;;)
-       switch (*++yyp)
-         {
-         case '\'':
-         case ',':
-           goto do_not_strip_quotes;
-
-         case '\\':
-           if (*++yyp != '\\')
-             goto do_not_strip_quotes;
-           /* Fall through.  */
-         default:
-           if (yyres)
-             yyres[yyn] = *yyp;
-           yyn++;
-           break;
-
-         case '"':
-           if (yyres)
-             yyres[yyn] = '\0';
-           return yyn;
-         }
-    do_not_strip_quotes: ;
-    }
-
-  if (! yyres)
-    return yystrlen (yystr);
-
-  return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into YYRESULT an error message about the unexpected token
-   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
-   including the terminating null byte.  If YYRESULT is null, do not
-   copy anything; just return the number of bytes that would be
-   copied.  As a special case, return 0 if an ordinary "syntax error"
-   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
-   size calculation.  */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
-  int yyn = yypact[yystate];
-
-  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
-    return 0;
-  else
-    {
-      int yytype = YYTRANSLATE (yychar);
-      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-      YYSIZE_T yysize = yysize0;
-      YYSIZE_T yysize1;
-      int yysize_overflow = 0;
-      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-      int yyx;
-
-# if 0
-      /* This is so xgettext sees the translatable formats that are
-        constructed on the fly.  */
-      YY_("syntax error, unexpected %s");
-      YY_("syntax error, unexpected %s, expecting %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
-      char *yyfmt;
-      char const *yyf;
-      static char const yyunexpected[] = "syntax error, unexpected %s";
-      static char const yyexpecting[] = ", expecting %s";
-      static char const yyor[] = " or %s";
-      char yyformat[sizeof yyunexpected
-                   + sizeof yyexpecting - 1
-                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-                      * (sizeof yyor - 1))];
-      char const *yyprefix = yyexpecting;
-
-      /* Start YYX at -YYN if negative to avoid negative indexes in
-        YYCHECK.  */
-      int yyxbegin = yyn < 0 ? -yyn : 0;
-
-      /* Stay within bounds of both yycheck and yytname.  */
-      int yychecklim = YYLAST - yyn + 1;
-      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-      int yycount = 1;
-
-      yyarg[0] = yytname[yytype];
-      yyfmt = yystpcpy (yyformat, yyunexpected);
-
-      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-         {
-           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-             {
-               yycount = 1;
-               yysize = yysize0;
-               yyformat[sizeof yyunexpected - 1] = '\0';
-               break;
-             }
-           yyarg[yycount++] = yytname[yyx];
-           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-           yysize_overflow |= (yysize1 < yysize);
-           yysize = yysize1;
-           yyfmt = yystpcpy (yyfmt, yyprefix);
-           yyprefix = yyor;
-         }
-
-      yyf = YY_(yyformat);
-      yysize1 = yysize + yystrlen (yyf);
-      yysize_overflow |= (yysize1 < yysize);
-      yysize = yysize1;
-
-      if (yysize_overflow)
-       return YYSIZE_MAXIMUM;
-
-      if (yyresult)
-       {
-         /* Avoid sprintf, as that infringes on the user's name space.
-            Don't have undefined behavior even if the translation
-            produced a string with the wrong number of "%s"s.  */
-         char *yyp = yyresult;
-         int yyi = 0;
-         while ((*yyp = *yyf) != '\0')
-           {
-             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-               {
-                 yyp += yytnamerr (yyp, yyarg[yyi++]);
-                 yyf += 2;
-               }
-             else
-               {
-                 yyp++;
-                 yyf++;
-               }
-           }
-       }
-      return yysize;
-    }
-}
-#endif /* YYERROR_VERBOSE */
-\f
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, class THD *YYTHD)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep, YYTHD)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-    class THD *YYTHD;
-#endif
-{
-  YYUSE (yyvaluep);
-  YYUSE (YYTHD);
-
-  if (!yymsg)
-    yymsg = "Deleting";
-  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
-  switch (yytype)
-    {
-
-      default:
-       break;
-    }
-}
-
-/* Prevent warnings from -Wmissing-prototypes.  */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (class THD *YYTHD);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-
-
-/*-------------------------.
-| yyparse or yypush_parse.  |
-`-------------------------*/
-
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
-    void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (class THD *YYTHD)
-#else
-int
-yyparse (YYTHD)
-    class THD *YYTHD;
-#endif
-#endif
-{
-/* The lookahead symbol.  */
-int yychar;
-
-/* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval;
-
-    /* Number of syntax errors so far.  */
-    int yynerrs;
-
-    int yystate;
-    /* Number of tokens to shift before error messages enabled.  */
-    int yyerrstatus;
-
-    /* The stacks and their tools:
-       `yyss': related to states.
-       `yyvs': related to semantic values.
-
-       Refer to the stacks thru separate pointers, to allow yyoverflow
-       to reallocate them elsewhere.  */
-
-    /* The state stack.  */
-    yytype_int16 yyssa[YYINITDEPTH];
-    yytype_int16 *yyss;
-    yytype_int16 *yyssp;
-
-    /* The semantic value stack.  */
-    YYSTYPE yyvsa[YYINITDEPTH];
-    YYSTYPE *yyvs;
-    YYSTYPE *yyvsp;
-
-    YYSIZE_T yystacksize;
-
-  int yyn;
-  int yyresult;
-  /* Lookahead token as an internal (translated) token number.  */
-  int yytoken;
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
-
-  /* The number of symbols on the RHS of the reduced rule.
-     Keep to zero when no symbol should be popped.  */
-  int yylen = 0;
-
-  yytoken = 0;
-  yyss = yyssa;
-  yyvs = yyvsa;
-  yystacksize = YYINITDEPTH;
-
-  YYDPRINTF ((stderr, "Starting parse\n"));
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY; /* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-  yyssp = yyss;
-  yyvsp = yyvs;
-
-  goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
-`------------------------------------------------------------*/
- yynewstate:
-  /* In all cases, when you get here, the value and location stacks
-     have just been pushed.  So pushing a state here evens the stacks.  */
-  yyssp++;
-
- yysetstate:
-  *yyssp = yystate;
-
-  if (yyss + yystacksize - 1 <= yyssp)
-    {
-      /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      {
-       /* Give user a chance to reallocate the stack.  Use copies of
-          these so that the &'s don't force the real ones into
-          memory.  */
-       YYSTYPE *yyvs1 = yyvs;
-       yytype_int16 *yyss1 = yyss;
-
-       /* Each stack pointer address is followed by the size of the
-          data in use in that stack, in bytes.  This used to be a
-          conditional around just the two extra args, but that might
-          be undefined if yyoverflow is a macro.  */
-       yyoverflow (YY_("memory exhausted"),
-                   &yyss1, yysize * sizeof (*yyssp),
-                   &yyvs1, yysize * sizeof (*yyvsp),
-                   &yystacksize);
-
-       yyss = yyss1;
-       yyvs = yyvs1;
-      }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
-      /* Extend the stack our own way.  */
-      if (YYMAXDEPTH <= yystacksize)
-       goto yyexhaustedlab;
-      yystacksize *= 2;
-      if (YYMAXDEPTH < yystacksize)
-       yystacksize = YYMAXDEPTH;
-
-      {
-       yytype_int16 *yyss1 = yyss;
-       union yyalloc *yyptr =
-         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-       if (! yyptr)
-         goto yyexhaustedlab;
-       YYSTACK_RELOCATE (yyss_alloc, yyss);
-       YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-#  undef YYSTACK_RELOCATE
-       if (yyss1 != yyssa)
-         YYSTACK_FREE (yyss1);
-      }
-# endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + yysize - 1;
-      yyvsp = yyvs + yysize - 1;
-
-      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-                 (unsigned long int) yystacksize));
-
-      if (yyss + yystacksize - 1 <= yyssp)
-       YYABORT;
-    }
-
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
-  if (yystate == YYFINAL)
-    YYACCEPT;
-
-  goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-  /* Do appropriate processing given the current state.  Read a
-     lookahead token if we need one and don't already have one.  */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-  yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
-  if (yychar == YYEMPTY)
-    {
-      YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
-    }
-
-  if (yychar <= YYEOF)
-    {
-      yychar = yytoken = YYEOF;
-      YYDPRINTF ((stderr, "Now at end of input.\n"));
-    }
-  else
-    {
-      yytoken = YYTRANSLATE (yychar);
-      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-  /* If the proper action on seeing token YYTOKEN is to reduce or to
-     detect an error, take that action.  */
-  yyn += yytoken;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-    goto yydefault;
-  yyn = yytable[yyn];
-  if (yyn <= 0)
-    {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-       goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  /* Shift the lookahead token.  */
-  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
-  /* Discard the shifted token.  */
-  yychar = YYEMPTY;
-
-  yystate = yyn;
-  *++yyvsp = yylval;
-
-  goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-  goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-  /* yyn is the number of a rule to reduce with.  */
-  yylen = yyr2[yyn];
-
-  /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
-
-     Otherwise, the following line sets YYVAL to garbage.
-     This behavior is undocumented and Bison
-     users should not rely upon it.  Assigning to YYVAL
-     unconditionally makes the parser a bit smaller, and it avoids a
-     GCC warning that YYVAL may be used uninitialized.  */
-  yyval = yyvsp[1-yylen];
-
-
-  YY_REDUCE_PRINT (yyn);
-  switch (yyn)
-    {
-        case 2:
-
-/* Line 1455 of yacc.c  */
-#line 1969 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            if (!thd->bootstrap &&
-              (!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT)))
-            {
-              my_message(ER_EMPTY_QUERY, ER(ER_EMPTY_QUERY), MYF(0));
-              MYSQL_YYABORT;
-            }
-            thd->lex->sql_command= SQLCOM_EMPTY_QUERY;
-            YYLIP->found_semicolon= NULL;
-          }
-    break;
-
-  case 3:
-
-/* Line 1455 of yacc.c  */
-#line 1981 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex_input_stream *lip = YYLIP;
-
-            if ((YYTHD->client_capabilities & CLIENT_MULTI_QUERIES) &&
-                lip->multi_statements &&
-                ! lip->eof())
-            {
-              /*
-                We found a well formed query, and multi queries are allowed:
-                - force the parser to stop after the ';'
-                - mark the start of the next query for the next invocation
-                  of the parser.
-              */
-              lip->next_state= MY_LEX_END;
-              lip->found_semicolon= lip->get_ptr();
-            }
-            else
-            {
-              /* Single query, terminated. */
-              lip->found_semicolon= NULL;
-            }
-          }
-    break;
-
-  case 5:
-
-/* Line 1455 of yacc.c  */
-#line 2006 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* Single query, not terminated. */
-            YYLIP->found_semicolon= NULL;
-          }
-    break;
-
-  case 62:
-
-/* Line 1455 of yacc.c  */
-#line 2080 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
-            lex->prepared_stmt_name= (yyvsp[(3) - (3)].lex_str);
-          }
-    break;
-
-  case 65:
-
-/* Line 1455 of yacc.c  */
-#line 2095 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->sql_command= SQLCOM_PREPARE;
-            lex->prepared_stmt_name= (yyvsp[(2) - (4)].lex_str);
-            /*
-              We don't know know at this time whether there's a password
-              in prepare_src, so we err on the side of caution.  Setting
-              the flag will force a rewrite which will obscure all of
-              prepare_src in the "Query" log line.  We'll see the actual
-              query (with just the passwords obscured, if any) immediately
-              afterwards in the "Prepare" log lines anyway, and then again
-              in the "Execute" log line if and when prepare_src is executed.
-            */
-            lex->contains_plaintext_password= true;
-          }
-    break;
-
-  case 66:
-
-/* Line 1455 of yacc.c  */
-#line 2115 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->prepared_stmt_code= (yyvsp[(1) - (1)].lex_str);
-            lex->prepared_stmt_code_is_varref= FALSE;
-          }
-    break;
-
-  case 67:
-
-/* Line 1455 of yacc.c  */
-#line 2122 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->prepared_stmt_code= (yyvsp[(2) - (2)].lex_str);
-            lex->prepared_stmt_code_is_varref= TRUE;
-          }
-    break;
-
-  case 68:
-
-/* Line 1455 of yacc.c  */
-#line 2132 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->sql_command= SQLCOM_EXECUTE;
-            lex->prepared_stmt_name= (yyvsp[(2) - (2)].lex_str);
-          }
-    break;
-
-  case 69:
-
-/* Line 1455 of yacc.c  */
-#line 2139 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 74:
-
-/* Line 1455 of yacc.c  */
-#line 2154 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&(yyvsp[(2) - (2)].lex_str), sizeof(LEX_STRING));
-            if (!lexstr || lex->prepared_stmt_params.push_back(lexstr))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 75:
-
-/* Line 1455 of yacc.c  */
-#line 2166 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "HELP");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 76:
-
-/* Line 1455 of yacc.c  */
-#line 2174 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_HELP;
-            lex->help_arg= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 77:
-
-/* Line 1455 of yacc.c  */
-#line 2185 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex = Lex;
-            lex->sql_command = SQLCOM_CHANGE_MASTER;
-            /*
-              Clear LEX_MASTER_INFO struct. repl_ignore_server_ids is freed
-              in THD::cleanup_after_query. So it is guaranteed to be
-              uninitialized before here.
-             Its allocation is deferred till the option is parsed below.
-            */
-            lex->mi.set_unspecified();
-            DBUG_ASSERT(Lex->mi.repl_ignore_server_ids.elements == 0);
-          }
-    break;
-
-  case 78:
-
-/* Line 1455 of yacc.c  */
-#line 2198 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 81:
-
-/* Line 1455 of yacc.c  */
-#line 2208 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.host = (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 82:
-
-/* Line 1455 of yacc.c  */
-#line 2212 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.bind_addr = (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 83:
-
-/* Line 1455 of yacc.c  */
-#line 2216 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.user = (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 84:
-
-/* Line 1455 of yacc.c  */
-#line 2220 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.password = (yyvsp[(3) - (3)].lex_str).str;
-            Lex->contains_plaintext_password= true;
-          }
-    break;
-
-  case 85:
-
-/* Line 1455 of yacc.c  */
-#line 2225 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.port = (yyvsp[(3) - (3)].ulong_num);
-          }
-    break;
-
-  case 86:
-
-/* Line 1455 of yacc.c  */
-#line 2229 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.connect_retry = (yyvsp[(3) - (3)].ulong_num);
-          }
-    break;
-
-  case 87:
-
-/* Line 1455 of yacc.c  */
-#line 2233 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.retry_count= (yyvsp[(3) - (3)].ulong_num);
-            Lex->mi.retry_count_opt= LEX_MASTER_INFO::LEX_MI_ENABLE;
-          }
-    break;
-
-  case 88:
-
-/* Line 1455 of yacc.c  */
-#line 2238 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((yyvsp[(3) - (3)].ulong_num) > MASTER_DELAY_MAX)
-            {
-              Lex_input_stream *lip= YYLIP;
-              const char *start= lip->get_tok_start();
-              const char *msg= YYTHD->strmake(start, lip->get_ptr() - start);
-              my_error(ER_MASTER_DELAY_VALUE_OUT_OF_RANGE, MYF(0),
-                       msg, MASTER_DELAY_MAX);
-            }
-            else
-              Lex->mi.sql_delay = (yyvsp[(3) - (3)].ulong_num);
-          }
-    break;
-
-  case 89:
-
-/* Line 1455 of yacc.c  */
-#line 2251 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.ssl= (yyvsp[(3) - (3)].ulong_num) ? 
-              LEX_MASTER_INFO::LEX_MI_ENABLE : LEX_MASTER_INFO::LEX_MI_DISABLE;
-          }
-    break;
-
-  case 90:
-
-/* Line 1455 of yacc.c  */
-#line 2256 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.ssl_ca= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 91:
-
-/* Line 1455 of yacc.c  */
-#line 2260 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.ssl_capath= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 92:
-
-/* Line 1455 of yacc.c  */
-#line 2264 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.ssl_cert= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 93:
-
-/* Line 1455 of yacc.c  */
-#line 2268 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.ssl_cipher= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 94:
-
-/* Line 1455 of yacc.c  */
-#line 2272 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.ssl_key= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 95:
-
-/* Line 1455 of yacc.c  */
-#line 2276 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.ssl_verify_server_cert= (yyvsp[(3) - (3)].ulong_num) ?
-              LEX_MASTER_INFO::LEX_MI_ENABLE : LEX_MASTER_INFO::LEX_MI_DISABLE;
-          }
-    break;
-
-  case 96:
-
-/* Line 1455 of yacc.c  */
-#line 2281 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.ssl_crl= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 97:
-
-/* Line 1455 of yacc.c  */
-#line 2285 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.ssl_crlpath= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 98:
-
-/* Line 1455 of yacc.c  */
-#line 2290 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.heartbeat_period= (float) (yyvsp[(3) - (3)].item_num)->val_real();
-            if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD ||
-                Lex->mi.heartbeat_period < 0.0)
-            {
-               const char format[]= "%d";
-               char buf[4*sizeof(SLAVE_MAX_HEARTBEAT_PERIOD) + sizeof(format)];
-               sprintf(buf, format, SLAVE_MAX_HEARTBEAT_PERIOD);
-               my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE, MYF(0), buf);
-               MYSQL_YYABORT;
-            }
-            if (Lex->mi.heartbeat_period > slave_net_timeout)
-            {
-              push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN,
-                                  ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX,
-                                  ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX));
-            }
-            if (Lex->mi.heartbeat_period < 0.001)
-            {
-              if (Lex->mi.heartbeat_period != 0.0)
-              {
-                push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN,
-                                    ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN,
-                                    ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN));
-                Lex->mi.heartbeat_period= 0.0;
-              }
-              Lex->mi.heartbeat_opt=  LEX_MASTER_INFO::LEX_MI_DISABLE;
-            }
-            Lex->mi.heartbeat_opt=  LEX_MASTER_INFO::LEX_MI_ENABLE;
-          }
-    break;
-
-  case 99:
-
-/* Line 1455 of yacc.c  */
-#line 2321 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.repl_ignore_server_ids_opt= LEX_MASTER_INFO::LEX_MI_ENABLE;
-           }
-    break;
-
-  case 100:
-
-/* Line 1455 of yacc.c  */
-#line 2326 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.auto_position= (yyvsp[(3) - (3)].ulong_num) ?
-              LEX_MASTER_INFO::LEX_MI_ENABLE :
-              LEX_MASTER_INFO::LEX_MI_DISABLE;
-          }
-    break;
-
-  case 105:
-
-/* Line 1455 of yacc.c  */
-#line 2343 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->mi.repl_ignore_server_ids.elements == 0)
-            {
-              my_init_dynamic_array2(&Lex->mi.repl_ignore_server_ids,
-                                     sizeof(::server_id),
-                                     Lex->mi.server_ids_buffer,
-                                     array_elements(Lex->mi.server_ids_buffer),
-                                     16);
-            }
-            insert_dynamic(&Lex->mi.repl_ignore_server_ids, (uchar*) &((yyvsp[(1) - (1)].ulong_num)));
-          }
-    break;
-
-  case 106:
-
-/* Line 1455 of yacc.c  */
-#line 2357 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.log_file_name = (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 107:
-
-/* Line 1455 of yacc.c  */
-#line 2361 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.pos = (yyvsp[(3) - (3)].ulonglong_number);
-            /* 
-               If the user specified a value < BIN_LOG_HEADER_SIZE, adjust it
-               instead of causing subsequent errors. 
-               We need to do it in this file, because only there we know that 
-               MASTER_LOG_POS has been explicitely specified. On the contrary
-               in change_master() (sql_repl.cc) we cannot distinguish between 0
-               (MASTER_LOG_POS explicitely specified as 0) and 0 (unspecified),
-               whereas we want to distinguish (specified 0 means "read the binlog
-               from 0" (4 in fact), unspecified means "don't change the position
-               (keep the preceding value)").
-            */
-            Lex->mi.pos = max<ulonglong>(BIN_LOG_HEADER_SIZE, Lex->mi.pos);
-          }
-    break;
-
-  case 108:
-
-/* Line 1455 of yacc.c  */
-#line 2377 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.relay_log_name = (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 109:
-
-/* Line 1455 of yacc.c  */
-#line 2381 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.relay_log_pos = (yyvsp[(3) - (3)].ulong_num);
-            /* Adjust if < BIN_LOG_HEADER_SIZE (same comment as Lex->mi.pos) */
-            Lex->mi.relay_log_pos = max<ulong>(BIN_LOG_HEADER_SIZE,
-                                               Lex->mi.relay_log_pos);
-          }
-    break;
-
-  case 110:
-
-/* Line 1455 of yacc.c  */
-#line 2393 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->sql_command= SQLCOM_CREATE_TABLE;
-            if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(5) - (5)].table), NULL,
-                                                   TL_OPTION_UPDATING,
-                                                   TL_WRITE, MDL_SHARED))
-              MYSQL_YYABORT;
-            /*
-              Instruct open_table() to acquire SHARED lock to check the
-              existance of table. If the table does not exist then
-              it will be upgraded EXCLUSIVE MDL lock. If table exist
-              then open_table() will return with an error or warning.
-            */
-            lex->query_tables->open_strategy= TABLE_LIST::OPEN_FOR_CREATE;
-            lex->alter_info.reset();
-            lex->col_list.empty();
-            lex->change=NullS;
-            memset(&lex->create_info, 0, sizeof(lex->create_info));
-            lex->create_info.options=(yyvsp[(2) - (5)].num) | (yyvsp[(4) - (5)].num);
-            lex->create_info.default_table_charset= NULL;
-            lex->name.str= 0;
-            lex->name.length= 0;
-            lex->create_last_non_select_table= lex->last_table();
-          }
-    break;
-
-  case 111:
-
-/* Line 1455 of yacc.c  */
-#line 2419 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->current_select= &lex->select_lex; 
-            if ((lex->create_info.used_fields & HA_CREATE_USED_ENGINE) &&
-                !lex->create_info.db_type)
-            {
-              lex->create_info.db_type=
-                lex->create_info.options & HA_LEX_CREATE_TMP_TABLE ?
-                ha_default_temp_handlerton(thd) : ha_default_handlerton(thd);
-              push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN,
-                                  ER_WARN_USING_OTHER_HANDLER,
-                                  ER(ER_WARN_USING_OTHER_HANDLER),
-                                  ha_resolve_storage_engine_name(lex->create_info.db_type),
-                                  (yyvsp[(5) - (7)].table)->table.str);
-            }
-            create_table_set_open_action_and_adjust_tables(lex);
-          }
-    break;
-
-  case 112:
-
-/* Line 1455 of yacc.c  */
-#line 2438 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index_prepare(Lex, (yyvsp[(7) - (7)].table)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 113:
-
-/* Line 1455 of yacc.c  */
-#line 2443 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index(Lex, (yyvsp[(2) - (12)].key_type), (yyvsp[(4) - (12)].lex_str)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 114:
-
-/* Line 1455 of yacc.c  */
-#line 2447 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 115:
-
-/* Line 1455 of yacc.c  */
-#line 2450 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index_prepare(Lex, (yyvsp[(7) - (7)].table)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 116:
-
-/* Line 1455 of yacc.c  */
-#line 2455 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index(Lex, (yyvsp[(2) - (12)].key_type), (yyvsp[(4) - (12)].lex_str)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 117:
-
-/* Line 1455 of yacc.c  */
-#line 2459 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 118:
-
-/* Line 1455 of yacc.c  */
-#line 2462 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index_prepare(Lex, (yyvsp[(7) - (7)].table)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 119:
-
-/* Line 1455 of yacc.c  */
-#line 2467 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index(Lex, (yyvsp[(2) - (12)].key_type), (yyvsp[(4) - (12)].lex_str)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 120:
-
-/* Line 1455 of yacc.c  */
-#line 2471 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 121:
-
-/* Line 1455 of yacc.c  */
-#line 2473 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.default_table_charset= NULL;
-            Lex->create_info.used_fields= 0;
-          }
-    break;
-
-  case 122:
-
-/* Line 1455 of yacc.c  */
-#line 2478 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command=SQLCOM_CREATE_DB;
-            lex->name= (yyvsp[(4) - (6)].lex_str);
-            lex->create_info.options=(yyvsp[(3) - (6)].num);
-          }
-    break;
-
-  case 123:
-
-/* Line 1455 of yacc.c  */
-#line 2485 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_view_mode= VIEW_CREATE_NEW;
-            Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
-            Lex->create_view_suid= TRUE;
-          }
-    break;
-
-  case 124:
-
-/* Line 1455 of yacc.c  */
-#line 2491 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 125:
-
-/* Line 1455 of yacc.c  */
-#line 2493 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_CREATE_USER;
-          }
-    break;
-
-  case 126:
-
-/* Line 1455 of yacc.c  */
-#line 2497 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_tablespace_info->ts_cmd_type= CREATE_LOGFILE_GROUP;
-          }
-    break;
-
-  case 127:
-
-/* Line 1455 of yacc.c  */
-#line 2501 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_tablespace_info->ts_cmd_type= CREATE_TABLESPACE;
-          }
-    break;
-
-  case 128:
-
-/* Line 1455 of yacc.c  */
-#line 2505 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command= SQLCOM_CREATE_SERVER;
-          }
-    break;
-
-  case 129:
-
-/* Line 1455 of yacc.c  */
-#line 2516 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->server_options.server_name= (yyvsp[(2) - (10)].lex_str).str;
-            Lex->server_options.server_name_length= (yyvsp[(2) - (10)].lex_str).length;
-            Lex->server_options.scheme= (yyvsp[(6) - (10)].lex_str).str;
-          }
-    break;
-
-  case 132:
-
-/* Line 1455 of yacc.c  */
-#line 2530 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->server_options.username= (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 133:
-
-/* Line 1455 of yacc.c  */
-#line 2534 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->server_options.host= (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 134:
-
-/* Line 1455 of yacc.c  */
-#line 2538 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->server_options.db= (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 135:
-
-/* Line 1455 of yacc.c  */
-#line 2542 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->server_options.owner= (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 136:
-
-/* Line 1455 of yacc.c  */
-#line 2546 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->server_options.password= (yyvsp[(2) - (2)].lex_str).str;
-            Lex->contains_plaintext_password= true;
-          }
-    break;
-
-  case 137:
-
-/* Line 1455 of yacc.c  */
-#line 2551 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->server_options.socket= (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 138:
-
-/* Line 1455 of yacc.c  */
-#line 2555 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->server_options.port= (yyvsp[(2) - (2)].ulong_num);
-          }
-    break;
-
-  case 139:
-
-/* Line 1455 of yacc.c  */
-#line 2562 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex=Lex;
-
-            lex->stmt_definition_begin= (yyvsp[(1) - (4)].simple_string);
-            lex->create_info.options= (yyvsp[(3) - (4)].num);
-            if (!(lex->event_parse_data= Event_parse_data::new_instance(thd)))
-              MYSQL_YYABORT;
-            lex->event_parse_data->identifier= (yyvsp[(4) - (4)].spname);
-            lex->event_parse_data->on_completion=
-                                  Event_parse_data::ON_COMPLETION_DROP;
-
-            lex->sql_command= SQLCOM_CREATE_EVENT;
-            /* We need that for disallowing subqueries */
-          }
-    break;
-
-  case 140:
-
-/* Line 1455 of yacc.c  */
-#line 2582 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              sql_command is set here because some rules in ev_sql_stmt
-              can overwrite it
-            */
-            Lex->sql_command= SQLCOM_CREATE_EVENT;
-          }
-    break;
-
-  case 141:
-
-/* Line 1455 of yacc.c  */
-#line 2593 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->event_parse_data->item_expression= (yyvsp[(2) - (3)].item);
-            Lex->event_parse_data->interval= (yyvsp[(3) - (3)].interval);
-          }
-    break;
-
-  case 143:
-
-/* Line 1455 of yacc.c  */
-#line 2600 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->event_parse_data->item_execute_at= (yyvsp[(2) - (2)].item);
-          }
-    break;
-
-  case 144:
-
-/* Line 1455 of yacc.c  */
-#line 2606 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 145:
-
-/* Line 1455 of yacc.c  */
-#line 2608 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->event_parse_data->status= Event_parse_data::ENABLED;
-            Lex->event_parse_data->status_changed= true;
-            (yyval.num)= 1;
-          }
-    break;
-
-  case 146:
-
-/* Line 1455 of yacc.c  */
-#line 2614 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->event_parse_data->status= Event_parse_data::SLAVESIDE_DISABLED;
-            Lex->event_parse_data->status_changed= true; 
-            (yyval.num)= 1;
-          }
-    break;
-
-  case 147:
-
-/* Line 1455 of yacc.c  */
-#line 2620 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->event_parse_data->status= Event_parse_data::DISABLED;
-            Lex->event_parse_data->status_changed= true;
-            (yyval.num)= 1;
-          }
-    break;
-
-  case 148:
-
-/* Line 1455 of yacc.c  */
-#line 2629 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *item= new (YYTHD->mem_root) Item_func_now_local(0);
-            if (item == NULL)
-              MYSQL_YYABORT;
-            Lex->event_parse_data->item_starts= item;
-          }
-    break;
-
-  case 149:
-
-/* Line 1455 of yacc.c  */
-#line 2636 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->event_parse_data->item_starts= (yyvsp[(2) - (2)].item);
-          }
-    break;
-
-  case 151:
-
-/* Line 1455 of yacc.c  */
-#line 2644 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->event_parse_data->item_ends= (yyvsp[(2) - (2)].item);
-          }
-    break;
-
-  case 152:
-
-/* Line 1455 of yacc.c  */
-#line 2650 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 154:
-
-/* Line 1455 of yacc.c  */
-#line 2656 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->event_parse_data->on_completion=
-                                  Event_parse_data::ON_COMPLETION_PRESERVE;
-            (yyval.num)= 1;
-          }
-    break;
-
-  case 155:
-
-/* Line 1455 of yacc.c  */
-#line 2662 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->event_parse_data->on_completion=
-                                  Event_parse_data::ON_COMPLETION_DROP;
-            (yyval.num)= 1;
-          }
-    break;
-
-  case 156:
-
-/* Line 1455 of yacc.c  */
-#line 2670 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 157:
-
-/* Line 1455 of yacc.c  */
-#line 2672 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->comment= Lex->event_parse_data->comment= (yyvsp[(2) - (2)].lex_str);
-            (yyval.num)= 1;
-          }
-    break;
-
-  case 158:
-
-/* Line 1455 of yacc.c  */
-#line 2679 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            Lex_input_stream *lip= YYLIP;
-
-            /*
-              This stops the following :
-              - CREATE EVENT ... DO CREATE EVENT ...;
-              - ALTER  EVENT ... DO CREATE EVENT ...;
-              - CREATE EVENT ... DO ALTER EVENT DO ....;
-              - CREATE PROCEDURE ... BEGIN CREATE EVENT ... END|
-              This allows:
-              - CREATE EVENT ... DO DROP EVENT yyy;
-              - CREATE EVENT ... DO ALTER EVENT yyy;
-                (the nested ALTER EVENT can have anything but DO clause)
-              - ALTER  EVENT ... DO ALTER EVENT yyy;
-                (the nested ALTER EVENT can have anything but DO clause)
-              - ALTER  EVENT ... DO DROP EVENT yyy;
-              - CREATE PROCEDURE ... BEGIN ALTER EVENT ... END|
-                (the nested ALTER EVENT can have anything but DO clause)
-              - CREATE PROCEDURE ... BEGIN DROP EVENT ... END|
-            */
-            if (lex->sphead)
-            {
-              my_error(ER_EVENT_RECURSION_FORBIDDEN, MYF(0));
-              MYSQL_YYABORT;
-            }
-
-            sp_head *sp= sp_start_parsing(thd,
-                                          SP_TYPE_PROCEDURE,
-                                          lex->event_parse_data->identifier);
-
-            if (!sp)
-              MYSQL_YYABORT;
-
-            lex->sphead= sp;
-
-            memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
-            sp->m_chistics= &lex->sp_chistics;
-
-            sp->set_body_start(thd, lip->get_cpp_ptr());
-          }
-    break;
-
-  case 159:
-
-/* Line 1455 of yacc.c  */
-#line 2722 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-
-            sp_finish_parsing(thd);
-
-            lex->sp_chistics.suid= SP_IS_SUID;  //always the definer!
-            lex->event_parse_data->body_changed= TRUE;
-          }
-    break;
-
-  case 173:
-
-/* Line 1455 of yacc.c  */
-#line 2751 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-           LEX *lex=Lex;
-           lex->users_list.empty();
-           lex->columns.empty();
-           lex->grant= lex->grant_tot_col= 0;
-           lex->all_privileges= 0;
-           lex->select_lex.db= 0;
-           lex->ssl_type= SSL_TYPE_NOT_SPECIFIED;
-           lex->ssl_cipher= lex->x509_subject= lex->x509_issuer= 0;
-           memset(&(lex->mqh), 0, sizeof(lex->mqh));
-         }
-    break;
-
-  case 174:
-
-/* Line 1455 of yacc.c  */
-#line 2766 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!(yyvsp[(1) - (3)].lex_str).str ||
-                (check_and_convert_db_name(&(yyvsp[(1) - (3)].lex_str), FALSE) != IDENT_NAME_OK))
-              MYSQL_YYABORT;
-            if (sp_check_name(&(yyvsp[(3) - (3)].lex_str)))
-            {
-              MYSQL_YYABORT;
-            }
-            (yyval.spname)= new sp_name((yyvsp[(1) - (3)].lex_str), (yyvsp[(3) - (3)].lex_str), true);
-            if ((yyval.spname) == NULL)
-              MYSQL_YYABORT;
-            (yyval.spname)->init_qname(YYTHD);
-          }
-    break;
-
-  case 175:
-
-/* Line 1455 of yacc.c  */
-#line 2780 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            LEX_STRING db;
-            if (sp_check_name(&(yyvsp[(1) - (1)].lex_str)))
-            {
-              MYSQL_YYABORT;
-            }
-            if (lex->copy_db_to(&db.str, &db.length))
-              MYSQL_YYABORT;
-            (yyval.spname)= new sp_name(db, (yyvsp[(1) - (1)].lex_str), false);
-            if ((yyval.spname) == NULL)
-              MYSQL_YYABORT;
-            (yyval.spname)->init_qname(thd);
-          }
-    break;
-
-  case 176:
-
-/* Line 1455 of yacc.c  */
-#line 2798 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 177:
-
-/* Line 1455 of yacc.c  */
-#line 2799 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 178:
-
-/* Line 1455 of yacc.c  */
-#line 2803 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 179:
-
-/* Line 1455 of yacc.c  */
-#line 2804 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 180:
-
-/* Line 1455 of yacc.c  */
-#line 2810 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sp_chistics.comment= (yyvsp[(2) - (2)].lex_str); }
-    break;
-
-  case 181:
-
-/* Line 1455 of yacc.c  */
-#line 2812 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* Just parse it, we only have one language for now. */ }
-    break;
-
-  case 182:
-
-/* Line 1455 of yacc.c  */
-#line 2814 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sp_chistics.daccess= SP_NO_SQL; }
-    break;
-
-  case 183:
-
-/* Line 1455 of yacc.c  */
-#line 2816 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sp_chistics.daccess= SP_CONTAINS_SQL; }
-    break;
-
-  case 184:
-
-/* Line 1455 of yacc.c  */
-#line 2818 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sp_chistics.daccess= SP_READS_SQL_DATA; }
-    break;
-
-  case 185:
-
-/* Line 1455 of yacc.c  */
-#line 2820 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sp_chistics.daccess= SP_MODIFIES_SQL_DATA; }
-    break;
-
-  case 186:
-
-/* Line 1455 of yacc.c  */
-#line 2822 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 187:
-
-/* Line 1455 of yacc.c  */
-#line 2827 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 188:
-
-/* Line 1455 of yacc.c  */
-#line 2828 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sp_chistics.detistic= TRUE; }
-    break;
-
-  case 189:
-
-/* Line 1455 of yacc.c  */
-#line 2829 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sp_chistics.detistic= FALSE; }
-    break;
-
-  case 190:
-
-/* Line 1455 of yacc.c  */
-#line 2834 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sp_chistics.suid= SP_IS_SUID;
-          }
-    break;
-
-  case 191:
-
-/* Line 1455 of yacc.c  */
-#line 2838 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sp_chistics.suid= SP_IS_NOT_SUID;
-          }
-    break;
-
-  case 192:
-
-/* Line 1455 of yacc.c  */
-#line 2845 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex = Lex;
-
-            lex->sql_command= SQLCOM_CALL;
-            lex->spname= (yyvsp[(2) - (2)].spname);
-            lex->value_list.empty();
-            sp_add_used_routine(lex, YYTHD, (yyvsp[(2) - (2)].spname), SP_TYPE_PROCEDURE);
-          }
-    break;
-
-  case 193:
-
-/* Line 1455 of yacc.c  */
-#line 2853 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 198:
-
-/* Line 1455 of yacc.c  */
-#line 2869 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-           Lex->value_list.push_back((yyvsp[(3) - (3)].item));
-          }
-    break;
-
-  case 199:
-
-/* Line 1455 of yacc.c  */
-#line 2873 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->value_list.push_back((yyvsp[(1) - (1)].item));
-          }
-    break;
-
-  case 204:
-
-/* Line 1455 of yacc.c  */
-#line 2891 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            lex->length= 0;
-            lex->dec= 0;
-            lex->type= 0;
-
-            lex->default_value= 0;
-            lex->on_update_value= 0;
-
-            lex->comment= null_lex_str;
-            lex->charset= NULL;
-
-            lex->interval_list.empty();
-            lex->uint_geom_type= 0;
-          }
-    break;
-
-  case 205:
-
-/* Line 1455 of yacc.c  */
-#line 2911 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            if (pctx->find_variable((yyvsp[(1) - (3)].lex_str), TRUE))
-            {
-              my_error(ER_SP_DUP_PARAM, MYF(0), (yyvsp[(1) - (3)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            sp_variable *spvar= pctx->add_variable(thd,
-                                                   (yyvsp[(1) - (3)].lex_str),
-                                                   (enum enum_field_types) (yyvsp[(3) - (3)].num),
-                                                   sp_variable::MODE_IN);
-
-            if (fill_field_definition(thd, sp,
-                                      (enum enum_field_types) (yyvsp[(3) - (3)].num),
-                                      &spvar->field_def))
-            {
-              MYSQL_YYABORT;
-            }
-            spvar->field_def.field_name= spvar->name.str;
-            spvar->field_def.pack_flag |= FIELDFLAG_MAYBE_NULL;
-          }
-    break;
-
-  case 210:
-
-/* Line 1455 of yacc.c  */
-#line 2952 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            if (pctx->find_variable((yyvsp[(3) - (4)].lex_str), TRUE))
-            {
-              my_error(ER_SP_DUP_PARAM, MYF(0), (yyvsp[(3) - (4)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            sp_variable *spvar= pctx->add_variable(thd,
-                                                   (yyvsp[(3) - (4)].lex_str),
-                                                   (enum enum_field_types) (yyvsp[(4) - (4)].num),
-                                                   (sp_variable::enum_mode) (yyvsp[(1) - (4)].num));
-
-            if (fill_field_definition(thd, sp,
-                                      (enum enum_field_types) (yyvsp[(4) - (4)].num),
-                                      &spvar->field_def))
-            {
-              MYSQL_YYABORT;
-            }
-            spvar->field_def.field_name= spvar->name.str;
-            spvar->field_def.pack_flag |= FIELDFLAG_MAYBE_NULL;
-          }
-    break;
-
-  case 211:
-
-/* Line 1455 of yacc.c  */
-#line 2980 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= sp_variable::MODE_IN; }
-    break;
-
-  case 212:
-
-/* Line 1455 of yacc.c  */
-#line 2981 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= sp_variable::MODE_IN; }
-    break;
-
-  case 213:
-
-/* Line 1455 of yacc.c  */
-#line 2982 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= sp_variable::MODE_OUT; }
-    break;
-
-  case 214:
-
-/* Line 1455 of yacc.c  */
-#line 2983 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= sp_variable::MODE_INOUT; }
-    break;
-
-  case 215:
-
-/* Line 1455 of yacc.c  */
-#line 2987 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 217:
-
-/* Line 1455 of yacc.c  */
-#line 2992 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 219:
-
-/* Line 1455 of yacc.c  */
-#line 2998 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0;
-          }
-    break;
-
-  case 220:
-
-/* Line 1455 of yacc.c  */
-#line 3002 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* We check for declarations out of (standard) order this way
-              because letting the grammar rules reflect it caused tricky
-               shift/reduce conflicts with the wrong result. (And we get
-               better error handling this way.) */
-            if (((yyvsp[(2) - (3)].spblock).vars || (yyvsp[(2) - (3)].spblock).conds) && ((yyvsp[(1) - (3)].spblock).curs || (yyvsp[(1) - (3)].spblock).hndlrs))
-            { /* Variable or condition following cursor or handler */
-              my_message(ER_SP_VARCOND_AFTER_CURSHNDLR,
-                         ER(ER_SP_VARCOND_AFTER_CURSHNDLR), MYF(0));
-              MYSQL_YYABORT;
-            }
-            if ((yyvsp[(2) - (3)].spblock).curs && (yyvsp[(1) - (3)].spblock).hndlrs)
-            { /* Cursor following handler */
-              my_message(ER_SP_CURSOR_AFTER_HANDLER,
-                         ER(ER_SP_CURSOR_AFTER_HANDLER), MYF(0));
-              MYSQL_YYABORT;
-            }
-            (yyval.spblock).vars= (yyvsp[(1) - (3)].spblock).vars + (yyvsp[(2) - (3)].spblock).vars;
-            (yyval.spblock).conds= (yyvsp[(1) - (3)].spblock).conds + (yyvsp[(2) - (3)].spblock).conds;
-            (yyval.spblock).hndlrs= (yyvsp[(1) - (3)].spblock).hndlrs + (yyvsp[(2) - (3)].spblock).hndlrs;
-            (yyval.spblock).curs= (yyvsp[(1) - (3)].spblock).curs + (yyvsp[(2) - (3)].spblock).curs;
-          }
-    break;
-
-  case 221:
-
-/* Line 1455 of yacc.c  */
-#line 3028 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            sp->reset_lex(thd);
-            pctx->declare_var_boundary((yyvsp[(2) - (2)].num));
-          }
-    break;
-
-  case 222:
-
-/* Line 1455 of yacc.c  */
-#line 3039 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            uint num_vars= pctx->context_var_count();
-            enum enum_field_types var_type= (enum enum_field_types) (yyvsp[(4) - (5)].num);
-            Item *dflt_value_item= (yyvsp[(5) - (5)].item);
-            LEX_STRING dflt_value_query= EMPTY_STR;
-
-            if (dflt_value_item)
-            {
-              // sp_opt_default only pushes start ptr for DEFAULT clause.
-              const char *expr_start_ptr=
-                sp->m_parser_data.pop_expr_start_ptr();
-              if (lex->is_metadata_used())
-              {
-                dflt_value_query= make_string(thd, expr_start_ptr,
-                                              YY_TOKEN_END);
-                if (!dflt_value_query.str)
-                  MYSQL_YYABORT;
-              }
-            }
-            else
-            {
-              dflt_value_item= new (thd->mem_root) Item_null();
-
-              if (dflt_value_item == NULL)
-                MYSQL_YYABORT;
-            }
-
-            // We can have several variables in DECLARE statement.
-            // We need to create an sp_instr_set instruction for each variable.
-
-            for (uint i = num_vars-(yyvsp[(2) - (5)].num) ; i < num_vars ; i++)
-            {
-              uint var_idx= pctx->var_context2runtime(i);
-              sp_variable *spvar= pctx->find_variable(var_idx);
-
-              if (!spvar)
-                MYSQL_YYABORT;
-
-              spvar->type= var_type;
-              spvar->default_value= dflt_value_item;
-
-              if (fill_field_definition(thd, sp, var_type, &spvar->field_def))
-                MYSQL_YYABORT;
-
-              spvar->field_def.field_name= spvar->name.str;
-              spvar->field_def.pack_flag |= FIELDFLAG_MAYBE_NULL;
-
-              /* The last instruction is responsible for freeing LEX. */
-
-              sp_instr_set *is=
-                new (thd->mem_root)
-                  sp_instr_set(sp->instructions(),
-                               lex,
-                               var_idx,
-                               dflt_value_item,
-                               dflt_value_query,
-                               (i == num_vars - 1));
-
-              if (!is || sp->add_instr(thd, is))
-                MYSQL_YYABORT;
-            }
-
-            pctx->declare_var_boundary(0);
-            if (sp->restore_lex(thd))
-              MYSQL_YYABORT;
-            (yyval.spblock).vars= (yyvsp[(2) - (5)].num);
-            (yyval.spblock).conds= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0;
-          }
-    break;
-
-  case 223:
-
-/* Line 1455 of yacc.c  */
-#line 3112 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            if (pctx->find_condition((yyvsp[(2) - (5)].lex_str), TRUE))
-            {
-              my_error(ER_SP_DUP_COND, MYF(0), (yyvsp[(2) - (5)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            if(pctx->add_condition(thd, (yyvsp[(2) - (5)].lex_str), (yyvsp[(5) - (5)].spcondvalue)))
-              MYSQL_YYABORT;
-            (yyval.spblock).vars= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0;
-            (yyval.spblock).conds= 1;
-          }
-    break;
-
-  case 224:
-
-/* Line 1455 of yacc.c  */
-#line 3128 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            sp_pcontext *parent_pctx= lex->get_sp_current_parsing_ctx();
-
-            sp_pcontext *handler_pctx=
-              parent_pctx->push_context(thd, sp_pcontext::HANDLER_SCOPE);
-
-            sp_handler *h=
-              parent_pctx->add_handler(thd, (sp_handler::enum_type) (yyvsp[(2) - (4)].num));
-
-            lex->set_sp_current_parsing_ctx(handler_pctx);
-
-            sp_instr_hpush_jump *i=
-              new (thd->mem_root)
-                sp_instr_hpush_jump(sp->instructions(), handler_pctx, h);
-            
-            if (!i || sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-
-            if ((yyvsp[(2) - (4)].num) == sp_handler::CONTINUE)
-            {
-              // Mark the end of CONTINUE handler scope.
-
-              if (sp->m_parser_data.add_backpatch_entry(
-                    i, handler_pctx->last_label()))
-              {
-                MYSQL_YYABORT;
-              }
-            }
-
-            if (sp->m_parser_data.add_backpatch_entry(
-                  i, handler_pctx->push_label(thd, EMPTY_STR, 0)))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 225:
-
-/* Line 1455 of yacc.c  */
-#line 3168 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_label *hlab= pctx->pop_label(); /* After this hdlr */
-
-            if ((yyvsp[(2) - (7)].num) == sp_handler::CONTINUE)
-            {
-              sp_instr_hreturn *i=
-                new (thd->mem_root) sp_instr_hreturn(sp->instructions(), pctx);
-
-              if (!i || sp->add_instr(thd, i))
-                MYSQL_YYABORT;
-            }
-            else
-            {  /* EXIT or UNDO handler, just jump to the end of the block */
-              sp_instr_hreturn *i=
-                new (thd->mem_root) sp_instr_hreturn(sp->instructions(), pctx);
-
-              if (i == NULL ||
-                  sp->add_instr(thd, i) ||
-                  sp->m_parser_data.add_backpatch_entry(i, pctx->last_label()))
-                MYSQL_YYABORT;
-            }
-
-            sp->m_parser_data.do_backpatch(hlab, sp->instructions());
-
-            lex->set_sp_current_parsing_ctx(pctx->pop_context());
-
-            (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).curs= 0;
-            (yyval.spblock).hndlrs= 1;
-          }
-    break;
-
-  case 226:
-
-/* Line 1455 of yacc.c  */
-#line 3202 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-
-            sp->reset_lex(thd);
-            sp->m_parser_data.set_current_stmt_start_ptr(YY_TOKEN_END);
-          }
-    break;
-
-  case 227:
-
-/* Line 1455 of yacc.c  */
-#line 3211 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *cursor_lex= Lex;
-            sp_head *sp= cursor_lex->sphead;
-
-            DBUG_ASSERT(cursor_lex->sql_command == SQLCOM_SELECT);
-
-            if (cursor_lex->result)
-            {
-              my_message(ER_SP_BAD_CURSOR_SELECT, ER(ER_SP_BAD_CURSOR_SELECT),
-                         MYF(0));
-              MYSQL_YYABORT;
-            }
-
-            cursor_lex->sp_lex_in_use= true;
-
-            if (sp->restore_lex(thd))
-              MYSQL_YYABORT;
-
-            LEX *lex= Lex;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            uint offp;
-
-            if (pctx->find_cursor((yyvsp[(2) - (6)].lex_str), &offp, TRUE))
-            {
-              my_error(ER_SP_DUP_CURS, MYF(0), (yyvsp[(2) - (6)].lex_str).str);
-              delete cursor_lex;
-              MYSQL_YYABORT;
-            }
-
-            LEX_STRING cursor_query= EMPTY_STR;
-
-            if (cursor_lex->is_metadata_used())
-            {
-              cursor_query=
-                make_string(thd,
-                            sp->m_parser_data.get_current_stmt_start_ptr(),
-                            YY_TOKEN_END);
-
-              if (!cursor_query.str)
-                MYSQL_YYABORT;
-            }
-
-            sp_instr_cpush *i=
-              new (thd->mem_root)
-                sp_instr_cpush(sp->instructions(), pctx,
-                               cursor_lex, cursor_query,
-                               pctx->current_cursor_count());
-
-            if (i == NULL ||
-                sp->add_instr(thd, i) ||
-                pctx->add_cursor((yyvsp[(2) - (6)].lex_str)))
-            {
-              MYSQL_YYABORT;
-            }
-
-            (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).hndlrs= 0;
-            (yyval.spblock).curs= 1;
-          }
-    break;
-
-  case 228:
-
-/* Line 1455 of yacc.c  */
-#line 3274 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= sp_handler::EXIT; }
-    break;
-
-  case 229:
-
-/* Line 1455 of yacc.c  */
-#line 3275 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= sp_handler::CONTINUE; }
-    break;
-
-  case 230:
-
-/* Line 1455 of yacc.c  */
-#line 3281 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 231:
-
-/* Line 1455 of yacc.c  */
-#line 3283 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)+= 1; }
-    break;
-
-  case 232:
-
-/* Line 1455 of yacc.c  */
-#line 3288 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_pcontext *parent_pctx= pctx->parent_context();
-
-            if (parent_pctx->check_duplicate_handler((yyvsp[(1) - (1)].spcondvalue)))
-            {
-              my_message(ER_SP_DUP_HANDLER, ER(ER_SP_DUP_HANDLER), MYF(0));
-              MYSQL_YYABORT;
-            }
-            else
-            {
-              sp_instr_hpush_jump *i=
-                (sp_instr_hpush_jump *)sp->last_instruction();
-
-              i->add_condition((yyvsp[(1) - (1)].spcondvalue));
-            }
-          }
-    break;
-
-  case 233:
-
-/* Line 1455 of yacc.c  */
-#line 3311 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* mysql errno */
-            if ((yyvsp[(1) - (1)].ulong_num) == 0)
-            {
-              my_error(ER_WRONG_VALUE, MYF(0), "CONDITION", "0");
-              MYSQL_YYABORT;
-            }
-            (yyval.spcondvalue)= new (YYTHD->mem_root) sp_condition_value((yyvsp[(1) - (1)].ulong_num));
-            if ((yyval.spcondvalue) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 235:
-
-/* Line 1455 of yacc.c  */
-#line 3326 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* SQLSTATE */
-
-            /*
-              An error is triggered:
-                - if the specified string is not a valid SQLSTATE,
-                - or if it represents the completion condition -- it is not
-                  allowed to SIGNAL, or declare a handler for the completion
-                  condition.
-            */
-            if (!is_sqlstate_valid(&(yyvsp[(3) - (3)].lex_str)) || is_sqlstate_completion((yyvsp[(3) - (3)].lex_str).str))
-            {
-              my_error(ER_SP_BAD_SQLSTATE, MYF(0), (yyvsp[(3) - (3)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            (yyval.spcondvalue)= new (YYTHD->mem_root) sp_condition_value((yyvsp[(3) - (3)].lex_str).str);
-            if ((yyval.spcondvalue) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 236:
-
-/* Line 1455 of yacc.c  */
-#line 3347 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 237:
-
-/* Line 1455 of yacc.c  */
-#line 3348 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 238:
-
-/* Line 1455 of yacc.c  */
-#line 3353 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.spcondvalue)= (yyvsp[(1) - (1)].spcondvalue);
-          }
-    break;
-
-  case 239:
-
-/* Line 1455 of yacc.c  */
-#line 3357 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            (yyval.spcondvalue)= pctx->find_condition((yyvsp[(1) - (1)].lex_str), false);
-
-            if ((yyval.spcondvalue) == NULL)
-            {
-              my_error(ER_SP_COND_MISMATCH, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 240:
-
-/* Line 1455 of yacc.c  */
-#line 3370 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.spcondvalue)= new (YYTHD->mem_root) sp_condition_value(sp_condition_value::WARNING);
-            if ((yyval.spcondvalue) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 241:
-
-/* Line 1455 of yacc.c  */
-#line 3376 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.spcondvalue)= new (YYTHD->mem_root) sp_condition_value(sp_condition_value::NOT_FOUND);
-            if ((yyval.spcondvalue) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 242:
-
-/* Line 1455 of yacc.c  */
-#line 3382 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.spcondvalue)= new (YYTHD->mem_root) sp_condition_value(sp_condition_value::EXCEPTION);
-            if ((yyval.spcondvalue) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 243:
-
-/* Line 1455 of yacc.c  */
-#line 3391 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            Yacc_state *state= & thd->m_parser_state->m_yacc;
-
-            lex->sql_command= SQLCOM_SIGNAL;
-            lex->m_sql_cmd=
-              new (thd->mem_root) Sql_cmd_signal((yyvsp[(2) - (3)].spcondvalue), state->m_set_signal_info);
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 244:
-
-/* Line 1455 of yacc.c  */
-#line 3406 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            if (!pctx)
-            {
-              /* SIGNAL foo cannot be used outside of stored programs */
-              my_error(ER_SP_COND_MISMATCH, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            sp_condition_value *cond= pctx->find_condition((yyvsp[(1) - (1)].lex_str), false);
-
-            if (!cond)
-            {
-              my_error(ER_SP_COND_MISMATCH, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            if (cond->type != sp_condition_value::SQLSTATE)
-            {
-              my_error(ER_SIGNAL_BAD_CONDITION_TYPE, MYF(0));
-              MYSQL_YYABORT;
-            }
-            (yyval.spcondvalue)= cond;
-          }
-    break;
-
-  case 245:
-
-/* Line 1455 of yacc.c  */
-#line 3432 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.spcondvalue)= (yyvsp[(1) - (1)].spcondvalue); }
-    break;
-
-  case 246:
-
-/* Line 1455 of yacc.c  */
-#line 3437 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.spcondvalue)= NULL; }
-    break;
-
-  case 247:
-
-/* Line 1455 of yacc.c  */
-#line 3439 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.spcondvalue)= (yyvsp[(1) - (1)].spcondvalue); }
-    break;
-
-  case 248:
-
-/* Line 1455 of yacc.c  */
-#line 3444 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            YYTHD->m_parser_state->m_yacc.m_set_signal_info.clear();
-          }
-    break;
-
-  case 250:
-
-/* Line 1455 of yacc.c  */
-#line 3452 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Set_signal_information *info;
-            info= & YYTHD->m_parser_state->m_yacc.m_set_signal_info;
-            int index= (int) (yyvsp[(1) - (3)].diag_condition_item_name);
-            info->clear();
-            info->m_item[index]= (yyvsp[(3) - (3)].item);
-          }
-    break;
-
-  case 251:
-
-/* Line 1455 of yacc.c  */
-#line 3461 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Set_signal_information *info;
-            info= & YYTHD->m_parser_state->m_yacc.m_set_signal_info;
-            int index= (int) (yyvsp[(3) - (5)].diag_condition_item_name);
-            if (info->m_item[index] != NULL)
-            {
-              my_error(ER_DUP_SIGNAL_SET, MYF(0),
-                       Diag_condition_item_names[index].str);
-              MYSQL_YYABORT;
-            }
-            info->m_item[index]= (yyvsp[(5) - (5)].item);
-          }
-    break;
-
-  case 252:
-
-/* Line 1455 of yacc.c  */
-#line 3480 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(1) - (1)].item); }
-    break;
-
-  case 253:
-
-/* Line 1455 of yacc.c  */
-#line 3482 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((yyvsp[(1) - (1)].item)->type() == Item::FUNC_ITEM)
-            {
-              Item_func *item= (Item_func*) (yyvsp[(1) - (1)].item);
-              if (item->functype() == Item_func::SUSERVAR_FUNC)
-              {
-                /*
-                  Don't allow the following syntax:
-                    SIGNAL/RESIGNAL ...
-                    SET <signal condition item name> = @foo := expr
-                */
-                my_parse_error(ER(ER_SYNTAX_ERROR));
-                MYSQL_YYABORT;
-              }
-            }
-            (yyval.item)= (yyvsp[(1) - (1)].item);
-          }
-    break;
-
-  case 254:
-
-/* Line 1455 of yacc.c  */
-#line 3500 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(1) - (1)].item); }
-    break;
-
-  case 255:
-
-/* Line 1455 of yacc.c  */
-#line 3506 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_CLASS_ORIGIN; }
-    break;
-
-  case 256:
-
-/* Line 1455 of yacc.c  */
-#line 3508 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_SUBCLASS_ORIGIN; }
-    break;
-
-  case 257:
-
-/* Line 1455 of yacc.c  */
-#line 3510 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_CONSTRAINT_CATALOG; }
-    break;
-
-  case 258:
-
-/* Line 1455 of yacc.c  */
-#line 3512 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_CONSTRAINT_SCHEMA; }
-    break;
-
-  case 259:
-
-/* Line 1455 of yacc.c  */
-#line 3514 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_CONSTRAINT_NAME; }
-    break;
-
-  case 260:
-
-/* Line 1455 of yacc.c  */
-#line 3516 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_CATALOG_NAME; }
-    break;
-
-  case 261:
-
-/* Line 1455 of yacc.c  */
-#line 3518 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_SCHEMA_NAME; }
-    break;
-
-  case 262:
-
-/* Line 1455 of yacc.c  */
-#line 3520 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_TABLE_NAME; }
-    break;
-
-  case 263:
-
-/* Line 1455 of yacc.c  */
-#line 3522 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_COLUMN_NAME; }
-    break;
-
-  case 264:
-
-/* Line 1455 of yacc.c  */
-#line 3524 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_CURSOR_NAME; }
-    break;
-
-  case 265:
-
-/* Line 1455 of yacc.c  */
-#line 3526 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_MESSAGE_TEXT; }
-    break;
-
-  case 266:
-
-/* Line 1455 of yacc.c  */
-#line 3528 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_condition_item_name)= DIAG_MYSQL_ERRNO; }
-    break;
-
-  case 267:
-
-/* Line 1455 of yacc.c  */
-#line 3533 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            Yacc_state *state= & thd->m_parser_state->m_yacc;
-
-            lex->sql_command= SQLCOM_RESIGNAL;
-            lex->m_sql_cmd=
-              new (thd->mem_root) Sql_cmd_resignal((yyvsp[(2) - (3)].spcondvalue),
-                                                   state->m_set_signal_info);
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 268:
-
-/* Line 1455 of yacc.c  */
-#line 3549 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Diagnostics_information *info= (yyvsp[(4) - (4)].diag_info);
-
-            info->set_which_da((yyvsp[(2) - (4)].diag_area));
-
-            Lex->sql_command= SQLCOM_GET_DIAGNOSTICS;
-            Lex->m_sql_cmd= new (YYTHD->mem_root) Sql_cmd_get_diagnostics(info);
-
-            if (Lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 269:
-
-/* Line 1455 of yacc.c  */
-#line 3564 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_area)= Diagnostics_information::CURRENT_AREA; }
-    break;
-
-  case 270:
-
-/* Line 1455 of yacc.c  */
-#line 3566 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.diag_area)= Diagnostics_information::CURRENT_AREA; }
-    break;
-
-  case 271:
-
-/* Line 1455 of yacc.c  */
-#line 3571 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.diag_info)= new (YYTHD->mem_root) Statement_information((yyvsp[(1) - (1)].stmt_info_list));
-            if ((yyval.diag_info) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 272:
-
-/* Line 1455 of yacc.c  */
-#line 3577 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.diag_info)= new (YYTHD->mem_root) Condition_information((yyvsp[(2) - (3)].item), (yyvsp[(3) - (3)].cond_info_list));
-            if ((yyval.diag_info) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 273:
-
-/* Line 1455 of yacc.c  */
-#line 3586 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.stmt_info_list)= new (YYTHD->mem_root) List<Statement_information_item>;
-            if ((yyval.stmt_info_list) == NULL || (yyval.stmt_info_list)->push_back((yyvsp[(1) - (1)].stmt_info_item)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 274:
-
-/* Line 1455 of yacc.c  */
-#line 3592 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((yyvsp[(1) - (3)].stmt_info_list)->push_back((yyvsp[(3) - (3)].stmt_info_item)))
-              MYSQL_YYABORT;
-            (yyval.stmt_info_list)= (yyvsp[(1) - (3)].stmt_info_list);
-          }
-    break;
-
-  case 275:
-
-/* Line 1455 of yacc.c  */
-#line 3601 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.stmt_info_item)= new (YYTHD->mem_root) Statement_information_item((yyvsp[(3) - (3)].stmt_info_item_name), (yyvsp[(1) - (3)].item));
-            if ((yyval.stmt_info_item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 276:
-
-/* Line 1455 of yacc.c  */
-#line 3609 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            Lex_input_stream *lip= YYLIP;
-            sp_head *sp= lex->sphead;
-
-            /*
-              NOTE: lex->sphead is NULL if we're parsing something like
-              'GET DIAGNOSTICS v' outside a stored program. We should throw
-              ER_SP_UNDECLARED_VAR in such cases.
-            */
-
-            if (!sp)
-            {
-              my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            (yyval.item)=
-              create_item_for_sp_var(
-                thd, (yyvsp[(1) - (1)].lex_str), NULL,
-                sp->m_parser_data.get_current_stmt_start_ptr(),
-                lip->get_tok_start(),
-                lip->get_ptr());
-
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 277:
-
-/* Line 1455 of yacc.c  */
-#line 3638 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_get_user_var((yyvsp[(2) - (2)].lex_str));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 278:
-
-/* Line 1455 of yacc.c  */
-#line 3647 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.stmt_info_item_name)= Statement_information_item::NUMBER; }
-    break;
-
-  case 279:
-
-/* Line 1455 of yacc.c  */
-#line 3649 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.stmt_info_item_name)= Statement_information_item::ROW_COUNT; }
-    break;
-
-  case 280:
-
-/* Line 1455 of yacc.c  */
-#line 3658 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(1) - (1)].item); }
-    break;
-
-  case 281:
-
-/* Line 1455 of yacc.c  */
-#line 3663 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.cond_info_list)= new (YYTHD->mem_root) List<Condition_information_item>;
-            if ((yyval.cond_info_list) == NULL || (yyval.cond_info_list)->push_back((yyvsp[(1) - (1)].cond_info_item)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 282:
-
-/* Line 1455 of yacc.c  */
-#line 3669 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((yyvsp[(1) - (3)].cond_info_list)->push_back((yyvsp[(3) - (3)].cond_info_item)))
-              MYSQL_YYABORT;
-            (yyval.cond_info_list)= (yyvsp[(1) - (3)].cond_info_list);
-          }
-    break;
-
-  case 283:
-
-/* Line 1455 of yacc.c  */
-#line 3678 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.cond_info_item)= new (YYTHD->mem_root) Condition_information_item((yyvsp[(3) - (3)].cond_info_item_name), (yyvsp[(1) - (3)].item));
-            if ((yyval.cond_info_item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 284:
-
-/* Line 1455 of yacc.c  */
-#line 3686 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::CLASS_ORIGIN; }
-    break;
-
-  case 285:
-
-/* Line 1455 of yacc.c  */
-#line 3688 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::SUBCLASS_ORIGIN; }
-    break;
-
-  case 286:
-
-/* Line 1455 of yacc.c  */
-#line 3690 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::CONSTRAINT_CATALOG; }
-    break;
-
-  case 287:
-
-/* Line 1455 of yacc.c  */
-#line 3692 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::CONSTRAINT_SCHEMA; }
-    break;
-
-  case 288:
-
-/* Line 1455 of yacc.c  */
-#line 3694 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::CONSTRAINT_NAME; }
-    break;
-
-  case 289:
-
-/* Line 1455 of yacc.c  */
-#line 3696 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::CATALOG_NAME; }
-    break;
-
-  case 290:
-
-/* Line 1455 of yacc.c  */
-#line 3698 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::SCHEMA_NAME; }
-    break;
-
-  case 291:
-
-/* Line 1455 of yacc.c  */
-#line 3700 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::TABLE_NAME; }
-    break;
-
-  case 292:
-
-/* Line 1455 of yacc.c  */
-#line 3702 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::COLUMN_NAME; }
-    break;
-
-  case 293:
-
-/* Line 1455 of yacc.c  */
-#line 3704 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::CURSOR_NAME; }
-    break;
-
-  case 294:
-
-/* Line 1455 of yacc.c  */
-#line 3706 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::MESSAGE_TEXT; }
-    break;
-
-  case 295:
-
-/* Line 1455 of yacc.c  */
-#line 3708 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::MYSQL_ERRNO; }
-    break;
-
-  case 296:
-
-/* Line 1455 of yacc.c  */
-#line 3710 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cond_info_item_name)= Condition_information_item::RETURNED_SQLSTATE; }
-    break;
-
-  case 297:
-
-/* Line 1455 of yacc.c  */
-#line 3715 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* NOTE: field definition is filled in sp_decl section. */
-
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            if (pctx->find_variable((yyvsp[(1) - (1)].lex_str), TRUE))
-            {
-              my_error(ER_SP_DUP_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            pctx->add_variable(thd,
-                               (yyvsp[(1) - (1)].lex_str),
-                               MYSQL_TYPE_DECIMAL,
-                               sp_variable::MODE_IN);
-            (yyval.num)= 1;
-          }
-    break;
-
-  case 298:
-
-/* Line 1455 of yacc.c  */
-#line 3735 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* NOTE: field definition is filled in sp_decl section. */
-
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            if (pctx->find_variable((yyvsp[(3) - (3)].lex_str), TRUE))
-            {
-              my_error(ER_SP_DUP_VAR, MYF(0), (yyvsp[(3) - (3)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            pctx->add_variable(thd,
-                               (yyvsp[(3) - (3)].lex_str),
-                               MYSQL_TYPE_DECIMAL,
-                               sp_variable::MODE_IN);
-            (yyval.num)= (yyvsp[(1) - (3)].num) + 1;
-          }
-    break;
-
-  case 299:
-
-/* Line 1455 of yacc.c  */
-#line 3758 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item) = NULL; }
-    break;
-
-  case 300:
-
-/* Line 1455 of yacc.c  */
-#line 3760 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sphead->m_parser_data.push_expr_start_ptr(YY_TOKEN_END); }
-    break;
-
-  case 301:
-
-/* Line 1455 of yacc.c  */
-#line 3762 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item) = (yyvsp[(3) - (3)].item); }
-    break;
-
-  case 315:
-
-/* Line 1455 of yacc.c  */
-#line 3783 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sphead->m_parser_data.new_cont_backpatch(); }
-    break;
-
-  case 316:
-
-/* Line 1455 of yacc.c  */
-#line 3785 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            sp_head *sp= Lex->sphead;
-
-            sp->m_parser_data.do_cont_backpatch(sp->instructions());
-          }
-    break;
-
-  case 317:
-
-/* Line 1455 of yacc.c  */
-#line 3793 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            Lex_input_stream *lip= YYLIP;
-            sp_head *sp= lex->sphead;
-
-            sp->reset_lex(thd);
-            sp->m_parser_data.set_current_stmt_start_ptr(lip->get_tok_start());
-          }
-    break;
-
-  case 318:
-
-/* Line 1455 of yacc.c  */
-#line 3803 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            sp->m_flags|= sp_get_flags_for_command(lex);
-            if (lex->sql_command == SQLCOM_CHANGE_DB)
-            { /* "USE db" doesn't work in a procedure */
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "USE");
-              MYSQL_YYABORT;
-            }
-            /*
-              Don't add an instruction for SET statements, since all
-              instructions for them were already added during processing
-              of "set" rule.
-            */
-            DBUG_ASSERT(lex->sql_command != SQLCOM_SET_OPTION ||
-                        lex->var_list.is_empty());
-            if (lex->sql_command != SQLCOM_SET_OPTION)
-            {
-              /* Extract the query statement from the tokenizer. */
-
-              LEX_STRING query=
-                make_string(thd,
-                            sp->m_parser_data.get_current_stmt_start_ptr(),
-                            YY_TOKEN_END);
-
-              if (!query.str)
-                MYSQL_YYABORT;
-
-              /* Add instruction. */
-
-              sp_instr_stmt *i=
-                new (thd->mem_root)
-                  sp_instr_stmt(sp->instructions(), lex, query);
-
-              if (!i || sp->add_instr(thd, i))
-                MYSQL_YYABORT;
-            }
-
-            if (sp->restore_lex(thd))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 319:
-
-/* Line 1455 of yacc.c  */
-#line 3850 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            sp->reset_lex(thd);
-
-            sp->m_parser_data.push_expr_start_ptr(YY_TOKEN_END);
-          }
-    break;
-
-  case 320:
-
-/* Line 1455 of yacc.c  */
-#line 3860 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            /* Extract expression string. */
-
-            LEX_STRING expr_query= EMPTY_STR;
-            const char *expr_start_ptr= sp->m_parser_data.pop_expr_start_ptr();
-
-            if (lex->is_metadata_used())
-            {
-              expr_query= make_string(thd, expr_start_ptr, YY_TOKEN_END);
-              if (!expr_query.str)
-                MYSQL_YYABORT;
-            }
-
-            /* Check that this is a stored function. */
-
-            if (sp->m_type != SP_TYPE_FUNCTION)
-            {
-              my_message(ER_SP_BADRETURN, ER(ER_SP_BADRETURN), MYF(0));
-              MYSQL_YYABORT;
-            }
-
-            /* Indicate that we've reached RETURN statement. */
-
-            sp->m_flags|= sp_head::HAS_RETURN;
-
-            /* Add instruction. */
-
-            sp_instr_freturn *i=
-              new (thd->mem_root)
-                sp_instr_freturn(sp->instructions(), lex, (yyvsp[(3) - (3)].item), expr_query,
-                                 sp->m_return_field_def.sql_type);
-
-            if (i == NULL ||
-                sp->add_instr(thd, i) ||
-                sp->restore_lex(thd))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 321:
-
-/* Line 1455 of yacc.c  */
-#line 3906 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* Unlabeled controls get a secret label. */
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            pctx->push_label(thd,
-                             EMPTY_STR,
-                             sp->instructions());
-          }
-    break;
-
-  case 322:
-
-/* Line 1455 of yacc.c  */
-#line 3917 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            sp->m_parser_data.do_backpatch(pctx->pop_label(),
-                                           sp->instructions());
-          }
-    break;
-
-  case 323:
-
-/* Line 1455 of yacc.c  */
-#line 3929 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp = lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_label *lab= pctx->find_label((yyvsp[(2) - (2)].lex_str));
-
-            if (! lab)
-            {
-              my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", (yyvsp[(2) - (2)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            uint ip= sp->instructions();
-
-            /*
-              When jumping to a BEGIN-END block end, the target jump
-              points to the block hpop/cpop cleanup instructions,
-              so we should exclude the block context here.
-              When jumping to something else (i.e., sp_label::ITERATION),
-              there are no hpop/cpop at the jump destination,
-              so we should include the block context here for cleanup.
-            */
-            bool exclusive= (lab->type == sp_label::BEGIN);
-
-            uint n= pctx->diff_handlers(lab->ctx, exclusive);
-
-            if (n)
-            {
-              sp_instr_hpop *hpop=
-                new (thd->mem_root) sp_instr_hpop(ip++, pctx);
-
-              if (!hpop || sp->add_instr(thd, hpop))
-                MYSQL_YYABORT;
-            }
-
-            n= pctx->diff_cursors(lab->ctx, exclusive);
-
-            if (n)
-            {
-              sp_instr_cpop *cpop=
-                new (thd->mem_root) sp_instr_cpop(ip++, pctx, n);
-
-              if (!cpop || sp->add_instr(thd, cpop))
-                MYSQL_YYABORT;
-            }
-
-            sp_instr_jump *i= new (thd->mem_root) sp_instr_jump(ip, pctx);
-
-            if (!i ||
-                /* Jumping forward */
-                sp->m_parser_data.add_backpatch_entry(i, lab) ||
-                sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 324:
-
-/* Line 1455 of yacc.c  */
-#line 3988 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_label *lab= pctx->find_label((yyvsp[(2) - (2)].lex_str));
-
-            if (! lab || lab->type != sp_label::ITERATION)
-            {
-              my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", (yyvsp[(2) - (2)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            uint ip= sp->instructions();
-
-            /* Inclusive the dest. */
-            uint n= pctx->diff_handlers(lab->ctx, FALSE);
-
-            if (n)
-            {
-              sp_instr_hpop *hpop=
-                new (thd->mem_root) sp_instr_hpop(ip++, pctx);
-
-              if (!hpop || sp->add_instr(thd, hpop))
-                MYSQL_YYABORT;
-            }
-
-            /* Inclusive the dest. */
-            n= pctx->diff_cursors(lab->ctx, FALSE);
-
-            if (n)
-            {
-              sp_instr_cpop *cpop=
-                new (thd->mem_root) sp_instr_cpop(ip++, pctx, n);
-
-              if (!cpop || sp->add_instr(thd, cpop))
-                MYSQL_YYABORT;
-            }
-
-            /* Jump back */
-            sp_instr_jump *i=
-              new (thd->mem_root) sp_instr_jump(ip, pctx, lab->ip);
-
-            if (!i || sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 325:
-
-/* Line 1455 of yacc.c  */
-#line 4038 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            uint offset;
-
-            if (! pctx->find_cursor((yyvsp[(2) - (2)].lex_str), &offset, false))
-            {
-              my_error(ER_SP_CURSOR_MISMATCH, MYF(0), (yyvsp[(2) - (2)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            sp_instr_copen *i=
-              new (thd->mem_root)
-                sp_instr_copen(sp->instructions(), pctx, offset);
-
-            if (!i || sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 326:
-
-/* Line 1455 of yacc.c  */
-#line 4062 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            uint offset;
-
-            if (! pctx->find_cursor((yyvsp[(3) - (4)].lex_str), &offset, false))
-            {
-              my_error(ER_SP_CURSOR_MISMATCH, MYF(0), (yyvsp[(3) - (4)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            sp_instr_cfetch *i=
-              new (thd->mem_root)
-                sp_instr_cfetch(sp->instructions(), pctx, offset);
-
-            if (!i || sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 327:
-
-/* Line 1455 of yacc.c  */
-#line 4083 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 328:
-
-/* Line 1455 of yacc.c  */
-#line 4088 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            uint offset;
-
-            if (! pctx->find_cursor((yyvsp[(2) - (2)].lex_str), &offset, false))
-            {
-              my_error(ER_SP_CURSOR_MISMATCH, MYF(0), (yyvsp[(2) - (2)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            sp_instr_cclose *i=
-              new (thd->mem_root)
-                sp_instr_cclose(sp->instructions(), pctx, offset);
-
-            if (!i || sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 332:
-
-/* Line 1455 of yacc.c  */
-#line 4118 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_variable *spv;
-
-            if (!pctx || !(spv= pctx->find_variable((yyvsp[(1) - (1)].lex_str), false)))
-            {
-              my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            /* An SP local variable */
-            sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction();
-
-            i->add_to_varlist(spv);
-          }
-    break;
-
-  case 333:
-
-/* Line 1455 of yacc.c  */
-#line 4136 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_variable *spv;
-
-            if (!pctx || !(spv= pctx->find_variable((yyvsp[(3) - (3)].lex_str), false)))
-            {
-              my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(3) - (3)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            /* An SP local variable */
-            sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction();
-
-            i->add_to_varlist(spv);
-          }
-    break;
-
-  case 334:
-
-/* Line 1455 of yacc.c  */
-#line 4156 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            sp->reset_lex(thd);
-            sp->m_parser_data.push_expr_start_ptr(YY_TOKEN_END);
-          }
-    break;
-
-  case 335:
-
-/* Line 1455 of yacc.c  */
-#line 4165 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            /* Extract expression string. */
-
-            LEX_STRING expr_query= EMPTY_STR;
-            const char *expr_start_ptr= sp->m_parser_data.pop_expr_start_ptr();
-
-            if (lex->is_metadata_used())
-            {
-              expr_query= make_string(thd, expr_start_ptr, YY_TOKEN_END);
-              if (!expr_query.str)
-                MYSQL_YYABORT;
-            }
-
-            sp_instr_jump_if_not *i =
-              new (thd->mem_root)
-                sp_instr_jump_if_not(sp->instructions(), lex,
-                                     (yyvsp[(2) - (2)].item), expr_query);
-
-            /* Add jump instruction. */
-
-            if (i == NULL ||
-                sp->m_parser_data.add_backpatch_entry(
-                  i, pctx->push_label(thd, EMPTY_STR, 0)) ||
-                sp->m_parser_data.add_cont_backpatch_entry(i) ||
-                sp->add_instr(thd, i) ||
-                sp->restore_lex(thd))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 336:
-
-/* Line 1455 of yacc.c  */
-#line 4201 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            sp_instr_jump *i =
-              new (thd->mem_root) sp_instr_jump(sp->instructions(), pctx);
-
-            if (!i || sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-
-            sp->m_parser_data.do_backpatch(pctx->pop_label(),
-                                           sp->instructions());
-
-            sp->m_parser_data.add_backpatch_entry(
-              i, pctx->push_label(thd, EMPTY_STR, 0));
-          }
-    break;
-
-  case 337:
-
-/* Line 1455 of yacc.c  */
-#line 4220 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            sp->m_parser_data.do_backpatch(pctx->pop_label(),
-                                           sp->instructions());
-          }
-    break;
-
-  case 343:
-
-/* Line 1455 of yacc.c  */
-#line 4243 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            case_stmt_action_case(thd);
-
-            sp->reset_lex(thd); /* For CASE-expr $3 */
-            sp->m_parser_data.push_expr_start_ptr(YY_TOKEN_END);
-          }
-    break;
-
-  case 344:
-
-/* Line 1455 of yacc.c  */
-#line 4254 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-
-            /* Extract CASE-expression string. */
-
-            LEX_STRING case_expr_query= EMPTY_STR;
-            const char *expr_start_ptr= sp->m_parser_data.pop_expr_start_ptr();
-
-            if (lex->is_metadata_used())
-            {
-              case_expr_query= make_string(thd, expr_start_ptr, YY_TOKEN_END);
-              if (!case_expr_query.str)
-                MYSQL_YYABORT;
-            }
-
-            /* Register new CASE-expression and get its id. */
-
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            int case_expr_id= pctx->push_case_expr_id();
-
-            if (case_expr_id < 0)
-              MYSQL_YYABORT;
-
-            /* Add CASE-set instruction. */
-
-            sp_instr_set_case_expr *i=
-              new (thd->mem_root)
-                sp_instr_set_case_expr(sp->instructions(), lex,
-                                       case_expr_id, (yyvsp[(3) - (3)].item), case_expr_query);
-
-            if (i == NULL ||
-                sp->m_parser_data.add_cont_backpatch_entry(i) ||
-                sp->add_instr(thd, i) ||
-                sp->restore_lex(thd))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 345:
-
-/* Line 1455 of yacc.c  */
-#line 4298 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            case_stmt_action_end_case(Lex, true);
-          }
-    break;
-
-  case 346:
-
-/* Line 1455 of yacc.c  */
-#line 4305 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            case_stmt_action_case(YYTHD);
-          }
-    break;
-
-  case 347:
-
-/* Line 1455 of yacc.c  */
-#line 4312 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            case_stmt_action_end_case(Lex, false);
-          }
-    break;
-
-  case 352:
-
-/* Line 1455 of yacc.c  */
-#line 4329 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            sp->reset_lex(thd);
-            sp->m_parser_data.push_expr_start_ptr(YY_TOKEN_END);
-          }
-    break;
-
-  case 353:
-
-/* Line 1455 of yacc.c  */
-#line 4338 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* Simple case: <caseval> = <whenval> */
-
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            /* Extract expression string. */
-
-            LEX_STRING when_expr_query= EMPTY_STR;
-            const char *expr_start_ptr= sp->m_parser_data.pop_expr_start_ptr();
-
-            if (lex->is_metadata_used())
-            {
-              when_expr_query= make_string(thd, expr_start_ptr, YY_TOKEN_END);
-              if (!when_expr_query.str)
-                MYSQL_YYABORT;
-            }
-
-            /* Add CASE-when-jump instruction. */
-
-            sp_instr_jump_case_when *i =
-              new (thd->mem_root)
-                sp_instr_jump_case_when(sp->instructions(), lex,
-                                        pctx->get_current_case_expr_id(),
-                                        (yyvsp[(3) - (3)].item), when_expr_query);
-
-            if (i == NULL ||
-                i->on_after_expr_parsing(thd) ||
-                sp->m_parser_data.add_backpatch_entry(
-                  i, pctx->push_label(thd, EMPTY_STR, 0)) ||
-                sp->m_parser_data.add_cont_backpatch_entry(i) ||
-                sp->add_instr(thd, i) ||
-                sp->restore_lex(thd))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 354:
-
-/* Line 1455 of yacc.c  */
-#line 4379 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (case_stmt_action_then(YYTHD, Lex))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 355:
-
-/* Line 1455 of yacc.c  */
-#line 4387 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            sp->reset_lex(thd);
-            sp->m_parser_data.push_expr_start_ptr(YY_TOKEN_END);
-          }
-    break;
-
-  case 356:
-
-/* Line 1455 of yacc.c  */
-#line 4396 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            /* Extract expression string. */
-
-            LEX_STRING when_query= EMPTY_STR;
-            const char *expr_start_ptr= sp->m_parser_data.pop_expr_start_ptr();
-
-            if (lex->is_metadata_used())
-            {
-              when_query= make_string(thd, expr_start_ptr, YY_TOKEN_END);
-              if (!when_query.str)
-                MYSQL_YYABORT;
-            }
-
-            /* Add jump instruction. */
-
-            sp_instr_jump_if_not *i=
-              new (thd->mem_root)
-                sp_instr_jump_if_not(sp->instructions(), lex, (yyvsp[(3) - (3)].item), when_query);
-
-            if (i == NULL ||
-                sp->m_parser_data.add_backpatch_entry(
-                  i, pctx->push_label(thd, EMPTY_STR, 0)) ||
-                sp->m_parser_data.add_cont_backpatch_entry(i) ||
-                sp->add_instr(thd, i) ||
-                sp->restore_lex(thd))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 357:
-
-/* Line 1455 of yacc.c  */
-#line 4432 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (case_stmt_action_then(YYTHD, Lex))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 358:
-
-/* Line 1455 of yacc.c  */
-#line 4440 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            sp_instr_error *i=
-              new (thd->mem_root)
-                sp_instr_error(sp->instructions(), pctx, ER_SP_CASE_NOT_FOUND);
-
-            if (!i || sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 360:
-
-/* Line 1455 of yacc.c  */
-#line 4458 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_label *lab= pctx->find_label((yyvsp[(1) - (2)].lex_str));
-
-            if (lab)
-            {
-              my_error(ER_SP_LABEL_REDEFINE, MYF(0), (yyvsp[(1) - (2)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            else
-            {
-              lab= pctx->push_label(YYTHD, (yyvsp[(1) - (2)].lex_str), sp->instructions());
-              lab->type= sp_label::ITERATION;
-            }
-          }
-    break;
-
-  case 361:
-
-/* Line 1455 of yacc.c  */
-#line 4476 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_label *lab= pctx->pop_label();
-
-            if ((yyvsp[(5) - (5)].lex_str).str)
-            {
-              if (my_strcasecmp(system_charset_info, (yyvsp[(5) - (5)].lex_str).str, lab->name.str) != 0)
-              {
-                my_error(ER_SP_LABEL_MISMATCH, MYF(0), (yyvsp[(5) - (5)].lex_str).str);
-                MYSQL_YYABORT;
-              }
-            }
-            sp->m_parser_data.do_backpatch(lab, sp->instructions());
-          }
-    break;
-
-  case 362:
-
-/* Line 1455 of yacc.c  */
-#line 4495 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= null_lex_str; }
-    break;
-
-  case 363:
-
-/* Line 1455 of yacc.c  */
-#line 4496 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 364:
-
-/* Line 1455 of yacc.c  */
-#line 4501 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_label *lab= pctx->find_label((yyvsp[(1) - (2)].lex_str));
-
-            if (lab)
-            {
-              my_error(ER_SP_LABEL_REDEFINE, MYF(0), (yyvsp[(1) - (2)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-
-            lab= pctx->push_label(YYTHD, (yyvsp[(1) - (2)].lex_str), sp->instructions());
-            lab->type= sp_label::BEGIN;
-          }
-    break;
-
-  case 365:
-
-/* Line 1455 of yacc.c  */
-#line 4517 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_label *lab= pctx->pop_label();
-
-            if ((yyvsp[(5) - (5)].lex_str).str)
-            {
-              if (my_strcasecmp(system_charset_info, (yyvsp[(5) - (5)].lex_str).str, lab->name.str) != 0)
-              {
-                my_error(ER_SP_LABEL_MISMATCH, MYF(0), (yyvsp[(5) - (5)].lex_str).str);
-                MYSQL_YYABORT;
-              }
-            }
-          }
-    break;
-
-  case 366:
-
-/* Line 1455 of yacc.c  */
-#line 4534 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* Unlabeled blocks get a secret label. */
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            sp_label *lab=
-              pctx->push_label(YYTHD, EMPTY_STR, sp->instructions());
-
-            lab->type= sp_label::BEGIN;
-          }
-    break;
-
-  case 367:
-
-/* Line 1455 of yacc.c  */
-#line 4545 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->get_sp_current_parsing_ctx()->pop_label();
-          }
-    break;
-
-  case 368:
-
-/* Line 1455 of yacc.c  */
-#line 4553 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* QQ This is just a dummy for grouping declarations and statements
-              together. No [[NOT] ATOMIC] yet, and we need to figure out how
-              make it coexist with the existing BEGIN COMMIT/ROLLBACK. */
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_pcontext *parent_pctx= lex->get_sp_current_parsing_ctx();
-
-            sp_pcontext *child_pctx=
-              parent_pctx->push_context(thd, sp_pcontext::REGULAR_SCOPE);
-
-            lex->set_sp_current_parsing_ctx(child_pctx);
-          }
-    break;
-
-  case 369:
-
-/* Line 1455 of yacc.c  */
-#line 4568 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            // We always have a label.
-            sp->m_parser_data.do_backpatch(pctx->last_label(),
-                                           sp->instructions());
-
-            if ((yyvsp[(3) - (5)].spblock).hndlrs)
-            {
-              sp_instr *i=
-                new (thd->mem_root) sp_instr_hpop(sp->instructions(), pctx);
-
-              if (!i || sp->add_instr(thd, i))
-                MYSQL_YYABORT;
-            }
-
-            if ((yyvsp[(3) - (5)].spblock).curs)
-            {
-              sp_instr *i=
-                new (thd->mem_root)
-                  sp_instr_cpop(sp->instructions(), pctx, (yyvsp[(3) - (5)].spblock).curs);
-
-              if (!i || sp->add_instr(thd, i))
-                MYSQL_YYABORT;
-            }
-
-            lex->set_sp_current_parsing_ctx(pctx->pop_context());
-          }
-    break;
-
-  case 370:
-
-/* Line 1455 of yacc.c  */
-#line 4604 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            sp_instr_jump *i=
-                new (thd->mem_root)
-                  sp_instr_jump(sp->instructions(), pctx,
-                                pctx->last_label()->ip);
-
-            if (!i || sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 371:
-
-/* Line 1455 of yacc.c  */
-#line 4619 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            sp->reset_lex(thd);
-            sp->m_parser_data.push_expr_start_ptr(YY_TOKEN_END);
-          }
-    break;
-
-  case 372:
-
-/* Line 1455 of yacc.c  */
-#line 4628 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            /* Extract expression string. */
-
-            LEX_STRING expr_query= EMPTY_STR;
-            const char *expr_start_ptr= sp->m_parser_data.pop_expr_start_ptr();
-
-            if (lex->is_metadata_used())
-            {
-              expr_query= make_string(thd, expr_start_ptr, YY_TOKEN_END);
-              if (!expr_query.str)
-                MYSQL_YYABORT;
-            }
-
-            /* Add jump instruction. */
-
-            sp_instr_jump_if_not *i=
-              new (thd->mem_root)
-                sp_instr_jump_if_not(sp->instructions(), lex, (yyvsp[(3) - (3)].item), expr_query);
-
-            if (i == NULL ||
-                /* Jumping forward */
-                sp->m_parser_data.add_backpatch_entry(i, pctx->last_label()) ||
-                sp->m_parser_data.new_cont_backpatch() ||
-                sp->m_parser_data.add_cont_backpatch_entry(i) ||
-                sp->add_instr(thd, i) ||
-                sp->restore_lex(thd))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 373:
-
-/* Line 1455 of yacc.c  */
-#line 4666 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-
-            sp_instr_jump *i=
-              new (thd->mem_root)
-                sp_instr_jump(sp->instructions(), pctx, pctx->last_label()->ip);
-
-            if (!i || sp->add_instr(thd, i))
-              MYSQL_YYABORT;
-
-            sp->m_parser_data.do_cont_backpatch(sp->instructions());
-          }
-    break;
-
-  case 374:
-
-/* Line 1455 of yacc.c  */
-#line 4682 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            sp->reset_lex(thd);
-            sp->m_parser_data.push_expr_start_ptr(YY_TOKEN_END);
-          }
-    break;
-
-  case 375:
-
-/* Line 1455 of yacc.c  */
-#line 4691 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            uint ip= sp->instructions();
-
-            /* Extract expression string. */
-
-            LEX_STRING expr_query= EMPTY_STR;
-            const char *expr_start_ptr= sp->m_parser_data.pop_expr_start_ptr();
-
-            if (lex->is_metadata_used())
-            {
-              expr_query= make_string(thd, expr_start_ptr, YY_TOKEN_END);
-              if (!expr_query.str)
-                MYSQL_YYABORT;
-            }
-
-            /* Add jump instruction. */
-
-            sp_instr_jump_if_not *i=
-              new (thd->mem_root)
-                sp_instr_jump_if_not(ip, lex, (yyvsp[(5) - (5)].item), expr_query,
-                                     pctx->last_label()->ip);
-
-            if (i == NULL ||
-                sp->add_instr(thd, i) ||
-                sp->restore_lex(thd))
-            {
-              MYSQL_YYABORT;
-            }
-
-            /* We can shortcut the cont_backpatch here */
-            i->set_cont_dest(ip + 1);
-          }
-    break;
-
-  case 377:
-
-/* Line 1455 of yacc.c  */
-#line 4732 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= TRG_ACTION_BEFORE; }
-    break;
-
-  case 378:
-
-/* Line 1455 of yacc.c  */
-#line 4734 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= TRG_ACTION_AFTER; }
-    break;
-
-  case 379:
-
-/* Line 1455 of yacc.c  */
-#line 4739 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= TRG_EVENT_INSERT; }
-    break;
-
-  case 380:
-
-/* Line 1455 of yacc.c  */
-#line 4741 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= TRG_EVENT_UPDATE; }
-    break;
-
-  case 381:
-
-/* Line 1455 of yacc.c  */
-#line 4743 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= TRG_EVENT_DELETE; }
-    break;
-
-  case 385:
-
-/* Line 1455 of yacc.c  */
-#line 4777 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 386:
-
-/* Line 1455 of yacc.c  */
-#line 4779 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->logfile_group_name= (yyvsp[(4) - (4)].lex_str).str;
-          }
-    break;
-
-  case 387:
-
-/* Line 1455 of yacc.c  */
-#line 4789 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_ADD_FILE; 
-          }
-    break;
-
-  case 388:
-
-/* Line 1455 of yacc.c  */
-#line 4795 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_DROP_FILE; 
-          }
-    break;
-
-  case 393:
-
-/* Line 1455 of yacc.c  */
-#line 4818 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 444:
-
-/* Line 1455 of yacc.c  */
-#line 4916 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->data_file_name= (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 445:
-
-/* Line 1455 of yacc.c  */
-#line 4924 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->undo_file_name= (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 446:
-
-/* Line 1455 of yacc.c  */
-#line 4932 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->redo_file_name= (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 447:
-
-/* Line 1455 of yacc.c  */
-#line 4940 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info= new st_alter_tablespace();
-            if (lex->alter_tablespace_info == NULL)
-              MYSQL_YYABORT;
-            lex->alter_tablespace_info->tablespace_name= (yyvsp[(1) - (1)].lex_str).str;
-            lex->sql_command= SQLCOM_ALTER_TABLESPACE;
-          }
-    break;
-
-  case 448:
-
-/* Line 1455 of yacc.c  */
-#line 4952 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info= new st_alter_tablespace();
-            if (lex->alter_tablespace_info == NULL)
-              MYSQL_YYABORT;
-            lex->alter_tablespace_info->logfile_group_name= (yyvsp[(1) - (1)].lex_str).str;
-            lex->sql_command= SQLCOM_ALTER_TABLESPACE;
-          }
-    break;
-
-  case 449:
-
-/* Line 1455 of yacc.c  */
-#line 4964 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->ts_access_mode= TS_READ_ONLY;
-          }
-    break;
-
-  case 450:
-
-/* Line 1455 of yacc.c  */
-#line 4969 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->ts_access_mode= TS_READ_WRITE;
-          }
-    break;
-
-  case 451:
-
-/* Line 1455 of yacc.c  */
-#line 4974 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->ts_access_mode= TS_NOT_ACCESSIBLE;
-          }
-    break;
-
-  case 452:
-
-/* Line 1455 of yacc.c  */
-#line 4982 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->initial_size= (yyvsp[(3) - (3)].ulonglong_number);
-          }
-    break;
-
-  case 453:
-
-/* Line 1455 of yacc.c  */
-#line 4990 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->autoextend_size= (yyvsp[(3) - (3)].ulonglong_number);
-          }
-    break;
-
-  case 454:
-
-/* Line 1455 of yacc.c  */
-#line 4998 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->max_size= (yyvsp[(3) - (3)].ulonglong_number);
-          }
-    break;
-
-  case 455:
-
-/* Line 1455 of yacc.c  */
-#line 5006 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->extent_size= (yyvsp[(3) - (3)].ulonglong_number);
-          }
-    break;
-
-  case 456:
-
-/* Line 1455 of yacc.c  */
-#line 5014 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->undo_buffer_size= (yyvsp[(3) - (3)].ulonglong_number);
-          }
-    break;
-
-  case 457:
-
-/* Line 1455 of yacc.c  */
-#line 5022 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->redo_buffer_size= (yyvsp[(3) - (3)].ulonglong_number);
-          }
-    break;
-
-  case 458:
-
-/* Line 1455 of yacc.c  */
-#line 5030 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP)
-            {
-              my_error(ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NODEGROUP");
-              MYSQL_YYABORT;
-            }
-            lex->alter_tablespace_info->nodegroup_id= (yyvsp[(3) - (3)].ulong_num);
-          }
-    break;
-
-  case 459:
-
-/* Line 1455 of yacc.c  */
-#line 5043 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->alter_tablespace_info->ts_comment != NULL)
-            {
-              my_error(ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"COMMENT");
-              MYSQL_YYABORT;
-            }
-            lex->alter_tablespace_info->ts_comment= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 460:
-
-/* Line 1455 of yacc.c  */
-#line 5056 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->alter_tablespace_info->storage_engine != NULL)
-            {
-              my_error(ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),
-                       "STORAGE ENGINE");
-              MYSQL_YYABORT;
-            }
-            lex->alter_tablespace_info->storage_engine= (yyvsp[(4) - (4)].db_type);
-          }
-    break;
-
-  case 461:
-
-/* Line 1455 of yacc.c  */
-#line 5070 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->wait_until_completed= TRUE;
-          }
-    break;
-
-  case 462:
-
-/* Line 1455 of yacc.c  */
-#line 5075 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (!(lex->alter_tablespace_info->wait_until_completed))
-            {
-              my_error(ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NO_WAIT");
-              MYSQL_YYABORT;
-            }
-            lex->alter_tablespace_info->wait_until_completed= FALSE;
-          }
-    break;
-
-  case 463:
-
-/* Line 1455 of yacc.c  */
-#line 5087 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulonglong_number)= (yyvsp[(1) - (1)].ulonglong_number);}
-    break;
-
-  case 464:
-
-/* Line 1455 of yacc.c  */
-#line 5089 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            ulonglong number;
-            uint text_shift_number= 0;
-            longlong prefix_number;
-            char *start_ptr= (yyvsp[(1) - (1)].lex_str).str;
-            uint str_len= (yyvsp[(1) - (1)].lex_str).length;
-            char *end_ptr= start_ptr + str_len;
-            int error;
-            prefix_number= my_strtoll10(start_ptr, &end_ptr, &error);
-            if ((start_ptr + str_len - 1) == end_ptr)
-            {
-              switch (end_ptr[0])
-              {
-                case 'g':
-                case 'G':
-                  text_shift_number+=10;
-                case 'm':
-                case 'M':
-                  text_shift_number+=10;
-                case 'k':
-                case 'K':
-                  text_shift_number+=10;
-                  break;
-                default:
-                {
-                  my_error(ER_WRONG_SIZE_NUMBER, MYF(0));
-                  MYSQL_YYABORT;
-                }
-              }
-              if (prefix_number >> 31)
-              {
-                my_error(ER_SIZE_OVERFLOW_ERROR, MYF(0));
-                MYSQL_YYABORT;
-              }
-              number= prefix_number << text_shift_number;
-            }
-            else
-            {
-              my_error(ER_WRONG_SIZE_NUMBER, MYF(0));
-              MYSQL_YYABORT;
-            }
-            (yyval.ulonglong_number)= number;
-          }
-    break;
-
-  case 465:
-
-/* Line 1455 of yacc.c  */
-#line 5139 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 466:
-
-/* Line 1455 of yacc.c  */
-#line 5142 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 467:
-
-/* Line 1455 of yacc.c  */
-#line 5144 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            TABLE_LIST *src_table;
-            LEX *lex= thd->lex;
-
-            lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
-            src_table= lex->select_lex.add_table_to_list(thd, (yyvsp[(2) - (2)].table), NULL, 0,
-                                                         TL_READ,
-                                                         MDL_SHARED_READ);
-            if (! src_table)
-              MYSQL_YYABORT;
-            /* CREATE TABLE ... LIKE is not allowed for views. */
-            src_table->required_type= FRMTYPE_TABLE;
-          }
-    break;
-
-  case 468:
-
-/* Line 1455 of yacc.c  */
-#line 5159 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            TABLE_LIST *src_table;
-            LEX *lex= thd->lex;
-
-            lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
-            src_table= lex->select_lex.add_table_to_list(thd, (yyvsp[(3) - (4)].table), NULL, 0,
-                                                         TL_READ,
-                                                         MDL_SHARED_READ);
-            if (! src_table)
-              MYSQL_YYABORT;
-            /* CREATE TABLE ... LIKE is not allowed for views. */
-            src_table->required_type= FRMTYPE_TABLE;
-          }
-    break;
-
-  case 469:
-
-/* Line 1455 of yacc.c  */
-#line 5178 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 470:
-
-/* Line 1455 of yacc.c  */
-#line 5181 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->set_braces(1);}
-    break;
-
-  case 471:
-
-/* Line 1455 of yacc.c  */
-#line 5182 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 472:
-
-/* Line 1455 of yacc.c  */
-#line 5186 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 473:
-
-/* Line 1455 of yacc.c  */
-#line 5188 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->set_braces(0);}
-    break;
-
-  case 474:
-
-/* Line 1455 of yacc.c  */
-#line 5189 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 475:
-
-/* Line 1455 of yacc.c  */
-#line 5191 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->set_braces(1);}
-    break;
-
-  case 476:
-
-/* Line 1455 of yacc.c  */
-#line 5192 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 477:
-
-/* Line 1455 of yacc.c  */
-#line 5197 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              Remove all tables used in PARTITION clause from the global table
-              list. Partitioning with subqueries is not allowed anyway.
-            */
-            TABLE_LIST *last_non_sel_table= Lex->create_last_non_select_table;
-            last_non_sel_table->next_global= 0;
-            Lex->query_tables_last= &last_non_sel_table->next_global;
-          }
-    break;
-
-  case 478:
-
-/* Line 1455 of yacc.c  */
-#line 5233 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 480:
-
-/* Line 1455 of yacc.c  */
-#line 5239 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->part_info= new partition_info();
-            if (!lex->part_info)
-            {
-              mem_alloc_error(sizeof(partition_info));
-              MYSQL_YYABORT;
-            }
-            if (lex->sql_command == SQLCOM_ALTER_TABLE)
-            {
-              lex->alter_info.flags|= Alter_info::ALTER_PARTITION;
-            }
-          }
-    break;
-
-  case 482:
-
-/* Line 1455 of yacc.c  */
-#line 5257 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-#ifdef WITH_PARTITION_STORAGE_ENGINE
-            LEX_STRING partition_name={C_STRING_WITH_LEN("partition")};
-            if (!plugin_is_ready(&partition_name, MYSQL_STORAGE_ENGINE_PLUGIN))
-            {
-              my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
-                      "--skip-partition");
-              MYSQL_YYABORT;
-            }
-#else
-            my_error(ER_FEATURE_DISABLED, MYF(0), "partitioning",
-                    "--with-plugin-partition");
-            MYSQL_YYABORT;
-#endif
-          }
-    break;
-
-  case 483:
-
-/* Line 1455 of yacc.c  */
-#line 5276 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (!lex->part_info)
-            {
-              my_parse_error(ER(ER_PARTITION_ENTRY_ERROR));
-              MYSQL_YYABORT;
-            }
-            /*
-              We enter here when opening the frm file to translate
-              partition info string into part_info data structure.
-            */
-          }
-    break;
-
-  case 484:
-
-/* Line 1455 of yacc.c  */
-#line 5288 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 486:
-
-/* Line 1455 of yacc.c  */
-#line 5297 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            part_info->list_of_part_fields= TRUE;
-            part_info->column_list= FALSE;
-            part_info->part_type= HASH_PARTITION;
-          }
-    break;
-
-  case 487:
-
-/* Line 1455 of yacc.c  */
-#line 5304 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->part_type= HASH_PARTITION; }
-    break;
-
-  case 488:
-
-/* Line 1455 of yacc.c  */
-#line 5305 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 489:
-
-/* Line 1455 of yacc.c  */
-#line 5307 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->part_type= RANGE_PARTITION; }
-    break;
-
-  case 490:
-
-/* Line 1455 of yacc.c  */
-#line 5309 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->part_type= RANGE_PARTITION; }
-    break;
-
-  case 491:
-
-/* Line 1455 of yacc.c  */
-#line 5311 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->part_type= LIST_PARTITION; }
-    break;
-
-  case 492:
-
-/* Line 1455 of yacc.c  */
-#line 5313 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->part_type= LIST_PARTITION; }
-    break;
-
-  case 493:
-
-/* Line 1455 of yacc.c  */
-#line 5317 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 494:
-
-/* Line 1455 of yacc.c  */
-#line 5319 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->linear_hash_ind= TRUE;}
-    break;
-
-  case 495:
-
-/* Line 1455 of yacc.c  */
-#line 5324 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->key_algorithm= partition_info::KEY_ALGORITHM_NONE;}
-    break;
-
-  case 496:
-
-/* Line 1455 of yacc.c  */
-#line 5326 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            switch ((yyvsp[(3) - (3)].ulong_num)) {
-            case 1:
-              Lex->part_info->key_algorithm= partition_info::KEY_ALGORITHM_51;
-              break;
-            case 2:
-              Lex->part_info->key_algorithm= partition_info::KEY_ALGORITHM_55;
-              break;
-            default:
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 497:
-
-/* Line 1455 of yacc.c  */
-#line 5342 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 498:
-
-/* Line 1455 of yacc.c  */
-#line 5343 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 499:
-
-/* Line 1455 of yacc.c  */
-#line 5347 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 500:
-
-/* Line 1455 of yacc.c  */
-#line 5348 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 501:
-
-/* Line 1455 of yacc.c  */
-#line 5353 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            part_info->num_columns++;
-            if (part_info->part_field_list.push_back((yyvsp[(1) - (1)].lex_str).str))
-            {
-              mem_alloc_error(1);
-              MYSQL_YYABORT;
-            }
-            if (part_info->num_columns > MAX_REF_PARTS)
-            {
-              my_error(ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0),
-                       "list of partition fields");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 502:
-
-/* Line 1455 of yacc.c  */
-#line 5372 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            part_info->column_list= TRUE;
-            part_info->list_of_part_fields= TRUE;
-          }
-    break;
-
-  case 503:
-
-/* Line 1455 of yacc.c  */
-#line 5382 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            if (part_info->set_part_expr((yyvsp[(2) - (5)].simple_string)+1, (yyvsp[(3) - (5)].item), (yyvsp[(4) - (5)].simple_string), FALSE))
-            { MYSQL_YYABORT; }
-            part_info->num_columns= 1;
-            part_info->column_list= FALSE;
-          }
-    break;
-
-  case 504:
-
-/* Line 1455 of yacc.c  */
-#line 5393 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->part_info->set_part_expr((yyvsp[(2) - (5)].simple_string)+1, (yyvsp[(3) - (5)].item), (yyvsp[(4) - (5)].simple_string), TRUE))
-            { MYSQL_YYABORT; }
-          }
-    break;
-
-  case 505:
-
-/* Line 1455 of yacc.c  */
-#line 5401 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 506:
-
-/* Line 1455 of yacc.c  */
-#line 5403 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            uint num_parts= (yyvsp[(2) - (2)].ulong_num);
-            partition_info *part_info= Lex->part_info;
-            if (num_parts == 0)
-            {
-              my_error(ER_NO_PARTS_ERROR, MYF(0), "partitions");
-              MYSQL_YYABORT;
-            }
-
-            part_info->num_parts= num_parts;
-            part_info->use_default_num_partitions= FALSE;
-          }
-    break;
-
-  case 507:
-
-/* Line 1455 of yacc.c  */
-#line 5418 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 508:
-
-/* Line 1455 of yacc.c  */
-#line 5420 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->subpart_type= HASH_PARTITION; }
-    break;
-
-  case 509:
-
-/* Line 1455 of yacc.c  */
-#line 5421 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 510:
-
-/* Line 1455 of yacc.c  */
-#line 5424 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            part_info->subpart_type= HASH_PARTITION;
-            part_info->list_of_subpart_fields= TRUE;
-          }
-    break;
-
-  case 511:
-
-/* Line 1455 of yacc.c  */
-#line 5429 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 512:
-
-/* Line 1455 of yacc.c  */
-#line 5433 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 513:
-
-/* Line 1455 of yacc.c  */
-#line 5434 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 514:
-
-/* Line 1455 of yacc.c  */
-#line 5439 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            if (part_info->subpart_field_list.push_back((yyvsp[(1) - (1)].lex_str).str))
-            {
-              mem_alloc_error(1);
-              MYSQL_YYABORT;
-            }
-            if (part_info->subpart_field_list.elements > MAX_REF_PARTS)
-            {
-              my_error(ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0),
-                       "list of subpartition fields");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 515:
-
-/* Line 1455 of yacc.c  */
-#line 5457 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            bool not_corr_func;
-            not_corr_func= !lex->safe_to_cache_query;
-            lex->safe_to_cache_query= 1;
-            if (not_corr_func)
-            {
-              my_parse_error(ER(ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR));
-              MYSQL_YYABORT;
-            }
-            (yyval.item)=(yyvsp[(1) - (1)].item);
-          }
-    break;
-
-  case 516:
-
-/* Line 1455 of yacc.c  */
-#line 5472 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 517:
-
-/* Line 1455 of yacc.c  */
-#line 5474 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            uint num_parts= (yyvsp[(2) - (2)].ulong_num);
-            LEX *lex= Lex;
-            if (num_parts == 0)
-            {
-              my_error(ER_NO_PARTS_ERROR, MYF(0), "subpartitions");
-              MYSQL_YYABORT;
-            }
-            lex->part_info->num_subparts= num_parts;
-            lex->part_info->use_default_num_subpartitions= FALSE;
-          }
-    break;
-
-  case 518:
-
-/* Line 1455 of yacc.c  */
-#line 5489 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            if (part_info->part_type == RANGE_PARTITION)
-            {
-              my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0),
-                       "RANGE");
-              MYSQL_YYABORT;
-            }
-            else if (part_info->part_type == LIST_PARTITION)
-            {
-              my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0),
-                       "LIST");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 519:
-
-/* Line 1455 of yacc.c  */
-#line 5505 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            uint count_curr_parts= part_info->partitions.elements;
-            if (part_info->num_parts != 0)
-            {
-              if (part_info->num_parts !=
-                  count_curr_parts)
-              {
-                my_parse_error(ER(ER_PARTITION_WRONG_NO_PART_ERROR));
-                MYSQL_YYABORT;
-              }
-            }
-            else if (count_curr_parts > 0)
-            {
-              part_info->num_parts= count_curr_parts;
-            }
-            part_info->count_curr_subparts= 0;
-          }
-    break;
-
-  case 520:
-
-/* Line 1455 of yacc.c  */
-#line 5526 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 521:
-
-/* Line 1455 of yacc.c  */
-#line 5527 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 522:
-
-/* Line 1455 of yacc.c  */
-#line 5532 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            partition_element *p_elem= new partition_element();
-
-            if (!p_elem || part_info->partitions.push_back(p_elem))
-            {
-              mem_alloc_error(sizeof(partition_element));
-              MYSQL_YYABORT;
-            }
-            p_elem->part_state= PART_NORMAL;
-            part_info->curr_part_elem= p_elem;
-            part_info->current_partition= p_elem;
-            part_info->use_default_partitions= FALSE;
-            part_info->use_default_num_partitions= FALSE;
-          }
-    break;
-
-  case 523:
-
-/* Line 1455 of yacc.c  */
-#line 5551 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 524:
-
-/* Line 1455 of yacc.c  */
-#line 5556 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            partition_element *p_elem= part_info->curr_part_elem;
-            p_elem->partition_name= (yyvsp[(1) - (1)].lex_str).str;
-          }
-    break;
-
-  case 525:
-
-/* Line 1455 of yacc.c  */
-#line 5565 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            partition_info *part_info= lex->part_info;
-            if (! lex->is_partition_management())
-            {
-              if (part_info->part_type == RANGE_PARTITION)
-              {
-                my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
-                         "RANGE", "LESS THAN");
-                MYSQL_YYABORT;
-              }
-              if (part_info->part_type == LIST_PARTITION)
-              {
-                my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
-                         "LIST", "IN");
-                MYSQL_YYABORT;
-              }
-            }
-            else
-              part_info->part_type= HASH_PARTITION;
-          }
-    break;
-
-  case 526:
-
-/* Line 1455 of yacc.c  */
-#line 5587 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            partition_info *part_info= lex->part_info;
-            if (! lex->is_partition_management())
-            {
-              if (part_info->part_type != RANGE_PARTITION)
-              {
-                my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
-                         "RANGE", "LESS THAN");
-                MYSQL_YYABORT;
-              }
-            }
-            else
-              part_info->part_type= RANGE_PARTITION;
-          }
-    break;
-
-  case 527:
-
-/* Line 1455 of yacc.c  */
-#line 5602 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 528:
-
-/* Line 1455 of yacc.c  */
-#line 5604 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            partition_info *part_info= lex->part_info;
-            if (! lex->is_partition_management())
-            {
-              if (part_info->part_type != LIST_PARTITION)
-              {
-                my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
-                               "LIST", "IN");
-                MYSQL_YYABORT;
-              }
-            }
-            else
-              part_info->part_type= LIST_PARTITION;
-          }
-    break;
-
-  case 529:
-
-/* Line 1455 of yacc.c  */
-#line 5619 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 530:
-
-/* Line 1455 of yacc.c  */
-#line 5624 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-
-            if (part_info->num_columns &&
-                part_info->num_columns != 1U)
-            {
-              part_info->print_debug("Kilroy II", NULL);
-              my_parse_error(ER(ER_PARTITION_COLUMN_LIST_ERROR));
-              MYSQL_YYABORT;
-            }
-            else
-              part_info->num_columns= 1U;
-            if (part_info->init_column_part())
-            {
-              MYSQL_YYABORT;
-            }
-            if (part_info->add_max_value())
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 531:
-
-/* Line 1455 of yacc.c  */
-#line 5645 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 532:
-
-/* Line 1455 of yacc.c  */
-#line 5650 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            partition_info *part_info= lex->part_info;
-            part_info->print_debug("part_values_in: part_value_item", NULL);
-
-            if (part_info->num_columns != 1U)
-            {
-              if (!lex->is_partition_management() ||
-                  part_info->num_columns == 0 ||
-                  part_info->num_columns > MAX_REF_PARTS)
-              {
-                part_info->print_debug("Kilroy III", NULL);
-                my_parse_error(ER(ER_PARTITION_COLUMN_LIST_ERROR));
-                MYSQL_YYABORT;
-              }
-              /*
-                Reorganize the current large array into a list of small
-                arrays with one entry in each array. This can happen
-                in the first partition of an ALTER TABLE statement where
-                we ADD or REORGANIZE partitions. Also can only happen
-                for LIST [COLUMNS] partitions.
-              */
-              if (part_info->reorganize_into_single_field_col_val())
-              {
-                MYSQL_YYABORT;
-              }
-            }
-          }
-    break;
-
-  case 533:
-
-/* Line 1455 of yacc.c  */
-#line 5679 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            if (part_info->num_columns < 2U)
-            {
-              my_parse_error(ER(ER_ROW_SINGLE_PARTITION_FIELD_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 534:
-
-/* Line 1455 of yacc.c  */
-#line 5690 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 535:
-
-/* Line 1455 of yacc.c  */
-#line 5691 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 536:
-
-/* Line 1455 of yacc.c  */
-#line 5696 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            part_info->print_debug("( part_value_item", NULL);
-            /* Initialisation code needed for each list of value expressions */
-            if (!(part_info->part_type == LIST_PARTITION &&
-                  part_info->num_columns == 1U) &&
-                 part_info->init_column_part())
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 537:
-
-/* Line 1455 of yacc.c  */
-#line 5707 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 538:
-
-/* Line 1455 of yacc.c  */
-#line 5709 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            part_info->print_debug(") part_value_item", NULL);
-            if (part_info->num_columns == 0)
-              part_info->num_columns= part_info->curr_list_object;
-            if (part_info->num_columns != part_info->curr_list_object)
-            {
-              /*
-                All value items lists must be of equal length, in some cases
-                which is covered by the above if-statement we don't know yet
-                how many columns is in the partition so the assignment above
-                ensures that we only report errors when we know we have an
-                error.
-              */
-              part_info->print_debug("Kilroy I", NULL);
-              my_parse_error(ER(ER_PARTITION_COLUMN_LIST_ERROR));
-              MYSQL_YYABORT;
-            }
-            part_info->curr_list_object= 0;
-          }
-    break;
-
-  case 539:
-
-/* Line 1455 of yacc.c  */
-#line 5732 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 540:
-
-/* Line 1455 of yacc.c  */
-#line 5733 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 541:
-
-/* Line 1455 of yacc.c  */
-#line 5738 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            if (part_info->part_type == LIST_PARTITION)
-            {
-              my_parse_error(ER(ER_MAXVALUE_IN_VALUES_IN));
-              MYSQL_YYABORT;
-            }
-            if (part_info->add_max_value())
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 542:
-
-/* Line 1455 of yacc.c  */
-#line 5751 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            partition_info *part_info= lex->part_info;
-            Item *part_expr= (yyvsp[(1) - (1)].item);
-
-            if (!lex->safe_to_cache_query)
-            {
-              my_parse_error(ER(ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR));
-              MYSQL_YYABORT;
-            }
-            if (part_info->add_column_list_value(YYTHD, part_expr))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 543:
-
-/* Line 1455 of yacc.c  */
-#line 5771 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            if (part_info->num_subparts != 0 &&
-                !part_info->use_default_subpartitions)
-            {
-              /*
-                We come here when we have defined subpartitions on the first
-                partition but not on all the subsequent partitions. 
-              */
-              my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 544:
-
-/* Line 1455 of yacc.c  */
-#line 5785 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            if (part_info->num_subparts != 0)
-            {
-              if (part_info->num_subparts !=
-                  part_info->count_curr_subparts)
-              {
-                my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
-                MYSQL_YYABORT;
-              }
-            }
-            else if (part_info->count_curr_subparts > 0)
-            {
-              if (part_info->partitions.elements > 1)
-              {
-                my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
-                MYSQL_YYABORT;
-              }
-              part_info->num_subparts= part_info->count_curr_subparts;
-            }
-            part_info->count_curr_subparts= 0;
-          }
-    break;
-
-  case 545:
-
-/* Line 1455 of yacc.c  */
-#line 5810 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 546:
-
-/* Line 1455 of yacc.c  */
-#line 5811 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 547:
-
-/* Line 1455 of yacc.c  */
-#line 5816 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            partition_element *curr_part= part_info->current_partition;
-            partition_element *sub_p_elem= new partition_element(curr_part);
-            if (part_info->use_default_subpartitions &&
-                part_info->partitions.elements >= 2)
-            {
-              /*
-                create table t1 (a int)
-                partition by list (a) subpartition by hash (a)
-                (partition p0 values in (1),
-                 partition p1 values in (2) subpartition sp11);
-                causes use to arrive since we are on the second
-                partition, but still use_default_subpartitions
-                is set. When we come here we're processing at least
-                the second partition (the current partition processed
-                have already been put into the partitions list.
-              */
-              my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
-              MYSQL_YYABORT;
-            }
-            if (!sub_p_elem ||
-             curr_part->subpartitions.push_back(sub_p_elem))
-            {
-              mem_alloc_error(sizeof(partition_element));
-              MYSQL_YYABORT;
-            }
-            part_info->curr_part_elem= sub_p_elem;
-            part_info->use_default_subpartitions= FALSE;
-            part_info->use_default_num_subpartitions= FALSE;
-            part_info->count_curr_subparts++;
-          }
-    break;
-
-  case 548:
-
-/* Line 1455 of yacc.c  */
-#line 5848 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 549:
-
-/* Line 1455 of yacc.c  */
-#line 5853 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->curr_part_elem->partition_name= (yyvsp[(1) - (1)].lex_str).str; }
-    break;
-
-  case 550:
-
-/* Line 1455 of yacc.c  */
-#line 5857 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 551:
-
-/* Line 1455 of yacc.c  */
-#line 5858 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 552:
-
-/* Line 1455 of yacc.c  */
-#line 5862 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 553:
-
-/* Line 1455 of yacc.c  */
-#line 5863 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 554:
-
-/* Line 1455 of yacc.c  */
-#line 5868 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->curr_part_elem->tablespace_name= (yyvsp[(3) - (3)].lex_str).str; }
-    break;
-
-  case 555:
-
-/* Line 1455 of yacc.c  */
-#line 5870 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            part_info->curr_part_elem->engine_type= (yyvsp[(4) - (4)].db_type);
-            part_info->default_engine_type= (yyvsp[(4) - (4)].db_type);
-          }
-    break;
-
-  case 556:
-
-/* Line 1455 of yacc.c  */
-#line 5876 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->curr_part_elem->nodegroup_id= (uint16) (yyvsp[(3) - (3)].ulong_num); }
-    break;
-
-  case 557:
-
-/* Line 1455 of yacc.c  */
-#line 5878 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->curr_part_elem->part_max_rows= (ha_rows) (yyvsp[(3) - (3)].ulonglong_number); }
-    break;
-
-  case 558:
-
-/* Line 1455 of yacc.c  */
-#line 5880 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->curr_part_elem->part_min_rows= (ha_rows) (yyvsp[(3) - (3)].ulonglong_number); }
-    break;
-
-  case 559:
-
-/* Line 1455 of yacc.c  */
-#line 5882 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->curr_part_elem->data_file_name= (yyvsp[(4) - (4)].lex_str).str; }
-    break;
-
-  case 560:
-
-/* Line 1455 of yacc.c  */
-#line 5884 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->curr_part_elem->index_file_name= (yyvsp[(4) - (4)].lex_str).str; }
-    break;
-
-  case 561:
-
-/* Line 1455 of yacc.c  */
-#line 5886 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->part_info->curr_part_elem->part_comment= (yyvsp[(3) - (3)].lex_str).str; }
-    break;
-
-  case 562:
-
-/* Line 1455 of yacc.c  */
-#line 5895 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (lex->sql_command == SQLCOM_INSERT)
-              lex->sql_command= SQLCOM_INSERT_SELECT;
-            else if (lex->sql_command == SQLCOM_REPLACE)
-              lex->sql_command= SQLCOM_REPLACE_SELECT;
-            /*
-              The following work only with the local list, the global list
-              is created correctly in this case
-            */
-            lex->current_select->table_list.save_and_clear(&lex->save_list);
-            mysql_init_select(lex);
-            lex->current_select->parsing_place= SELECT_LIST;
-          }
-    break;
-
-  case 563:
-
-/* Line 1455 of yacc.c  */
-#line 5910 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 564:
-
-/* Line 1455 of yacc.c  */
-#line 5914 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              The following work only with the local list, the global list
-              is created correctly in this case
-            */
-            Lex->current_select->table_list.push_front(&Lex->save_list);
-          }
-    break;
-
-  case 565:
-
-/* Line 1455 of yacc.c  */
-#line 5924 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 566:
-
-/* Line 1455 of yacc.c  */
-#line 5925 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 567:
-
-/* Line 1455 of yacc.c  */
-#line 5929 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 568:
-
-/* Line 1455 of yacc.c  */
-#line 5930 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 569:
-
-/* Line 1455 of yacc.c  */
-#line 5934 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 570:
-
-/* Line 1455 of yacc.c  */
-#line 5935 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 571:
-
-/* Line 1455 of yacc.c  */
-#line 5939 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 572:
-
-/* Line 1455 of yacc.c  */
-#line 5940 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 573:
-
-/* Line 1455 of yacc.c  */
-#line 5944 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 574:
-
-/* Line 1455 of yacc.c  */
-#line 5945 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= (yyvsp[(1) - (1)].num);}
-    break;
-
-  case 575:
-
-/* Line 1455 of yacc.c  */
-#line 5949 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=(yyvsp[(1) - (1)].num); }
-    break;
-
-  case 576:
-
-/* Line 1455 of yacc.c  */
-#line 5950 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= (yyvsp[(1) - (2)].num) | (yyvsp[(2) - (2)].num); }
-    break;
-
-  case 577:
-
-/* Line 1455 of yacc.c  */
-#line 5954 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=HA_LEX_CREATE_TMP_TABLE; }
-    break;
-
-  case 578:
-
-/* Line 1455 of yacc.c  */
-#line 5958 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 579:
-
-/* Line 1455 of yacc.c  */
-#line 5959 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=HA_LEX_CREATE_IF_NOT_EXISTS; }
-    break;
-
-  case 587:
-
-/* Line 1455 of yacc.c  */
-#line 5980 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.db_type= (yyvsp[(3) - (3)].db_type);
-            Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
-          }
-    break;
-
-  case 588:
-
-/* Line 1455 of yacc.c  */
-#line 5985 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.max_rows= (yyvsp[(3) - (3)].ulonglong_number);
-            Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;
-          }
-    break;
-
-  case 589:
-
-/* Line 1455 of yacc.c  */
-#line 5990 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.min_rows= (yyvsp[(3) - (3)].ulonglong_number);
-            Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;
-          }
-    break;
-
-  case 590:
-
-/* Line 1455 of yacc.c  */
-#line 5995 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.avg_row_length=(yyvsp[(3) - (3)].ulong_num);
-            Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;
-          }
-    break;
-
-  case 591:
-
-/* Line 1455 of yacc.c  */
-#line 6000 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.password=(yyvsp[(3) - (3)].lex_str).str;
-            Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD;
-          }
-    break;
-
-  case 592:
-
-/* Line 1455 of yacc.c  */
-#line 6005 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.comment=(yyvsp[(3) - (3)].lex_str);
-            Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT;
-          }
-    break;
-
-  case 593:
-
-/* Line 1455 of yacc.c  */
-#line 6010 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.auto_increment_value=(yyvsp[(3) - (3)].ulonglong_number);
-            Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;
-          }
-    break;
-
-  case 594:
-
-/* Line 1455 of yacc.c  */
-#line 6015 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            switch((yyvsp[(3) - (3)].ulong_num)) {
-            case 0:
-                Lex->create_info.table_options|= HA_OPTION_NO_PACK_KEYS;
-                break;
-            case 1:
-                Lex->create_info.table_options|= HA_OPTION_PACK_KEYS;
-                break;
-            default:
-                my_parse_error(ER(ER_SYNTAX_ERROR));
-                MYSQL_YYABORT;
-            }
-            Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;
-          }
-    break;
-
-  case 595:
-
-/* Line 1455 of yacc.c  */
-#line 6030 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.table_options&=
-              ~(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS);
-            Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;
-          }
-    break;
-
-  case 596:
-
-/* Line 1455 of yacc.c  */
-#line 6036 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            switch((yyvsp[(3) - (3)].ulong_num)) {
-            case 0:
-                Lex->create_info.stats_auto_recalc= HA_STATS_AUTO_RECALC_OFF;
-                break;
-            case 1:
-                Lex->create_info.stats_auto_recalc= HA_STATS_AUTO_RECALC_ON;
-                break;
-            default:
-                my_parse_error(ER(ER_SYNTAX_ERROR));
-                MYSQL_YYABORT;
-            }
-            Lex->create_info.used_fields|= HA_CREATE_USED_STATS_AUTO_RECALC;
-          }
-    break;
-
-  case 597:
-
-/* Line 1455 of yacc.c  */
-#line 6051 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.stats_auto_recalc= HA_STATS_AUTO_RECALC_DEFAULT;
-            Lex->create_info.used_fields|= HA_CREATE_USED_STATS_AUTO_RECALC;
-          }
-    break;
-
-  case 598:
-
-/* Line 1455 of yacc.c  */
-#line 6056 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            switch((yyvsp[(3) - (3)].ulong_num)) {
-            case 0:
-                Lex->create_info.table_options|= HA_OPTION_NO_STATS_PERSISTENT;
-                break;
-            case 1:
-                Lex->create_info.table_options|= HA_OPTION_STATS_PERSISTENT;
-                break;
-            default:
-                my_parse_error(ER(ER_SYNTAX_ERROR));
-                MYSQL_YYABORT;
-            }
-            Lex->create_info.used_fields|= HA_CREATE_USED_STATS_PERSISTENT;
-          }
-    break;
-
-  case 599:
-
-/* Line 1455 of yacc.c  */
-#line 6071 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.table_options&=
-              ~(HA_OPTION_STATS_PERSISTENT | HA_OPTION_NO_STATS_PERSISTENT);
-            Lex->create_info.used_fields|= HA_CREATE_USED_STATS_PERSISTENT;
-          }
-    break;
-
-  case 600:
-
-/* Line 1455 of yacc.c  */
-#line 6077 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* From user point of view STATS_SAMPLE_PAGES can be specified as
-            STATS_SAMPLE_PAGES=N (where 0<N<=65535, it does not make sense to
-            scan 0 pages) or STATS_SAMPLE_PAGES=default. Internally we record
-            =default as 0. See create_frm() in sql/table.cc, we use only two
-            bytes for stats_sample_pages and this is why we do not allow
-            larger values. 65535 pages, 16kb each means to sample 1GB, which
-            is impractical. If at some point this needs to be extended, then
-            we can store the higher bits from stats_sample_pages in .frm too. */
-            if ((yyvsp[(3) - (3)].ulong_num) == 0 || (yyvsp[(3) - (3)].ulong_num) > 0xffff)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            Lex->create_info.stats_sample_pages=(yyvsp[(3) - (3)].ulong_num);
-            Lex->create_info.used_fields|= HA_CREATE_USED_STATS_SAMPLE_PAGES;
-          }
-    break;
-
-  case 601:
-
-/* Line 1455 of yacc.c  */
-#line 6095 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.stats_sample_pages=0;
-            Lex->create_info.used_fields|= HA_CREATE_USED_STATS_SAMPLE_PAGES;
-          }
-    break;
-
-  case 602:
-
-/* Line 1455 of yacc.c  */
-#line 6100 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM;
-            Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM;
-          }
-    break;
-
-  case 603:
-
-/* Line 1455 of yacc.c  */
-#line 6105 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-             Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM;
-             Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM;
-          }
-    break;
-
-  case 604:
-
-/* Line 1455 of yacc.c  */
-#line 6110 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE;
-            Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE;
-          }
-    break;
-
-  case 605:
-
-/* Line 1455 of yacc.c  */
-#line 6115 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.row_type= (yyvsp[(3) - (3)].row_type);
-            Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT;
-          }
-    break;
-
-  case 606:
-
-/* Line 1455 of yacc.c  */
-#line 6120 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->select_lex.table_list.save_and_clear(&Lex->save_list);
-          }
-    break;
-
-  case 607:
-
-/* Line 1455 of yacc.c  */
-#line 6124 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              Move the union list to the merge_list and exclude its tables
-              from the global list.
-            */
-            LEX *lex=Lex;
-            lex->create_info.merge_list= lex->select_lex.table_list;
-            lex->select_lex.table_list= lex->save_list;
-            /*
-              When excluding union list from the global list we assume that
-              elements of the former immediately follow elements which represent
-              table being created/altered and parent tables.
-            */
-            TABLE_LIST *last_non_sel_table= lex->create_last_non_select_table;
-            DBUG_ASSERT(last_non_sel_table->next_global ==
-                        lex->create_info.merge_list.first);
-            last_non_sel_table->next_global= 0;
-            Lex->query_tables_last= &last_non_sel_table->next_global;
-
-            lex->create_info.used_fields|= HA_CREATE_USED_UNION;
-          }
-    break;
-
-  case 610:
-
-/* Line 1455 of yacc.c  */
-#line 6148 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.merge_insert_method= (yyvsp[(3) - (3)].ulong_num);
-            Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;
-          }
-    break;
-
-  case 611:
-
-/* Line 1455 of yacc.c  */
-#line 6153 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.data_file_name= (yyvsp[(4) - (4)].lex_str).str;
-            Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR;
-          }
-    break;
-
-  case 612:
-
-/* Line 1455 of yacc.c  */
-#line 6158 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.index_file_name= (yyvsp[(4) - (4)].lex_str).str;
-            Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR;
-          }
-    break;
-
-  case 613:
-
-/* Line 1455 of yacc.c  */
-#line 6163 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {Lex->create_info.tablespace= (yyvsp[(2) - (2)].lex_str).str;}
-    break;
-
-  case 614:
-
-/* Line 1455 of yacc.c  */
-#line 6165 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {Lex->create_info.storage_media= HA_SM_DISK;}
-    break;
-
-  case 615:
-
-/* Line 1455 of yacc.c  */
-#line 6167 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {Lex->create_info.storage_media= HA_SM_MEMORY;}
-    break;
-
-  case 616:
-
-/* Line 1455 of yacc.c  */
-#line 6169 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.connect_string.str= (yyvsp[(3) - (3)].lex_str).str;
-            Lex->create_info.connect_string.length= (yyvsp[(3) - (3)].lex_str).length;
-            Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION;
-          }
-    break;
-
-  case 617:
-
-/* Line 1455 of yacc.c  */
-#line 6175 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE;
-            Lex->create_info.key_block_size= (yyvsp[(3) - (3)].ulong_num);
-          }
-    break;
-
-  case 618:
-
-/* Line 1455 of yacc.c  */
-#line 6183 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            HA_CREATE_INFO *cinfo= &Lex->create_info;
-            if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
-                 cinfo->default_table_charset && (yyvsp[(4) - (4)].charset) &&
-                 !my_charset_same(cinfo->default_table_charset,(yyvsp[(4) - (4)].charset)))
-            {
-              my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
-                       "CHARACTER SET ", cinfo->default_table_charset->csname,
-                       "CHARACTER SET ", (yyvsp[(4) - (4)].charset)->csname);
-              MYSQL_YYABORT;
-            }
-            Lex->create_info.default_table_charset= (yyvsp[(4) - (4)].charset);
-            Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
-          }
-    break;
-
-  case 619:
-
-/* Line 1455 of yacc.c  */
-#line 6201 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            HA_CREATE_INFO *cinfo= &Lex->create_info;
-            if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
-                 cinfo->default_table_charset && (yyvsp[(4) - (4)].charset) &&
-                 !((yyvsp[(4) - (4)].charset)= merge_charset_and_collation(cinfo->default_table_charset,
-                                                   (yyvsp[(4) - (4)].charset))))
-            {
-              MYSQL_YYABORT;
-            }
-
-            Lex->create_info.default_table_charset= (yyvsp[(4) - (4)].charset);
-            Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
-          }
-    break;
-
-  case 620:
-
-/* Line 1455 of yacc.c  */
-#line 6218 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            plugin_ref plugin=
-              ha_resolve_by_name(thd, &(yyvsp[(1) - (1)].lex_str),
-                thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE);
-
-            if (plugin)
-              (yyval.db_type)= plugin_data(plugin, handlerton*);
-            else
-            {
-              if (thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
-              {
-                my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-                MYSQL_YYABORT;
-              }
-              (yyval.db_type)= 0;
-              push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
-                                  ER_UNKNOWN_STORAGE_ENGINE,
-                                  ER(ER_UNKNOWN_STORAGE_ENGINE),
-                                  (yyvsp[(1) - (1)].lex_str).str);
-            }
-          }
-    break;
-
-  case 621:
-
-/* Line 1455 of yacc.c  */
-#line 6244 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            plugin_ref plugin=
-              ha_resolve_by_name(thd, &(yyvsp[(1) - (1)].lex_str),
-                lex->create_info.options & HA_LEX_CREATE_TMP_TABLE);
-            if (plugin)
-              (yyval.db_type)= plugin_data(plugin, handlerton*);
-            else
-            {
-              my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 622:
-
-/* Line 1455 of yacc.c  */
-#line 6261 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.row_type)= ROW_TYPE_DEFAULT; }
-    break;
-
-  case 623:
-
-/* Line 1455 of yacc.c  */
-#line 6262 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.row_type)= ROW_TYPE_FIXED; }
-    break;
-
-  case 624:
-
-/* Line 1455 of yacc.c  */
-#line 6263 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.row_type)= ROW_TYPE_DYNAMIC; }
-    break;
-
-  case 625:
-
-/* Line 1455 of yacc.c  */
-#line 6264 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.row_type)= ROW_TYPE_COMPRESSED; }
-    break;
-
-  case 626:
-
-/* Line 1455 of yacc.c  */
-#line 6265 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.row_type)= ROW_TYPE_REDUNDANT; }
-    break;
-
-  case 627:
-
-/* Line 1455 of yacc.c  */
-#line 6266 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.row_type)= ROW_TYPE_COMPACT; }
-    break;
-
-  case 628:
-
-/* Line 1455 of yacc.c  */
-#line 6270 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= MERGE_INSERT_DISABLED; }
-    break;
-
-  case 629:
-
-/* Line 1455 of yacc.c  */
-#line 6271 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= MERGE_INSERT_TO_FIRST; }
-    break;
-
-  case 630:
-
-/* Line 1455 of yacc.c  */
-#line 6272 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= MERGE_INSERT_TO_LAST; }
-    break;
-
-  case 631:
-
-/* Line 1455 of yacc.c  */
-#line 6276 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 633:
-
-/* Line 1455 of yacc.c  */
-#line 6281 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {(yyval.num) = (int) STRING_RESULT; }
-    break;
-
-  case 634:
-
-/* Line 1455 of yacc.c  */
-#line 6282 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {(yyval.num) = (int) REAL_RESULT; }
-    break;
-
-  case 635:
-
-/* Line 1455 of yacc.c  */
-#line 6283 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {(yyval.num) = (int) DECIMAL_RESULT; }
-    break;
-
-  case 636:
-
-/* Line 1455 of yacc.c  */
-#line 6284 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {(yyval.num) = (int) INT_RESULT; }
-    break;
-
-  case 637:
-
-/* Line 1455 of yacc.c  */
-#line 6290 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          Lex->create_last_non_select_table= Lex->last_table();
-        }
-    break;
-
-  case 643:
-
-/* Line 1455 of yacc.c  */
-#line 6308 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->col_list.empty(); /* Alloced by sql_alloc */
-          }
-    break;
-
-  case 644:
-
-/* Line 1455 of yacc.c  */
-#line 6315 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index (Lex, (yyvsp[(1) - (7)].key_type), (yyvsp[(2) - (7)].lex_str)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 645:
-
-/* Line 1455 of yacc.c  */
-#line 6321 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index (Lex, (yyvsp[(1) - (8)].key_type), (yyvsp[(3) - (8)].lex_str)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 646:
-
-/* Line 1455 of yacc.c  */
-#line 6327 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index (Lex, (yyvsp[(1) - (8)].key_type), (yyvsp[(3) - (8)].lex_str)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 647:
-
-/* Line 1455 of yacc.c  */
-#line 6333 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_create_index (Lex, (yyvsp[(2) - (8)].key_type), (yyvsp[(3) - (8)].lex_str).str ? (yyvsp[(3) - (8)].lex_str) : (yyvsp[(1) - (8)].lex_str)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 648:
-
-/* Line 1455 of yacc.c  */
-#line 6338 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            Key *key= new Foreign_key((yyvsp[(4) - (8)].lex_str).str ? (yyvsp[(4) - (8)].lex_str) : (yyvsp[(1) - (8)].lex_str), lex->col_list,
-                                      (yyvsp[(8) - (8)].table)->db,
-                                      (yyvsp[(8) - (8)].table)->table,
-                                      lex->ref_list,
-                                      lex->fk_delete_opt,
-                                      lex->fk_update_opt,
-                                      lex->fk_match_option);
-            if (key == NULL)
-              MYSQL_YYABORT;
-            lex->alter_info.key_list.push_back(key);
-            if (add_create_index (lex, Key::MULTIPLE, (yyvsp[(1) - (8)].lex_str).str ? (yyvsp[(1) - (8)].lex_str) : (yyvsp[(4) - (8)].lex_str),
-                                  &default_key_create_info, 1))
-              MYSQL_YYABORT;
-            /* Only used for ALTER TABLE. Ignored otherwise. */
-            lex->alter_info.flags|= Alter_info::ADD_FOREIGN_KEY;
-          }
-    break;
-
-  case 649:
-
-/* Line 1455 of yacc.c  */
-#line 6357 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->col_list.empty(); /* Alloced by sql_alloc */
-          }
-    break;
-
-  case 653:
-
-/* Line 1455 of yacc.c  */
-#line 6372 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= null_lex_str; }
-    break;
-
-  case 654:
-
-/* Line 1455 of yacc.c  */
-#line 6373 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 655:
-
-/* Line 1455 of yacc.c  */
-#line 6377 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); }
-    break;
-
-  case 656:
-
-/* Line 1455 of yacc.c  */
-#line 6382 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->length=lex->dec=0;
-            lex->type=0;
-            lex->default_value= lex->on_update_value= 0;
-            lex->comment=null_lex_str;
-            lex->charset=NULL;
-          }
-    break;
-
-  case 657:
-
-/* Line 1455 of yacc.c  */
-#line 6391 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (add_field_to_list(lex->thd, &(yyvsp[(1) - (4)].lex_str), (enum enum_field_types) (yyvsp[(3) - (4)].num),
-                                  lex->length,lex->dec,lex->type,
-                                  lex->default_value, lex->on_update_value, 
-                                  &lex->comment,
-                                  lex->change,&lex->interval_list,lex->charset,
-                                  lex->uint_geom_type))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 658:
-
-/* Line 1455 of yacc.c  */
-#line 6404 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=(yyvsp[(1) - (3)].num); }
-    break;
-
-  case 659:
-
-/* Line 1455 of yacc.c  */
-#line 6405 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=(yyvsp[(1) - (3)].num); }
-    break;
-
-  case 660:
-
-/* Line 1455 of yacc.c  */
-#line 6406 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_FLOAT; }
-    break;
-
-  case 661:
-
-/* Line 1455 of yacc.c  */
-#line 6408 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->length= (char*) "1";
-            (yyval.num)=MYSQL_TYPE_BIT;
-          }
-    break;
-
-  case 662:
-
-/* Line 1455 of yacc.c  */
-#line 6413 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)=MYSQL_TYPE_BIT;
-          }
-    break;
-
-  case 663:
-
-/* Line 1455 of yacc.c  */
-#line 6417 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->length= (char*) "1";
-            (yyval.num)=MYSQL_TYPE_TINY;
-          }
-    break;
-
-  case 664:
-
-/* Line 1455 of yacc.c  */
-#line 6422 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->length= (char*) "1";
-            (yyval.num)=MYSQL_TYPE_TINY;
-          }
-    break;
-
-  case 665:
-
-/* Line 1455 of yacc.c  */
-#line 6427 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)=MYSQL_TYPE_STRING;
-          }
-    break;
-
-  case 666:
-
-/* Line 1455 of yacc.c  */
-#line 6431 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->length= (char*) "1";
-            (yyval.num)=MYSQL_TYPE_STRING;
-          }
-    break;
-
-  case 667:
-
-/* Line 1455 of yacc.c  */
-#line 6436 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)=MYSQL_TYPE_STRING;
-            Lex->charset=national_charset_info;
-          }
-    break;
-
-  case 668:
-
-/* Line 1455 of yacc.c  */
-#line 6441 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->length= (char*) "1";
-            (yyval.num)=MYSQL_TYPE_STRING;
-            Lex->charset=national_charset_info;
-          }
-    break;
-
-  case 669:
-
-/* Line 1455 of yacc.c  */
-#line 6447 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset=&my_charset_bin;
-            (yyval.num)=MYSQL_TYPE_STRING;
-          }
-    break;
-
-  case 670:
-
-/* Line 1455 of yacc.c  */
-#line 6452 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->length= (char*) "1";
-            Lex->charset=&my_charset_bin;
-            (yyval.num)=MYSQL_TYPE_STRING;
-          }
-    break;
-
-  case 671:
-
-/* Line 1455 of yacc.c  */
-#line 6458 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= MYSQL_TYPE_VARCHAR;
-          }
-    break;
-
-  case 672:
-
-/* Line 1455 of yacc.c  */
-#line 6462 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= MYSQL_TYPE_VARCHAR;
-            Lex->charset=national_charset_info;
-          }
-    break;
-
-  case 673:
-
-/* Line 1455 of yacc.c  */
-#line 6467 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset=&my_charset_bin;
-            (yyval.num)= MYSQL_TYPE_VARCHAR;
-          }
-    break;
-
-  case 674:
-
-/* Line 1455 of yacc.c  */
-#line 6472 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->length)
-            {
-              errno= 0;
-              ulong length= strtoul(Lex->length, NULL, 10);
-              if (errno == 0 && length <= MAX_FIELD_BLOBLENGTH && length != 4)
-              {
-                /* Reset unsupported positive column width to default value */
-                Lex->length= NULL;
-                push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN,
-                                    ER_INVALID_YEAR_COLUMN_LENGTH,
-                                    ER(ER_INVALID_YEAR_COLUMN_LENGTH),
-                                    length);
-              }
-            }
-            (yyval.num)=MYSQL_TYPE_YEAR;
-          }
-    break;
-
-  case 675:
-
-/* Line 1455 of yacc.c  */
-#line 6490 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_DATE; }
-    break;
-
-  case 676:
-
-/* Line 1455 of yacc.c  */
-#line 6492 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= MYSQL_TYPE_TIME2; }
-    break;
-
-  case 677:
-
-/* Line 1455 of yacc.c  */
-#line 6494 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (YYTHD->variables.sql_mode & MODE_MAXDB)
-              (yyval.num)=MYSQL_TYPE_DATETIME2;
-            else
-            {
-              /* 
-                Unlike other types TIMESTAMP fields are NOT NULL by default.
-                This behavior is deprecated now.
-              */
-              if (!YYTHD->variables.explicit_defaults_for_timestamp)
-                Lex->type|= NOT_NULL_FLAG;
-
-              (yyval.num)=MYSQL_TYPE_TIMESTAMP2;
-            }
-          }
-    break;
-
-  case 678:
-
-/* Line 1455 of yacc.c  */
-#line 6510 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= MYSQL_TYPE_DATETIME2; }
-    break;
-
-  case 679:
-
-/* Line 1455 of yacc.c  */
-#line 6512 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset=&my_charset_bin;
-            (yyval.num)=MYSQL_TYPE_TINY_BLOB;
-          }
-    break;
-
-  case 680:
-
-/* Line 1455 of yacc.c  */
-#line 6517 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset=&my_charset_bin;
-            (yyval.num)=MYSQL_TYPE_BLOB;
-          }
-    break;
-
-  case 681:
-
-/* Line 1455 of yacc.c  */
-#line 6522 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-#ifdef HAVE_SPATIAL
-            Lex->charset=&my_charset_bin;
-            Lex->uint_geom_type= (uint)(yyvsp[(1) - (1)].num);
-            (yyval.num)=MYSQL_TYPE_GEOMETRY;
-#else
-            my_error(ER_FEATURE_DISABLED, MYF(0),
-                     sym_group_geom.name, sym_group_geom.needed_define);
-            MYSQL_YYABORT;
-#endif
-          }
-    break;
-
-  case 682:
-
-/* Line 1455 of yacc.c  */
-#line 6534 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset=&my_charset_bin;
-            (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB;
-          }
-    break;
-
-  case 683:
-
-/* Line 1455 of yacc.c  */
-#line 6539 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset=&my_charset_bin;
-            (yyval.num)=MYSQL_TYPE_LONG_BLOB;
-          }
-    break;
-
-  case 684:
-
-/* Line 1455 of yacc.c  */
-#line 6544 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset=&my_charset_bin;
-            (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB;
-          }
-    break;
-
-  case 685:
-
-/* Line 1455 of yacc.c  */
-#line 6549 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB; }
-    break;
-
-  case 686:
-
-/* Line 1455 of yacc.c  */
-#line 6551 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_TINY_BLOB; }
-    break;
-
-  case 687:
-
-/* Line 1455 of yacc.c  */
-#line 6553 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_BLOB; }
-    break;
-
-  case 688:
-
-/* Line 1455 of yacc.c  */
-#line 6555 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB; }
-    break;
-
-  case 689:
-
-/* Line 1455 of yacc.c  */
-#line 6557 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_LONG_BLOB; }
-    break;
-
-  case 690:
-
-/* Line 1455 of yacc.c  */
-#line 6559 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_NEWDECIMAL;}
-    break;
-
-  case 691:
-
-/* Line 1455 of yacc.c  */
-#line 6561 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_NEWDECIMAL;}
-    break;
-
-  case 692:
-
-/* Line 1455 of yacc.c  */
-#line 6563 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_NEWDECIMAL;}
-    break;
-
-  case 693:
-
-/* Line 1455 of yacc.c  */
-#line 6565 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {Lex->interval_list.empty();}
-    break;
-
-  case 694:
-
-/* Line 1455 of yacc.c  */
-#line 6567 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_ENUM; }
-    break;
-
-  case 695:
-
-/* Line 1455 of yacc.c  */
-#line 6569 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->interval_list.empty();}
-    break;
-
-  case 696:
-
-/* Line 1455 of yacc.c  */
-#line 6571 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_SET; }
-    break;
-
-  case 697:
-
-/* Line 1455 of yacc.c  */
-#line 6573 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB; }
-    break;
-
-  case 698:
-
-/* Line 1455 of yacc.c  */
-#line 6575 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)=MYSQL_TYPE_LONGLONG;
-            Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG |
-              UNIQUE_FLAG);
-          }
-    break;
-
-  case 699:
-
-/* Line 1455 of yacc.c  */
-#line 6583 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= Field::GEOM_GEOMETRY; }
-    break;
-
-  case 700:
-
-/* Line 1455 of yacc.c  */
-#line 6584 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= Field::GEOM_GEOMETRYCOLLECTION; }
-    break;
-
-  case 701:
-
-/* Line 1455 of yacc.c  */
-#line 6586 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->length= const_cast<char*>(STRINGIFY_ARG
-                                           (MAX_LEN_GEOM_POINT_FIELD));
-            (yyval.num)= Field::GEOM_POINT;
-          }
-    break;
-
-  case 702:
-
-/* Line 1455 of yacc.c  */
-#line 6591 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= Field::GEOM_MULTIPOINT; }
-    break;
-
-  case 703:
-
-/* Line 1455 of yacc.c  */
-#line 6592 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= Field::GEOM_LINESTRING; }
-    break;
-
-  case 704:
-
-/* Line 1455 of yacc.c  */
-#line 6593 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= Field::GEOM_MULTILINESTRING; }
-    break;
-
-  case 705:
-
-/* Line 1455 of yacc.c  */
-#line 6594 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= Field::GEOM_POLYGON; }
-    break;
-
-  case 706:
-
-/* Line 1455 of yacc.c  */
-#line 6595 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= Field::GEOM_MULTIPOLYGON; }
-    break;
-
-  case 707:
-
-/* Line 1455 of yacc.c  */
-#line 6599 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 708:
-
-/* Line 1455 of yacc.c  */
-#line 6603 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 709:
-
-/* Line 1455 of yacc.c  */
-#line 6604 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 710:
-
-/* Line 1455 of yacc.c  */
-#line 6608 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 711:
-
-/* Line 1455 of yacc.c  */
-#line 6609 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 712:
-
-/* Line 1455 of yacc.c  */
-#line 6613 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 713:
-
-/* Line 1455 of yacc.c  */
-#line 6614 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 714:
-
-/* Line 1455 of yacc.c  */
-#line 6615 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 715:
-
-/* Line 1455 of yacc.c  */
-#line 6616 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 716:
-
-/* Line 1455 of yacc.c  */
-#line 6617 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 717:
-
-/* Line 1455 of yacc.c  */
-#line 6621 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_LONG; }
-    break;
-
-  case 718:
-
-/* Line 1455 of yacc.c  */
-#line 6622 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_TINY; }
-    break;
-
-  case 719:
-
-/* Line 1455 of yacc.c  */
-#line 6623 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_SHORT; }
-    break;
-
-  case 720:
-
-/* Line 1455 of yacc.c  */
-#line 6624 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_INT24; }
-    break;
-
-  case 721:
-
-/* Line 1455 of yacc.c  */
-#line 6625 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_LONGLONG; }
-    break;
-
-  case 722:
-
-/* Line 1455 of yacc.c  */
-#line 6630 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ?
-              MYSQL_TYPE_FLOAT : MYSQL_TYPE_DOUBLE;
-          }
-    break;
-
-  case 723:
-
-/* Line 1455 of yacc.c  */
-#line 6635 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_DOUBLE; }
-    break;
-
-  case 724:
-
-/* Line 1455 of yacc.c  */
-#line 6637 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=MYSQL_TYPE_DOUBLE; }
-    break;
-
-  case 725:
-
-/* Line 1455 of yacc.c  */
-#line 6642 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->dec=Lex->length= (char*)0; }
-    break;
-
-  case 726:
-
-/* Line 1455 of yacc.c  */
-#line 6644 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->dec= (char*)0; }
-    break;
-
-  case 727:
-
-/* Line 1455 of yacc.c  */
-#line 6646 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 728:
-
-/* Line 1455 of yacc.c  */
-#line 6651 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->length=(yyvsp[(2) - (5)].lex_str).str;
-            lex->dec=(yyvsp[(4) - (5)].lex_str).str;
-          }
-    break;
-
-  case 729:
-
-/* Line 1455 of yacc.c  */
-#line 6660 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->dec= (char *) 0; }
-    break;
-
-  case 730:
-
-/* Line 1455 of yacc.c  */
-#line 6661 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->dec= (yyvsp[(2) - (3)].lex_str).str; }
-    break;
-
-  case 731:
-
-/* Line 1455 of yacc.c  */
-#line 6665 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= 0; }
-    break;
-
-  case 732:
-
-/* Line 1455 of yacc.c  */
-#line 6666 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= 0; }
-    break;
-
-  case 733:
-
-/* Line 1455 of yacc.c  */
-#line 6668 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-             int error;
-             (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(2) - (3)].lex_str).str, NULL, &error);
-           }
-    break;
-
-  case 734:
-
-/* Line 1455 of yacc.c  */
-#line 6675 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 735:
-
-/* Line 1455 of yacc.c  */
-#line 6676 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 736:
-
-/* Line 1455 of yacc.c  */
-#line 6680 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 737:
-
-/* Line 1455 of yacc.c  */
-#line 6681 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 738:
-
-/* Line 1455 of yacc.c  */
-#line 6685 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 739:
-
-/* Line 1455 of yacc.c  */
-#line 6686 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= UNSIGNED_FLAG;}
-    break;
-
-  case 740:
-
-/* Line 1455 of yacc.c  */
-#line 6687 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= UNSIGNED_FLAG | ZEROFILL_FLAG; }
-    break;
-
-  case 741:
-
-/* Line 1455 of yacc.c  */
-#line 6691 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->length= (yyvsp[(2) - (3)].lex_str).str; }
-    break;
-
-  case 742:
-
-/* Line 1455 of yacc.c  */
-#line 6692 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->length= (yyvsp[(2) - (3)].lex_str).str; }
-    break;
-
-  case 743:
-
-/* Line 1455 of yacc.c  */
-#line 6693 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->length= (yyvsp[(2) - (3)].lex_str).str; }
-    break;
-
-  case 744:
-
-/* Line 1455 of yacc.c  */
-#line 6694 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->length= (yyvsp[(2) - (3)].lex_str).str; }
-    break;
-
-  case 745:
-
-/* Line 1455 of yacc.c  */
-#line 6697 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->length=(char*) 0; /* use default length */ }
-    break;
-
-  case 746:
-
-/* Line 1455 of yacc.c  */
-#line 6698 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 747:
-
-/* Line 1455 of yacc.c  */
-#line 6702 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 748:
-
-/* Line 1455 of yacc.c  */
-#line 6703 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 749:
-
-/* Line 1455 of yacc.c  */
-#line 6707 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 750:
-
-/* Line 1455 of yacc.c  */
-#line 6708 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 751:
-
-/* Line 1455 of yacc.c  */
-#line 6712 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 753:
-
-/* Line 1455 of yacc.c  */
-#line 6717 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type&= ~ NOT_NULL_FLAG; }
-    break;
-
-  case 754:
-
-/* Line 1455 of yacc.c  */
-#line 6718 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= NOT_NULL_FLAG; }
-    break;
-
-  case 755:
-
-/* Line 1455 of yacc.c  */
-#line 6719 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->default_value=(yyvsp[(2) - (2)].item); }
-    break;
-
-  case 756:
-
-/* Line 1455 of yacc.c  */
-#line 6720 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->on_update_value= (yyvsp[(3) - (3)].item); }
-    break;
-
-  case 757:
-
-/* Line 1455 of yacc.c  */
-#line 6721 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG; }
-    break;
-
-  case 758:
-
-/* Line 1455 of yacc.c  */
-#line 6723 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            LEX *lex=Lex;
-            lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG;
-            lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX;
-          }
-    break;
-
-  case 759:
-
-/* Line 1455 of yacc.c  */
-#line 6729 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG;
-            lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX;
-          }
-    break;
-
-  case 760:
-
-/* Line 1455 of yacc.c  */
-#line 6735 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->type|= UNIQUE_FLAG; 
-            lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX;
-          }
-    break;
-
-  case 761:
-
-/* Line 1455 of yacc.c  */
-#line 6741 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->type|= UNIQUE_KEY_FLAG; 
-            lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX; 
-          }
-    break;
-
-  case 762:
-
-/* Line 1455 of yacc.c  */
-#line 6746 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->comment= (yyvsp[(2) - (2)].lex_str); }
-    break;
-
-  case 763:
-
-/* Line 1455 of yacc.c  */
-#line 6748 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->charset && !my_charset_same(Lex->charset,(yyvsp[(2) - (2)].charset)))
-            {
-              my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
-                       (yyvsp[(2) - (2)].charset)->name,Lex->charset->csname);
-              MYSQL_YYABORT;
-            }
-            else
-            {
-              Lex->charset=(yyvsp[(2) - (2)].charset);
-            }
-          }
-    break;
-
-  case 764:
-
-/* Line 1455 of yacc.c  */
-#line 6761 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->type&= ~(FIELD_FLAGS_COLUMN_FORMAT_MASK);
-            Lex->type|=
-              (COLUMN_FORMAT_TYPE_DEFAULT << FIELD_FLAGS_COLUMN_FORMAT);
-          }
-    break;
-
-  case 765:
-
-/* Line 1455 of yacc.c  */
-#line 6767 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->type&= ~(FIELD_FLAGS_COLUMN_FORMAT_MASK);
-            Lex->type|=
-              (COLUMN_FORMAT_TYPE_FIXED << FIELD_FLAGS_COLUMN_FORMAT);
-          }
-    break;
-
-  case 766:
-
-/* Line 1455 of yacc.c  */
-#line 6773 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->type&= ~(FIELD_FLAGS_COLUMN_FORMAT_MASK);
-            Lex->type|=
-              (COLUMN_FORMAT_TYPE_DYNAMIC << FIELD_FLAGS_COLUMN_FORMAT);
-          }
-    break;
-
-  case 767:
-
-/* Line 1455 of yacc.c  */
-#line 6779 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->type&= ~(FIELD_FLAGS_STORAGE_MEDIA_MASK);
-            Lex->type|= (HA_SM_DEFAULT << FIELD_FLAGS_STORAGE_MEDIA);
-          }
-    break;
-
-  case 768:
-
-/* Line 1455 of yacc.c  */
-#line 6784 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->type&= ~(FIELD_FLAGS_STORAGE_MEDIA_MASK);
-            Lex->type|= (HA_SM_DISK << FIELD_FLAGS_STORAGE_MEDIA);
-          }
-    break;
-
-  case 769:
-
-/* Line 1455 of yacc.c  */
-#line 6789 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->type&= ~(FIELD_FLAGS_STORAGE_MEDIA_MASK);
-            Lex->type|= (HA_SM_MEMORY << FIELD_FLAGS_STORAGE_MEDIA);
-          }
-    break;
-
-  case 770:
-
-/* Line 1455 of yacc.c  */
-#line 6798 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          (yyval.num)= (yyvsp[(1) - (2)].num);
-
-          if (Lex->charset) /* Lex->charset is scanned in "type" */
-          {
-            if (!(Lex->charset= merge_charset_and_collation(Lex->charset, (yyvsp[(2) - (2)].charset))))
-              MYSQL_YYABORT;
-          }
-          else if ((yyvsp[(2) - (2)].charset))
-          {
-            my_error(ER_NOT_SUPPORTED_YET, MYF(0),
-                     "COLLATE with no CHARACTER SET "
-                     "in SP parameters, RETURNS, DECLARE");
-            MYSQL_YYABORT;
-          }
-        }
-    break;
-
-  case 771:
-
-/* Line 1455 of yacc.c  */
-#line 6819 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_now_local((yyvsp[(2) - (2)].ulong_num));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 773:
-
-/* Line 1455 of yacc.c  */
-#line 6828 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)=(yyvsp[(1) - (1)].item); }
-    break;
-
-  case 774:
-
-/* Line 1455 of yacc.c  */
-#line 6832 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 775:
-
-/* Line 1455 of yacc.c  */
-#line 6833 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 776:
-
-/* Line 1455 of yacc.c  */
-#line 6838 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyval.charset)=get_charset_by_csname((yyvsp[(1) - (1)].lex_str).str,MY_CS_PRIMARY,MYF(0))))
-            {
-              my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 777:
-
-/* Line 1455 of yacc.c  */
-#line 6845 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)= &my_charset_bin; }
-    break;
-
-  case 778:
-
-/* Line 1455 of yacc.c  */
-#line 6849 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)=(yyvsp[(1) - (1)].charset);   }
-    break;
-
-  case 779:
-
-/* Line 1455 of yacc.c  */
-#line 6850 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)=NULL; }
-    break;
-
-  case 780:
-
-/* Line 1455 of yacc.c  */
-#line 6854 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)= NULL; }
-    break;
-
-  case 781:
-
-/* Line 1455 of yacc.c  */
-#line 6855 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)= (yyvsp[(2) - (2)].charset); }
-    break;
-
-  case 782:
-
-/* Line 1455 of yacc.c  */
-#line 6860 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyval.charset)=get_charset_by_csname((yyvsp[(1) - (1)].lex_str).str,MY_CS_PRIMARY,MYF(0))) &&
-                !((yyval.charset)=get_old_charset_by_name((yyvsp[(1) - (1)].lex_str).str)))
-            {
-              my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 783:
-
-/* Line 1455 of yacc.c  */
-#line 6868 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)= &my_charset_bin; }
-    break;
-
-  case 784:
-
-/* Line 1455 of yacc.c  */
-#line 6872 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)=(yyvsp[(1) - (1)].charset);   }
-    break;
-
-  case 785:
-
-/* Line 1455 of yacc.c  */
-#line 6873 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)=NULL; }
-    break;
-
-  case 786:
-
-/* Line 1455 of yacc.c  */
-#line 6878 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyval.charset)= mysqld_collation_get_by_name((yyvsp[(1) - (1)].lex_str).str)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 787:
-
-/* Line 1455 of yacc.c  */
-#line 6885 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)=NULL; }
-    break;
-
-  case 788:
-
-/* Line 1455 of yacc.c  */
-#line 6886 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)=(yyvsp[(2) - (2)].charset); }
-    break;
-
-  case 789:
-
-/* Line 1455 of yacc.c  */
-#line 6890 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)=(yyvsp[(1) - (1)].charset); }
-    break;
-
-  case 790:
-
-/* Line 1455 of yacc.c  */
-#line 6891 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.charset)=NULL; }
-    break;
-
-  case 791:
-
-/* Line 1455 of yacc.c  */
-#line 6895 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 792:
-
-/* Line 1455 of yacc.c  */
-#line 6896 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 793:
-
-/* Line 1455 of yacc.c  */
-#line 6901 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->charset= &my_charset_latin1; }
-    break;
-
-  case 794:
-
-/* Line 1455 of yacc.c  */
-#line 6903 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset= &my_charset_latin1_bin;
-          }
-    break;
-
-  case 795:
-
-/* Line 1455 of yacc.c  */
-#line 6907 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset= &my_charset_latin1_bin;
-          }
-    break;
-
-  case 796:
-
-/* Line 1455 of yacc.c  */
-#line 6914 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!(Lex->charset=get_charset_by_csname("ucs2",
-                                                     MY_CS_PRIMARY,MYF(0))))
-            {
-              my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 797:
-
-/* Line 1455 of yacc.c  */
-#line 6923 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!(Lex->charset= mysqld_collation_get_by_name("ucs2_bin")))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 798:
-
-/* Line 1455 of yacc.c  */
-#line 6928 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!(Lex->charset= mysqld_collation_get_by_name("ucs2_bin")))
-              my_error(ER_UNKNOWN_COLLATION, MYF(0), "ucs2_bin");
-          }
-    break;
-
-  case 799:
-
-/* Line 1455 of yacc.c  */
-#line 6935 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->charset=NULL; }
-    break;
-
-  case 802:
-
-/* Line 1455 of yacc.c  */
-#line 6938 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->charset=&my_charset_bin; }
-    break;
-
-  case 803:
-
-/* Line 1455 of yacc.c  */
-#line 6939 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->charset=(yyvsp[(2) - (3)].charset); }
-    break;
-
-  case 804:
-
-/* Line 1455 of yacc.c  */
-#line 6941 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset= NULL;
-            Lex->type|= BINCMP_FLAG;
-          }
-    break;
-
-  case 805:
-
-/* Line 1455 of yacc.c  */
-#line 6946 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->charset= (yyvsp[(3) - (3)].charset);
-            Lex->type|= BINCMP_FLAG;
-          }
-    break;
-
-  case 806:
-
-/* Line 1455 of yacc.c  */
-#line 6953 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 807:
-
-/* Line 1455 of yacc.c  */
-#line 6954 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= BINCMP_FLAG; }
-    break;
-
-  case 808:
-
-/* Line 1455 of yacc.c  */
-#line 6959 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          if ((yyvsp[(2) - (2)].ulong_num) == 0)
-          {
-            my_parse_error(ER(ER_SYNTAX_ERROR));
-            MYSQL_YYABORT;
-          }
-        }
-    break;
-
-  case 809:
-
-/* Line 1455 of yacc.c  */
-#line 6967 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (yyvsp[(2) - (4)].ulong_num); }
-    break;
-
-  case 810:
-
-/* Line 1455 of yacc.c  */
-#line 6971 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= 0; }
-    break;
-
-  case 811:
-
-/* Line 1455 of yacc.c  */
-#line 6972 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= 1 << MY_STRXFRM_DESC_SHIFT; }
-    break;
-
-  case 812:
-
-/* Line 1455 of yacc.c  */
-#line 6976 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= 1 << MY_STRXFRM_REVERSE_SHIFT; }
-    break;
-
-  case 813:
-
-/* Line 1455 of yacc.c  */
-#line 6979 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= 0; }
-    break;
-
-  case 814:
-
-/* Line 1455 of yacc.c  */
-#line 6980 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num); }
-    break;
-
-  case 815:
-
-/* Line 1455 of yacc.c  */
-#line 6981 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (yyvsp[(1) - (2)].ulong_num) | (yyvsp[(2) - (2)].ulong_num); }
-    break;
-
-  case 816:
-
-/* Line 1455 of yacc.c  */
-#line 6982 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num) ; }
-    break;
-
-  case 817:
-
-/* Line 1455 of yacc.c  */
-#line 6987 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num) < 1 ? 1 : ((yyvsp[(1) - (1)].ulong_num) > MY_STRXFRM_NLEVELS ? MY_STRXFRM_NLEVELS : (yyvsp[(1) - (1)].ulong_num));
-          (yyval.ulong_num)--;
-        }
-    break;
-
-  case 818:
-
-/* Line 1455 of yacc.c  */
-#line 6995 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          (yyval.ulong_num)= (1 | (yyvsp[(2) - (2)].ulong_num)) << (yyvsp[(1) - (2)].ulong_num);
-        }
-    break;
-
-  case 819:
-
-/* Line 1455 of yacc.c  */
-#line 7001 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num); }
-    break;
-
-  case 820:
-
-/* Line 1455 of yacc.c  */
-#line 7002 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)|= (yyvsp[(3) - (3)].ulong_num); }
-    break;
-
-  case 821:
-
-/* Line 1455 of yacc.c  */
-#line 7007 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          uint start= (yyvsp[(1) - (3)].ulong_num);
-          uint end= (yyvsp[(3) - (3)].ulong_num);
-          for ((yyval.ulong_num)= 0; start <= end; start++)
-            (yyval.ulong_num)|= (1 << start);
-        }
-    break;
-
-  case 822:
-
-/* Line 1455 of yacc.c  */
-#line 7016 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num); }
-    break;
-
-  case 823:
-
-/* Line 1455 of yacc.c  */
-#line 7017 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num); }
-    break;
-
-  case 824:
-
-/* Line 1455 of yacc.c  */
-#line 7021 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= 0; }
-    break;
-
-  case 825:
-
-/* Line 1455 of yacc.c  */
-#line 7022 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (yyvsp[(2) - (2)].ulong_num); }
-    break;
-
-  case 828:
-
-/* Line 1455 of yacc.c  */
-#line 7036 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.table)=(yyvsp[(2) - (5)].table);
-          }
-    break;
-
-  case 829:
-
-/* Line 1455 of yacc.c  */
-#line 7043 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->ref_list.empty(); }
-    break;
-
-  case 831:
-
-/* Line 1455 of yacc.c  */
-#line 7049 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Key_part_spec *key= new Key_part_spec((yyvsp[(3) - (3)].lex_str), 0);
-            if (key == NULL)
-              MYSQL_YYABORT;
-            Lex->ref_list.push_back(key);
-          }
-    break;
-
-  case 832:
-
-/* Line 1455 of yacc.c  */
-#line 7056 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Key_part_spec *key= new Key_part_spec((yyvsp[(1) - (1)].lex_str), 0);
-            if (key == NULL)
-              MYSQL_YYABORT;
-            LEX *lex= Lex;
-            lex->ref_list.empty();
-            lex->ref_list.push_back(key);
-          }
-    break;
-
-  case 833:
-
-/* Line 1455 of yacc.c  */
-#line 7068 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->fk_match_option= Foreign_key::FK_MATCH_UNDEF; }
-    break;
-
-  case 834:
-
-/* Line 1455 of yacc.c  */
-#line 7070 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->fk_match_option= Foreign_key::FK_MATCH_FULL; }
-    break;
-
-  case 835:
-
-/* Line 1455 of yacc.c  */
-#line 7072 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->fk_match_option= Foreign_key::FK_MATCH_PARTIAL; }
-    break;
-
-  case 836:
-
-/* Line 1455 of yacc.c  */
-#line 7074 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->fk_match_option= Foreign_key::FK_MATCH_SIMPLE; }
-    break;
-
-  case 837:
-
-/* Line 1455 of yacc.c  */
-#line 7079 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->fk_update_opt= Foreign_key::FK_OPTION_UNDEF;
-            lex->fk_delete_opt= Foreign_key::FK_OPTION_UNDEF;
-          }
-    break;
-
-  case 838:
-
-/* Line 1455 of yacc.c  */
-#line 7085 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->fk_update_opt= (yyvsp[(3) - (3)].m_fk_option);
-            lex->fk_delete_opt= Foreign_key::FK_OPTION_UNDEF;
-          }
-    break;
-
-  case 839:
-
-/* Line 1455 of yacc.c  */
-#line 7091 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->fk_update_opt= Foreign_key::FK_OPTION_UNDEF;
-            lex->fk_delete_opt= (yyvsp[(3) - (3)].m_fk_option);
-          }
-    break;
-
-  case 840:
-
-/* Line 1455 of yacc.c  */
-#line 7098 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->fk_update_opt= (yyvsp[(3) - (6)].m_fk_option);
-            lex->fk_delete_opt= (yyvsp[(6) - (6)].m_fk_option);
-          }
-    break;
-
-  case 841:
-
-/* Line 1455 of yacc.c  */
-#line 7105 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->fk_update_opt= (yyvsp[(6) - (6)].m_fk_option);
-            lex->fk_delete_opt= (yyvsp[(3) - (6)].m_fk_option);
-          }
-    break;
-
-  case 842:
-
-/* Line 1455 of yacc.c  */
-#line 7113 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_fk_option)= Foreign_key::FK_OPTION_RESTRICT; }
-    break;
-
-  case 843:
-
-/* Line 1455 of yacc.c  */
-#line 7114 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_fk_option)= Foreign_key::FK_OPTION_CASCADE; }
-    break;
-
-  case 844:
-
-/* Line 1455 of yacc.c  */
-#line 7115 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_fk_option)= Foreign_key::FK_OPTION_SET_NULL; }
-    break;
-
-  case 845:
-
-/* Line 1455 of yacc.c  */
-#line 7116 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_fk_option)= Foreign_key::FK_OPTION_NO_ACTION; }
-    break;
-
-  case 846:
-
-/* Line 1455 of yacc.c  */
-#line 7117 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_fk_option)= Foreign_key::FK_OPTION_DEFAULT;  }
-    break;
-
-  case 847:
-
-/* Line 1455 of yacc.c  */
-#line 7121 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.key_type)= Key::MULTIPLE; }
-    break;
-
-  case 848:
-
-/* Line 1455 of yacc.c  */
-#line 7125 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.key_type)= Key::PRIMARY; }
-    break;
-
-  case 849:
-
-/* Line 1455 of yacc.c  */
-#line 7126 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.key_type)= Key::UNIQUE; }
-    break;
-
-  case 850:
-
-/* Line 1455 of yacc.c  */
-#line 7130 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 851:
-
-/* Line 1455 of yacc.c  */
-#line 7131 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 852:
-
-/* Line 1455 of yacc.c  */
-#line 7135 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 854:
-
-/* Line 1455 of yacc.c  */
-#line 7140 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 855:
-
-/* Line 1455 of yacc.c  */
-#line 7141 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 856:
-
-/* Line 1455 of yacc.c  */
-#line 7142 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 857:
-
-/* Line 1455 of yacc.c  */
-#line 7146 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.key_type)= Key::MULTIPLE; }
-    break;
-
-  case 858:
-
-/* Line 1455 of yacc.c  */
-#line 7147 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.key_type)= Key::UNIQUE; }
-    break;
-
-  case 859:
-
-/* Line 1455 of yacc.c  */
-#line 7151 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.key_type)= Key::FULLTEXT;}
-    break;
-
-  case 860:
-
-/* Line 1455 of yacc.c  */
-#line 7156 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-#ifdef HAVE_SPATIAL
-            (yyval.key_type)= Key::SPATIAL;
-#else
-            my_error(ER_FEATURE_DISABLED, MYF(0),
-                     sym_group_geom.name, sym_group_geom.needed_define);
-            MYSQL_YYABORT;
-#endif
-          }
-    break;
-
-  case 861:
-
-/* Line 1455 of yacc.c  */
-#line 7168 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->key_create_info= default_key_create_info;
-          }
-    break;
-
-  case 864:
-
-/* Line 1455 of yacc.c  */
-#line 7185 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 866:
-
-/* Line 1455 of yacc.c  */
-#line 7190 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 868:
-
-/* Line 1455 of yacc.c  */
-#line 7195 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 876:
-
-/* Line 1455 of yacc.c  */
-#line 7215 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->key_create_info.algorithm= (yyvsp[(2) - (2)].key_alg); }
-    break;
-
-  case 877:
-
-/* Line 1455 of yacc.c  */
-#line 7216 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->key_create_info.algorithm= (yyvsp[(2) - (2)].key_alg); }
-    break;
-
-  case 878:
-
-/* Line 1455 of yacc.c  */
-#line 7221 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->key_create_info.block_size= (yyvsp[(3) - (3)].ulong_num); }
-    break;
-
-  case 879:
-
-/* Line 1455 of yacc.c  */
-#line 7222 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->key_create_info.comment= (yyvsp[(2) - (2)].lex_str); }
-    break;
-
-  case 884:
-
-/* Line 1455 of yacc.c  */
-#line 7237 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (plugin_is_ready(&(yyvsp[(3) - (3)].lex_str), MYSQL_FTPARSER_PLUGIN))
-              Lex->key_create_info.parser_name= (yyvsp[(3) - (3)].lex_str);
-            else
-            {
-              my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), (yyvsp[(3) - (3)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 885:
-
-/* Line 1455 of yacc.c  */
-#line 7249 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.key_alg)= HA_KEY_ALG_BTREE; }
-    break;
-
-  case 886:
-
-/* Line 1455 of yacc.c  */
-#line 7250 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.key_alg)= HA_KEY_ALG_RTREE; }
-    break;
-
-  case 887:
-
-/* Line 1455 of yacc.c  */
-#line 7251 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.key_alg)= HA_KEY_ALG_HASH; }
-    break;
-
-  case 888:
-
-/* Line 1455 of yacc.c  */
-#line 7255 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->col_list.push_back((yyvsp[(3) - (4)].key_part)); }
-    break;
-
-  case 889:
-
-/* Line 1455 of yacc.c  */
-#line 7256 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->col_list.push_back((yyvsp[(1) - (2)].key_part)); }
-    break;
-
-  case 890:
-
-/* Line 1455 of yacc.c  */
-#line 7261 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.key_part)= new Key_part_spec((yyvsp[(1) - (1)].lex_str), 0);
-            if ((yyval.key_part) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 891:
-
-/* Line 1455 of yacc.c  */
-#line 7267 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            int key_part_len= atoi((yyvsp[(3) - (4)].lex_str).str);
-            if (!key_part_len)
-            {
-              my_error(ER_KEY_PART_0, MYF(0), (yyvsp[(1) - (4)].lex_str).str);
-            }
-            (yyval.key_part)= new Key_part_spec((yyvsp[(1) - (4)].lex_str), (uint) key_part_len);
-            if ((yyval.key_part) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 892:
-
-/* Line 1455 of yacc.c  */
-#line 7280 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= null_lex_str; }
-    break;
-
-  case 893:
-
-/* Line 1455 of yacc.c  */
-#line 7281 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 894:
-
-/* Line 1455 of yacc.c  */
-#line 7285 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= null_lex_str; }
-    break;
-
-  case 895:
-
-/* Line 1455 of yacc.c  */
-#line 7286 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= (yyvsp[(2) - (2)].lex_str); }
-    break;
-
-  case 896:
-
-/* Line 1455 of yacc.c  */
-#line 7290 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->interval_list.push_back((yyvsp[(1) - (1)].string)); }
-    break;
-
-  case 897:
-
-/* Line 1455 of yacc.c  */
-#line 7291 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->interval_list.push_back((yyvsp[(3) - (3)].string)); }
-    break;
-
-  case 898:
-
-/* Line 1455 of yacc.c  */
-#line 7299 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->name.str= 0;
-            lex->name.length= 0;
-            lex->sql_command= SQLCOM_ALTER_TABLE;
-            lex->duplicates= DUP_ERROR; 
-            if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(4) - (4)].table), NULL,
-                                                   TL_OPTION_UPDATING,
-                                                   TL_READ_NO_INSERT,
-                                                   MDL_SHARED_UPGRADABLE))
-              MYSQL_YYABORT;
-            lex->col_list.empty();
-            lex->select_lex.init_order();
-            lex->select_lex.db= (lex->select_lex.table_list.first)->db;
-            memset(&lex->create_info, 0, sizeof(lex->create_info));
-            lex->create_info.db_type= 0;
-            lex->create_info.default_table_charset= NULL;
-            lex->create_info.row_type= ROW_TYPE_NOT_USED;
-            lex->alter_info.reset();
-            lex->no_write_to_binlog= 0;
-            lex->create_info.storage_media= HA_SM_DEFAULT;
-            lex->create_last_non_select_table= lex->last_table();
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            if (lex->ignore)
-            {
-              push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN,
-                                  ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
-                                  ER(ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT),
-                                  "IGNORE");
-            }
-          }
-    break;
-
-  case 899:
-
-/* Line 1455 of yacc.c  */
-#line 7332 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            if (!lex->m_sql_cmd)
-            {
-              /* Create a generic ALTER TABLE statment. */
-              lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_alter_table();
-              if (lex->m_sql_cmd == NULL)
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 900:
-
-/* Line 1455 of yacc.c  */
-#line 7344 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_info.default_table_charset= NULL;
-            Lex->create_info.used_fields= 0;
-          }
-    break;
-
-  case 901:
-
-/* Line 1455 of yacc.c  */
-#line 7349 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command=SQLCOM_ALTER_DB;
-            lex->name= (yyvsp[(3) - (5)].lex_str);
-            if (lex->name.str == NULL &&
-                lex->copy_db_to(&lex->name.str, &lex->name.length))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 902:
-
-/* Line 1455 of yacc.c  */
-#line 7358 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_DROP_SP, MYF(0), "DATABASE");
-              MYSQL_YYABORT;
-            }
-            lex->sql_command= SQLCOM_ALTER_DB_UPGRADE;
-            lex->name= (yyvsp[(3) - (7)].lex_str);
-          }
-    break;
-
-  case 903:
-
-/* Line 1455 of yacc.c  */
-#line 7369 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
-              MYSQL_YYABORT;
-            }
-            memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
-          }
-    break;
-
-  case 904:
-
-/* Line 1455 of yacc.c  */
-#line 7380 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-
-            lex->sql_command= SQLCOM_ALTER_PROCEDURE;
-            lex->spname= (yyvsp[(3) - (5)].spname);
-          }
-    break;
-
-  case 905:
-
-/* Line 1455 of yacc.c  */
-#line 7387 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
-              MYSQL_YYABORT;
-            }
-            memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
-          }
-    break;
-
-  case 906:
-
-/* Line 1455 of yacc.c  */
-#line 7398 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-
-            lex->sql_command= SQLCOM_ALTER_FUNCTION;
-            lex->spname= (yyvsp[(3) - (5)].spname);
-          }
-    break;
-
-  case 907:
-
-/* Line 1455 of yacc.c  */
-#line 7405 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW");
-              MYSQL_YYABORT;
-            }
-            lex->create_view_mode= VIEW_ALTER;
-          }
-    break;
-
-  case 908:
-
-/* Line 1455 of yacc.c  */
-#line 7416 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 909:
-
-/* Line 1455 of yacc.c  */
-#line 7423 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW");
-              MYSQL_YYABORT;
-            }
-            lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
-            lex->create_view_mode= VIEW_ALTER;
-          }
-    break;
-
-  case 910:
-
-/* Line 1455 of yacc.c  */
-#line 7435 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 911:
-
-/* Line 1455 of yacc.c  */
-#line 7437 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* 
-              It is safe to use Lex->spname because
-              ALTER EVENT xxx RENATE TO yyy DO ALTER EVENT RENAME TO
-              is not allowed. Lex->spname is used in the case of RENAME TO
-              If it had to be supported spname had to be added to
-              Event_parse_data.
-            */
-
-            if (!(Lex->event_parse_data= Event_parse_data::new_instance(YYTHD)))
-              MYSQL_YYABORT;
-            Lex->event_parse_data->identifier= (yyvsp[(4) - (4)].spname);
-
-            Lex->sql_command= SQLCOM_ALTER_EVENT;
-          }
-    break;
-
-  case 912:
-
-/* Line 1455 of yacc.c  */
-#line 7457 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyvsp[(6) - (10)].num) || (yyvsp[(7) - (10)].num) || (yyvsp[(8) - (10)].num) || (yyvsp[(9) - (10)].num) || (yyvsp[(10) - (10)].num)))
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            /*
-              sql_command is set here because some rules in ev_sql_stmt
-              can overwrite it
-            */
-            Lex->sql_command= SQLCOM_ALTER_EVENT;
-          }
-    break;
-
-  case 913:
-
-/* Line 1455 of yacc.c  */
-#line 7470 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->ts_cmd_type= ALTER_TABLESPACE;
-          }
-    break;
-
-  case 914:
-
-/* Line 1455 of yacc.c  */
-#line 7475 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->ts_cmd_type= ALTER_LOGFILE_GROUP;
-          }
-    break;
-
-  case 915:
-
-/* Line 1455 of yacc.c  */
-#line 7480 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->ts_cmd_type= CHANGE_FILE_TABLESPACE;
-          }
-    break;
-
-  case 916:
-
-/* Line 1455 of yacc.c  */
-#line 7485 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->ts_cmd_type= ALTER_ACCESS_MODE_TABLESPACE;
-          }
-    break;
-
-  case 917:
-
-/* Line 1455 of yacc.c  */
-#line 7490 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_ALTER_SERVER;
-            lex->server_options.server_name= (yyvsp[(3) - (7)].lex_str).str;
-            lex->server_options.server_name_length= (yyvsp[(3) - (7)].lex_str).length;
-          }
-    break;
-
-  case 918:
-
-/* Line 1455 of yacc.c  */
-#line 7497 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command= SQLCOM_ALTER_USER;
-          }
-    break;
-
-  case 919:
-
-/* Line 1455 of yacc.c  */
-#line 7504 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->users_list.push_back((yyvsp[(1) - (3)].lex_user)))
-              MYSQL_YYABORT;
-        }
-    break;
-
-  case 920:
-
-/* Line 1455 of yacc.c  */
-#line 7509 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->users_list.push_back((yyvsp[(3) - (5)].lex_user)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 921:
-
-/* Line 1455 of yacc.c  */
-#line 7516 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0;}
-    break;
-
-  case 922:
-
-/* Line 1455 of yacc.c  */
-#line 7517 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 923:
-
-/* Line 1455 of yacc.c  */
-#line 7518 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 924:
-
-/* Line 1455 of yacc.c  */
-#line 7519 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 925:
-
-/* Line 1455 of yacc.c  */
-#line 7523 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0;}
-    break;
-
-  case 926:
-
-/* Line 1455 of yacc.c  */
-#line 7525 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              Use lex's spname to hold the new name.
-              The original name is in the Event_parse_data object
-            */
-            Lex->spname= (yyvsp[(3) - (3)].spname); 
-            (yyval.num)= 1;
-          }
-    break;
-
-  case 927:
-
-/* Line 1455 of yacc.c  */
-#line 7536 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0;}
-    break;
-
-  case 928:
-
-/* Line 1455 of yacc.c  */
-#line 7537 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 929:
-
-/* Line 1455 of yacc.c  */
-#line 7541 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str).str= 0; (yyval.lex_str).length= 0; }
-    break;
-
-  case 930:
-
-/* Line 1455 of yacc.c  */
-#line 7542 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 932:
-
-/* Line 1455 of yacc.c  */
-#line 7548 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->m_sql_cmd= new (YYTHD->mem_root)
-              Sql_cmd_discard_import_tablespace(
-                Sql_cmd_discard_import_tablespace::DISCARD_TABLESPACE);
-            if (Lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 933:
-
-/* Line 1455 of yacc.c  */
-#line 7556 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->m_sql_cmd= new (YYTHD->mem_root)
-              Sql_cmd_discard_import_tablespace(
-                Sql_cmd_discard_import_tablespace::IMPORT_TABLESPACE);
-            if (Lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 939:
-
-/* Line 1455 of yacc.c  */
-#line 7578 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.flags|= Alter_info::ALTER_DROP_PARTITION;
-          }
-    break;
-
-  case 940:
-
-/* Line 1455 of yacc.c  */
-#line 7583 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_info.flags|= Alter_info::ALTER_REBUILD_PARTITION;
-            lex->no_write_to_binlog= (yyvsp[(3) - (4)].num);
-          }
-    break;
-
-  case 941:
-
-/* Line 1455 of yacc.c  */
-#line 7590 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->no_write_to_binlog= (yyvsp[(3) - (4)].num);
-            lex->check_opt.init();
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root)
-                              Sql_cmd_alter_table_optimize_partition();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 943:
-
-/* Line 1455 of yacc.c  */
-#line 7604 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->no_write_to_binlog= (yyvsp[(3) - (4)].num);
-            lex->check_opt.init();
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root)
-                              Sql_cmd_alter_table_analyze_partition();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 944:
-
-/* Line 1455 of yacc.c  */
-#line 7616 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->check_opt.init();
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root)
-                              Sql_cmd_alter_table_check_partition();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 946:
-
-/* Line 1455 of yacc.c  */
-#line 7629 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->no_write_to_binlog= (yyvsp[(3) - (4)].num);
-            lex->check_opt.init();
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root)
-                              Sql_cmd_alter_table_repair_partition();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 948:
-
-/* Line 1455 of yacc.c  */
-#line 7642 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_info.flags|= Alter_info::ALTER_COALESCE_PARTITION;
-            lex->no_write_to_binlog= (yyvsp[(3) - (4)].num);
-            lex->alter_info.num_parts= (yyvsp[(4) - (4)].ulong_num);
-          }
-    break;
-
-  case 949:
-
-/* Line 1455 of yacc.c  */
-#line 7649 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->check_opt.init();
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root)
-                              Sql_cmd_alter_table_truncate_partition();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 951:
-
-/* Line 1455 of yacc.c  */
-#line 7662 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            size_t dummy;
-            lex->select_lex.db=(yyvsp[(6) - (7)].table)->db.str;
-            if (lex->select_lex.db == NULL &&
-                lex->copy_db_to(&lex->select_lex.db, &dummy))
-            {
-              MYSQL_YYABORT;
-            }
-            lex->name= (yyvsp[(6) - (7)].table)->table;
-            lex->alter_info.flags|= Alter_info::ALTER_EXCHANGE_PARTITION;
-            if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(6) - (7)].table), NULL,
-                                                   TL_OPTION_UPDATING,
-                                                   TL_READ_NO_INSERT,
-                                                   MDL_SHARED_NO_WRITE))
-              MYSQL_YYABORT;
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root)
-                               Sql_cmd_alter_table_exchange_partition();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 952:
-
-/* Line 1455 of yacc.c  */
-#line 7689 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.flags|= Alter_info::ALTER_REMOVE_PARTITIONING;
-          }
-    break;
-
-  case 953:
-
-/* Line 1455 of yacc.c  */
-#line 7696 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.flags|= Alter_info::ALTER_ALL_PARTITION;
-          }
-    break;
-
-  case 955:
-
-/* Line 1455 of yacc.c  */
-#line 7704 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->part_info= new partition_info();
-            if (!lex->part_info)
-            {
-              mem_alloc_error(sizeof(partition_info));
-              MYSQL_YYABORT;
-            }
-            lex->alter_info.flags|= Alter_info::ALTER_ADD_PARTITION;
-            lex->no_write_to_binlog= (yyvsp[(3) - (3)].num);
-          }
-    break;
-
-  case 956:
-
-/* Line 1455 of yacc.c  */
-#line 7716 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 958:
-
-/* Line 1455 of yacc.c  */
-#line 7722 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->part_info->num_parts= lex->part_info->partitions.elements;
-          }
-    break;
-
-  case 959:
-
-/* Line 1455 of yacc.c  */
-#line 7727 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->part_info->num_parts= (yyvsp[(2) - (2)].ulong_num);
-          }
-    break;
-
-  case 960:
-
-/* Line 1455 of yacc.c  */
-#line 7734 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->part_info= new partition_info();
-            if (!lex->part_info)
-            {
-              mem_alloc_error(sizeof(partition_info));
-              MYSQL_YYABORT;
-            }
-            lex->no_write_to_binlog= (yyvsp[(3) - (3)].num);
-          }
-    break;
-
-  case 962:
-
-/* Line 1455 of yacc.c  */
-#line 7749 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.flags|= Alter_info::ALTER_TABLE_REORG;
-          }
-    break;
-
-  case 963:
-
-/* Line 1455 of yacc.c  */
-#line 7753 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.flags|= Alter_info::ALTER_REORGANIZE_PARTITION;
-          }
-    break;
-
-  case 964:
-
-/* Line 1455 of yacc.c  */
-#line 7757 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            partition_info *part_info= Lex->part_info;
-            part_info->num_parts= part_info->partitions.elements;
-          }
-    break;
-
-  case 965:
-
-/* Line 1455 of yacc.c  */
-#line 7764 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 966:
-
-/* Line 1455 of yacc.c  */
-#line 7765 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 967:
-
-/* Line 1455 of yacc.c  */
-#line 7770 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->alter_info.partition_names.push_back((yyvsp[(1) - (1)].lex_str).str))
-            {
-              mem_alloc_error(1);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 970:
-
-/* Line 1455 of yacc.c  */
-#line 7790 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->change=0;
-            lex->alter_info.flags|= Alter_info::ALTER_ADD_COLUMN;
-          }
-    break;
-
-  case 971:
-
-/* Line 1455 of yacc.c  */
-#line 7799 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_last_non_select_table= Lex->last_table();
-          }
-    break;
-
-  case 972:
-
-/* Line 1455 of yacc.c  */
-#line 7803 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_last_non_select_table= Lex->last_table();
-            Lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX;
-          }
-    break;
-
-  case 973:
-
-/* Line 1455 of yacc.c  */
-#line 7808 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.flags|= Alter_info::ALTER_ADD_COLUMN |
-                                    Alter_info::ALTER_ADD_INDEX;
-          }
-    break;
-
-  case 974:
-
-/* Line 1455 of yacc.c  */
-#line 7813 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->change= (yyvsp[(3) - (3)].lex_str).str;
-            lex->alter_info.flags|= Alter_info::ALTER_CHANGE_COLUMN;
-          }
-    break;
-
-  case 975:
-
-/* Line 1455 of yacc.c  */
-#line 7819 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_last_non_select_table= Lex->last_table();
-          }
-    break;
-
-  case 976:
-
-/* Line 1455 of yacc.c  */
-#line 7823 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->length=lex->dec=0; lex->type=0;
-            lex->default_value= lex->on_update_value= 0;
-            lex->comment=null_lex_str;
-            lex->charset= NULL;
-            lex->alter_info.flags|= Alter_info::ALTER_CHANGE_COLUMN;
-          }
-    break;
-
-  case 977:
-
-/* Line 1455 of yacc.c  */
-#line 7832 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (add_field_to_list(lex->thd,&(yyvsp[(3) - (6)].lex_str),
-                                  (enum enum_field_types) (yyvsp[(5) - (6)].num),
-                                  lex->length,lex->dec,lex->type,
-                                  lex->default_value, lex->on_update_value,
-                                  &lex->comment,
-                                  (yyvsp[(3) - (6)].lex_str).str, &lex->interval_list, lex->charset,
-                                  lex->uint_geom_type))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 978:
-
-/* Line 1455 of yacc.c  */
-#line 7844 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->create_last_non_select_table= Lex->last_table();
-          }
-    break;
-
-  case 979:
-
-/* Line 1455 of yacc.c  */
-#line 7848 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            Alter_drop *ad= new Alter_drop(Alter_drop::COLUMN, (yyvsp[(3) - (4)].lex_str).str);
-            if (ad == NULL)
-              MYSQL_YYABORT;
-            lex->alter_info.drop_list.push_back(ad);
-            lex->alter_info.flags|= Alter_info::ALTER_DROP_COLUMN;
-          }
-    break;
-
-  case 980:
-
-/* Line 1455 of yacc.c  */
-#line 7857 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            Alter_drop *ad= new Alter_drop(Alter_drop::FOREIGN_KEY, (yyvsp[(4) - (4)].lex_str).str);
-            if (ad == NULL)
-              MYSQL_YYABORT;
-            lex->alter_info.drop_list.push_back(ad);
-            lex->alter_info.flags|= Alter_info::DROP_FOREIGN_KEY;
-          }
-    break;
-
-  case 981:
-
-/* Line 1455 of yacc.c  */
-#line 7866 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            Alter_drop *ad= new Alter_drop(Alter_drop::KEY, primary_key_name);
-            if (ad == NULL)
-              MYSQL_YYABORT;
-            lex->alter_info.drop_list.push_back(ad);
-            lex->alter_info.flags|= Alter_info::ALTER_DROP_INDEX;
-          }
-    break;
-
-  case 982:
-
-/* Line 1455 of yacc.c  */
-#line 7875 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            Alter_drop *ad= new Alter_drop(Alter_drop::KEY, (yyvsp[(3) - (3)].lex_str).str);
-            if (ad == NULL)
-              MYSQL_YYABORT;
-            lex->alter_info.drop_list.push_back(ad);
-            lex->alter_info.flags|= Alter_info::ALTER_DROP_INDEX;
-          }
-    break;
-
-  case 983:
-
-/* Line 1455 of yacc.c  */
-#line 7884 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->alter_info.keys_onoff= Alter_info::DISABLE;
-            lex->alter_info.flags|= Alter_info::ALTER_KEYS_ONOFF;
-          }
-    break;
-
-  case 984:
-
-/* Line 1455 of yacc.c  */
-#line 7890 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->alter_info.keys_onoff= Alter_info::ENABLE;
-            lex->alter_info.flags|= Alter_info::ALTER_KEYS_ONOFF;
-          }
-    break;
-
-  case 985:
-
-/* Line 1455 of yacc.c  */
-#line 7896 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            Alter_column *ac= new Alter_column((yyvsp[(3) - (6)].lex_str).str,(yyvsp[(6) - (6)].item));
-            if (ac == NULL)
-              MYSQL_YYABORT;
-            lex->alter_info.alter_list.push_back(ac);
-            lex->alter_info.flags|= Alter_info::ALTER_CHANGE_COLUMN_DEFAULT;
-          }
-    break;
-
-  case 986:
-
-/* Line 1455 of yacc.c  */
-#line 7905 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            Alter_column *ac= new Alter_column((yyvsp[(3) - (5)].lex_str).str, (Item*) 0);
-            if (ac == NULL)
-              MYSQL_YYABORT;
-            lex->alter_info.alter_list.push_back(ac);
-            lex->alter_info.flags|= Alter_info::ALTER_CHANGE_COLUMN_DEFAULT;
-          }
-    break;
-
-  case 987:
-
-/* Line 1455 of yacc.c  */
-#line 7914 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            size_t dummy;
-            lex->select_lex.db=(yyvsp[(3) - (3)].table)->db.str;
-            if (lex->select_lex.db == NULL &&
-                lex->copy_db_to(&lex->select_lex.db, &dummy))
-            {
-              MYSQL_YYABORT;
-            }
-            enum_ident_name_check ident_check_status=
-              check_table_name((yyvsp[(3) - (3)].table)->table.str,(yyvsp[(3) - (3)].table)->table.length, FALSE);
-            if (ident_check_status == IDENT_NAME_WRONG)
-            {
-              my_error(ER_WRONG_TABLE_NAME, MYF(0), (yyvsp[(3) - (3)].table)->table.str);
-              MYSQL_YYABORT;
-            }
-            else if (ident_check_status == IDENT_NAME_TOO_LONG)
-            {
-              my_error(ER_TOO_LONG_IDENT, MYF(0), (yyvsp[(3) - (3)].table)->table.str);
-              MYSQL_YYABORT;
-            }
-            if ((yyvsp[(3) - (3)].table)->db.str &&
-                (check_and_convert_db_name(&(yyvsp[(3) - (3)].table)->db, FALSE) != IDENT_NAME_OK))
-              MYSQL_YYABORT;
-            lex->name= (yyvsp[(3) - (3)].table)->table;
-            lex->alter_info.flags|= Alter_info::ALTER_RENAME;
-          }
-    break;
-
-  case 988:
-
-/* Line 1455 of yacc.c  */
-#line 7942 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!(yyvsp[(4) - (5)].charset))
-            {
-              THD *thd= YYTHD;
-              (yyvsp[(4) - (5)].charset)= thd->variables.collation_database;
-            }
-            (yyvsp[(5) - (5)].charset)= (yyvsp[(5) - (5)].charset) ? (yyvsp[(5) - (5)].charset) : (yyvsp[(4) - (5)].charset);
-            if (!my_charset_same((yyvsp[(4) - (5)].charset),(yyvsp[(5) - (5)].charset)))
-            {
-              my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
-                       (yyvsp[(5) - (5)].charset)->name, (yyvsp[(4) - (5)].charset)->csname);
-              MYSQL_YYABORT;
-            }
-            LEX *lex= Lex;
-            lex->create_info.table_charset=
-            lex->create_info.default_table_charset= (yyvsp[(5) - (5)].charset);
-            lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
-              HA_CREATE_USED_DEFAULT_CHARSET);
-            lex->alter_info.flags|= Alter_info::ALTER_CONVERT;
-          }
-    break;
-
-  case 989:
-
-/* Line 1455 of yacc.c  */
-#line 7963 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->alter_info.flags|= Alter_info::ALTER_OPTIONS;
-            if ((lex->create_info.used_fields & HA_CREATE_USED_ENGINE) &&
-                !lex->create_info.db_type)
-            {
-              lex->create_info.used_fields&= ~HA_CREATE_USED_ENGINE;
-            }
-          }
-    break;
-
-  case 990:
-
-/* Line 1455 of yacc.c  */
-#line 7973 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.flags|= Alter_info::ALTER_RECREATE;
-          }
-    break;
-
-  case 991:
-
-/* Line 1455 of yacc.c  */
-#line 7977 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->alter_info.flags|= Alter_info::ALTER_ORDER;
-          }
-    break;
-
-  case 999:
-
-/* Line 1455 of yacc.c  */
-#line 7994 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.requested_algorithm=
-              Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT;
-          }
-    break;
-
-  case 1000:
-
-/* Line 1455 of yacc.c  */
-#line 7999 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->alter_info.set_requested_algorithm(&(yyvsp[(3) - (3)].lex_str)))
-            {
-              my_error(ER_UNKNOWN_ALTER_ALGORITHM, MYF(0), (yyvsp[(3) - (3)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1001:
-
-/* Line 1455 of yacc.c  */
-#line 8010 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.requested_lock=
-              Alter_info::ALTER_TABLE_LOCK_DEFAULT;
-          }
-    break;
-
-  case 1002:
-
-/* Line 1455 of yacc.c  */
-#line 8015 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->alter_info.set_requested_lock(&(yyvsp[(3) - (3)].lex_str)))
-            {
-              my_error(ER_UNKNOWN_ALTER_LOCK, MYF(0), (yyvsp[(3) - (3)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1003:
-
-/* Line 1455 of yacc.c  */
-#line 8025 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1004:
-
-/* Line 1455 of yacc.c  */
-#line 8026 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1005:
-
-/* Line 1455 of yacc.c  */
-#line 8030 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->ignore= 0;}
-    break;
-
-  case 1006:
-
-/* Line 1455 of yacc.c  */
-#line 8031 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->ignore= 1;}
-    break;
-
-  case 1007:
-
-/* Line 1455 of yacc.c  */
-#line 8035 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->drop_mode= DROP_DEFAULT; }
-    break;
-
-  case 1008:
-
-/* Line 1455 of yacc.c  */
-#line 8036 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->drop_mode= DROP_RESTRICT; }
-    break;
-
-  case 1009:
-
-/* Line 1455 of yacc.c  */
-#line 8037 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->drop_mode= DROP_CASCADE; }
-    break;
-
-  case 1010:
-
-/* Line 1455 of yacc.c  */
-#line 8041 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1011:
-
-/* Line 1455 of yacc.c  */
-#line 8043 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            store_position_for_column((yyvsp[(2) - (2)].lex_str).str);
-            Lex->alter_info.flags |= Alter_info::ALTER_COLUMN_ORDER;
-          }
-    break;
-
-  case 1012:
-
-/* Line 1455 of yacc.c  */
-#line 8048 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            store_position_for_column(first_keyword);
-            Lex->alter_info.flags |= Alter_info::ALTER_COLUMN_ORDER;
-          }
-    break;
-
-  case 1013:
-
-/* Line 1455 of yacc.c  */
-#line 8055 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1014:
-
-/* Line 1455 of yacc.c  */
-#line 8056 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1015:
-
-/* Line 1455 of yacc.c  */
-#line 8057 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1016:
-
-/* Line 1455 of yacc.c  */
-#line 8058 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1017:
-
-/* Line 1455 of yacc.c  */
-#line 8063 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            /* Clean previous slave connection values */
-            lex->slave_connection.reset();
-            lex->sql_command = SQLCOM_SLAVE_START;
-            lex->type = 0;
-            /* We'll use mi structure for UNTIL options */
-            lex->mi.set_unspecified();
-            lex->slave_thd_opt= (yyvsp[(3) - (3)].num);
-          }
-    break;
-
-  case 1018:
-
-/* Line 1455 of yacc.c  */
-#line 8075 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              It is not possible to set user's information when
-              one is trying to start the SQL Thread.
-            */
-            if ((Lex->slave_thd_opt & SLAVE_SQL) == SLAVE_SQL &&
-                (Lex->slave_thd_opt & SLAVE_IO) != SLAVE_IO &&
-                (Lex->slave_connection.user ||
-                 Lex->slave_connection.password ||
-                 Lex->slave_connection.plugin_auth ||
-                 Lex->slave_connection.plugin_dir))
-            {
-              my_error(ER_SQLTHREAD_WITH_SECURE_SLAVE, MYF(0));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1019:
-
-/* Line 1455 of yacc.c  */
-#line 8092 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command = SQLCOM_SLAVE_STOP;
-            lex->type = 0;
-            lex->slave_thd_opt= (yyvsp[(3) - (3)].num);
-          }
-    break;
-
-  case 1020:
-
-/* Line 1455 of yacc.c  */
-#line 8102 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_BEGIN;
-            /* READ ONLY and READ WRITE are mutually exclusive. */
-            if (((yyvsp[(3) - (3)].num) & MYSQL_START_TRANS_OPT_READ_WRITE) &&
-                ((yyvsp[(3) - (3)].num) & MYSQL_START_TRANS_OPT_READ_ONLY))
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            lex->start_transaction_opt= (yyvsp[(3) - (3)].num);
-          }
-    break;
-
-  case 1021:
-
-/* Line 1455 of yacc.c  */
-#line 8118 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= 0;
-          }
-    break;
-
-  case 1022:
-
-/* Line 1455 of yacc.c  */
-#line 8122 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= (yyvsp[(1) - (1)].num);
-          }
-    break;
-
-  case 1023:
-
-/* Line 1455 of yacc.c  */
-#line 8129 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= (yyvsp[(1) - (1)].num);
-          }
-    break;
-
-  case 1024:
-
-/* Line 1455 of yacc.c  */
-#line 8133 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= (yyvsp[(1) - (3)].num) | (yyvsp[(3) - (3)].num);
-          }
-    break;
-
-  case 1025:
-
-/* Line 1455 of yacc.c  */
-#line 8140 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT;
-          }
-    break;
-
-  case 1026:
-
-/* Line 1455 of yacc.c  */
-#line 8144 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= MYSQL_START_TRANS_OPT_READ_ONLY;
-          }
-    break;
-
-  case 1027:
-
-/* Line 1455 of yacc.c  */
-#line 8148 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= MYSQL_START_TRANS_OPT_READ_WRITE;
-          }
-    break;
-
-  case 1029:
-
-/* Line 1455 of yacc.c  */
-#line 8159 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* empty */
-          }
-    break;
-
-  case 1030:
-
-/* Line 1455 of yacc.c  */
-#line 8163 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->slave_connection.user= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 1031:
-
-/* Line 1455 of yacc.c  */
-#line 8169 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* empty */
-          }
-    break;
-
-  case 1032:
-
-/* Line 1455 of yacc.c  */
-#line 8173 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->slave_connection.password= (yyvsp[(3) - (3)].lex_str).str;
-            Lex->contains_plaintext_password= true;
-          }
-    break;
-
-  case 1033:
-
-/* Line 1455 of yacc.c  */
-#line 8179 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* empty */
-          }
-    break;
-
-  case 1034:
-
-/* Line 1455 of yacc.c  */
-#line 8183 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->slave_connection.plugin_auth= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 1035:
-
-/* Line 1455 of yacc.c  */
-#line 8189 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* empty */
-          }
-    break;
-
-  case 1036:
-
-/* Line 1455 of yacc.c  */
-#line 8193 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->slave_connection.plugin_dir= (yyvsp[(3) - (3)].lex_str).str;
-          }
-    break;
-
-  case 1037:
-
-/* Line 1455 of yacc.c  */
-#line 8200 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= 0;
-          }
-    break;
-
-  case 1038:
-
-/* Line 1455 of yacc.c  */
-#line 8204 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= (yyvsp[(1) - (1)].num);
-          }
-    break;
-
-  case 1039:
-
-/* Line 1455 of yacc.c  */
-#line 8211 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= (yyvsp[(1) - (1)].num);
-          }
-    break;
-
-  case 1040:
-
-/* Line 1455 of yacc.c  */
-#line 8215 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= (yyvsp[(1) - (3)].num) | (yyvsp[(3) - (3)].num);
-          }
-    break;
-
-  case 1041:
-
-/* Line 1455 of yacc.c  */
-#line 8222 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= SLAVE_SQL;
-          }
-    break;
-
-  case 1042:
-
-/* Line 1455 of yacc.c  */
-#line 8226 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= SLAVE_IO;
-          }
-    break;
-
-  case 1043:
-
-/* Line 1455 of yacc.c  */
-#line 8232 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1044:
-
-/* Line 1455 of yacc.c  */
-#line 8234 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (((lex->mi.log_file_name || lex->mi.pos) &&
-                lex->mi.gtid) ||
-               ((lex->mi.relay_log_name || lex->mi.relay_log_pos) &&
-                lex->mi.gtid) ||
-                !((lex->mi.log_file_name && lex->mi.pos) ||
-                  (lex->mi.relay_log_name && lex->mi.relay_log_pos) ||
-                  lex->mi.gtid ||
-                  lex->mi.until_after_gaps) ||
-                /* SQL_AFTER_MTS_GAPS is meaningless in combination */
-                /* with any other coordinates related options       */
-                ((lex->mi.log_file_name || lex->mi.pos || lex->mi.relay_log_name
-                  || lex->mi.relay_log_pos || lex->mi.gtid)
-                 && lex->mi.until_after_gaps))
-            {
-               my_message(ER_BAD_SLAVE_UNTIL_COND,
-                          ER(ER_BAD_SLAVE_UNTIL_COND), MYF(0));
-               MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1047:
-
-/* Line 1455 of yacc.c  */
-#line 8261 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.gtid= (yyvsp[(3) - (3)].lex_str).str;
-            Lex->mi.gtid_until_condition= LEX_MASTER_INFO::UNTIL_SQL_BEFORE_GTIDS;
-          }
-    break;
-
-  case 1048:
-
-/* Line 1455 of yacc.c  */
-#line 8266 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.gtid= (yyvsp[(3) - (3)].lex_str).str;
-            Lex->mi.gtid_until_condition= LEX_MASTER_INFO::UNTIL_SQL_AFTER_GTIDS;
-          }
-    break;
-
-  case 1049:
-
-/* Line 1455 of yacc.c  */
-#line 8271 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->mi.until_after_gaps= true;
-          }
-    break;
-
-  case 1050:
-
-/* Line 1455 of yacc.c  */
-#line 8278 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command = SQLCOM_CHECKSUM;
-            /* Will be overriden during execution. */
-            YYPS->m_lock_type= TL_UNLOCK;
-          }
-    break;
-
-  case 1051:
-
-/* Line 1455 of yacc.c  */
-#line 8285 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1052:
-
-/* Line 1455 of yacc.c  */
-#line 8289 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags= 0; }
-    break;
-
-  case 1053:
-
-/* Line 1455 of yacc.c  */
-#line 8290 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags= T_QUICK; }
-    break;
-
-  case 1054:
-
-/* Line 1455 of yacc.c  */
-#line 8291 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags= T_EXTEND; }
-    break;
-
-  case 1055:
-
-/* Line 1455 of yacc.c  */
-#line 8296 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command = SQLCOM_REPAIR;
-            lex->no_write_to_binlog= (yyvsp[(2) - (3)].num);
-            lex->check_opt.init();
-            lex->alter_info.reset();
-            /* Will be overriden during execution. */
-            YYPS->m_lock_type= TL_UNLOCK;
-          }
-    break;
-
-  case 1056:
-
-/* Line 1455 of yacc.c  */
-#line 8306 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX* lex= thd->lex;
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_repair_table();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1057:
-
-/* Line 1455 of yacc.c  */
-#line 8317 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags = T_MEDIUM; }
-    break;
-
-  case 1058:
-
-/* Line 1455 of yacc.c  */
-#line 8318 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1059:
-
-/* Line 1455 of yacc.c  */
-#line 8322 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1060:
-
-/* Line 1455 of yacc.c  */
-#line 8323 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1061:
-
-/* Line 1455 of yacc.c  */
-#line 8327 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags|= T_QUICK; }
-    break;
-
-  case 1062:
-
-/* Line 1455 of yacc.c  */
-#line 8328 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags|= T_EXTEND; }
-    break;
-
-  case 1063:
-
-/* Line 1455 of yacc.c  */
-#line 8329 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.sql_flags|= TT_USEFRM; }
-    break;
-
-  case 1064:
-
-/* Line 1455 of yacc.c  */
-#line 8334 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command = SQLCOM_ANALYZE;
-            lex->no_write_to_binlog= (yyvsp[(2) - (3)].num);
-            lex->check_opt.init();
-            lex->alter_info.reset();
-            /* Will be overriden during execution. */
-            YYPS->m_lock_type= TL_UNLOCK;
-          }
-    break;
-
-  case 1065:
-
-/* Line 1455 of yacc.c  */
-#line 8344 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX* lex= thd->lex;
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_analyze_table();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1066:
-
-/* Line 1455 of yacc.c  */
-#line 8356 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT;
-            Lex->comment= (yyvsp[(2) - (2)].lex_str);
-          }
-    break;
-
-  case 1067:
-
-/* Line 1455 of yacc.c  */
-#line 8364 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "CHECK");
-              MYSQL_YYABORT;
-            }
-            lex->sql_command = SQLCOM_CHECK;
-            lex->check_opt.init();
-            lex->alter_info.reset();
-            /* Will be overriden during execution. */
-            YYPS->m_lock_type= TL_UNLOCK;
-          }
-    break;
-
-  case 1068:
-
-/* Line 1455 of yacc.c  */
-#line 8379 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX* lex= thd->lex;
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_check_table();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1069:
-
-/* Line 1455 of yacc.c  */
-#line 8390 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags = T_MEDIUM; }
-    break;
-
-  case 1070:
-
-/* Line 1455 of yacc.c  */
-#line 8391 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1071:
-
-/* Line 1455 of yacc.c  */
-#line 8395 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1072:
-
-/* Line 1455 of yacc.c  */
-#line 8396 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1073:
-
-/* Line 1455 of yacc.c  */
-#line 8400 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags|= T_QUICK; }
-    break;
-
-  case 1074:
-
-/* Line 1455 of yacc.c  */
-#line 8401 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags|= T_FAST; }
-    break;
-
-  case 1075:
-
-/* Line 1455 of yacc.c  */
-#line 8402 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags|= T_MEDIUM; }
-    break;
-
-  case 1076:
-
-/* Line 1455 of yacc.c  */
-#line 8403 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags|= T_EXTEND; }
-    break;
-
-  case 1077:
-
-/* Line 1455 of yacc.c  */
-#line 8404 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; }
-    break;
-
-  case 1078:
-
-/* Line 1455 of yacc.c  */
-#line 8405 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; }
-    break;
-
-  case 1079:
-
-/* Line 1455 of yacc.c  */
-#line 8410 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command = SQLCOM_OPTIMIZE;
-            lex->no_write_to_binlog= (yyvsp[(2) - (3)].num);
-            lex->check_opt.init();
-            lex->alter_info.reset();
-            /* Will be overriden during execution. */
-            YYPS->m_lock_type= TL_UNLOCK;
-          }
-    break;
-
-  case 1080:
-
-/* Line 1455 of yacc.c  */
-#line 8420 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX* lex= thd->lex;
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_optimize_table();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1081:
-
-/* Line 1455 of yacc.c  */
-#line 8431 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 1082:
-
-/* Line 1455 of yacc.c  */
-#line 8432 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 1083:
-
-/* Line 1455 of yacc.c  */
-#line 8433 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 1084:
-
-/* Line 1455 of yacc.c  */
-#line 8438 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command= SQLCOM_RENAME_TABLE;
-          }
-    break;
-
-  case 1085:
-
-/* Line 1455 of yacc.c  */
-#line 8442 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1086:
-
-/* Line 1455 of yacc.c  */
-#line 8444 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_RENAME_USER;
-          }
-    break;
-
-  case 1087:
-
-/* Line 1455 of yacc.c  */
-#line 8451 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->users_list.push_back((yyvsp[(1) - (3)].lex_user)) || Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1088:
-
-/* Line 1455 of yacc.c  */
-#line 8456 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->users_list.push_back((yyvsp[(3) - (5)].lex_user)) || Lex->users_list.push_back((yyvsp[(5) - (5)].lex_user)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1091:
-
-/* Line 1455 of yacc.c  */
-#line 8469 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            SELECT_LEX *sl= lex->current_select;
-            if (!sl->add_table_to_list(lex->thd, (yyvsp[(1) - (3)].table),NULL,TL_OPTION_UPDATING,
-                                       TL_IGNORE, MDL_EXCLUSIVE) ||
-                !sl->add_table_to_list(lex->thd, (yyvsp[(3) - (3)].table),NULL,TL_OPTION_UPDATING,
-                                       TL_IGNORE, MDL_EXCLUSIVE))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1092:
-
-/* Line 1455 of yacc.c  */
-#line 8482 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.reset();
-          }
-    break;
-
-  case 1093:
-
-/* Line 1455 of yacc.c  */
-#line 8486 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE;
-            lex->ident= (yyvsp[(6) - (6)].lex_str);
-          }
-    break;
-
-  case 1098:
-
-/* Line 1455 of yacc.c  */
-#line 8505 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (2)].table), NULL, 0, TL_READ,
-                                           MDL_SHARED_READ,
-                                           Select->pop_index_hints()))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1099:
-
-/* Line 1455 of yacc.c  */
-#line 8515 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (3)].table), NULL, 0, TL_READ, 
-                                           MDL_SHARED_READ,
-                                           Select->pop_index_hints()))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1100:
-
-/* Line 1455 of yacc.c  */
-#line 8524 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 1101:
-
-/* Line 1455 of yacc.c  */
-#line 8525 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str) = default_key_cache_base; }
-    break;
-
-  case 1102:
-
-/* Line 1455 of yacc.c  */
-#line 8530 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command=SQLCOM_PRELOAD_KEYS;
-            lex->alter_info.reset();
-          }
-    break;
-
-  case 1103:
-
-/* Line 1455 of yacc.c  */
-#line 8536 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1108:
-
-/* Line 1455 of yacc.c  */
-#line 8551 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (3)].table), NULL, (yyvsp[(3) - (3)].num), TL_READ,
-                                           MDL_SHARED_READ,
-                                           Select->pop_index_hints()))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1109:
-
-/* Line 1455 of yacc.c  */
-#line 8561 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (4)].table), NULL, (yyvsp[(4) - (4)].num), TL_READ,
-                                           MDL_SHARED_READ,
-                                           Select->pop_index_hints()))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1110:
-
-/* Line 1455 of yacc.c  */
-#line 8571 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->alter_info.flags|= Alter_info::ALTER_ADMIN_PARTITION;
-          }
-    break;
-
-  case 1112:
-
-/* Line 1455 of yacc.c  */
-#line 8578 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->select_lex.alloc_index_hints(YYTHD);
-            Select->set_index_hint_type(INDEX_HINT_USE, 
-                                        old_mode ? 
-                                        INDEX_HINT_MASK_JOIN : 
-                                        INDEX_HINT_MASK_ALL);
-          }
-    break;
-
-  case 1114:
-
-/* Line 1455 of yacc.c  */
-#line 8589 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 1116:
-
-/* Line 1455 of yacc.c  */
-#line 8595 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 1117:
-
-/* Line 1455 of yacc.c  */
-#line 8596 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= TL_OPTION_IGNORE_LEAVES; }
-    break;
-
-  case 1118:
-
-/* Line 1455 of yacc.c  */
-#line 8606 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SELECT;
-          }
-    break;
-
-  case 1121:
-
-/* Line 1455 of yacc.c  */
-#line 8620 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (setup_select_in_parentheses(Lex))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1123:
-
-/* Line 1455 of yacc.c  */
-#line 8630 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (setup_select_in_parentheses(Lex))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1125:
-
-/* Line 1455 of yacc.c  */
-#line 8639 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            SELECT_LEX * sel= lex->current_select;
-            if (lex->current_select->set_braces(0))
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            if (sel->linkage == UNION_TYPE &&
-                sel->master_unit()->first_select()->braces)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1127:
-
-/* Line 1455 of yacc.c  */
-#line 8658 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            SELECT_LEX *sel= lex->current_select;
-            if (sel->linkage != UNION_TYPE)
-              mysql_init_select(lex);
-            lex->current_select->parsing_place= SELECT_LIST;
-          }
-    break;
-
-  case 1128:
-
-/* Line 1455 of yacc.c  */
-#line 8666 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 1130:
-
-/* Line 1455 of yacc.c  */
-#line 8673 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1135:
-
-/* Line 1455 of yacc.c  */
-#line 8683 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->context.table_list=
-              Select->context.first_name_resolution_table=
-                Select->table_list.first;
-          }
-    break;
-
-  case 1138:
-
-/* Line 1455 of yacc.c  */
-#line 8698 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Select->options & SELECT_DISTINCT && Select->options & SELECT_ALL)
-            {
-              my_error(ER_WRONG_USAGE, MYF(0), "ALL", "DISTINCT");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1142:
-
-/* Line 1455 of yacc.c  */
-#line 8715 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* 
-              Allow this flag only on the first top-level SELECT statement, if
-              SQL_CACHE wasn't specified, and only once per query.
-             */
-            if (Lex->current_select != &Lex->select_lex)
-            {
-              my_error(ER_CANT_USE_OPTION_HERE, MYF(0), "SQL_NO_CACHE");
-              MYSQL_YYABORT;
-            }
-            else if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_CACHE)
-            {
-              my_error(ER_WRONG_USAGE, MYF(0), "SQL_CACHE", "SQL_NO_CACHE");
-              MYSQL_YYABORT;
-            }
-            else if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_NO_CACHE)
-            {
-              my_error(ER_DUP_ARGUMENT, MYF(0), "SQL_NO_CACHE");
-              MYSQL_YYABORT;
-            }
-            else
-            {
-              Lex->safe_to_cache_query=0;
-              Lex->select_lex.options&= ~OPTION_TO_QUERY_CACHE;
-              Lex->select_lex.sql_cache= SELECT_LEX::SQL_NO_CACHE;
-            }
-          }
-    break;
-
-  case 1143:
-
-/* Line 1455 of yacc.c  */
-#line 8743 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* 
-              Allow this flag only on the first top-level SELECT statement, if
-              SQL_NO_CACHE wasn't specified, and only once per query.
-             */
-            if (Lex->current_select != &Lex->select_lex)
-            {
-              my_error(ER_CANT_USE_OPTION_HERE, MYF(0), "SQL_CACHE");
-              MYSQL_YYABORT;
-            }         
-            else if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_NO_CACHE)
-            {
-              my_error(ER_WRONG_USAGE, MYF(0), "SQL_NO_CACHE", "SQL_CACHE");
-              MYSQL_YYABORT;
-            }
-            else if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_CACHE)
-            {
-              my_error(ER_DUP_ARGUMENT, MYF(0), "SQL_CACHE");
-              MYSQL_YYABORT;
-            }
-            else
-            {
-              Lex->safe_to_cache_query=1;
-              Lex->select_lex.options|= OPTION_TO_QUERY_CACHE;
-              Lex->select_lex.sql_cache= SELECT_LEX::SQL_CACHE;
-            }
-          }
-    break;
-
-  case 1145:
-
-/* Line 1455 of yacc.c  */
-#line 8775 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->current_select->set_lock_for_tables(TL_WRITE);
-            lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1146:
-
-/* Line 1455 of yacc.c  */
-#line 8781 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->current_select->
-              set_lock_for_tables(TL_READ_WITH_SHARED_LOCKS);
-            lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1149:
-
-/* Line 1455 of yacc.c  */
-#line 8793 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            Item *item= new (thd->mem_root)
-                          Item_field(&thd->lex->current_select->context,
-                                     NULL, NULL, "*");
-            if (item == NULL)
-              MYSQL_YYABORT;
-            if (add_item_to_list(thd, item))
-              MYSQL_YYABORT;
-            (thd->lex->current_select->with_wild)++;
-          }
-    break;
-
-  case 1150:
-
-/* Line 1455 of yacc.c  */
-#line 8808 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-
-            if (add_item_to_list(thd, (yyvsp[(2) - (3)].item)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1151:
-
-/* Line 1455 of yacc.c  */
-#line 8815 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            DBUG_ASSERT((yyvsp[(1) - (4)].simple_string) < (yyvsp[(3) - (4)].simple_string));
-
-            if (add_item_to_list(thd, (yyvsp[(2) - (4)].item)))
-              MYSQL_YYABORT;
-            if ((yyvsp[(4) - (4)].lex_str).str)
-            {
-              if (Lex->sql_command == SQLCOM_CREATE_VIEW &&
-                  check_column_name((yyvsp[(4) - (4)].lex_str).str))
-              {
-                my_error(ER_WRONG_COLUMN_NAME, MYF(0), (yyvsp[(4) - (4)].lex_str).str);
-                MYSQL_YYABORT;
-              }
-              (yyvsp[(2) - (4)].item)->item_name.copy((yyvsp[(4) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).length, system_charset_info, false);
-            }
-            else if (!(yyvsp[(2) - (4)].item)->item_name.is_set())
-            {
-              (yyvsp[(2) - (4)].item)->item_name.copy((yyvsp[(1) - (4)].simple_string), (uint) ((yyvsp[(3) - (4)].simple_string) - (yyvsp[(1) - (4)].simple_string)), thd->charset());
-            }
-          }
-    break;
-
-  case 1152:
-
-/* Line 1455 of yacc.c  */
-#line 8839 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.simple_string)= (char*) YYLIP->get_cpp_tok_start();
-          }
-    break;
-
-  case 1153:
-
-/* Line 1455 of yacc.c  */
-#line 8845 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.simple_string)= (char*) YYLIP->get_cpp_tok_end();
-          }
-    break;
-
-  case 1154:
-
-/* Line 1455 of yacc.c  */
-#line 8851 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=null_lex_str;}
-    break;
-
-  case 1155:
-
-/* Line 1455 of yacc.c  */
-#line 8852 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); }
-    break;
-
-  case 1156:
-
-/* Line 1455 of yacc.c  */
-#line 8853 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); }
-    break;
-
-  case 1157:
-
-/* Line 1455 of yacc.c  */
-#line 8854 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 1158:
-
-/* Line 1455 of yacc.c  */
-#line 8855 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 1159:
-
-/* Line 1455 of yacc.c  */
-#line 8859 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1160:
-
-/* Line 1455 of yacc.c  */
-#line 8860 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1161:
-
-/* Line 1455 of yacc.c  */
-#line 8866 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              Design notes:
-              Do not use a manually maintained stack like thd->lex->xxx_list,
-              but use the internal bison stack ($$, $1 and $3) instead.
-              Using the bison stack is:
-              - more robust to changes in the grammar,
-              - guaranteed to be in sync with the parser state,
-              - better for performances (no memory allocation).
-            */
-            Item_cond_or *item1;
-            Item_cond_or *item3;
-            if (is_cond_or((yyvsp[(1) - (3)].item)))
-            {
-              item1= (Item_cond_or*) (yyvsp[(1) - (3)].item);
-              if (is_cond_or((yyvsp[(3) - (3)].item)))
-              {
-                item3= (Item_cond_or*) (yyvsp[(3) - (3)].item);
-                /*
-                  (X1 OR X2) OR (Y1 OR Y2) ==> OR (X1, X2, Y1, Y2)
-                */
-                item3->add_at_head(item1->argument_list());
-                (yyval.item) = (yyvsp[(3) - (3)].item);
-              }
-              else
-              {
-                /*
-                  (X1 OR X2) OR Y ==> OR (X1, X2, Y)
-                */
-                item1->add((yyvsp[(3) - (3)].item));
-                (yyval.item) = (yyvsp[(1) - (3)].item);
-              }
-            }
-            else if (is_cond_or((yyvsp[(3) - (3)].item)))
-            {
-              item3= (Item_cond_or*) (yyvsp[(3) - (3)].item);
-              /*
-                X OR (Y1 OR Y2) ==> OR (X, Y1, Y2)
-              */
-              item3->add_at_head((yyvsp[(1) - (3)].item));
-              (yyval.item) = (yyvsp[(3) - (3)].item);
-            }
-            else
-            {
-              /* X OR Y */
-              (yyval.item) = new (YYTHD->mem_root) Item_cond_or((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item));
-              if ((yyval.item) == NULL)
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1162:
-
-/* Line 1455 of yacc.c  */
-#line 8917 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* XOR is a proprietary extension */
-            (yyval.item) = new (YYTHD->mem_root) Item_func_xor((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1163:
-
-/* Line 1455 of yacc.c  */
-#line 8924 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* See comments in rule expr: expr or expr */
-            Item_cond_and *item1;
-            Item_cond_and *item3;
-            if (is_cond_and((yyvsp[(1) - (3)].item)))
-            {
-              item1= (Item_cond_and*) (yyvsp[(1) - (3)].item);
-              if (is_cond_and((yyvsp[(3) - (3)].item)))
-              {
-                item3= (Item_cond_and*) (yyvsp[(3) - (3)].item);
-                /*
-                  (X1 AND X2) AND (Y1 AND Y2) ==> AND (X1, X2, Y1, Y2)
-                */
-                item3->add_at_head(item1->argument_list());
-                (yyval.item) = (yyvsp[(3) - (3)].item);
-              }
-              else
-              {
-                /*
-                  (X1 AND X2) AND Y ==> AND (X1, X2, Y)
-                */
-                item1->add((yyvsp[(3) - (3)].item));
-                (yyval.item) = (yyvsp[(1) - (3)].item);
-              }
-            }
-            else if (is_cond_and((yyvsp[(3) - (3)].item)))
-            {
-              item3= (Item_cond_and*) (yyvsp[(3) - (3)].item);
-              /*
-                X AND (Y1 AND Y2) ==> AND (X, Y1, Y2)
-              */
-              item3->add_at_head((yyvsp[(1) - (3)].item));
-              (yyval.item) = (yyvsp[(3) - (3)].item);
-            }
-            else
-            {
-              /* X AND Y */
-              (yyval.item) = new (YYTHD->mem_root) Item_cond_and((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item));
-              if ((yyval.item) == NULL)
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1164:
-
-/* Line 1455 of yacc.c  */
-#line 8967 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1165:
-
-/* Line 1455 of yacc.c  */
-#line 8973 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_istrue((yyvsp[(1) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1166:
-
-/* Line 1455 of yacc.c  */
-#line 8979 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_isnottrue((yyvsp[(1) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1167:
-
-/* Line 1455 of yacc.c  */
-#line 8985 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_isfalse((yyvsp[(1) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1168:
-
-/* Line 1455 of yacc.c  */
-#line 8991 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_isnotfalse((yyvsp[(1) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1169:
-
-/* Line 1455 of yacc.c  */
-#line 8997 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_isnull((yyvsp[(1) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1170:
-
-/* Line 1455 of yacc.c  */
-#line 9003 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_isnotnull((yyvsp[(1) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1172:
-
-/* Line 1455 of yacc.c  */
-#line 9013 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_isnull((yyvsp[(1) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1173:
-
-/* Line 1455 of yacc.c  */
-#line 9019 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_isnotnull((yyvsp[(1) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1174:
-
-/* Line 1455 of yacc.c  */
-#line 9025 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_equal((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1175:
-
-/* Line 1455 of yacc.c  */
-#line 9031 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= (*(yyvsp[(2) - (3)].boolfunc2creator))(0)->create((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1176:
-
-/* Line 1455 of yacc.c  */
-#line 9037 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= all_any_subquery_creator((yyvsp[(1) - (6)].item), (yyvsp[(2) - (6)].boolfunc2creator), (yyvsp[(3) - (6)].num), (yyvsp[(5) - (6)].select_lex));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1178:
-
-/* Line 1455 of yacc.c  */
-#line 9047 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_in_subselect((yyvsp[(1) - (5)].item), (yyvsp[(4) - (5)].select_lex));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1179:
-
-/* Line 1455 of yacc.c  */
-#line 9053 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            Item *item= new (thd->mem_root) Item_in_subselect((yyvsp[(1) - (6)].item), (yyvsp[(5) - (6)].select_lex));
-            if (item == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= negate_expression(thd, item);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1180:
-
-/* Line 1455 of yacc.c  */
-#line 9063 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (5)].item), true, (yyvsp[(4) - (5)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1181:
-
-/* Line 1455 of yacc.c  */
-#line 9069 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(4) - (7)].item));
-            (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(1) - (7)].item));
-            (yyval.item)= new (YYTHD->mem_root) Item_func_in(*(yyvsp[(6) - (7)].item_list));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1182:
-
-/* Line 1455 of yacc.c  */
-#line 9077 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (6)].item), false, (yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1183:
-
-/* Line 1455 of yacc.c  */
-#line 9083 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(5) - (8)].item));
-            (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(1) - (8)].item));
-            Item_func_in *item = new (YYTHD->mem_root) Item_func_in(*(yyvsp[(7) - (8)].item_list));
-            if (item == NULL)
-              MYSQL_YYABORT;
-            item->negate();
-            (yyval.item)= item;
-          }
-    break;
-
-  case 1184:
-
-/* Line 1455 of yacc.c  */
-#line 9093 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_between((yyvsp[(1) - (5)].item),(yyvsp[(3) - (5)].item),(yyvsp[(5) - (5)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1185:
-
-/* Line 1455 of yacc.c  */
-#line 9099 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item_func_between *item;
-            item= new (YYTHD->mem_root) Item_func_between((yyvsp[(1) - (6)].item),(yyvsp[(4) - (6)].item),(yyvsp[(6) - (6)].item));
-            if (item == NULL)
-              MYSQL_YYABORT;
-            item->negate();
-            (yyval.item)= item;
-          }
-    break;
-
-  case 1186:
-
-/* Line 1455 of yacc.c  */
-#line 9108 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *item1= new (YYTHD->mem_root) Item_func_soundex((yyvsp[(1) - (4)].item));
-            Item *item4= new (YYTHD->mem_root) Item_func_soundex((yyvsp[(4) - (4)].item));
-            if ((item1 == NULL) || (item4 == NULL))
-              MYSQL_YYABORT;
-            (yyval.item)= new (YYTHD->mem_root) Item_func_eq(item1, item4);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1187:
-
-/* Line 1455 of yacc.c  */
-#line 9118 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_like((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].item),Lex->escape_used);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1188:
-
-/* Line 1455 of yacc.c  */
-#line 9124 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *item= new (YYTHD->mem_root) Item_func_like((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].item),
-                                                             Lex->escape_used);
-            if (item == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= new (YYTHD->mem_root) Item_func_not(item);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1189:
-
-/* Line 1455 of yacc.c  */
-#line 9134 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_regex((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1190:
-
-/* Line 1455 of yacc.c  */
-#line 9140 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *item= new (YYTHD->mem_root) Item_func_regex((yyvsp[(1) - (4)].item),(yyvsp[(4) - (4)].item));
-            if (item == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= negate_expression(YYTHD, item);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1192:
-
-/* Line 1455 of yacc.c  */
-#line 9153 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_bit_or((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1193:
-
-/* Line 1455 of yacc.c  */
-#line 9159 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_bit_and((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1194:
-
-/* Line 1455 of yacc.c  */
-#line 9165 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_shift_left((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1195:
-
-/* Line 1455 of yacc.c  */
-#line 9171 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_shift_right((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1196:
-
-/* Line 1455 of yacc.c  */
-#line 9177 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_plus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1197:
-
-/* Line 1455 of yacc.c  */
-#line 9183 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_minus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1198:
-
-/* Line 1455 of yacc.c  */
-#line 9189 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].interval),0);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1199:
-
-/* Line 1455 of yacc.c  */
-#line 9195 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].interval),1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1200:
-
-/* Line 1455 of yacc.c  */
-#line 9201 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_mul((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1201:
-
-/* Line 1455 of yacc.c  */
-#line 9207 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1202:
-
-/* Line 1455 of yacc.c  */
-#line 9213 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1203:
-
-/* Line 1455 of yacc.c  */
-#line 9219 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_int_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1204:
-
-/* Line 1455 of yacc.c  */
-#line 9225 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1205:
-
-/* Line 1455 of yacc.c  */
-#line 9231 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_bit_xor((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1215:
-
-/* Line 1455 of yacc.c  */
-#line 9260 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.boolfunc2creator) = &comp_eq_creator; }
-    break;
-
-  case 1216:
-
-/* Line 1455 of yacc.c  */
-#line 9261 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.boolfunc2creator) = &comp_ge_creator; }
-    break;
-
-  case 1217:
-
-/* Line 1455 of yacc.c  */
-#line 9262 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.boolfunc2creator) = &comp_gt_creator; }
-    break;
-
-  case 1218:
-
-/* Line 1455 of yacc.c  */
-#line 9263 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.boolfunc2creator) = &comp_le_creator; }
-    break;
-
-  case 1219:
-
-/* Line 1455 of yacc.c  */
-#line 9264 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.boolfunc2creator) = &comp_lt_creator; }
-    break;
-
-  case 1220:
-
-/* Line 1455 of yacc.c  */
-#line 9265 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.boolfunc2creator) = &comp_ne_creator; }
-    break;
-
-  case 1221:
-
-/* Line 1455 of yacc.c  */
-#line 9269 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num) = 1; }
-    break;
-
-  case 1222:
-
-/* Line 1455 of yacc.c  */
-#line 9270 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num) = 0; }
-    break;
-
-  case 1228:
-
-/* Line 1455 of yacc.c  */
-#line 9280 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            Item *i1= new (thd->mem_root) Item_string((yyvsp[(3) - (3)].lex_str).str,
-                                                      (yyvsp[(3) - (3)].lex_str).length,
-                                                      thd->charset());
-            if (i1 == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= new (thd->mem_root) Item_func_set_collation((yyvsp[(1) - (3)].item), i1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1233:
-
-/* Line 1455 of yacc.c  */
-#line 9296 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_concat((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1234:
-
-/* Line 1455 of yacc.c  */
-#line 9302 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= (yyvsp[(2) - (2)].item);
-          }
-    break;
-
-  case 1235:
-
-/* Line 1455 of yacc.c  */
-#line 9306 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_neg((yyvsp[(2) - (2)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1236:
-
-/* Line 1455 of yacc.c  */
-#line 9312 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_bit_neg((yyvsp[(2) - (2)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1237:
-
-/* Line 1455 of yacc.c  */
-#line 9318 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1238:
-
-/* Line 1455 of yacc.c  */
-#line 9324 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            (yyval.item)= new (YYTHD->mem_root) Item_singlerow_subselect((yyvsp[(2) - (3)].select_lex));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1239:
-
-/* Line 1455 of yacc.c  */
-#line 9330 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(2) - (3)].item); }
-    break;
-
-  case 1240:
-
-/* Line 1455 of yacc.c  */
-#line 9332 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(4) - (5)].item_list)->push_front((yyvsp[(2) - (5)].item));
-            (yyval.item)= new (YYTHD->mem_root) Item_row(*(yyvsp[(4) - (5)].item_list));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1241:
-
-/* Line 1455 of yacc.c  */
-#line 9339 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item));
-            (yyval.item)= new (YYTHD->mem_root) Item_row(*(yyvsp[(5) - (6)].item_list));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1242:
-
-/* Line 1455 of yacc.c  */
-#line 9346 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_exists_subselect((yyvsp[(3) - (4)].select_lex));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1243:
-
-/* Line 1455 of yacc.c  */
-#line 9352 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item_string *item;
-            (yyval.item)= NULL;
-            /*
-              If "expr" is reasonably short pure ASCII string literal,
-              try to parse known ODBC style date, time or timestamp literals,
-              e.g:
-              SELECT {d'2001-01-01'};
-              SELECT {t'10:20:30'};
-              SELECT {ts'2001-01-01 10:20:30'};
-            */
-            if ((yyvsp[(3) - (4)].item)->type() == Item::STRING_ITEM &&
-               (item= (Item_string *) (yyvsp[(3) - (4)].item)) &&
-                item->collation.repertoire == MY_REPERTOIRE_ASCII &&
-                item->str_value.length() < MAX_DATE_STRING_REP_LENGTH * 4)
-            {
-              enum_field_types type= MYSQL_TYPE_STRING;
-              ErrConvString str(&item->str_value);
-              LEX_STRING *ls= &(yyvsp[(2) - (4)].lex_str);
-              if (ls->length == 1)
-              {
-                if (ls->str[0] == 'd')  /* {d'2001-01-01'} */
-                  type= MYSQL_TYPE_DATE;
-                else if (ls->str[0] == 't') /* {t'10:20:30'} */
-                  type= MYSQL_TYPE_TIME;
-              }
-              else if (ls->length == 2) /* {ts'2001-01-01 10:20:30'} */
-              {
-                if (ls->str[0] == 't' && ls->str[1] == 's')
-                  type= MYSQL_TYPE_DATETIME;
-              }
-              if (type != MYSQL_TYPE_STRING)
-                (yyval.item)= create_temporal_literal(YYTHD,
-                                            str.ptr(), str.length(),
-                                            system_charset_info,
-                                            type, false);
-            }
-            if ((yyval.item) == NULL)
-              (yyval.item)= (yyvsp[(3) - (4)].item);
-          }
-    break;
-
-  case 1244:
-
-/* Line 1455 of yacc.c  */
-#line 9393 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(2) - (7)].item_list)->push_front((yyvsp[(5) - (7)].item));
-            Item_func_match *i1= new (YYTHD->mem_root) Item_func_match(*(yyvsp[(2) - (7)].item_list), (yyvsp[(6) - (7)].num));
-            if (i1 == NULL)
-              MYSQL_YYABORT;
-            Select->add_ftfunc_to_list(i1);
-            (yyval.item)= i1;
-          }
-    break;
-
-  case 1245:
-
-/* Line 1455 of yacc.c  */
-#line 9402 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= create_func_cast(YYTHD, (yyvsp[(2) - (2)].item), ITEM_CAST_CHAR, NULL, NULL,
-                                 &my_charset_bin);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1246:
-
-/* Line 1455 of yacc.c  */
-#line 9409 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            (yyval.item)= create_func_cast(YYTHD, (yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), lex->length, lex->dec,
-                                 lex->charset);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1247:
-
-/* Line 1455 of yacc.c  */
-#line 9417 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_case(* (yyvsp[(3) - (5)].item_list), (yyvsp[(2) - (5)].item), (yyvsp[(4) - (5)].item) );
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1248:
-
-/* Line 1455 of yacc.c  */
-#line 9423 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= create_func_cast(YYTHD, (yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), Lex->length, Lex->dec,
-                                 Lex->charset);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1249:
-
-/* Line 1455 of yacc.c  */
-#line 9430 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_conv_charset((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].charset));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1250:
-
-/* Line 1455 of yacc.c  */
-#line 9436 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((yyvsp[(3) - (4)].item)->is_splocal())
-            {
-              Item_splocal *il= static_cast<Item_splocal *>((yyvsp[(3) - (4)].item));
-
-              my_error(ER_WRONG_COLUMN_NAME, MYF(0), il->m_name.ptr());
-              MYSQL_YYABORT;
-            }
-            (yyval.item)= new (YYTHD->mem_root) Item_default_value(Lex->current_context(),
-                                                         (yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1251:
-
-/* Line 1455 of yacc.c  */
-#line 9450 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_insert_value(Lex->current_context(),
-                                                        (yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1252:
-
-/* Line 1455 of yacc.c  */
-#line 9458 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(5) - (5)].item),(yyvsp[(2) - (5)].item),(yyvsp[(3) - (5)].interval),0);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1253:
-
-/* Line 1455 of yacc.c  */
-#line 9473 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_char(*(yyvsp[(3) - (4)].item_list));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1254:
-
-/* Line 1455 of yacc.c  */
-#line 9479 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_char(*(yyvsp[(3) - (6)].item_list), (yyvsp[(5) - (6)].charset));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1255:
-
-/* Line 1455 of yacc.c  */
-#line 9485 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_current_user(Lex->current_context());
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
-            Lex->safe_to_cache_query= 0;
-          }
-    break;
-
-  case 1256:
-
-/* Line 1455 of yacc.c  */
-#line 9493 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_typecast((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1257:
-
-/* Line 1455 of yacc.c  */
-#line 9499 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_dayofmonth((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1258:
-
-/* Line 1455 of yacc.c  */
-#line 9505 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_hour((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1259:
-
-/* Line 1455 of yacc.c  */
-#line 9511 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_insert((yyvsp[(3) - (10)].item),(yyvsp[(5) - (10)].item),(yyvsp[(7) - (10)].item),(yyvsp[(9) - (10)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1260:
-
-/* Line 1455 of yacc.c  */
-#line 9517 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            List<Item> *list= new (thd->mem_root) List<Item>;
-            if (list == NULL)
-              MYSQL_YYABORT;
-            list->push_front((yyvsp[(5) - (6)].item));
-            list->push_front((yyvsp[(3) - (6)].item));
-            Item_row *item= new (thd->mem_root) Item_row(*list);
-            if (item == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= new (thd->mem_root) Item_func_interval(item);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1261:
-
-/* Line 1455 of yacc.c  */
-#line 9532 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(5) - (8)].item));
-            (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(3) - (8)].item));
-            Item_row *item= new (thd->mem_root) Item_row(*(yyvsp[(7) - (8)].item_list));
-            if (item == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= new (thd->mem_root) Item_func_interval(item);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1262:
-
-/* Line 1455 of yacc.c  */
-#line 9544 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_left((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1263:
-
-/* Line 1455 of yacc.c  */
-#line 9550 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_minute((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1264:
-
-/* Line 1455 of yacc.c  */
-#line 9556 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_month((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1265:
-
-/* Line 1455 of yacc.c  */
-#line 9562 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_right((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1266:
-
-/* Line 1455 of yacc.c  */
-#line 9568 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_second((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1267:
-
-/* Line 1455 of yacc.c  */
-#line 9574 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_time_typecast((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1268:
-
-/* Line 1455 of yacc.c  */
-#line 9580 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_datetime_typecast((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1269:
-
-/* Line 1455 of yacc.c  */
-#line 9586 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_add_time((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), 1, 0);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1270:
-
-/* Line 1455 of yacc.c  */
-#line 9592 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_trim((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1271:
-
-/* Line 1455 of yacc.c  */
-#line 9598 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_ltrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1272:
-
-/* Line 1455 of yacc.c  */
-#line 9604 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_rtrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1273:
-
-/* Line 1455 of yacc.c  */
-#line 9610 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_trim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1274:
-
-/* Line 1455 of yacc.c  */
-#line 9616 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_ltrim((yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1275:
-
-/* Line 1455 of yacc.c  */
-#line 9622 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_rtrim((yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1276:
-
-/* Line 1455 of yacc.c  */
-#line 9628 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_trim((yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1277:
-
-/* Line 1455 of yacc.c  */
-#line 9634 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_trim((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1278:
-
-/* Line 1455 of yacc.c  */
-#line 9640 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_user();
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
-            Lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1279:
-
-/* Line 1455 of yacc.c  */
-#line 9648 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_year((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1280:
-
-/* Line 1455 of yacc.c  */
-#line 9669 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item),
-                                                             INTERVAL_DAY, 0);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1281:
-
-/* Line 1455 of yacc.c  */
-#line 9676 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 0);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1282:
-
-/* Line 1455 of yacc.c  */
-#line 9682 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_curdate_local();
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1283:
-
-/* Line 1455 of yacc.c  */
-#line 9689 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_curtime_local((yyvsp[(2) - (2)].ulong_num));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1284:
-
-/* Line 1455 of yacc.c  */
-#line 9697 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (8)].item),(yyvsp[(6) - (8)].item),(yyvsp[(7) - (8)].interval),0);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1285:
-
-/* Line 1455 of yacc.c  */
-#line 9704 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (8)].item),(yyvsp[(6) - (8)].item),(yyvsp[(7) - (8)].interval),1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1286:
-
-/* Line 1455 of yacc.c  */
-#line 9710 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)=new (YYTHD->mem_root) Item_extract( (yyvsp[(3) - (6)].interval), (yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1287:
-
-/* Line 1455 of yacc.c  */
-#line 9716 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_get_format((yyvsp[(3) - (6)].date_time_type), (yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1288:
-
-/* Line 1455 of yacc.c  */
-#line 9722 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= (yyvsp[(1) - (1)].item);
-            Lex->safe_to_cache_query= 0;
-          }
-    break;
-
-  case 1289:
-
-/* Line 1455 of yacc.c  */
-#line 9727 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item) = new (YYTHD->mem_root) Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1290:
-
-/* Line 1455 of yacc.c  */
-#line 9733 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item),
-                                                             INTERVAL_DAY, 1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1291:
-
-/* Line 1455 of yacc.c  */
-#line 9740 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1292:
-
-/* Line 1455 of yacc.c  */
-#line 9746 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1293:
-
-/* Line 1455 of yacc.c  */
-#line 9752 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1294:
-
-/* Line 1455 of yacc.c  */
-#line 9758 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1295:
-
-/* Line 1455 of yacc.c  */
-#line 9764 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1296:
-
-/* Line 1455 of yacc.c  */
-#line 9770 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              Unlike other time-related functions, SYSDATE() is
-              replication-unsafe because it is not affected by the
-              TIMESTAMP variable.  It is unsafe even if
-              sysdate_is_now=1, because the slave may have
-              sysdate_is_now=0.
-            */
-            Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
-            if (global_system_variables.sysdate_is_now == 0)
-              (yyval.item)= new (YYTHD->mem_root) Item_func_sysdate_local((yyvsp[(2) - (2)].ulong_num));
-            else
-              (yyval.item)= new (YYTHD->mem_root) Item_func_now_local((yyvsp[(2) - (2)].ulong_num));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1297:
-
-/* Line 1455 of yacc.c  */
-#line 9788 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(7) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].interval_time_st),0);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1298:
-
-/* Line 1455 of yacc.c  */
-#line 9794 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_timestamp_diff((yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item),(yyvsp[(3) - (8)].interval_time_st));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1299:
-
-/* Line 1455 of yacc.c  */
-#line 9800 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_curdate_utc();
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1300:
-
-/* Line 1455 of yacc.c  */
-#line 9807 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_curtime_utc((yyvsp[(2) - (2)].ulong_num));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1301:
-
-/* Line 1455 of yacc.c  */
-#line 9814 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_now_utc((yyvsp[(2) - (2)].ulong_num));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1302:
-
-/* Line 1455 of yacc.c  */
-#line 9829 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_ascii((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1303:
-
-/* Line 1455 of yacc.c  */
-#line 9835 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_charset((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1304:
-
-/* Line 1455 of yacc.c  */
-#line 9841 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_coalesce(* (yyvsp[(3) - (4)].item_list));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1305:
-
-/* Line 1455 of yacc.c  */
-#line 9847 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_collation((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1306:
-
-/* Line 1455 of yacc.c  */
-#line 9853 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_database();
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->safe_to_cache_query=0;
-          }
-    break;
-
-  case 1307:
-
-/* Line 1455 of yacc.c  */
-#line 9860 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_if((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1308:
-
-/* Line 1455 of yacc.c  */
-#line 9866 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_format((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1309:
-
-/* Line 1455 of yacc.c  */
-#line 9872 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_format((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1310:
-
-/* Line 1455 of yacc.c  */
-#line 9878 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_microsecond((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1311:
-
-/* Line 1455 of yacc.c  */
-#line 9884 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item) = new (YYTHD->mem_root) Item_func_mod((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1312:
-
-/* Line 1455 of yacc.c  */
-#line 9890 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            WARN_DEPRECATED(YYTHD, "OLD_PASSWORD", "PASSWORD");
-            (yyval.item)=  new (YYTHD->mem_root) Item_func_old_password((yyvsp[(3) - (4)].item));
-            Lex->contains_plaintext_password= true;
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1313:
-
-/* Line 1455 of yacc.c  */
-#line 9898 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            Item* i1;
-            Lex->contains_plaintext_password= true;
-            if (thd->variables.old_passwords == 1)
-              i1= new (thd->mem_root) Item_func_old_password((yyvsp[(3) - (4)].item));
-            else
-              i1= new (thd->mem_root) Item_func_password((yyvsp[(3) - (4)].item));
-            if (i1 == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= i1;
-          }
-    break;
-
-  case 1314:
-
-/* Line 1455 of yacc.c  */
-#line 9911 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item) = new (YYTHD->mem_root) Item_func_quarter((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1315:
-
-/* Line 1455 of yacc.c  */
-#line 9917 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_repeat((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1316:
-
-/* Line 1455 of yacc.c  */
-#line 9923 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_replace((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1317:
-
-/* Line 1455 of yacc.c  */
-#line 9929 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_reverse((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1318:
-
-/* Line 1455 of yacc.c  */
-#line 9935 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_row_count();
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
-            Lex->safe_to_cache_query= 0;
-          }
-    break;
-
-  case 1319:
-
-/* Line 1455 of yacc.c  */
-#line 9943 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1320:
-
-/* Line 1455 of yacc.c  */
-#line 9949 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            Item *i1= new (thd->mem_root) Item_int(NAME_STRING("0"),
-                                           thd->variables.default_week_format,
-                                                   1);
-            if (i1 == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= new (thd->mem_root) Item_func_week((yyvsp[(3) - (4)].item), i1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1321:
-
-/* Line 1455 of yacc.c  */
-#line 9961 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_week((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1322:
-
-/* Line 1455 of yacc.c  */
-#line 9967 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_weight_string((yyvsp[(3) - (5)].item), 0, 0, (yyvsp[(4) - (5)].ulong_num));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1323:
-
-/* Line 1455 of yacc.c  */
-#line 9973 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root)
-                Item_func_weight_string((yyvsp[(3) - (8)].item), 0, (yyvsp[(6) - (8)].ulong_num),
-                                        (yyvsp[(7) - (8)].ulong_num) | MY_STRXFRM_PAD_WITH_SPACE);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1324:
-
-/* Line 1455 of yacc.c  */
-#line 9981 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *item= new (YYTHD->mem_root) Item_char_typecast((yyvsp[(3) - (7)].item), (yyvsp[(6) - (7)].ulong_num), &my_charset_bin);
-            if (item == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= new (YYTHD->mem_root)
-                Item_func_weight_string(item, 0, (yyvsp[(6) - (7)].ulong_num), MY_STRXFRM_PAD_WITH_SPACE);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1325:
-
-/* Line 1455 of yacc.c  */
-#line 9991 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_weight_string((yyvsp[(3) - (10)].item), (yyvsp[(5) - (10)].ulong_num), (yyvsp[(7) - (10)].ulong_num), (yyvsp[(9) - (10)].ulong_num));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1326:
-
-/* Line 1455 of yacc.c  */
-#line 9997 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-#ifdef HAVE_SPATIAL
-            (yyval.item)= (yyvsp[(1) - (1)].item);
-            /* $1 may be NULL, GEOM_NEW not tested for out of memory */
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-#else
-            my_error(ER_FEATURE_DISABLED, MYF(0),
-                     sym_group_geom.name, sym_group_geom.needed_define);
-            MYSQL_YYABORT;
-#endif
-          }
-    break;
-
-  case 1327:
-
-/* Line 1455 of yacc.c  */
-#line 10013 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= GEOM_NEW(YYTHD,
-                         Item_func_spatial_mbr_rel((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item),
-                                               Item_func::SP_CONTAINS_FUNC));
-          }
-    break;
-
-  case 1328:
-
-/* Line 1455 of yacc.c  */
-#line 10019 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= GEOM_NEW(YYTHD,
-                         Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list),
-                           Geometry::wkb_geometrycollection,
-                           Geometry::wkb_point));
-          }
-    break;
-
-  case 1329:
-
-/* Line 1455 of yacc.c  */
-#line 10026 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= GEOM_NEW(YYTHD,
-                         Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list),
-                           Geometry::wkb_linestring,
-                           Geometry::wkb_point));
-          }
-    break;
-
-  case 1330:
-
-/* Line 1455 of yacc.c  */
-#line 10033 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= GEOM_NEW(YYTHD,
-                         Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list),
-                           Geometry::wkb_multilinestring,
-                           Geometry::wkb_linestring));
-          }
-    break;
-
-  case 1331:
-
-/* Line 1455 of yacc.c  */
-#line 10040 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= GEOM_NEW(YYTHD,
-                         Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list),
-                           Geometry::wkb_multipoint,
-                           Geometry::wkb_point));
-          }
-    break;
-
-  case 1332:
-
-/* Line 1455 of yacc.c  */
-#line 10047 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= GEOM_NEW(YYTHD,
-                         Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list),
-                           Geometry::wkb_multipolygon,
-                           Geometry::wkb_polygon));
-          }
-    break;
-
-  case 1333:
-
-/* Line 1455 of yacc.c  */
-#line 10054 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= GEOM_NEW(YYTHD, Item_func_point((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)));
-          }
-    break;
-
-  case 1334:
-
-/* Line 1455 of yacc.c  */
-#line 10058 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= GEOM_NEW(YYTHD,
-                         Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list),
-                           Geometry::wkb_polygon,
-                           Geometry::wkb_linestring));
-          }
-    break;
-
-  case 1335:
-
-/* Line 1455 of yacc.c  */
-#line 10077 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-#ifdef HAVE_DLOPEN
-            udf_func *udf= 0;
-            LEX *lex= Lex;
-            if (using_udf_functions &&
-                (udf= find_udf((yyvsp[(1) - (2)].lex_str).str, (yyvsp[(1) - (2)].lex_str).length)) &&
-                udf->type == UDFTYPE_AGGREGATE)
-            {
-              if (lex->current_select->inc_in_sum_expr())
-              {
-                my_parse_error(ER(ER_SYNTAX_ERROR));
-                MYSQL_YYABORT;
-              }
-            }
-            /* Temporary placing the result of find_udf in $3 */
-            (yyval.udf)= udf;
-#endif
-          }
-    break;
-
-  case 1336:
-
-/* Line 1455 of yacc.c  */
-#line 10096 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            Create_func *builder;
-            Item *item= NULL;
-
-            if (sp_check_name(&(yyvsp[(1) - (5)].lex_str)))
-            {
-              MYSQL_YYABORT;
-            }
-
-            /*
-              Implementation note:
-              names are resolved with the following order:
-              - MySQL native functions,
-              - User Defined Functions,
-              - Stored Functions (assuming the current <use> database)
-
-              This will be revised with WL#2128 (SQL PATH)
-            */
-            builder= find_native_function_builder(thd, (yyvsp[(1) - (5)].lex_str));
-            if (builder)
-            {
-              item= builder->create_func(thd, (yyvsp[(1) - (5)].lex_str), (yyvsp[(4) - (5)].item_list));
-            }
-            else
-            {
-#ifdef HAVE_DLOPEN
-              /* Retrieving the result of find_udf */
-              udf_func *udf= (yyvsp[(3) - (5)].udf);
-
-              if (udf)
-              {
-                if (udf->type == UDFTYPE_AGGREGATE)
-                {
-                  Select->in_sum_expr--;
-                }
-
-                item= Create_udf_func::s_singleton.create(thd, udf, (yyvsp[(4) - (5)].item_list));
-              }
-              else
-#endif
-              {
-                builder= find_qualified_function_builder(thd);
-                DBUG_ASSERT(builder);
-                item= builder->create_func(thd, (yyvsp[(1) - (5)].lex_str), (yyvsp[(4) - (5)].item_list));
-              }
-            }
-
-            if (! ((yyval.item)= item))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1337:
-
-/* Line 1455 of yacc.c  */
-#line 10150 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            Create_qfunc *builder;
-            Item *item= NULL;
-
-            /*
-              The following in practice calls:
-              <code>Create_sp_func::create()</code>
-              and builds a stored function.
-
-              However, it's important to maintain the interface between the
-              parser and the implementation in item_create.cc clean,
-              since this will change with WL#2128 (SQL PATH):
-              - INFORMATION_SCHEMA.version() is the SQL 99 syntax for the native
-              function version(),
-              - MySQL.version() is the SQL 2003 syntax for the native function
-              version() (a vendor can specify any schema).
-            */
-
-            if (!(yyvsp[(1) - (6)].lex_str).str ||
-                (check_and_convert_db_name(&(yyvsp[(1) - (6)].lex_str), FALSE) != IDENT_NAME_OK))
-              MYSQL_YYABORT;
-            if (sp_check_name(&(yyvsp[(3) - (6)].lex_str)))
-            {
-              MYSQL_YYABORT;
-            }
-
-            builder= find_qualified_function_builder(thd);
-            DBUG_ASSERT(builder);
-            item= builder->create(thd, (yyvsp[(1) - (6)].lex_str), (yyvsp[(3) - (6)].lex_str), true, (yyvsp[(5) - (6)].item_list));
-
-            if (! ((yyval.item)= item))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1338:
-
-/* Line 1455 of yacc.c  */
-#line 10190 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= (yyvsp[(1) - (2)].num) | (yyvsp[(2) - (2)].num); }
-    break;
-
-  case 1339:
-
-/* Line 1455 of yacc.c  */
-#line 10192 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= FT_BOOL; }
-    break;
-
-  case 1340:
-
-/* Line 1455 of yacc.c  */
-#line 10196 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= FT_NL; }
-    break;
-
-  case 1341:
-
-/* Line 1455 of yacc.c  */
-#line 10197 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= FT_NL; }
-    break;
-
-  case 1342:
-
-/* Line 1455 of yacc.c  */
-#line 10201 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0;         }
-    break;
-
-  case 1343:
-
-/* Line 1455 of yacc.c  */
-#line 10202 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= FT_EXPAND; }
-    break;
-
-  case 1344:
-
-/* Line 1455 of yacc.c  */
-#line 10206 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item_list)= NULL; }
-    break;
-
-  case 1345:
-
-/* Line 1455 of yacc.c  */
-#line 10207 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item_list)= (yyvsp[(1) - (1)].item_list); }
-    break;
-
-  case 1346:
-
-/* Line 1455 of yacc.c  */
-#line 10212 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item_list)= new (YYTHD->mem_root) List<Item>;
-            if ((yyval.item_list) == NULL)
-              MYSQL_YYABORT;
-            (yyval.item_list)->push_back((yyvsp[(1) - (1)].item));
-          }
-    break;
-
-  case 1347:
-
-/* Line 1455 of yacc.c  */
-#line 10219 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(1) - (3)].item_list)->push_back((yyvsp[(3) - (3)].item));
-            (yyval.item_list)= (yyvsp[(1) - (3)].item_list);
-          }
-    break;
-
-  case 1348:
-
-/* Line 1455 of yacc.c  */
-#line 10227 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-             Use Item::name as a storage for the attribute value of user
-             defined function argument. It is safe to use Item::name
-             because the syntax will not allow having an explicit name here.
-             See WL#1017 re. udf attributes.
-            */
-            if ((yyvsp[(4) - (4)].lex_str).str)
-            {
-              (yyvsp[(2) - (4)].item)->item_name.copy((yyvsp[(4) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).length, system_charset_info, false);
-            }
-            /* 
-               A field has to have its proper name in order for name
-               resolution to work, something we are only guaranteed if we
-               parse it out. If we hijack the input stream with
-               remember_name we may get quoted or escaped names.
-            */
-            else if ((yyvsp[(2) - (4)].item)->type() != Item::FIELD_ITEM &&
-                     (yyvsp[(2) - (4)].item)->type() != Item::REF_ITEM /* For HAVING */ )
-              (yyvsp[(2) - (4)].item)->item_name.copy((yyvsp[(1) - (4)].simple_string), (uint) ((yyvsp[(3) - (4)].simple_string) - (yyvsp[(1) - (4)].simple_string)), YYTHD->charset());
-            (yyval.item)= (yyvsp[(2) - (4)].item);
-          }
-    break;
-
-  case 1349:
-
-/* Line 1455 of yacc.c  */
-#line 10253 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_avg((yyvsp[(3) - (4)].item), FALSE);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1350:
-
-/* Line 1455 of yacc.c  */
-#line 10259 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_avg((yyvsp[(4) - (5)].item), TRUE);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1351:
-
-/* Line 1455 of yacc.c  */
-#line 10265 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_and((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1352:
-
-/* Line 1455 of yacc.c  */
-#line 10271 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_or((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1353:
-
-/* Line 1455 of yacc.c  */
-#line 10277 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_xor((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1354:
-
-/* Line 1455 of yacc.c  */
-#line 10283 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *item= new (YYTHD->mem_root) Item_int((int32) 0L,1);
-            if (item == NULL)
-              MYSQL_YYABORT;
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_count(item);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1355:
-
-/* Line 1455 of yacc.c  */
-#line 10292 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_count((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1356:
-
-/* Line 1455 of yacc.c  */
-#line 10298 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->in_sum_expr++; }
-    break;
-
-  case 1357:
-
-/* Line 1455 of yacc.c  */
-#line 10300 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->in_sum_expr--; }
-    break;
-
-  case 1358:
-
-/* Line 1455 of yacc.c  */
-#line 10302 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_count(* (yyvsp[(5) - (7)].item_list));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1359:
-
-/* Line 1455 of yacc.c  */
-#line 10308 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_min((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1360:
-
-/* Line 1455 of yacc.c  */
-#line 10319 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_min((yyvsp[(4) - (5)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1361:
-
-/* Line 1455 of yacc.c  */
-#line 10325 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_max((yyvsp[(3) - (4)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1362:
-
-/* Line 1455 of yacc.c  */
-#line 10331 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_max((yyvsp[(4) - (5)].item));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1363:
-
-/* Line 1455 of yacc.c  */
-#line 10337 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_std((yyvsp[(3) - (4)].item), 0);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1364:
-
-/* Line 1455 of yacc.c  */
-#line 10343 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_variance((yyvsp[(3) - (4)].item), 0);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1365:
-
-/* Line 1455 of yacc.c  */
-#line 10349 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_std((yyvsp[(3) - (4)].item), 1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1366:
-
-/* Line 1455 of yacc.c  */
-#line 10355 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_variance((yyvsp[(3) - (4)].item), 1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1367:
-
-/* Line 1455 of yacc.c  */
-#line 10361 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_sum((yyvsp[(3) - (4)].item), FALSE);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1368:
-
-/* Line 1455 of yacc.c  */
-#line 10367 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_sum_sum((yyvsp[(4) - (5)].item), TRUE);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1369:
-
-/* Line 1455 of yacc.c  */
-#line 10373 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->in_sum_expr++; }
-    break;
-
-  case 1370:
-
-/* Line 1455 of yacc.c  */
-#line 10377 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            SELECT_LEX *sel= Select;
-            sel->in_sum_expr--;
-            (yyval.item)= new (YYTHD->mem_root)
-                  Item_func_group_concat(Lex->current_context(), (yyvsp[(3) - (8)].num), (yyvsp[(5) - (8)].item_list),
-                                         sel->gorder_list, (yyvsp[(7) - (8)].string));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            (yyvsp[(5) - (8)].item_list)->empty();
-            sel->gorder_list.empty();
-          }
-    break;
-
-  case 1371:
-
-/* Line 1455 of yacc.c  */
-#line 10392 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (! Lex->parsing_options.allows_variable)
-            {
-              my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1372:
-
-/* Line 1455 of yacc.c  */
-#line 10400 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= (yyvsp[(3) - (3)].item);
-          }
-    break;
-
-  case 1373:
-
-/* Line 1455 of yacc.c  */
-#line 10407 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item_func_set_user_var *item;
-            (yyval.item)= item=
-              new (YYTHD->mem_root) Item_func_set_user_var((yyvsp[(1) - (3)].lex_str), (yyvsp[(3) - (3)].item), false);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            LEX *lex= Lex;
-            lex->uncacheable(UNCACHEABLE_RAND);
-            lex->set_var_list.push_back(item);
-          }
-    break;
-
-  case 1374:
-
-/* Line 1455 of yacc.c  */
-#line 10418 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_func_get_user_var((yyvsp[(1) - (1)].lex_str));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            LEX *lex= Lex;
-            lex->uncacheable(UNCACHEABLE_RAND);
-          }
-    break;
-
-  case 1375:
-
-/* Line 1455 of yacc.c  */
-#line 10426 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* disallow "SELECT @@global.global.variable" */
-            if ((yyvsp[(3) - (4)].lex_str).str && (yyvsp[(4) - (4)].lex_str).str && check_reserved_words(&(yyvsp[(3) - (4)].lex_str)))
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            if (!((yyval.item)= get_system_var(YYTHD, (yyvsp[(2) - (4)].var_type), (yyvsp[(3) - (4)].lex_str), (yyvsp[(4) - (4)].lex_str))))
-              MYSQL_YYABORT;
-            if (!((Item_func_get_system_var*) (yyval.item))->is_written_to_binlog())
-              Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_VARIABLE);
-          }
-    break;
-
-  case 1376:
-
-/* Line 1455 of yacc.c  */
-#line 10441 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num) = 0; }
-    break;
-
-  case 1377:
-
-/* Line 1455 of yacc.c  */
-#line 10442 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num) = 1; }
-    break;
-
-  case 1378:
-
-/* Line 1455 of yacc.c  */
-#line 10447 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.string)= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1);
-            if ((yyval.string) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1379:
-
-/* Line 1455 of yacc.c  */
-#line 10452 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.string) = (yyvsp[(2) - (2)].string); }
-    break;
-
-  case 1381:
-
-/* Line 1455 of yacc.c  */
-#line 10458 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            SELECT_LEX *sel= lex->current_select;
-            if (sel->linkage != GLOBAL_OPTIONS_TYPE &&
-                sel->olap != UNSPECIFIED_OLAP_TYPE &&
-                (sel->linkage != UNION_TYPE || sel->braces))
-            {
-              my_error(ER_WRONG_USAGE, MYF(0),
-                       "CUBE/ROLLUP", "ORDER BY");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1383:
-
-/* Line 1455 of yacc.c  */
-#line 10475 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { if (add_gorder_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; }
-    break;
-
-  case 1384:
-
-/* Line 1455 of yacc.c  */
-#line 10477 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { if (add_gorder_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; }
-    break;
-
-  case 1385:
-
-/* Line 1455 of yacc.c  */
-#line 10482 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->current_select->inc_in_sum_expr())
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1386:
-
-/* Line 1455 of yacc.c  */
-#line 10491 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->in_sum_expr--;
-            (yyval.item)= (yyvsp[(3) - (3)].item);
-          }
-    break;
-
-  case 1387:
-
-/* Line 1455 of yacc.c  */
-#line 10499 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; }
-    break;
-
-  case 1388:
-
-/* Line 1455 of yacc.c  */
-#line 10501 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->dec= 0; }
-    break;
-
-  case 1389:
-
-/* Line 1455 of yacc.c  */
-#line 10503 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; }
-    break;
-
-  case 1390:
-
-/* Line 1455 of yacc.c  */
-#line 10505 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
-    break;
-
-  case 1391:
-
-/* Line 1455 of yacc.c  */
-#line 10507 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
-    break;
-
-  case 1392:
-
-/* Line 1455 of yacc.c  */
-#line 10509 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
-    break;
-
-  case 1393:
-
-/* Line 1455 of yacc.c  */
-#line 10511 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
-    break;
-
-  case 1394:
-
-/* Line 1455 of yacc.c  */
-#line 10513 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)= ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec= Lex->length= (char *) 0; }
-    break;
-
-  case 1395:
-
-/* Line 1455 of yacc.c  */
-#line 10515 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)= ITEM_CAST_TIME; Lex->charset= NULL; Lex->length= (char *) 0; }
-    break;
-
-  case 1396:
-
-/* Line 1455 of yacc.c  */
-#line 10517 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)= ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->length= (char *) 0; }
-    break;
-
-  case 1397:
-
-/* Line 1455 of yacc.c  */
-#line 10519 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.cast_type)=ITEM_CAST_DECIMAL; Lex->charset= NULL; }
-    break;
-
-  case 1398:
-
-/* Line 1455 of yacc.c  */
-#line 10523 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item_list)= NULL; }
-    break;
-
-  case 1399:
-
-/* Line 1455 of yacc.c  */
-#line 10524 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);}
-    break;
-
-  case 1400:
-
-/* Line 1455 of yacc.c  */
-#line 10529 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item_list)= new (YYTHD->mem_root) List<Item>;
-            if ((yyval.item_list) == NULL)
-              MYSQL_YYABORT;
-            (yyval.item_list)->push_back((yyvsp[(1) - (1)].item));
-          }
-    break;
-
-  case 1401:
-
-/* Line 1455 of yacc.c  */
-#line 10536 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(1) - (3)].item_list)->push_back((yyvsp[(3) - (3)].item));
-            (yyval.item_list)= (yyvsp[(1) - (3)].item_list);
-          }
-    break;
-
-  case 1402:
-
-/* Line 1455 of yacc.c  */
-#line 10543 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item_list)= (yyvsp[(1) - (1)].item_list); }
-    break;
-
-  case 1403:
-
-/* Line 1455 of yacc.c  */
-#line 10544 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item_list)= (yyvsp[(2) - (3)].item_list); }
-    break;
-
-  case 1404:
-
-/* Line 1455 of yacc.c  */
-#line 10549 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item_list)= new (YYTHD->mem_root) List<Item>;
-            if ((yyval.item_list) == NULL)
-              MYSQL_YYABORT;
-            (yyval.item_list)->push_back((yyvsp[(1) - (1)].item));
-          }
-    break;
-
-  case 1405:
-
-/* Line 1455 of yacc.c  */
-#line 10556 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(1) - (3)].item_list)->push_back((yyvsp[(3) - (3)].item));
-            (yyval.item_list)= (yyvsp[(1) - (3)].item_list);
-          }
-    break;
-
-  case 1406:
-
-/* Line 1455 of yacc.c  */
-#line 10563 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= NULL; }
-    break;
-
-  case 1407:
-
-/* Line 1455 of yacc.c  */
-#line 10564 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(1) - (1)].item); }
-    break;
-
-  case 1408:
-
-/* Line 1455 of yacc.c  */
-#line 10568 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= NULL; }
-    break;
-
-  case 1409:
-
-/* Line 1455 of yacc.c  */
-#line 10569 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(2) - (2)].item); }
-    break;
-
-  case 1410:
-
-/* Line 1455 of yacc.c  */
-#line 10574 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item_list)= new List<Item>;
-            if ((yyval.item_list) == NULL)
-              MYSQL_YYABORT;
-            (yyval.item_list)->push_back((yyvsp[(2) - (4)].item));
-            (yyval.item_list)->push_back((yyvsp[(4) - (4)].item));
-          }
-    break;
-
-  case 1411:
-
-/* Line 1455 of yacc.c  */
-#line 10582 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(3) - (5)].item));
-            (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(5) - (5)].item));
-            (yyval.item_list)= (yyvsp[(1) - (5)].item_list);
-          }
-    break;
-
-  case 1412:
-
-/* Line 1455 of yacc.c  */
-#line 10592 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); }
-    break;
-
-  case 1413:
-
-/* Line 1455 of yacc.c  */
-#line 10594 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (!((yyval.table_list)= lex->current_select->nest_last_join(lex->thd)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1414:
-
-/* Line 1455 of yacc.c  */
-#line 10602 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { MYSQL_YYABORT_UNLESS((yyval.table_list)=(yyvsp[(1) - (1)].table_list)); }
-    break;
-
-  case 1415:
-
-/* Line 1455 of yacc.c  */
-#line 10613 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); }
-    break;
-
-  case 1416:
-
-/* Line 1455 of yacc.c  */
-#line 10614 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.table_list)=(yyvsp[(3) - (4)].table_list); }
-    break;
-
-  case 1417:
-
-/* Line 1455 of yacc.c  */
-#line 10620 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); }
-    break;
-
-  case 1418:
-
-/* Line 1455 of yacc.c  */
-#line 10622 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list)));
-          }
-    break;
-
-  case 1419:
-
-/* Line 1455 of yacc.c  */
-#line 10642 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); }
-    break;
-
-  case 1420:
-
-/* Line 1455 of yacc.c  */
-#line 10644 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); (yyvsp[(3) - (3)].table_list)->straight=1; }
-    break;
-
-  case 1421:
-
-/* Line 1455 of yacc.c  */
-#line 10647 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list));
-            /* Change the current name resolution context to a local context. */
-            if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (4)].table_list), (yyvsp[(3) - (4)].table_list)))
-              MYSQL_YYABORT;
-            Select->parsing_place= IN_ON;
-          }
-    break;
-
-  case 1422:
-
-/* Line 1455 of yacc.c  */
-#line 10655 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item));
-            Lex->pop_context();
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 1423:
-
-/* Line 1455 of yacc.c  */
-#line 10662 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list));
-            /* Change the current name resolution context to a local context. */
-            if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (4)].table_list), (yyvsp[(3) - (4)].table_list)))
-              MYSQL_YYABORT;
-            Select->parsing_place= IN_ON;
-          }
-    break;
-
-  case 1424:
-
-/* Line 1455 of yacc.c  */
-#line 10670 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(3) - (6)].table_list)->straight=1;
-            add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item));
-            Lex->pop_context();
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 1425:
-
-/* Line 1455 of yacc.c  */
-#line 10678 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list));
-          }
-    break;
-
-  case 1426:
-
-/* Line 1455 of yacc.c  */
-#line 10682 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { add_join_natural((yyvsp[(1) - (8)].table_list),(yyvsp[(3) - (8)].table_list),(yyvsp[(7) - (8)].string_list),Select); (yyval.table_list)=(yyvsp[(3) - (8)].table_list); }
-    break;
-
-  case 1427:
-
-/* Line 1455 of yacc.c  */
-#line 10684 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && ((yyval.table_list)=(yyvsp[(4) - (4)].table_list)));
-            add_join_natural((yyvsp[(1) - (4)].table_list),(yyvsp[(4) - (4)].table_list),NULL,Select);
-          }
-    break;
-
-  case 1428:
-
-/* Line 1455 of yacc.c  */
-#line 10692 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list));
-            /* Change the current name resolution context to a local context. */
-            if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (6)].table_list), (yyvsp[(5) - (6)].table_list)))
-              MYSQL_YYABORT;
-            Select->parsing_place= IN_ON;
-          }
-    break;
-
-  case 1429:
-
-/* Line 1455 of yacc.c  */
-#line 10700 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            add_join_on((yyvsp[(5) - (8)].table_list),(yyvsp[(8) - (8)].item));
-            Lex->pop_context();
-            (yyvsp[(5) - (8)].table_list)->outer_join|=JOIN_TYPE_LEFT;
-            (yyval.table_list)=(yyvsp[(5) - (8)].table_list);
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 1430:
-
-/* Line 1455 of yacc.c  */
-#line 10708 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list));
-          }
-    break;
-
-  case 1431:
-
-/* Line 1455 of yacc.c  */
-#line 10712 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            add_join_natural((yyvsp[(1) - (10)].table_list),(yyvsp[(5) - (10)].table_list),(yyvsp[(9) - (10)].string_list),Select); 
-            (yyvsp[(5) - (10)].table_list)->outer_join|=JOIN_TYPE_LEFT; 
-            (yyval.table_list)=(yyvsp[(5) - (10)].table_list); 
-          }
-    break;
-
-  case 1432:
-
-/* Line 1455 of yacc.c  */
-#line 10718 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list));
-            add_join_natural((yyvsp[(1) - (6)].table_list),(yyvsp[(6) - (6)].table_list),NULL,Select);
-            (yyvsp[(6) - (6)].table_list)->outer_join|=JOIN_TYPE_LEFT;
-            (yyval.table_list)=(yyvsp[(6) - (6)].table_list);
-          }
-    break;
-
-  case 1433:
-
-/* Line 1455 of yacc.c  */
-#line 10728 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list));
-            /* Change the current name resolution context to a local context. */
-            if (push_new_name_resolution_context(YYTHD, (yyvsp[(1) - (6)].table_list), (yyvsp[(5) - (6)].table_list)))
-              MYSQL_YYABORT;
-            Select->parsing_place= IN_ON;
-          }
-    break;
-
-  case 1434:
-
-/* Line 1455 of yacc.c  */
-#line 10736 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (!((yyval.table_list)= lex->current_select->convert_right_join()))
-              MYSQL_YYABORT;
-            add_join_on((yyval.table_list), (yyvsp[(8) - (8)].item));
-            Lex->pop_context();
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 1435:
-
-/* Line 1455 of yacc.c  */
-#line 10745 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list));
-          }
-    break;
-
-  case 1436:
-
-/* Line 1455 of yacc.c  */
-#line 10749 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (!((yyval.table_list)= lex->current_select->convert_right_join()))
-              MYSQL_YYABORT;
-            add_join_natural((yyval.table_list),(yyvsp[(5) - (10)].table_list),(yyvsp[(9) - (10)].string_list),Select);
-          }
-    break;
-
-  case 1437:
-
-/* Line 1455 of yacc.c  */
-#line 10756 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list));
-            add_join_natural((yyvsp[(6) - (6)].table_list),(yyvsp[(1) - (6)].table_list),NULL,Select);
-            LEX *lex= Lex;
-            if (!((yyval.table_list)= lex->current_select->convert_right_join()))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1438:
-
-/* Line 1455 of yacc.c  */
-#line 10766 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1439:
-
-/* Line 1455 of yacc.c  */
-#line 10767 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1440:
-
-/* Line 1455 of yacc.c  */
-#line 10768 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1441:
-
-/* Line 1455 of yacc.c  */
-#line 10776 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.string_list)= 0;}
-    break;
-
-  case 1443:
-
-/* Line 1455 of yacc.c  */
-#line 10782 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.string_list)= (yyvsp[(3) - (5)].string_list);
-          }
-    break;
-
-  case 1444:
-
-/* Line 1455 of yacc.c  */
-#line 10796 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            SELECT_LEX *sel= Select;
-            sel->table_join_options= 0;
-          }
-    break;
-
-  case 1445:
-
-/* Line 1455 of yacc.c  */
-#line 10801 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyval.table_list)= Select->add_table_to_list(YYTHD, (yyvsp[(2) - (5)].table), (yyvsp[(4) - (5)].lex_str_ptr),
-                                                Select->get_table_join_options(),
-                                                YYPS->m_lock_type,
-                                                YYPS->m_mdl_type,
-                                                Select->pop_index_hints(),
-                                                (yyvsp[(3) - (5)].string_list))))
-              MYSQL_YYABORT;
-            Select->add_joined_table((yyval.table_list));
-          }
-    break;
-
-  case 1446:
-
-/* Line 1455 of yacc.c  */
-#line 10812 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            SELECT_LEX *sel= lex->current_select;
-            if ((yyvsp[(1) - (3)].num))
-            {
-              if (sel->set_braces(1))
-              {
-                my_parse_error(ER(ER_SYNTAX_ERROR));
-                MYSQL_YYABORT;
-              }
-              /* select in braces, can't contain global parameters */
-              if (sel->master_unit()->fake_select_lex)
-                sel->master_unit()->global_parameters=
-                   sel->master_unit()->fake_select_lex;
-            }
-            if ((yyvsp[(2) - (3)].select_lex)->init_nested_join(lex->thd))
-              MYSQL_YYABORT;
-            (yyval.table_list)= 0;
-            /* incomplete derived tables return NULL, we must be
-               nested in select_derived rule to be here. */
-          }
-    break;
-
-  case 1447:
-
-/* Line 1455 of yacc.c  */
-#line 10852 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* Use $2 instead of Lex->current_select as derived table will
-               alter value of Lex->current_select. */
-            if (!((yyvsp[(3) - (5)].table_list) || (yyvsp[(5) - (5)].lex_str_ptr)) && (yyvsp[(2) - (5)].select_lex)->embedding &&
-                !(yyvsp[(2) - (5)].select_lex)->embedding->nested_join->join_list.elements)
-            {
-              /* we have a derived table ($3 == NULL) but no alias,
-                 Since we are nested in further parentheses so we
-                 can pass NULL to the outer level parentheses
-                 Permits parsing of "((((select ...))) as xyz)" */
-              (yyval.table_list)= 0;
-            }
-            else if (!(yyvsp[(3) - (5)].table_list))
-            {
-              /* Handle case of derived table, alias may be NULL if there
-                 are no outer parentheses, add_table_to_list() will throw
-                 error in this case */
-              LEX *lex=Lex;
-              SELECT_LEX *sel= lex->current_select;
-              SELECT_LEX_UNIT *unit= sel->master_unit();
-              lex->current_select= sel= unit->outer_select();
-              Table_ident *ti= new Table_ident(unit);
-              if (ti == NULL)
-                MYSQL_YYABORT;
-              if (!((yyval.table_list)= sel->add_table_to_list(lex->thd,
-                                               ti, (yyvsp[(5) - (5)].lex_str_ptr), 0,
-                                               TL_READ, MDL_SHARED_READ)))
-
-                MYSQL_YYABORT;
-              sel->add_joined_table((yyval.table_list));
-              lex->pop_context();
-              lex->nest_level--;
-            }
-            else if ((yyvsp[(5) - (5)].lex_str_ptr) != NULL)
-            {
-              /*
-                Tables with or without joins within parentheses cannot
-                have aliases, and we ruled out derived tables above.
-              */
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            else
-            {
-              /* nested join: FROM (t1 JOIN t2 ...),
-                 nest_level is the same as in the outer query */
-              (yyval.table_list)= (yyvsp[(3) - (5)].table_list);
-            }
-          }
-    break;
-
-  case 1448:
-
-/* Line 1455 of yacc.c  */
-#line 10925 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((yyvsp[(1) - (2)].table_list) && (yyvsp[(2) - (2)].is_not_empty))
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1449:
-
-/* Line 1455 of yacc.c  */
-#line 10935 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_select_to_union_list(Lex, (bool)(yyvsp[(3) - (3)].num), FALSE))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1450:
-
-/* Line 1455 of yacc.c  */
-#line 10940 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              Remove from the name resolution context stack the context of the
-              last select in the union.
-             */
-            Lex->pop_context();
-          }
-    break;
-
-  case 1451:
-
-/* Line 1455 of yacc.c  */
-#line 10948 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((yyvsp[(1) - (7)].table_list) != NULL)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1452:
-
-/* Line 1455 of yacc.c  */
-#line 10960 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            SELECT_LEX * sel= lex->current_select;
-            if (lex->current_select->set_braces(0))
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            if (sel->linkage == UNION_TYPE &&
-                sel->master_unit()->first_select()->braces)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1453:
-
-/* Line 1455 of yacc.c  */
-#line 10979 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            SELECT_LEX *sel= lex->current_select;
-            if (sel->linkage != UNION_TYPE)
-              mysql_init_select(lex);
-            lex->current_select->parsing_place= SELECT_LIST;
-          }
-    break;
-
-  case 1454:
-
-/* Line 1455 of yacc.c  */
-#line 10987 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 1456:
-
-/* Line 1455 of yacc.c  */
-#line 10996 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if ((yyvsp[(1) - (1)].select_lex)->init_nested_join(lex->thd))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1457:
-
-/* Line 1455 of yacc.c  */
-#line 11002 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            /* for normal joins, $3 != NULL and end_nested_join() != NULL,
-               for derived tables, both must equal NULL */
-
-            if (!((yyval.table_list)= (yyvsp[(1) - (3)].select_lex)->end_nested_join(lex->thd)) && (yyvsp[(3) - (3)].table_list))
-              MYSQL_YYABORT;
-            if (!(yyvsp[(3) - (3)].table_list) && (yyval.table_list))
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1458:
-
-/* Line 1455 of yacc.c  */
-#line 11018 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->derived_tables|= DERIVED_SUBQUERY;
-            if (!lex->expr_allows_subselect ||
-                lex->sql_command == (int)SQLCOM_PURGE)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE ||
-                mysql_new_select(lex, 1))
-              MYSQL_YYABORT;
-            mysql_init_select(lex);
-            lex->current_select->linkage= DERIVED_TABLE_TYPE;
-            lex->current_select->parsing_place= SELECT_LIST;
-          }
-    break;
-
-  case 1459:
-
-/* Line 1455 of yacc.c  */
-#line 11035 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 1461:
-
-/* Line 1455 of yacc.c  */
-#line 11042 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.select_lex)= Select; }
-    break;
-
-  case 1462:
-
-/* Line 1455 of yacc.c  */
-#line 11047 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            if (! lex->parsing_options.allows_derived)
-            {
-              my_error(ER_VIEW_SELECT_DERIVED, MYF(0));
-              MYSQL_YYABORT;
-            }
-
-            SELECT_LEX *sel= lex->current_select;
-            TABLE_LIST *embedding;
-            if (!sel->embedding || sel->end_nested_join(lex->thd))
-            {
-              /* we are not in parentheses */
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            embedding= Select->embedding;
-            (yyval.num)= embedding &&
-                !embedding->nested_join->join_list.elements;
-            /* return true if we are deeply nested */
-          }
-    break;
-
-  case 1463:
-
-/* Line 1455 of yacc.c  */
-#line 11072 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1464:
-
-/* Line 1455 of yacc.c  */
-#line 11073 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1465:
-
-/* Line 1455 of yacc.c  */
-#line 11078 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.num)= old_mode ?  INDEX_HINT_MASK_JOIN : INDEX_HINT_MASK_ALL; 
-          }
-    break;
-
-  case 1466:
-
-/* Line 1455 of yacc.c  */
-#line 11081 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= INDEX_HINT_MASK_JOIN;  }
-    break;
-
-  case 1467:
-
-/* Line 1455 of yacc.c  */
-#line 11082 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= INDEX_HINT_MASK_ORDER; }
-    break;
-
-  case 1468:
-
-/* Line 1455 of yacc.c  */
-#line 11083 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= INDEX_HINT_MASK_GROUP; }
-    break;
-
-  case 1469:
-
-/* Line 1455 of yacc.c  */
-#line 11087 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.index_hint)= INDEX_HINT_FORCE; }
-    break;
-
-  case 1470:
-
-/* Line 1455 of yacc.c  */
-#line 11088 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.index_hint)= INDEX_HINT_IGNORE; }
-    break;
-
-  case 1471:
-
-/* Line 1455 of yacc.c  */
-#line 11093 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->set_index_hint_type((yyvsp[(1) - (3)].index_hint), (yyvsp[(3) - (3)].num));
-          }
-    break;
-
-  case 1473:
-
-/* Line 1455 of yacc.c  */
-#line 11098 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->set_index_hint_type(INDEX_HINT_USE, (yyvsp[(3) - (3)].num));
-          }
-    break;
-
-  case 1478:
-
-/* Line 1455 of yacc.c  */
-#line 11111 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->alloc_index_hints(YYTHD); }
-    break;
-
-  case 1480:
-
-/* Line 1455 of yacc.c  */
-#line 11115 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {  Select->clear_index_hints(); }
-    break;
-
-  case 1482:
-
-/* Line 1455 of yacc.c  */
-#line 11120 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->add_index_hint(YYTHD, NULL, 0); }
-    break;
-
-  case 1483:
-
-/* Line 1455 of yacc.c  */
-#line 11121 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1484:
-
-/* Line 1455 of yacc.c  */
-#line 11126 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->add_index_hint(YYTHD, (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); }
-    break;
-
-  case 1485:
-
-/* Line 1455 of yacc.c  */
-#line 11128 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->add_index_hint(YYTHD, (char *)"PRIMARY", 7); }
-    break;
-
-  case 1488:
-
-/* Line 1455 of yacc.c  */
-#line 11138 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyval.string_list)= new List<String>))
-              MYSQL_YYABORT;
-            String *s= new (YYTHD->mem_root) String((const char *) (yyvsp[(1) - (1)].lex_str).str,
-                                                    (yyvsp[(1) - (1)].lex_str).length,
-                                                    system_charset_info);
-            if (s == NULL)
-              MYSQL_YYABORT;
-            (yyval.string_list)->push_back(s);
-          }
-    break;
-
-  case 1489:
-
-/* Line 1455 of yacc.c  */
-#line 11149 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            String *s= new (YYTHD->mem_root) String((const char *) (yyvsp[(3) - (3)].lex_str).str,
-                                                    (yyvsp[(3) - (3)].lex_str).length,
-                                                    system_charset_info);
-            if (s == NULL)
-              MYSQL_YYABORT;
-            (yyvsp[(1) - (3)].string_list)->push_back(s);
-            (yyval.string_list)= (yyvsp[(1) - (3)].string_list);
-          }
-    break;
-
-  case 1490:
-
-/* Line 1455 of yacc.c  */
-#line 11161 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1491:
-
-/* Line 1455 of yacc.c  */
-#line 11162 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_DAY_HOUR; }
-    break;
-
-  case 1492:
-
-/* Line 1455 of yacc.c  */
-#line 11163 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_DAY_MICROSECOND; }
-    break;
-
-  case 1493:
-
-/* Line 1455 of yacc.c  */
-#line 11164 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_DAY_MINUTE; }
-    break;
-
-  case 1494:
-
-/* Line 1455 of yacc.c  */
-#line 11165 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_DAY_SECOND; }
-    break;
-
-  case 1495:
-
-/* Line 1455 of yacc.c  */
-#line 11166 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_HOUR_MICROSECOND; }
-    break;
-
-  case 1496:
-
-/* Line 1455 of yacc.c  */
-#line 11167 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_HOUR_MINUTE; }
-    break;
-
-  case 1497:
-
-/* Line 1455 of yacc.c  */
-#line 11168 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_HOUR_SECOND; }
-    break;
-
-  case 1498:
-
-/* Line 1455 of yacc.c  */
-#line 11169 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_MINUTE_MICROSECOND; }
-    break;
-
-  case 1499:
-
-/* Line 1455 of yacc.c  */
-#line 11170 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_MINUTE_SECOND; }
-    break;
-
-  case 1500:
-
-/* Line 1455 of yacc.c  */
-#line 11171 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_SECOND_MICROSECOND; }
-    break;
-
-  case 1501:
-
-/* Line 1455 of yacc.c  */
-#line 11172 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval)=INTERVAL_YEAR_MONTH; }
-    break;
-
-  case 1502:
-
-/* Line 1455 of yacc.c  */
-#line 11176 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval_time_st)=INTERVAL_DAY; }
-    break;
-
-  case 1503:
-
-/* Line 1455 of yacc.c  */
-#line 11177 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval_time_st)=INTERVAL_WEEK; }
-    break;
-
-  case 1504:
-
-/* Line 1455 of yacc.c  */
-#line 11178 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval_time_st)=INTERVAL_HOUR; }
-    break;
-
-  case 1505:
-
-/* Line 1455 of yacc.c  */
-#line 11179 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval_time_st)=INTERVAL_MINUTE; }
-    break;
-
-  case 1506:
-
-/* Line 1455 of yacc.c  */
-#line 11180 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval_time_st)=INTERVAL_MONTH; }
-    break;
-
-  case 1507:
-
-/* Line 1455 of yacc.c  */
-#line 11181 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval_time_st)=INTERVAL_QUARTER; }
-    break;
-
-  case 1508:
-
-/* Line 1455 of yacc.c  */
-#line 11182 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval_time_st)=INTERVAL_SECOND; }
-    break;
-
-  case 1509:
-
-/* Line 1455 of yacc.c  */
-#line 11183 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval_time_st)=INTERVAL_MICROSECOND; }
-    break;
-
-  case 1510:
-
-/* Line 1455 of yacc.c  */
-#line 11184 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.interval_time_st)=INTERVAL_YEAR; }
-    break;
-
-  case 1511:
-
-/* Line 1455 of yacc.c  */
-#line 11188 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {(yyval.date_time_type)= MYSQL_TIMESTAMP_DATE; }
-    break;
-
-  case 1512:
-
-/* Line 1455 of yacc.c  */
-#line 11189 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {(yyval.date_time_type)= MYSQL_TIMESTAMP_TIME; }
-    break;
-
-  case 1513:
-
-/* Line 1455 of yacc.c  */
-#line 11190 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {(yyval.date_time_type)= MYSQL_TIMESTAMP_DATETIME; }
-    break;
-
-  case 1514:
-
-/* Line 1455 of yacc.c  */
-#line 11191 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {(yyval.date_time_type)= MYSQL_TIMESTAMP_DATETIME; }
-    break;
-
-  case 1518:
-
-/* Line 1455 of yacc.c  */
-#line 11201 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str_ptr)=0; }
-    break;
-
-  case 1519:
-
-/* Line 1455 of yacc.c  */
-#line 11203 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.lex_str_ptr)= (LEX_STRING*) sql_memdup(&(yyvsp[(2) - (2)].lex_str),sizeof(LEX_STRING));
-            if ((yyval.lex_str_ptr) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1522:
-
-/* Line 1455 of yacc.c  */
-#line 11216 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->where= 0; }
-    break;
-
-  case 1523:
-
-/* Line 1455 of yacc.c  */
-#line 11218 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->parsing_place= IN_WHERE;
-          }
-    break;
-
-  case 1524:
-
-/* Line 1455 of yacc.c  */
-#line 11222 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            SELECT_LEX *select= Select;
-            select->where= (yyvsp[(3) - (3)].item);
-            select->parsing_place= NO_MATTER;
-            if ((yyvsp[(3) - (3)].item))
-              (yyvsp[(3) - (3)].item)->top_level_item();
-          }
-    break;
-
-  case 1526:
-
-/* Line 1455 of yacc.c  */
-#line 11234 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->parsing_place= IN_HAVING;
-          }
-    break;
-
-  case 1527:
-
-/* Line 1455 of yacc.c  */
-#line 11238 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            SELECT_LEX *sel= Select;
-            sel->having= (yyvsp[(3) - (3)].item);
-            sel->parsing_place= NO_MATTER;
-            if ((yyvsp[(3) - (3)].item))
-              (yyvsp[(3) - (3)].item)->top_level_item();
-          }
-    break;
-
-  case 1528:
-
-/* Line 1455 of yacc.c  */
-#line 11249 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->escape_used= TRUE;
-            (yyval.item)= (yyvsp[(2) - (2)].item);
-          }
-    break;
-
-  case 1529:
-
-/* Line 1455 of yacc.c  */
-#line 11254 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            Lex->escape_used= FALSE;
-            (yyval.item)= ((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ?
-                 new (thd->mem_root) Item_string("", 0, &my_charset_latin1) :
-                 new (thd->mem_root) Item_string("\\", 1, &my_charset_latin1));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1532:
-
-/* Line 1455 of yacc.c  */
-#line 11276 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { if (add_group_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; }
-    break;
-
-  case 1533:
-
-/* Line 1455 of yacc.c  */
-#line 11278 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { if (add_group_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; }
-    break;
-
-  case 1534:
-
-/* Line 1455 of yacc.c  */
-#line 11282 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1535:
-
-/* Line 1455 of yacc.c  */
-#line 11284 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              'WITH CUBE' is reserved in the MySQL syntax, but not implemented,
-              and cause LALR(2) conflicts.
-              This syntax is not standard.
-              MySQL syntax: GROUP BY col1, col2, col3 WITH CUBE
-              SQL-2003: GROUP BY ... CUBE(col1, col2, col3)
-            */
-            LEX *lex=Lex;
-            if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
-            {
-              my_error(ER_WRONG_USAGE, MYF(0), "WITH CUBE",
-                       "global union parameters");
-              MYSQL_YYABORT;
-            }
-            lex->current_select->olap= CUBE_TYPE;
-            my_error(ER_NOT_SUPPORTED_YET, MYF(0), "CUBE");
-            MYSQL_YYABORT;
-          }
-    break;
-
-  case 1536:
-
-/* Line 1455 of yacc.c  */
-#line 11304 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              'WITH ROLLUP' is needed for backward compatibility,
-              and cause LALR(2) conflicts.
-              This syntax is not standard.
-              MySQL syntax: GROUP BY col1, col2, col3 WITH ROLLUP
-              SQL-2003: GROUP BY ... ROLLUP(col1, col2, col3)
-            */
-            LEX *lex= Lex;
-            if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
-            {
-              my_error(ER_WRONG_USAGE, MYF(0), "WITH ROLLUP",
-                       "global union parameters");
-              MYSQL_YYABORT;
-            }
-            if (lex->current_select->options & SELECT_DISTINCT)
-            {
-              // DISTINCT+ROLLUP does not work
-              my_error(ER_WRONG_USAGE, MYF(0), "WITH ROLLUP", "DISTINCT");
-              MYSQL_YYABORT;
-            }
-            lex->current_select->olap= ROLLUP_TYPE;
-          }
-    break;
-
-  case 1540:
-
-/* Line 1455 of yacc.c  */
-#line 11344 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            bool ascending= ((yyvsp[(2) - (2)].num) == 1) ? true : false;
-            if (add_order_to_list(thd, (yyvsp[(1) - (2)].item), ascending))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1543:
-
-/* Line 1455 of yacc.c  */
-#line 11363 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            SELECT_LEX *sel= lex->current_select;
-            SELECT_LEX_UNIT *unit= sel-> master_unit();
-            if (sel->linkage != GLOBAL_OPTIONS_TYPE &&
-                sel->olap != UNSPECIFIED_OLAP_TYPE &&
-                (sel->linkage != UNION_TYPE || sel->braces))
-            {
-              my_error(ER_WRONG_USAGE, MYF(0),
-                       "CUBE/ROLLUP", "ORDER BY");
-              MYSQL_YYABORT;
-            }
-            if (lex->sql_command != SQLCOM_ALTER_TABLE && !unit->fake_select_lex)
-            {
-              /*
-                A query of the of the form (SELECT ...) ORDER BY order_list is
-                executed in the same way as the query
-                SELECT ... ORDER BY order_list
-                unless the SELECT construct contains ORDER BY or LIMIT clauses.
-                Otherwise we create a fake SELECT_LEX if it has not been created
-                yet.
-              */
-              SELECT_LEX *first_sl= unit->first_select();
-              if (!unit->is_union() &&
-                  (first_sl->order_list.elements || 
-                   first_sl->select_limit) &&            
-                  unit->add_fake_select_lex(lex->thd))
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1545:
-
-/* Line 1455 of yacc.c  */
-#line 11398 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { if (add_order_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; }
-    break;
-
-  case 1546:
-
-/* Line 1455 of yacc.c  */
-#line 11400 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { if (add_order_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; }
-    break;
-
-  case 1547:
-
-/* Line 1455 of yacc.c  */
-#line 11404 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num) =  1; }
-    break;
-
-  case 1548:
-
-/* Line 1455 of yacc.c  */
-#line 11405 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num) =1; }
-    break;
-
-  case 1549:
-
-/* Line 1455 of yacc.c  */
-#line 11406 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num) =0; }
-    break;
-
-  case 1550:
-
-/* Line 1455 of yacc.c  */
-#line 11411 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            SELECT_LEX *sel= lex->current_select;
-            sel->offset_limit= 0;
-            sel->select_limit= 0;
-          }
-    break;
-
-  case 1551:
-
-/* Line 1455 of yacc.c  */
-#line 11417 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1552:
-
-/* Line 1455 of yacc.c  */
-#line 11421 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1553:
-
-/* Line 1455 of yacc.c  */
-#line 11422 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1554:
-
-/* Line 1455 of yacc.c  */
-#line 11427 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_LIMIT);
-          }
-    break;
-
-  case 1555:
-
-/* Line 1455 of yacc.c  */
-#line 11434 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            SELECT_LEX *sel= Select;
-            sel->select_limit= (yyvsp[(1) - (1)].item);
-            sel->offset_limit= 0;
-            sel->explicit_limit= 1;
-          }
-    break;
-
-  case 1556:
-
-/* Line 1455 of yacc.c  */
-#line 11441 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            SELECT_LEX *sel= Select;
-            sel->select_limit= (yyvsp[(3) - (3)].item);
-            sel->offset_limit= (yyvsp[(1) - (3)].item);
-            sel->explicit_limit= 1;
-          }
-    break;
-
-  case 1557:
-
-/* Line 1455 of yacc.c  */
-#line 11448 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            SELECT_LEX *sel= Select;
-            sel->select_limit= (yyvsp[(1) - (3)].item);
-            sel->offset_limit= (yyvsp[(3) - (3)].item);
-            sel->explicit_limit= 1;
-          }
-    break;
-
-  case 1558:
-
-/* Line 1455 of yacc.c  */
-#line 11458 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          THD *thd= YYTHD;
-          LEX *lex= Lex;
-          Lex_input_stream *lip= YYLIP;
-          sp_head *sp= lex->sphead;
-          const char *query_start_ptr=
-            sp ? sp->m_parser_data.get_current_stmt_start_ptr() : NULL;
-
-          Item_splocal *v= create_item_for_sp_var(thd, (yyvsp[(1) - (1)].lex_str), NULL,
-                                                  query_start_ptr,
-                                                  lip->get_tok_start(),
-                                                  lip->get_ptr());
-          if (!v)
-            MYSQL_YYABORT;
-
-          lex->safe_to_cache_query= false;
-
-          if (v->type() != Item::INT_ITEM)
-          {
-            my_error(ER_WRONG_SPVAR_TYPE_IN_LIMIT, MYF(0));
-            MYSQL_YYABORT;
-          }
-
-          v->limit_clause_param= true;
-          (yyval.item)= v;
-        }
-    break;
-
-  case 1559:
-
-/* Line 1455 of yacc.c  */
-#line 11485 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          ((Item_param *) (yyvsp[(1) - (1)].item))->limit_clause_param= TRUE;
-        }
-    break;
-
-  case 1560:
-
-/* Line 1455 of yacc.c  */
-#line 11489 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1561:
-
-/* Line 1455 of yacc.c  */
-#line 11495 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1562:
-
-/* Line 1455 of yacc.c  */
-#line 11501 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1563:
-
-/* Line 1455 of yacc.c  */
-#line 11510 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->current_select->select_limit= 0;
-          }
-    break;
-
-  case 1564:
-
-/* Line 1455 of yacc.c  */
-#line 11515 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            SELECT_LEX *sel= Select;
-            sel->select_limit= (yyvsp[(2) - (2)].item);
-            Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_LIMIT);
-            sel->explicit_limit= 1;
-          }
-    break;
-
-  case 1565:
-
-/* Line 1455 of yacc.c  */
-#line 11524 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1566:
-
-/* Line 1455 of yacc.c  */
-#line 11525 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (ulong) strtol((yyvsp[(1) - (1)].lex_str).str, (char**) 0, 16); }
-    break;
-
-  case 1567:
-
-/* Line 1455 of yacc.c  */
-#line 11526 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1568:
-
-/* Line 1455 of yacc.c  */
-#line 11527 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1569:
-
-/* Line 1455 of yacc.c  */
-#line 11528 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1570:
-
-/* Line 1455 of yacc.c  */
-#line 11529 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1571:
-
-/* Line 1455 of yacc.c  */
-#line 11533 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1572:
-
-/* Line 1455 of yacc.c  */
-#line 11534 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ulong_num)= (ulong) strtol((yyvsp[(1) - (1)].lex_str).str, (char**) 0, 16); }
-    break;
-
-  case 1573:
-
-/* Line 1455 of yacc.c  */
-#line 11535 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1574:
-
-/* Line 1455 of yacc.c  */
-#line 11536 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1575:
-
-/* Line 1455 of yacc.c  */
-#line 11537 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { MYSQL_YYABORT; }
-    break;
-
-  case 1576:
-
-/* Line 1455 of yacc.c  */
-#line 11541 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1577:
-
-/* Line 1455 of yacc.c  */
-#line 11542 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1578:
-
-/* Line 1455 of yacc.c  */
-#line 11543 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1579:
-
-/* Line 1455 of yacc.c  */
-#line 11544 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1580:
-
-/* Line 1455 of yacc.c  */
-#line 11545 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1581:
-
-/* Line 1455 of yacc.c  */
-#line 11549 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1582:
-
-/* Line 1455 of yacc.c  */
-#line 11550 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1583:
-
-/* Line 1455 of yacc.c  */
-#line 11551 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); }
-    break;
-
-  case 1584:
-
-/* Line 1455 of yacc.c  */
-#line 11552 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { MYSQL_YYABORT; }
-    break;
-
-  case 1585:
-
-/* Line 1455 of yacc.c  */
-#line 11557 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { my_parse_error(ER(ER_ONLY_INTEGERS_ALLOWED)); }
-    break;
-
-  case 1589:
-
-/* Line 1455 of yacc.c  */
-#line 11568 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            
-            if (!lex->parsing_options.allows_select_procedure)
-            {
-              my_error(ER_VIEW_SELECT_CLAUSE, MYF(0), "PROCEDURE");
-              MYSQL_YYABORT;
-            }
-
-            if (&lex->select_lex != lex->current_select)
-            {
-              my_error(ER_WRONG_USAGE, MYF(0), "PROCEDURE", "subquery");
-              MYSQL_YYABORT;
-            }
-
-            if (lex->result != NULL)
-            {
-              my_error(ER_WRONG_USAGE, MYF(0), "PROCEDURE", "INTO");
-              MYSQL_YYABORT;
-            }
-
-            if ((lex->proc_analyse= new Proc_analyse_params) == NULL)
-            {
-              my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR));
-              MYSQL_YYABORT;
-            }
-            
-            lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
-          }
-    break;
-
-  case 1591:
-
-/* Line 1455 of yacc.c  */
-#line 11601 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1592:
-
-/* Line 1455 of yacc.c  */
-#line 11603 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->proc_analyse->max_tree_elements= (yyvsp[(1) - (1)].ulonglong_number);
-          }
-    break;
-
-  case 1593:
-
-/* Line 1455 of yacc.c  */
-#line 11607 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->proc_analyse->max_tree_elements= (yyvsp[(1) - (3)].ulonglong_number);
-            Lex->proc_analyse->max_treemem= (yyvsp[(3) - (3)].ulonglong_number);
-          }
-    break;
-
-  case 1594:
-
-/* Line 1455 of yacc.c  */
-#line 11615 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            int error;
-            (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error);
-            if (error != 0)
-            {
-              my_error(ER_WRONG_PARAMETERS_TO_PROCEDURE, MYF(0), "ANALYSE");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1595:
-
-/* Line 1455 of yacc.c  */
-#line 11627 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (!lex->describe && (!(lex->result= new select_dumpvar())))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1596:
-
-/* Line 1455 of yacc.c  */
-#line 11633 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1598:
-
-/* Line 1455 of yacc.c  */
-#line 11638 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1599:
-
-/* Line 1455 of yacc.c  */
-#line 11643 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (lex->result) 
-            {
-              my_var *var= new my_var((yyvsp[(2) - (2)].lex_str),0,0,(enum_field_types)0);
-              if (var == NULL)
-                MYSQL_YYABORT;
-              ((select_dumpvar *)lex->result)->var_list.push_back(var);
-            }
-            else
-            {
-              /*
-                The parser won't create select_result instance only
-                if it's an EXPLAIN.
-              */
-              DBUG_ASSERT(lex->describe);
-            }
-          }
-    break;
-
-  case 1600:
-
-/* Line 1455 of yacc.c  */
-#line 11662 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-#ifndef DBUG_OFF
-            sp_head *sp= lex->sphead;
-#endif
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_variable *spv;
-
-            if (!pctx || !(spv= pctx->find_variable((yyvsp[(1) - (1)].lex_str), false)))
-            {
-              my_error(ER_SP_UNDECLARED_VAR, MYF(0), (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            if (lex->result)
-            {
-              my_var *var= new my_var((yyvsp[(1) - (1)].lex_str), 1, spv->offset, spv->type);
-
-              if (var == NULL)
-                MYSQL_YYABORT;
-
-              ((select_dumpvar *) lex->result)->var_list.push_back(var);
-
-#ifndef DBUG_OFF
-              var->sp= sp;
-#endif
-            }
-            else
-            {
-              /*
-                The parser won't create select_result instance only
-                if it's an EXPLAIN.
-              */
-              DBUG_ASSERT(lex->describe);
-            }
-          }
-    break;
-
-  case 1601:
-
-/* Line 1455 of yacc.c  */
-#line 11701 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (! Lex->parsing_options.allows_select_into)
-            {
-              my_error(ER_VIEW_SELECT_CLAUSE, MYF(0), "INTO");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1603:
-
-/* Line 1455 of yacc.c  */
-#line 11713 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
-            if (!(lex->exchange= new sql_exchange((yyvsp[(2) - (2)].lex_str).str, 0)) ||
-                !(lex->result= new select_export(lex->exchange)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1604:
-
-/* Line 1455 of yacc.c  */
-#line 11721 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->exchange->cs= (yyvsp[(4) - (4)].charset); }
-    break;
-
-  case 1606:
-
-/* Line 1455 of yacc.c  */
-#line 11724 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (!lex->describe)
-            {
-              lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
-              if (!(lex->exchange= new sql_exchange((yyvsp[(2) - (2)].lex_str).str,1)))
-                MYSQL_YYABORT;
-              if (!(lex->result= new select_dump(lex->exchange)))
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1607:
-
-/* Line 1455 of yacc.c  */
-#line 11736 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
-          }
-    break;
-
-  case 1608:
-
-/* Line 1455 of yacc.c  */
-#line 11747 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command = SQLCOM_DO;
-            mysql_init_select(lex);
-          }
-    break;
-
-  case 1609:
-
-/* Line 1455 of yacc.c  */
-#line 11753 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->insert_list= (yyvsp[(3) - (3)].item_list);
-          }
-    break;
-
-  case 1610:
-
-/* Line 1455 of yacc.c  */
-#line 11764 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command = SQLCOM_DROP_TABLE;
-            lex->drop_temporary= (yyvsp[(2) - (4)].num);
-            lex->drop_if_exists= (yyvsp[(4) - (4)].num);
-            YYPS->m_lock_type= TL_UNLOCK;
-            YYPS->m_mdl_type= MDL_EXCLUSIVE;
-          }
-    break;
-
-  case 1611:
-
-/* Line 1455 of yacc.c  */
-#line 11773 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1612:
-
-/* Line 1455 of yacc.c  */
-#line 11774 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1613:
-
-/* Line 1455 of yacc.c  */
-#line 11775 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            Alter_drop *ad= new Alter_drop(Alter_drop::KEY, (yyvsp[(3) - (6)].lex_str).str);
-            if (ad == NULL)
-              MYSQL_YYABORT;
-            lex->sql_command= SQLCOM_DROP_INDEX;
-            lex->alter_info.reset();
-            lex->alter_info.flags= Alter_info::ALTER_DROP_INDEX;
-            lex->alter_info.drop_list.push_back(ad);
-            if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(5) - (6)].table), NULL,
-                                                        TL_OPTION_UPDATING,
-                                                        TL_READ_NO_INSERT,
-                                                        MDL_SHARED_UPGRADABLE))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1614:
-
-/* Line 1455 of yacc.c  */
-#line 11790 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1615:
-
-/* Line 1455 of yacc.c  */
-#line 11792 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_DROP_DB;
-            lex->drop_if_exists=(yyvsp[(3) - (4)].num);
-            lex->name= (yyvsp[(4) - (4)].lex_str);
-          }
-    break;
-
-  case 1616:
-
-/* Line 1455 of yacc.c  */
-#line 11799 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_name *spname;
-            if ((yyvsp[(4) - (6)].lex_str).str &&
-                (check_and_convert_db_name(&(yyvsp[(4) - (6)].lex_str), FALSE) != IDENT_NAME_OK))
-               MYSQL_YYABORT;
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
-              MYSQL_YYABORT;
-            }
-            lex->sql_command = SQLCOM_DROP_FUNCTION;
-            lex->drop_if_exists= (yyvsp[(3) - (6)].num);
-            spname= new sp_name((yyvsp[(4) - (6)].lex_str), (yyvsp[(6) - (6)].lex_str), true);
-            if (spname == NULL)
-              MYSQL_YYABORT;
-            spname->init_qname(thd);
-            lex->spname= spname;
-          }
-    break;
-
-  case 1617:
-
-/* Line 1455 of yacc.c  */
-#line 11820 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            LEX_STRING db= {0, 0};
-            sp_name *spname;
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
-              MYSQL_YYABORT;
-            }
-            if (thd->db && lex->copy_db_to(&db.str, &db.length))
-              MYSQL_YYABORT;
-            lex->sql_command = SQLCOM_DROP_FUNCTION;
-            lex->drop_if_exists= (yyvsp[(3) - (4)].num);
-            spname= new sp_name(db, (yyvsp[(4) - (4)].lex_str), false);
-            if (spname == NULL)
-              MYSQL_YYABORT;
-            spname->init_qname(thd);
-            lex->spname= spname;
-          }
-    break;
-
-  case 1618:
-
-/* Line 1455 of yacc.c  */
-#line 11841 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
-              MYSQL_YYABORT;
-            }
-            lex->sql_command = SQLCOM_DROP_PROCEDURE;
-            lex->drop_if_exists= (yyvsp[(3) - (4)].num);
-            lex->spname= (yyvsp[(4) - (4)].spname);
-          }
-    break;
-
-  case 1619:
-
-/* Line 1455 of yacc.c  */
-#line 11853 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_DROP_USER;
-          }
-    break;
-
-  case 1620:
-
-/* Line 1455 of yacc.c  */
-#line 11857 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_DROP_VIEW;
-            lex->drop_if_exists= (yyvsp[(3) - (3)].num);
-            YYPS->m_lock_type= TL_UNLOCK;
-            YYPS->m_mdl_type= MDL_EXCLUSIVE;
-          }
-    break;
-
-  case 1621:
-
-/* Line 1455 of yacc.c  */
-#line 11865 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1622:
-
-/* Line 1455 of yacc.c  */
-#line 11867 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->drop_if_exists= (yyvsp[(3) - (4)].num);
-            Lex->spname= (yyvsp[(4) - (4)].spname);
-            Lex->sql_command = SQLCOM_DROP_EVENT;
-          }
-    break;
-
-  case 1623:
-
-/* Line 1455 of yacc.c  */
-#line 11873 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_DROP_TRIGGER;
-            lex->drop_if_exists= (yyvsp[(3) - (4)].num);
-            lex->spname= (yyvsp[(4) - (4)].spname);
-          }
-    break;
-
-  case 1624:
-
-/* Line 1455 of yacc.c  */
-#line 11880 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->ts_cmd_type= DROP_TABLESPACE;
-          }
-    break;
-
-  case 1625:
-
-/* Line 1455 of yacc.c  */
-#line 11885 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP;
-          }
-    break;
-
-  case 1626:
-
-/* Line 1455 of yacc.c  */
-#line 11890 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_DROP_SERVER;
-            Lex->drop_if_exists= (yyvsp[(3) - (4)].num);
-            Lex->server_options.server_name= (yyvsp[(4) - (4)].lex_str).str;
-            Lex->server_options.server_name_length= (yyvsp[(4) - (4)].lex_str).length;
-          }
-    break;
-
-  case 1629:
-
-/* Line 1455 of yacc.c  */
-#line 11905 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL,
-                                           TL_OPTION_UPDATING,
-                                           YYPS->m_lock_type,
-                                           YYPS->m_mdl_type))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1630:
-
-/* Line 1455 of yacc.c  */
-#line 11916 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (2)].table), NULL,
-                                           TL_OPTION_UPDATING,
-                                           YYPS->m_lock_type,
-                                           YYPS->m_mdl_type,
-                                           NULL,
-                                           (yyvsp[(2) - (2)].string_list)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1633:
-
-/* Line 1455 of yacc.c  */
-#line 11934 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL,
-                                           TL_OPTION_UPDATING | TL_OPTION_ALIAS,
-                                           YYPS->m_lock_type,
-                                           YYPS->m_mdl_type))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1634:
-
-/* Line 1455 of yacc.c  */
-#line 11944 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 1635:
-
-/* Line 1455 of yacc.c  */
-#line 11945 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 1636:
-
-/* Line 1455 of yacc.c  */
-#line 11949 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 1637:
-
-/* Line 1455 of yacc.c  */
-#line 11950 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 1645:
-
-/* Line 1455 of yacc.c  */
-#line 11973 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_INSERT;
-            lex->duplicates= DUP_ERROR; 
-            mysql_init_select(lex);
-          }
-    break;
-
-  case 1646:
-
-/* Line 1455 of yacc.c  */
-#line 11981 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->set_lock_for_tables((yyvsp[(3) - (5)].lock_type));
-            Lex->current_select= &Lex->select_lex;
-          }
-    break;
-
-  case 1647:
-
-/* Line 1455 of yacc.c  */
-#line 11986 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1648:
-
-/* Line 1455 of yacc.c  */
-#line 11991 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command = SQLCOM_REPLACE;
-            lex->duplicates= DUP_REPLACE;
-            mysql_init_select(lex);
-          }
-    break;
-
-  case 1649:
-
-/* Line 1455 of yacc.c  */
-#line 11998 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->set_lock_for_tables((yyvsp[(3) - (4)].lock_type));
-            Lex->current_select= &Lex->select_lex;
-          }
-    break;
-
-  case 1650:
-
-/* Line 1455 of yacc.c  */
-#line 12003 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1651:
-
-/* Line 1455 of yacc.c  */
-#line 12008 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-#ifdef HAVE_QUERY_CACHE
-            /*
-              If it is SP we do not allow insert optimisation whan result of
-              insert visible only after the table unlocking but everyone can
-              read table.
-            */
-            (yyval.lock_type)= (Lex->sphead ? TL_WRITE_DEFAULT : TL_WRITE_CONCURRENT_INSERT);
-#else
-            (yyval.lock_type)= TL_WRITE_CONCURRENT_INSERT;
-#endif
-          }
-    break;
-
-  case 1652:
-
-/* Line 1455 of yacc.c  */
-#line 12020 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; }
-    break;
-
-  case 1653:
-
-/* Line 1455 of yacc.c  */
-#line 12022 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          Lex->keyword_delayed_begin_offset= (uint)(YYLIP->get_tok_start() -
-                                                    YYTHD->query());
-          Lex->keyword_delayed_end_offset= Lex->keyword_delayed_begin_offset +
-                                           YYLIP->yyLength() + 1;
-          (yyval.lock_type)= TL_WRITE_DELAYED;
-
-          push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN,
-                              ER_WARN_DEPRECATED_SYNTAX,
-                              ER(ER_WARN_DEPRECATED_SYNTAX),
-                              "INSERT DELAYED", "INSERT");
-        }
-    break;
-
-  case 1654:
-
-/* Line 1455 of yacc.c  */
-#line 12034 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lock_type)= TL_WRITE; }
-    break;
-
-  case 1655:
-
-/* Line 1455 of yacc.c  */
-#line 12038 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lock_type)= (yyvsp[(1) - (1)].lock_type); }
-    break;
-
-  case 1656:
-
-/* Line 1455 of yacc.c  */
-#line 12040 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          Lex->keyword_delayed_begin_offset= (uint)(YYLIP->get_tok_start() -
-                                                    YYTHD->query());
-          Lex->keyword_delayed_end_offset= Lex->keyword_delayed_begin_offset +
-                                           YYLIP->yyLength() + 1;
-          (yyval.lock_type)= TL_WRITE_DELAYED;
-
-          push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN,
-                              ER_WARN_DEPRECATED_SYNTAX,
-                              ER(ER_WARN_DEPRECATED_SYNTAX),
-                              "REPLACE DELAYED", "REPLACE");
-        }
-    break;
-
-  case 1657:
-
-/* Line 1455 of yacc.c  */
-#line 12055 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1658:
-
-/* Line 1455 of yacc.c  */
-#line 12056 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1659:
-
-/* Line 1455 of yacc.c  */
-#line 12061 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->field_list.empty();
-            lex->many_values.empty();
-            lex->insert_list=0;
-          }
-    break;
-
-  case 1660:
-
-/* Line 1455 of yacc.c  */
-#line 12069 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1661:
-
-/* Line 1455 of yacc.c  */
-#line 12070 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1662:
-
-/* Line 1455 of yacc.c  */
-#line 12071 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1663:
-
-/* Line 1455 of yacc.c  */
-#line 12073 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (!(lex->insert_list = new List_item) ||
-                lex->many_values.push_back(lex->insert_list))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1665:
-
-/* Line 1455 of yacc.c  */
-#line 12083 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); }
-    break;
-
-  case 1666:
-
-/* Line 1455 of yacc.c  */
-#line 12084 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); }
-    break;
-
-  case 1667:
-
-/* Line 1455 of yacc.c  */
-#line 12088 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1668:
-
-/* Line 1455 of yacc.c  */
-#line 12089 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1669:
-
-/* Line 1455 of yacc.c  */
-#line 12091 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->set_braces(0);}
-    break;
-
-  case 1670:
-
-/* Line 1455 of yacc.c  */
-#line 12092 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1671:
-
-/* Line 1455 of yacc.c  */
-#line 12094 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->set_braces(1);}
-    break;
-
-  case 1672:
-
-/* Line 1455 of yacc.c  */
-#line 12095 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1677:
-
-/* Line 1455 of yacc.c  */
-#line 12110 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (lex->field_list.push_back((yyvsp[(1) - (3)].item)) ||
-                lex->insert_list->push_back((yyvsp[(3) - (3)].item)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1678:
-
-/* Line 1455 of yacc.c  */
-#line 12119 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1679:
-
-/* Line 1455 of yacc.c  */
-#line 12120 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1680:
-
-/* Line 1455 of yacc.c  */
-#line 12124 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1681:
-
-/* Line 1455 of yacc.c  */
-#line 12125 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1682:
-
-/* Line 1455 of yacc.c  */
-#line 12130 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-              if (!(Lex->insert_list = new List_item))
-                MYSQL_YYABORT;
-          }
-    break;
-
-  case 1683:
-
-/* Line 1455 of yacc.c  */
-#line 12135 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (lex->many_values.push_back(lex->insert_list))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1684:
-
-/* Line 1455 of yacc.c  */
-#line 12143 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1686:
-
-/* Line 1455 of yacc.c  */
-#line 12149 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->insert_list->push_back((yyvsp[(3) - (3)].item)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1687:
-
-/* Line 1455 of yacc.c  */
-#line 12154 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->insert_list->push_back((yyvsp[(1) - (1)].item)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1688:
-
-/* Line 1455 of yacc.c  */
-#line 12161 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(1) - (1)].item);}
-    break;
-
-  case 1689:
-
-/* Line 1455 of yacc.c  */
-#line 12163 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_default_value(Lex->current_context());
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1691:
-
-/* Line 1455 of yacc.c  */
-#line 12172 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->duplicates= DUP_UPDATE; }
-    break;
-
-  case 1693:
-
-/* Line 1455 of yacc.c  */
-#line 12180 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            mysql_init_select(lex);
-            lex->sql_command= SQLCOM_UPDATE;
-            lex->duplicates= DUP_ERROR; 
-          }
-    break;
-
-  case 1694:
-
-/* Line 1455 of yacc.c  */
-#line 12188 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->select_lex.table_list.elements > 1)
-              lex->sql_command= SQLCOM_UPDATE_MULTI;
-            else if (lex->select_lex.get_table_list()->derived)
-            {
-              /* it is single table update and it is update of derived table */
-              my_error(ER_NON_UPDATABLE_TABLE, MYF(0),
-                       lex->select_lex.get_table_list()->alias, "UPDATE");
-              MYSQL_YYABORT;
-            }
-            /*
-              In case of multi-update setting write lock for all tables may
-              be too pessimistic. We will decrease lock level if possible in
-              mysql_multi_update().
-            */
-            Select->set_lock_for_tables((yyvsp[(3) - (7)].lock_type));
-          }
-    break;
-
-  case 1695:
-
-/* Line 1455 of yacc.c  */
-#line 12206 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1698:
-
-/* Line 1455 of yacc.c  */
-#line 12216 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_item_to_list(YYTHD, (yyvsp[(1) - (3)].item)) || add_value_to_list(YYTHD, (yyvsp[(3) - (3)].item)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1701:
-
-/* Line 1455 of yacc.c  */
-#line 12229 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-          LEX *lex= Lex;
-          if (lex->update_list.push_back((yyvsp[(1) - (3)].item)) || 
-              lex->value_list.push_back((yyvsp[(3) - (3)].item)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1702:
-
-/* Line 1455 of yacc.c  */
-#line 12238 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lock_type)= TL_WRITE_DEFAULT; }
-    break;
-
-  case 1703:
-
-/* Line 1455 of yacc.c  */
-#line 12239 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; }
-    break;
-
-  case 1704:
-
-/* Line 1455 of yacc.c  */
-#line 12246 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_DELETE;
-            mysql_init_select(lex);
-            YYPS->m_lock_type= TL_WRITE_DEFAULT;
-            YYPS->m_mdl_type= MDL_SHARED_WRITE;
-
-            lex->ignore= 0;
-            lex->select_lex.init_order();
-          }
-    break;
-
-  case 1706:
-
-/* Line 1455 of yacc.c  */
-#line 12261 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(2) - (3)].table), NULL, TL_OPTION_UPDATING,
-                                           YYPS->m_lock_type,
-                                           YYPS->m_mdl_type,
-                                           NULL,
-                                           (yyvsp[(3) - (3)].string_list)))
-              MYSQL_YYABORT;
-            YYPS->m_lock_type= TL_READ_DEFAULT;
-            YYPS->m_mdl_type= MDL_SHARED_READ;
-          }
-    break;
-
-  case 1707:
-
-/* Line 1455 of yacc.c  */
-#line 12272 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1708:
-
-/* Line 1455 of yacc.c  */
-#line 12274 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            mysql_init_multi_delete(Lex);
-            YYPS->m_lock_type= TL_READ_DEFAULT;
-            YYPS->m_mdl_type= MDL_SHARED_READ;
-          }
-    break;
-
-  case 1709:
-
-/* Line 1455 of yacc.c  */
-#line 12280 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (multi_delete_set_locks_and_link_aux_tables(Lex))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1710:
-
-/* Line 1455 of yacc.c  */
-#line 12285 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            mysql_init_multi_delete(Lex);
-            YYPS->m_lock_type= TL_READ_DEFAULT;
-            YYPS->m_mdl_type= MDL_SHARED_READ;
-          }
-    break;
-
-  case 1711:
-
-/* Line 1455 of yacc.c  */
-#line 12291 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (multi_delete_set_locks_and_link_aux_tables(Lex))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1714:
-
-/* Line 1455 of yacc.c  */
-#line 12304 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Table_ident *ti= new Table_ident((yyvsp[(1) - (2)].lex_str));
-            if (ti == NULL)
-              MYSQL_YYABORT;
-            if (!Select->add_table_to_list(YYTHD,
-                                           ti,
-                                           NULL,
-                                           TL_OPTION_UPDATING | TL_OPTION_ALIAS,
-                                           YYPS->m_lock_type,
-                                           YYPS->m_mdl_type))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1715:
-
-/* Line 1455 of yacc.c  */
-#line 12317 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Table_ident *ti= new Table_ident(YYTHD, (yyvsp[(1) - (4)].lex_str), (yyvsp[(3) - (4)].lex_str), 0);
-            if (ti == NULL)
-              MYSQL_YYABORT;
-            if (!Select->add_table_to_list(YYTHD,
-                                           ti,
-                                           NULL,
-                                           TL_OPTION_UPDATING | TL_OPTION_ALIAS,
-                                           YYPS->m_lock_type,
-                                           YYPS->m_mdl_type))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1716:
-
-/* Line 1455 of yacc.c  */
-#line 12332 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1717:
-
-/* Line 1455 of yacc.c  */
-#line 12333 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1718:
-
-/* Line 1455 of yacc.c  */
-#line 12337 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1719:
-
-/* Line 1455 of yacc.c  */
-#line 12338 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1720:
-
-/* Line 1455 of yacc.c  */
-#line 12342 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->options|= OPTION_QUICK; }
-    break;
-
-  case 1721:
-
-/* Line 1455 of yacc.c  */
-#line 12343 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { YYPS->m_lock_type= TL_WRITE_LOW_PRIORITY; }
-    break;
-
-  case 1722:
-
-/* Line 1455 of yacc.c  */
-#line 12344 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->ignore= 1; }
-    break;
-
-  case 1723:
-
-/* Line 1455 of yacc.c  */
-#line 12349 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX* lex= Lex;
-            lex->sql_command= SQLCOM_TRUNCATE;
-            lex->alter_info.reset();
-            lex->select_lex.options= 0;
-            lex->select_lex.sql_cache= SELECT_LEX::SQL_CACHE_UNSPECIFIED;
-            lex->select_lex.init_order();
-            YYPS->m_lock_type= TL_WRITE;
-            YYPS->m_mdl_type= MDL_EXCLUSIVE;
-          }
-    break;
-
-  case 1724:
-
-/* Line 1455 of yacc.c  */
-#line 12360 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX* lex= thd->lex;
-            DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_truncate_table();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1731:
-
-/* Line 1455 of yacc.c  */
-#line 12385 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_options|= PROFILE_CPU;
-    }
-    break;
-
-  case 1732:
-
-/* Line 1455 of yacc.c  */
-#line 12389 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_options|= PROFILE_MEMORY;
-    }
-    break;
-
-  case 1733:
-
-/* Line 1455 of yacc.c  */
-#line 12393 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_options|= PROFILE_BLOCK_IO;
-    }
-    break;
-
-  case 1734:
-
-/* Line 1455 of yacc.c  */
-#line 12397 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_options|= PROFILE_CONTEXT;
-    }
-    break;
-
-  case 1735:
-
-/* Line 1455 of yacc.c  */
-#line 12401 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_options|= PROFILE_PAGE_FAULTS;
-    }
-    break;
-
-  case 1736:
-
-/* Line 1455 of yacc.c  */
-#line 12405 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_options|= PROFILE_IPC;
-    }
-    break;
-
-  case 1737:
-
-/* Line 1455 of yacc.c  */
-#line 12409 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_options|= PROFILE_SWAPS;
-    }
-    break;
-
-  case 1738:
-
-/* Line 1455 of yacc.c  */
-#line 12413 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_options|= PROFILE_SOURCE;
-    }
-    break;
-
-  case 1739:
-
-/* Line 1455 of yacc.c  */
-#line 12417 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_options|= PROFILE_ALL;
-    }
-    break;
-
-  case 1740:
-
-/* Line 1455 of yacc.c  */
-#line 12424 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_query_id= 0;
-    }
-    break;
-
-  case 1741:
-
-/* Line 1455 of yacc.c  */
-#line 12428 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-      Lex->profile_query_id= atoi((yyvsp[(3) - (3)].lex_str).str);
-    }
-    break;
-
-  case 1742:
-
-/* Line 1455 of yacc.c  */
-#line 12437 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->wild=0;
-            mysql_init_select(lex);
-            lex->current_select->parsing_place= SELECT_LIST;
-            memset(&lex->create_info, 0, sizeof(lex->create_info));
-          }
-    break;
-
-  case 1743:
-
-/* Line 1455 of yacc.c  */
-#line 12445 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 1744:
-
-/* Line 1455 of yacc.c  */
-#line 12452 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-             LEX *lex= Lex;
-             lex->sql_command= SQLCOM_SHOW_DATABASES;
-             if (prepare_schema_table(YYTHD, lex, 0, SCH_SCHEMATA))
-               MYSQL_YYABORT;
-           }
-    break;
-
-  case 1745:
-
-/* Line 1455 of yacc.c  */
-#line 12459 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-             LEX *lex= Lex;
-             lex->sql_command= SQLCOM_SHOW_TABLES;
-             lex->select_lex.db= (yyvsp[(3) - (4)].simple_string);
-             if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_NAMES))
-               MYSQL_YYABORT;
-           }
-    break;
-
-  case 1746:
-
-/* Line 1455 of yacc.c  */
-#line 12467 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-             LEX *lex= Lex;
-             lex->sql_command= SQLCOM_SHOW_TRIGGERS;
-             lex->select_lex.db= (yyvsp[(3) - (4)].simple_string);
-             if (prepare_schema_table(YYTHD, lex, 0, SCH_TRIGGERS))
-               MYSQL_YYABORT;
-           }
-    break;
-
-  case 1747:
-
-/* Line 1455 of yacc.c  */
-#line 12475 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-             LEX *lex= Lex;
-             lex->sql_command= SQLCOM_SHOW_EVENTS;
-             lex->select_lex.db= (yyvsp[(2) - (3)].simple_string);
-             if (prepare_schema_table(YYTHD, lex, 0, SCH_EVENTS))
-               MYSQL_YYABORT;
-           }
-    break;
-
-  case 1748:
-
-/* Line 1455 of yacc.c  */
-#line 12483 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-             LEX *lex= Lex;
-             lex->sql_command= SQLCOM_SHOW_TABLE_STATUS;
-             lex->select_lex.db= (yyvsp[(3) - (4)].simple_string);
-             if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLES))
-               MYSQL_YYABORT;
-           }
-    break;
-
-  case 1749:
-
-/* Line 1455 of yacc.c  */
-#line 12491 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_OPEN_TABLES;
-            lex->select_lex.db= (yyvsp[(3) - (4)].simple_string);
-            if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1750:
-
-/* Line 1455 of yacc.c  */
-#line 12499 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_PLUGINS;
-            if (prepare_schema_table(YYTHD, lex, 0, SCH_PLUGINS))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1751:
-
-/* Line 1455 of yacc.c  */
-#line 12506 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_info.db_type= (yyvsp[(2) - (3)].db_type); }
-    break;
-
-  case 1752:
-
-/* Line 1455 of yacc.c  */
-#line 12508 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_info.db_type= NULL; }
-    break;
-
-  case 1753:
-
-/* Line 1455 of yacc.c  */
-#line 12510 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_FIELDS;
-            if ((yyvsp[(5) - (6)].simple_string))
-              (yyvsp[(4) - (6)].table)->change_db((yyvsp[(5) - (6)].simple_string));
-            if (prepare_schema_table(YYTHD, lex, (yyvsp[(4) - (6)].table), SCH_COLUMNS))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1754:
-
-/* Line 1455 of yacc.c  */
-#line 12519 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_SHOW_BINLOGS;
-          }
-    break;
-
-  case 1755:
-
-/* Line 1455 of yacc.c  */
-#line 12523 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS;
-          }
-    break;
-
-  case 1756:
-
-/* Line 1455 of yacc.c  */
-#line 12527 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS;
-          }
-    break;
-
-  case 1758:
-
-/* Line 1455 of yacc.c  */
-#line 12532 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_RELAYLOG_EVENTS;
-          }
-    break;
-
-  case 1760:
-
-/* Line 1455 of yacc.c  */
-#line 12537 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_KEYS;
-            if ((yyvsp[(4) - (5)].simple_string))
-              (yyvsp[(3) - (5)].table)->change_db((yyvsp[(4) - (5)].simple_string));
-            if (prepare_schema_table(YYTHD, lex, (yyvsp[(3) - (5)].table), SCH_STATISTICS))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1761:
-
-/* Line 1455 of yacc.c  */
-#line 12546 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
-            if (prepare_schema_table(YYTHD, lex, 0, SCH_ENGINES))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1762:
-
-/* Line 1455 of yacc.c  */
-#line 12553 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_SHOW_PRIVILEGES;
-          }
-    break;
-
-  case 1763:
-
-/* Line 1455 of yacc.c  */
-#line 12558 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (void) create_select_for_variable("warning_count"); }
-    break;
-
-  case 1764:
-
-/* Line 1455 of yacc.c  */
-#line 12560 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (void) create_select_for_variable("error_count"); }
-    break;
-
-  case 1765:
-
-/* Line 1455 of yacc.c  */
-#line 12562 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sql_command = SQLCOM_SHOW_WARNS;}
-    break;
-
-  case 1766:
-
-/* Line 1455 of yacc.c  */
-#line 12564 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sql_command = SQLCOM_SHOW_ERRORS;}
-    break;
-
-  case 1767:
-
-/* Line 1455 of yacc.c  */
-#line 12566 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN,
-                                ER_WARN_DEPRECATED_SYNTAX,
-                                ER(ER_WARN_DEPRECATED_SYNTAX),
-                                "SHOW PROFILES", "Performance Schema");
-            Lex->sql_command = SQLCOM_SHOW_PROFILES;
-          }
-    break;
-
-  case 1768:
-
-/* Line 1455 of yacc.c  */
-#line 12574 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN,
-                                ER_WARN_DEPRECATED_SYNTAX,
-                                ER(ER_WARN_DEPRECATED_SYNTAX),
-                                "SHOW PROFILE", "Performance Schema");
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_PROFILE;
-            if (prepare_schema_table(YYTHD, lex, NULL, SCH_PROFILES) != 0)
-              YYABORT;
-          }
-    break;
-
-  case 1769:
-
-/* Line 1455 of yacc.c  */
-#line 12585 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_STATUS;
-            lex->option_type= (yyvsp[(1) - (3)].var_type);
-            if (prepare_schema_table(YYTHD, lex, 0, SCH_STATUS))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1770:
-
-/* Line 1455 of yacc.c  */
-#line 12593 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
-    break;
-
-  case 1771:
-
-/* Line 1455 of yacc.c  */
-#line 12595 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_VARIABLES;
-            lex->option_type= (yyvsp[(1) - (3)].var_type);
-            if (prepare_schema_table(YYTHD, lex, 0, SCH_VARIABLES))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1772:
-
-/* Line 1455 of yacc.c  */
-#line 12603 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_CHARSETS;
-            if (prepare_schema_table(YYTHD, lex, 0, SCH_CHARSETS))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1773:
-
-/* Line 1455 of yacc.c  */
-#line 12610 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_COLLATIONS;
-            if (prepare_schema_table(YYTHD, lex, 0, SCH_COLLATIONS))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1774:
-
-/* Line 1455 of yacc.c  */
-#line 12617 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_SHOW_GRANTS;
-            LEX_USER *curr_user;
-            if (!(curr_user= (LEX_USER*) lex->thd->alloc(sizeof(st_lex_user))))
-              MYSQL_YYABORT;
-            memset(curr_user, 0, sizeof(st_lex_user));
-            lex->grant_user= curr_user;
-          }
-    break;
-
-  case 1775:
-
-/* Line 1455 of yacc.c  */
-#line 12627 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_SHOW_GRANTS;
-            lex->grant_user=(yyvsp[(3) - (3)].lex_user);
-            lex->grant_user->password=null_lex_str;
-          }
-    break;
-
-  case 1776:
-
-/* Line 1455 of yacc.c  */
-#line 12634 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command=SQLCOM_SHOW_CREATE_DB;
-            Lex->create_info.options=(yyvsp[(3) - (4)].num);
-            Lex->name= (yyvsp[(4) - (4)].lex_str);
-          }
-    break;
-
-  case 1777:
-
-/* Line 1455 of yacc.c  */
-#line 12640 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command = SQLCOM_SHOW_CREATE;
-            if (!lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(3) - (3)].table), NULL,0))
-              MYSQL_YYABORT;
-            lex->only_view= 0;
-            lex->create_info.storage_media= HA_SM_DEFAULT;
-          }
-    break;
-
-  case 1778:
-
-/* Line 1455 of yacc.c  */
-#line 12649 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command = SQLCOM_SHOW_CREATE;
-            if (!lex->select_lex.add_table_to_list(YYTHD, (yyvsp[(3) - (3)].table), NULL, 0))
-              MYSQL_YYABORT;
-            lex->only_view= 1;
-          }
-    break;
-
-  case 1779:
-
-/* Line 1455 of yacc.c  */
-#line 12657 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_SHOW_MASTER_STAT;
-          }
-    break;
-
-  case 1780:
-
-/* Line 1455 of yacc.c  */
-#line 12661 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
-          }
-    break;
-
-  case 1781:
-
-/* Line 1455 of yacc.c  */
-#line 12665 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            lex->sql_command = SQLCOM_SHOW_CREATE_PROC;
-            lex->spname= (yyvsp[(3) - (3)].spname);
-          }
-    break;
-
-  case 1782:
-
-/* Line 1455 of yacc.c  */
-#line 12672 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            lex->sql_command = SQLCOM_SHOW_CREATE_FUNC;
-            lex->spname= (yyvsp[(3) - (3)].spname);
-          }
-    break;
-
-  case 1783:
-
-/* Line 1455 of yacc.c  */
-#line 12679 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_CREATE_TRIGGER;
-            lex->spname= (yyvsp[(3) - (3)].spname);
-          }
-    break;
-
-  case 1784:
-
-/* Line 1455 of yacc.c  */
-#line 12685 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_STATUS_PROC;
-            if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1785:
-
-/* Line 1455 of yacc.c  */
-#line 12692 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_SHOW_STATUS_FUNC;
-            if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1786:
-
-/* Line 1455 of yacc.c  */
-#line 12699 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command= SQLCOM_SHOW_PROC_CODE;
-            Lex->spname= (yyvsp[(3) - (3)].spname);
-          }
-    break;
-
-  case 1787:
-
-/* Line 1455 of yacc.c  */
-#line 12704 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command= SQLCOM_SHOW_FUNC_CODE;
-            Lex->spname= (yyvsp[(3) - (3)].spname);
-          }
-    break;
-
-  case 1788:
-
-/* Line 1455 of yacc.c  */
-#line 12709 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->spname= (yyvsp[(3) - (3)].spname);
-            Lex->sql_command = SQLCOM_SHOW_CREATE_EVENT;
-          }
-    break;
-
-  case 1789:
-
-/* Line 1455 of yacc.c  */
-#line 12717 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS; }
-    break;
-
-  case 1790:
-
-/* Line 1455 of yacc.c  */
-#line 12719 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sql_command= SQLCOM_SHOW_ENGINE_MUTEX; }
-    break;
-
-  case 1791:
-
-/* Line 1455 of yacc.c  */
-#line 12721 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sql_command= SQLCOM_SHOW_ENGINE_LOGS; }
-    break;
-
-  case 1796:
-
-/* Line 1455 of yacc.c  */
-#line 12735 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.simple_string)= 0; }
-    break;
-
-  case 1797:
-
-/* Line 1455 of yacc.c  */
-#line 12736 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.simple_string)= (yyvsp[(2) - (2)].lex_str).str; }
-    break;
-
-  case 1798:
-
-/* Line 1455 of yacc.c  */
-#line 12740 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->verbose=0; }
-    break;
-
-  case 1799:
-
-/* Line 1455 of yacc.c  */
-#line 12741 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->verbose=1; }
-    break;
-
-  case 1802:
-
-/* Line 1455 of yacc.c  */
-#line 12750 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->mi.log_file_name = 0; }
-    break;
-
-  case 1803:
-
-/* Line 1455 of yacc.c  */
-#line 12751 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->mi.log_file_name = (yyvsp[(2) - (2)].lex_str).str; }
-    break;
-
-  case 1804:
-
-/* Line 1455 of yacc.c  */
-#line 12755 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->mi.pos = 4; /* skip magic number */ }
-    break;
-
-  case 1805:
-
-/* Line 1455 of yacc.c  */
-#line 12756 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->mi.pos = (yyvsp[(2) - (2)].ulonglong_number); }
-    break;
-
-  case 1807:
-
-/* Line 1455 of yacc.c  */
-#line 12762 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->wild= new (YYTHD->mem_root) String((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length,
-                                                    system_charset_info);
-            if (Lex->wild == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1808:
-
-/* Line 1455 of yacc.c  */
-#line 12769 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->where= (yyvsp[(2) - (2)].item);
-            if ((yyvsp[(2) - (2)].item))
-              (yyvsp[(2) - (2)].item)->top_level_item();
-          }
-    break;
-
-  case 1809:
-
-/* Line 1455 of yacc.c  */
-#line 12779 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            mysql_init_select(lex);
-            lex->current_select->parsing_place= SELECT_LIST;
-            lex->sql_command= SQLCOM_SHOW_FIELDS;
-            lex->select_lex.db= 0;
-            lex->verbose= 0;
-            if (prepare_schema_table(YYTHD, lex, (yyvsp[(2) - (2)].table), SCH_COLUMNS))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1810:
-
-/* Line 1455 of yacc.c  */
-#line 12790 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Select->parsing_place= NO_MATTER;
-          }
-    break;
-
-  case 1811:
-
-/* Line 1455 of yacc.c  */
-#line 12794 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->describe|= DESCRIBE_NORMAL; }
-    break;
-
-  case 1812:
-
-/* Line 1455 of yacc.c  */
-#line 12796 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->select_lex.options|= SELECT_DESCRIBE; }
-    break;
-
-  case 1820:
-
-/* Line 1455 of yacc.c  */
-#line 12814 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((Lex->explain_format= new Explain_format_traditional) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1821:
-
-/* Line 1455 of yacc.c  */
-#line 12819 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((Lex->explain_format= new Explain_format_traditional) == NULL)
-              MYSQL_YYABORT;
-            Lex->describe|= DESCRIBE_EXTENDED;
-          }
-    break;
-
-  case 1822:
-
-/* Line 1455 of yacc.c  */
-#line 12825 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((Lex->explain_format= new Explain_format_traditional) == NULL)
-              MYSQL_YYABORT;
-            Lex->describe|= DESCRIBE_PARTITIONS;
-          }
-    break;
-
-  case 1823:
-
-/* Line 1455 of yacc.c  */
-#line 12831 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!my_strcasecmp(system_charset_info, (yyvsp[(3) - (3)].lex_str).str, "JSON"))
-            {
-              if ((Lex->explain_format= new Explain_format_JSON) == NULL)
-                MYSQL_YYABORT;
-              Lex->describe|= DESCRIBE_EXTENDED | DESCRIBE_PARTITIONS;
-            }
-            else if (!my_strcasecmp(system_charset_info, (yyvsp[(3) - (3)].lex_str).str, "TRADITIONAL"))
-            {
-              if ((Lex->explain_format= new Explain_format_traditional) == NULL)
-                MYSQL_YYABORT;
-            }
-            else
-            {
-              my_error(ER_UNKNOWN_EXPLAIN_FORMAT, MYF(0), (yyvsp[(3) - (3)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1824:
-
-/* Line 1455 of yacc.c  */
-#line 12852 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1825:
-
-/* Line 1455 of yacc.c  */
-#line 12853 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->wild= (yyvsp[(1) - (1)].string); }
-    break;
-
-  case 1826:
-
-/* Line 1455 of yacc.c  */
-#line 12855 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->wild= new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,
-                                                    (yyvsp[(1) - (1)].lex_str).length,
-                                                    system_charset_info);
-            if (Lex->wild == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1827:
-
-/* Line 1455 of yacc.c  */
-#line 12869 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_FLUSH;
-            lex->type= 0;
-            lex->no_write_to_binlog= (yyvsp[(2) - (2)].num);
-          }
-    break;
-
-  case 1828:
-
-/* Line 1455 of yacc.c  */
-#line 12876 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1829:
-
-/* Line 1455 of yacc.c  */
-#line 12881 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->type|= REFRESH_TABLES;
-            /*
-              Set type of metadata and table locks for
-              FLUSH TABLES table_list [WITH READ LOCK].
-            */
-            YYPS->m_lock_type= TL_READ_NO_INSERT;
-            YYPS->m_mdl_type= MDL_SHARED_HIGH_PRIO;
-          }
-    break;
-
-  case 1830:
-
-/* Line 1455 of yacc.c  */
-#line 12890 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1831:
-
-/* Line 1455 of yacc.c  */
-#line 12891 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1833:
-
-/* Line 1455 of yacc.c  */
-#line 12896 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1834:
-
-/* Line 1455 of yacc.c  */
-#line 12898 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            TABLE_LIST *tables= Lex->query_tables;
-            Lex->type|= REFRESH_READ_LOCK;
-            for (; tables; tables= tables->next_global)
-            {
-              tables->mdl_request.set_type(MDL_SHARED_NO_WRITE);
-              tables->required_type= FRMTYPE_TABLE; /* Don't try to flush views. */
-              tables->open_type= OT_BASE_ONLY;      /* Ignore temporary tables. */
-            }
-          }
-    break;
-
-  case 1835:
-
-/* Line 1455 of yacc.c  */
-#line 12909 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->query_tables == NULL) // Table list can't be empty
-            {
-              my_parse_error(ER(ER_NO_TABLES_USED));
-              MYSQL_YYABORT;
-            } 
-          }
-    break;
-
-  case 1836:
-
-/* Line 1455 of yacc.c  */
-#line 12917 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            TABLE_LIST *tables= Lex->query_tables;
-            Lex->type|= REFRESH_FOR_EXPORT;
-            for (; tables; tables= tables->next_global)
-            {
-              tables->mdl_request.set_type(MDL_SHARED_NO_WRITE);
-              tables->required_type= FRMTYPE_TABLE; /* Don't try to flush views. */
-              tables->open_type= OT_BASE_ONLY;      /* Ignore temporary tables. */
-            }
-          }
-    break;
-
-  case 1838:
-
-/* Line 1455 of yacc.c  */
-#line 12932 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1839:
-
-/* Line 1455 of yacc.c  */
-#line 12937 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_ERROR_LOG; }
-    break;
-
-  case 1840:
-
-/* Line 1455 of yacc.c  */
-#line 12939 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_ENGINE_LOG; }
-    break;
-
-  case 1841:
-
-/* Line 1455 of yacc.c  */
-#line 12941 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_GENERAL_LOG; }
-    break;
-
-  case 1842:
-
-/* Line 1455 of yacc.c  */
-#line 12943 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_SLOW_LOG; }
-    break;
-
-  case 1843:
-
-/* Line 1455 of yacc.c  */
-#line 12945 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_BINARY_LOG; }
-    break;
-
-  case 1844:
-
-/* Line 1455 of yacc.c  */
-#line 12947 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_RELAY_LOG; }
-    break;
-
-  case 1845:
-
-/* Line 1455 of yacc.c  */
-#line 12949 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_QUERY_CACHE_FREE; }
-    break;
-
-  case 1846:
-
-/* Line 1455 of yacc.c  */
-#line 12951 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_HOSTS; }
-    break;
-
-  case 1847:
-
-/* Line 1455 of yacc.c  */
-#line 12953 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_GRANT; }
-    break;
-
-  case 1848:
-
-/* Line 1455 of yacc.c  */
-#line 12955 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_LOG; }
-    break;
-
-  case 1849:
-
-/* Line 1455 of yacc.c  */
-#line 12957 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_STATUS; }
-    break;
-
-  case 1850:
-
-/* Line 1455 of yacc.c  */
-#line 12959 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_DES_KEY_FILE; }
-    break;
-
-  case 1851:
-
-/* Line 1455 of yacc.c  */
-#line 12961 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_USER_RESOURCES; }
-    break;
-
-  case 1852:
-
-/* Line 1455 of yacc.c  */
-#line 12965 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1853:
-
-/* Line 1455 of yacc.c  */
-#line 12966 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1854:
-
-/* Line 1455 of yacc.c  */
-#line 12971 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_RESET; lex->type=0;
-          }
-    break;
-
-  case 1855:
-
-/* Line 1455 of yacc.c  */
-#line 12976 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1858:
-
-/* Line 1455 of yacc.c  */
-#line 12985 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_SLAVE; }
-    break;
-
-  case 1859:
-
-/* Line 1455 of yacc.c  */
-#line 12986 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 1860:
-
-/* Line 1455 of yacc.c  */
-#line 12987 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_MASTER; }
-    break;
-
-  case 1861:
-
-/* Line 1455 of yacc.c  */
-#line 12988 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type|= REFRESH_QUERY_CACHE;}
-    break;
-
-  case 1862:
-
-/* Line 1455 of yacc.c  */
-#line 12992 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->reset_slave_info.all= false; }
-    break;
-
-  case 1863:
-
-/* Line 1455 of yacc.c  */
-#line 12993 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->reset_slave_info.all= true; }
-    break;
-
-  case 1864:
-
-/* Line 1455 of yacc.c  */
-#line 12998 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->type=0;
-            lex->sql_command = SQLCOM_PURGE;
-          }
-    break;
-
-  case 1865:
-
-/* Line 1455 of yacc.c  */
-#line 13004 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1867:
-
-/* Line 1455 of yacc.c  */
-#line 13013 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->to_log = (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 1868:
-
-/* Line 1455 of yacc.c  */
-#line 13017 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->value_list.empty();
-            lex->value_list.push_front((yyvsp[(2) - (2)].item));
-            lex->sql_command= SQLCOM_PURGE_BEFORE;
-          }
-    break;
-
-  case 1869:
-
-/* Line 1455 of yacc.c  */
-#line 13029 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->value_list.empty();
-            lex->value_list.push_front((yyvsp[(3) - (3)].item));
-            lex->sql_command= SQLCOM_KILL;
-          }
-    break;
-
-  case 1870:
-
-/* Line 1455 of yacc.c  */
-#line 13038 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type= 0; }
-    break;
-
-  case 1871:
-
-/* Line 1455 of yacc.c  */
-#line 13039 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type= 0; }
-    break;
-
-  case 1872:
-
-/* Line 1455 of yacc.c  */
-#line 13040 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->type= ONLY_KILL_QUERY; }
-    break;
-
-  case 1873:
-
-/* Line 1455 of yacc.c  */
-#line 13047 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command=SQLCOM_CHANGE_DB;
-            lex->select_lex.db= (yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 1874:
-
-/* Line 1455 of yacc.c  */
-#line 13058 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), 
-                       (yyvsp[(2) - (2)].filetype) == FILETYPE_CSV ? "LOAD DATA" : "LOAD XML");
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1875:
-
-/* Line 1455 of yacc.c  */
-#line 13070 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_LOAD;
-            lex->local_file=  (yyvsp[(5) - (7)].num);
-            lex->duplicates= DUP_ERROR;
-            lex->ignore= 0;
-            if (!(lex->exchange= new sql_exchange((yyvsp[(7) - (7)].lex_str).str, 0, (yyvsp[(2) - (7)].filetype))))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1876:
-
-/* Line 1455 of yacc.c  */
-#line 13080 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(12) - (13)].table), NULL, TL_OPTION_UPDATING,
-                                           (yyvsp[(4) - (13)].lock_type), MDL_SHARED_WRITE, NULL, (yyvsp[(13) - (13)].string_list)))
-              MYSQL_YYABORT;
-            lex->field_list.empty();
-            lex->update_list.empty();
-            lex->value_list.empty();
-          }
-    break;
-
-  case 1877:
-
-/* Line 1455 of yacc.c  */
-#line 13090 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->exchange->cs= (yyvsp[(15) - (15)].charset); }
-    break;
-
-  case 1878:
-
-/* Line 1455 of yacc.c  */
-#line 13094 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1879:
-
-/* Line 1455 of yacc.c  */
-#line 13098 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.filetype)= FILETYPE_CSV; }
-    break;
-
-  case 1880:
-
-/* Line 1455 of yacc.c  */
-#line 13099 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.filetype)= FILETYPE_XML; }
-    break;
-
-  case 1881:
-
-/* Line 1455 of yacc.c  */
-#line 13103 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=0;}
-    break;
-
-  case 1882:
-
-/* Line 1455 of yacc.c  */
-#line 13104 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=1;}
-    break;
-
-  case 1883:
-
-/* Line 1455 of yacc.c  */
-#line 13108 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lock_type)= TL_WRITE_DEFAULT; }
-    break;
-
-  case 1884:
-
-/* Line 1455 of yacc.c  */
-#line 13110 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-#ifdef HAVE_QUERY_CACHE
-            /*
-              Ignore this option in SP to avoid problem with query cache
-            */
-            if (Lex->sphead != 0)
-              (yyval.lock_type)= TL_WRITE_DEFAULT;
-            else
-#endif
-              (yyval.lock_type)= TL_WRITE_CONCURRENT_INSERT;
-          }
-    break;
-
-  case 1885:
-
-/* Line 1455 of yacc.c  */
-#line 13121 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; }
-    break;
-
-  case 1886:
-
-/* Line 1455 of yacc.c  */
-#line 13125 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->duplicates=DUP_ERROR; }
-    break;
-
-  case 1887:
-
-/* Line 1455 of yacc.c  */
-#line 13126 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->duplicates=DUP_REPLACE; }
-    break;
-
-  case 1888:
-
-/* Line 1455 of yacc.c  */
-#line 13127 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->ignore= 1; }
-    break;
-
-  case 1893:
-
-/* Line 1455 of yacc.c  */
-#line 13142 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            DBUG_ASSERT(Lex->exchange != 0);
-            Lex->exchange->field_term= (yyvsp[(3) - (3)].string);
-          }
-    break;
-
-  case 1894:
-
-/* Line 1455 of yacc.c  */
-#line 13147 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            DBUG_ASSERT(lex->exchange != 0);
-            lex->exchange->enclosed= (yyvsp[(4) - (4)].string);
-            lex->exchange->opt_enclosed= 1;
-          }
-    break;
-
-  case 1895:
-
-/* Line 1455 of yacc.c  */
-#line 13154 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            DBUG_ASSERT(Lex->exchange != 0);
-            Lex->exchange->enclosed= (yyvsp[(3) - (3)].string);
-          }
-    break;
-
-  case 1896:
-
-/* Line 1455 of yacc.c  */
-#line 13159 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            DBUG_ASSERT(Lex->exchange != 0);
-            Lex->exchange->escaped= (yyvsp[(3) - (3)].string);
-          }
-    break;
-
-  case 1901:
-
-/* Line 1455 of yacc.c  */
-#line 13177 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            DBUG_ASSERT(Lex->exchange != 0);
-            Lex->exchange->line_term= (yyvsp[(3) - (3)].string);
-          }
-    break;
-
-  case 1902:
-
-/* Line 1455 of yacc.c  */
-#line 13182 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            DBUG_ASSERT(Lex->exchange != 0);
-            Lex->exchange->line_start= (yyvsp[(3) - (3)].string);
-          }
-    break;
-
-  case 1903:
-
-/* Line 1455 of yacc.c  */
-#line 13189 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 1904:
-
-/* Line 1455 of yacc.c  */
-#line 13191 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->exchange->line_term = (yyvsp[(4) - (4)].string); }
-    break;
-
-  case 1906:
-
-/* Line 1455 of yacc.c  */
-#line 13196 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            DBUG_ASSERT(Lex->exchange != 0);
-            Lex->exchange->skip_lines= atol((yyvsp[(2) - (3)].lex_str).str);
-          }
-    break;
-
-  case 1907:
-
-/* Line 1455 of yacc.c  */
-#line 13203 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 1908:
-
-/* Line 1455 of yacc.c  */
-#line 13205 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { }
-    break;
-
-  case 1909:
-
-/* Line 1455 of yacc.c  */
-#line 13209 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1910:
-
-/* Line 1455 of yacc.c  */
-#line 13210 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1911:
-
-/* Line 1455 of yacc.c  */
-#line 13211 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1912:
-
-/* Line 1455 of yacc.c  */
-#line 13216 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); }
-    break;
-
-  case 1913:
-
-/* Line 1455 of yacc.c  */
-#line 13218 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); }
-    break;
-
-  case 1914:
-
-/* Line 1455 of yacc.c  */
-#line 13222 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {(yyval.item)= (yyvsp[(1) - (1)].item);}
-    break;
-
-  case 1915:
-
-/* Line 1455 of yacc.c  */
-#line 13224 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_user_var_as_out_param((yyvsp[(2) - (2)].lex_str));
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1916:
-
-/* Line 1455 of yacc.c  */
-#line 13232 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1917:
-
-/* Line 1455 of yacc.c  */
-#line 13233 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1920:
-
-/* Line 1455 of yacc.c  */
-#line 13243 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            uint length= (uint) ((yyvsp[(5) - (5)].simple_string) - (yyvsp[(3) - (5)].simple_string));
-            String *val= new (YYTHD->mem_root) String((yyvsp[(3) - (5)].simple_string),
-                                                      length,
-                                                      YYTHD->charset());
-            if (val == NULL)
-              MYSQL_YYABORT;
-            if (lex->update_list.push_back((yyvsp[(1) - (5)].item)) ||
-                lex->value_list.push_back((yyvsp[(4) - (5)].item)) ||
-                lex->load_set_str_list.push_back(val))
-                MYSQL_YYABORT;
-            (yyvsp[(4) - (5)].item)->item_name.copy((yyvsp[(3) - (5)].simple_string), length, YYTHD->charset());
-          }
-    break;
-
-  case 1921:
-
-/* Line 1455 of yacc.c  */
-#line 13263 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX_STRING tmp;
-            THD *thd= YYTHD;
-            const CHARSET_INFO *cs_con= thd->variables.collation_connection;
-            const CHARSET_INFO *cs_cli= thd->variables.character_set_client;
-            uint repertoire= thd->lex->text_string_is_7bit &&
-                             my_charset_is_ascii_based(cs_cli) ?
-                             MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
-            if (thd->charset_is_collation_connection ||
-                (repertoire == MY_REPERTOIRE_ASCII &&
-                 my_charset_is_ascii_based(cs_con)))
-              tmp= (yyvsp[(1) - (1)].lex_str);
-            else
-            {
-              if (thd->convert_string(&tmp, cs_con, (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, cs_cli))
-                MYSQL_YYABORT;
-            }
-            (yyval.item)= new (thd->mem_root) Item_string(tmp.str, tmp.length, cs_con,
-                                                DERIVATION_COERCIBLE,
-                                                repertoire);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1922:
-
-/* Line 1455 of yacc.c  */
-#line 13287 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            uint repertoire= Lex->text_string_is_7bit ?
-                             MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
-            DBUG_ASSERT(my_charset_is_ascii_based(national_charset_info));
-            (yyval.item)= new (YYTHD->mem_root) Item_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length,
-                                                  national_charset_info,
-                                                  DERIVATION_COERCIBLE,
-                                                  repertoire);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1923:
-
-/* Line 1455 of yacc.c  */
-#line 13299 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item_string *str= new (YYTHD->mem_root) Item_string((yyvsp[(2) - (2)].lex_str).str,
-                                                                (yyvsp[(2) - (2)].lex_str).length, (yyvsp[(1) - (2)].charset));
-            if (str == NULL)
-              MYSQL_YYABORT;
-            str->set_repertoire_from_value();
-            str->set_cs_specified(TRUE);
-
-            (yyval.item)= str;
-          }
-    break;
-
-  case 1924:
-
-/* Line 1455 of yacc.c  */
-#line 13310 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item_string* item= (Item_string*) (yyvsp[(1) - (2)].item);
-            item->append((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length);
-            if (!(item->collation.repertoire & MY_REPERTOIRE_EXTENDED))
-            {
-              /*
-                 If the string has been pure ASCII so far,
-                 check the new part.
-              */
-              const CHARSET_INFO *cs= YYTHD->variables.collation_connection;
-              item->collation.repertoire|= my_string_repertoire(cs,
-                                                                (yyvsp[(2) - (2)].lex_str).str,
-                                                                (yyvsp[(2) - (2)].lex_str).length);
-            }
-          }
-    break;
-
-  case 1925:
-
-/* Line 1455 of yacc.c  */
-#line 13329 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.string)= new (YYTHD->mem_root) String((yyvsp[(1) - (1)].lex_str).str,
-                                             (yyvsp[(1) - (1)].lex_str).length,
-                                             YYTHD->variables.collation_connection);
-            if ((yyval.string) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1926:
-
-/* Line 1455 of yacc.c  */
-#line 13337 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *tmp= new (YYTHD->mem_root) Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);
-            if (tmp == NULL)
-              MYSQL_YYABORT;
-            /*
-              it is OK only emulate fix_fields, because we need only
-              value of constant
-            */
-            tmp->quick_fix_field();
-            (yyval.string)= tmp->val_str((String*) 0);
-          }
-    break;
-
-  case 1927:
-
-/* Line 1455 of yacc.c  */
-#line 13349 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *tmp= new (YYTHD->mem_root) Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);
-            if (tmp == NULL)
-              MYSQL_YYABORT;
-            /*
-              it is OK only emulate fix_fields, because we need only
-              value of constant
-            */
-            tmp->quick_fix_field();
-            (yyval.string)= tmp->val_str((String*) 0);
-          }
-    break;
-
-  case 1928:
-
-/* Line 1455 of yacc.c  */
-#line 13364 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            Lex_input_stream *lip= YYLIP;
-            Item_param *item;
-            if (! lex->parsing_options.allows_variable)
-            {
-              my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
-              MYSQL_YYABORT;
-            }
-            item= new (thd->mem_root) Item_param((uint) (lip->get_tok_start() - thd->query()));
-            if (!((yyval.item)= item) || lex->param_list.push_back(item))
-            {
-              my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1929:
-
-/* Line 1455 of yacc.c  */
-#line 13384 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item) = (yyvsp[(1) - (1)].item); }
-    break;
-
-  case 1930:
-
-/* Line 1455 of yacc.c  */
-#line 13385 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item) = (yyvsp[(2) - (2)].item_num); }
-    break;
-
-  case 1931:
-
-/* Line 1455 of yacc.c  */
-#line 13387 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyvsp[(2) - (2)].item_num)->max_length++;
-            (yyval.item)= (yyvsp[(2) - (2)].item_num)->neg();
-          }
-    break;
-
-  case 1932:
-
-/* Line 1455 of yacc.c  */
-#line 13395 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item) = (yyvsp[(1) - (1)].item); }
-    break;
-
-  case 1933:
-
-/* Line 1455 of yacc.c  */
-#line 13396 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item) = (yyvsp[(1) - (1)].item_num); }
-    break;
-
-  case 1934:
-
-/* Line 1455 of yacc.c  */
-#line 13397 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(1) - (1)].item); }
-    break;
-
-  case 1935:
-
-/* Line 1455 of yacc.c  */
-#line 13399 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item) = new (YYTHD->mem_root) Item_null();
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            YYLIP->next_state= MY_LEX_OPERATOR_OR_IDENT;
-          }
-    break;
-
-  case 1936:
-
-/* Line 1455 of yacc.c  */
-#line 13406 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_int(NAME_STRING("FALSE"), 0, 1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1937:
-
-/* Line 1455 of yacc.c  */
-#line 13412 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_int(NAME_STRING("TRUE"), 1, 1);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1938:
-
-/* Line 1455 of yacc.c  */
-#line 13418 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item) = new (YYTHD->mem_root) Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1939:
-
-/* Line 1455 of yacc.c  */
-#line 13424 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)= new (YYTHD->mem_root) Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1940:
-
-/* Line 1455 of yacc.c  */
-#line 13430 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *tmp= new (YYTHD->mem_root) Item_hex_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length);
-            if (tmp == NULL)
-              MYSQL_YYABORT;
-            /*
-              it is OK only emulate fix_fieds, because we need only
-              value of constant
-            */
-            tmp->quick_fix_field();
-            String *str= tmp->val_str((String*) 0);
-
-            Item_string *item_str;
-            item_str= new (YYTHD->mem_root)
-                        Item_string(null_name_string, /* name will be set in select_item */
-                                    str ? str->ptr() : "",
-                                    str ? str->length() : 0,
-                                    (yyvsp[(1) - (2)].charset));
-            if (!item_str ||
-                !item_str->check_well_formed_result(&item_str->str_value, TRUE))
-            {
-              MYSQL_YYABORT;
-            }
-
-            item_str->set_repertoire_from_value();
-            item_str->set_cs_specified(TRUE);
-
-            (yyval.item)= item_str;
-          }
-    break;
-
-  case 1941:
-
-/* Line 1455 of yacc.c  */
-#line 13459 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item *tmp= new (YYTHD->mem_root) Item_bin_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length);
-            if (tmp == NULL)
-              MYSQL_YYABORT;
-            /*
-              it is OK only emulate fix_fieds, because we need only
-              value of constant
-            */
-            tmp->quick_fix_field();
-            String *str= tmp->val_str((String*) 0);
-
-            Item_string *item_str;
-            item_str= new (YYTHD->mem_root)
-                        Item_string(null_name_string, /* name will be set in select_item */
-                                    str ? str->ptr() : "",
-                                    str ? str->length() : 0,
-                                    (yyvsp[(1) - (2)].charset));
-            if (!item_str ||
-                !item_str->check_well_formed_result(&item_str->str_value, TRUE))
-            {
-              MYSQL_YYABORT;
-            }
-
-            item_str->set_cs_specified(TRUE);
-
-            (yyval.item)= item_str;
-          }
-    break;
-
-  case 1942:
-
-/* Line 1455 of yacc.c  */
-#line 13490 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            int error;
-            (yyval.item_num)= new (YYTHD->mem_root)
-                  Item_int((yyvsp[(1) - (1)].lex_str),
-                           (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error),
-                           (yyvsp[(1) - (1)].lex_str).length);
-            if ((yyval.item_num) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1943:
-
-/* Line 1455 of yacc.c  */
-#line 13500 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            int error;
-            (yyval.item_num)= new (YYTHD->mem_root)
-                  Item_int((yyvsp[(1) - (1)].lex_str),
-                           (longlong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, NULL, &error),
-                           (yyvsp[(1) - (1)].lex_str).length);
-            if ((yyval.item_num) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1944:
-
-/* Line 1455 of yacc.c  */
-#line 13510 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item_num)= new (YYTHD->mem_root) Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);
-            if ((yyval.item_num) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1945:
-
-/* Line 1455 of yacc.c  */
-#line 13516 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item_num)= new (YYTHD->mem_root) Item_decimal((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length,
-                                                   YYTHD->charset());
-            if (((yyval.item_num) == NULL) || (YYTHD->is_error()))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1946:
-
-/* Line 1455 of yacc.c  */
-#line 13525 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item_num)= new (YYTHD->mem_root) Item_float((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length);
-            if (((yyval.item_num) == NULL) || (YYTHD->is_error()))
-            {
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1947:
-
-/* Line 1455 of yacc.c  */
-#line 13537 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyval.item)= create_temporal_literal(YYTHD, (yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, YYCSCL,
-                                              MYSQL_TYPE_DATE, true)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1948:
-
-/* Line 1455 of yacc.c  */
-#line 13543 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyval.item)= create_temporal_literal(YYTHD, (yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, YYCSCL,
-                                              MYSQL_TYPE_TIME, true)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1949:
-
-/* Line 1455 of yacc.c  */
-#line 13549 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyval.item)= create_temporal_literal(YYTHD, (yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, YYCSCL,
-                                              MYSQL_TYPE_DATETIME, true)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1950:
-
-/* Line 1455 of yacc.c  */
-#line 13564 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)=(yyvsp[(1) - (1)].item); }
-    break;
-
-  case 1951:
-
-/* Line 1455 of yacc.c  */
-#line 13565 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)=(yyvsp[(1) - (1)].item); }
-    break;
-
-  case 1952:
-
-/* Line 1455 of yacc.c  */
-#line 13570 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            SELECT_LEX *sel= Select;
-            (yyval.item)= new (YYTHD->mem_root) Item_field(Lex->current_context(),
-                                                 NullS, (yyvsp[(1) - (3)].lex_str).str, "*");
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            sel->with_wild++;
-          }
-    break;
-
-  case 1953:
-
-/* Line 1455 of yacc.c  */
-#line 13579 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            SELECT_LEX *sel= Select;
-            const char* schema= thd->client_capabilities & CLIENT_NO_SCHEMA ?
-                                  NullS : (yyvsp[(1) - (5)].lex_str).str;
-            (yyval.item)= new (thd->mem_root) Item_field(Lex->current_context(),
-                                               schema,
-                                               (yyvsp[(3) - (5)].lex_str).str,"*");
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-            sel->with_wild++;
-          }
-    break;
-
-  case 1954:
-
-/* Line 1455 of yacc.c  */
-#line 13594 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)=(yyvsp[(1) - (1)].item); }
-    break;
-
-  case 1955:
-
-/* Line 1455 of yacc.c  */
-#line 13599 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_pcontext *pctx = lex->get_sp_current_parsing_ctx();
-            sp_variable *spv;
-
-            if (pctx && (spv= pctx->find_variable((yyvsp[(1) - (1)].lex_str), false)))
-            {
-              Lex_input_stream *lip= &thd->m_parser_state->m_lip;
-              sp_head *sp= lex->sphead;
-
-              DBUG_ASSERT(sp);
-
-              /* We're compiling a stored procedure and found a variable */
-              if (! lex->parsing_options.allows_variable)
-              {
-                my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
-                MYSQL_YYABORT;
-              }
-
-              (yyval.item)=
-                create_item_for_sp_var(
-                  thd, (yyvsp[(1) - (1)].lex_str), spv,
-                  sp->m_parser_data.get_current_stmt_start_ptr(),
-                  lip->get_tok_start_prev(),
-                  lip->get_tok_end());
-
-              if ((yyval.item) == NULL)
-                MYSQL_YYABORT;
-
-              lex->safe_to_cache_query= false;
-            }
-            else
-            {
-              SELECT_LEX *sel=Select;
-              if ((sel->parsing_place != IN_HAVING) ||
-                  (sel->get_in_sum_expr() > 0))
-              {
-                (yyval.item)= new (thd->mem_root) Item_field(Lex->current_context(),
-                                                   NullS, NullS, (yyvsp[(1) - (1)].lex_str).str);
-              }
-              else
-              {
-                (yyval.item)= new (thd->mem_root) Item_ref(Lex->current_context(),
-                                                 NullS, NullS, (yyvsp[(1) - (1)].lex_str).str);
-              }
-              if ((yyval.item) == NULL)
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1956:
-
-/* Line 1455 of yacc.c  */
-#line 13649 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(1) - (1)].item); }
-    break;
-
-  case 1957:
-
-/* Line 1455 of yacc.c  */
-#line 13654 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            SELECT_LEX *sel=Select;
-            if ((sel->parsing_place != IN_HAVING) ||
-                (sel->get_in_sum_expr() > 0))
-            {
-              (yyval.item)= new (thd->mem_root) Item_field(Lex->current_context(),
-                                                 NullS, NullS, (yyvsp[(1) - (1)].lex_str).str);
-            }
-            else
-            {
-              (yyval.item)= new (thd->mem_root) Item_ref(Lex->current_context(),
-                                               NullS, NullS, (yyvsp[(1) - (1)].lex_str).str);
-            }
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1958:
-
-/* Line 1455 of yacc.c  */
-#line 13671 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)= (yyvsp[(1) - (1)].item); }
-    break;
-
-  case 1959:
-
-/* Line 1455 of yacc.c  */
-#line 13676 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            /*
-              FIXME This will work ok in simple_ident_nospvar case because
-              we can't meet simple_ident_nospvar in trigger now. But it
-              should be changed in future.
-            */
-            if (sp && sp->m_type == SP_TYPE_TRIGGER &&
-                (!my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "NEW") ||
-                 !my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "OLD")))
-            {
-              Item_trigger_field *trg_fld;
-              bool new_row= ((yyvsp[(1) - (3)].lex_str).str[0]=='N' || (yyvsp[(1) - (3)].lex_str).str[0]=='n');
-
-              if (sp->m_trg_chistics.event == TRG_EVENT_INSERT &&
-                  !new_row)
-              {
-                my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "OLD", "on INSERT");
-                MYSQL_YYABORT;
-              }
-
-              if (sp->m_trg_chistics.event == TRG_EVENT_DELETE &&
-                  new_row)
-              {
-                my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "NEW", "on DELETE");
-                MYSQL_YYABORT;
-              }
-
-              DBUG_ASSERT(!new_row ||
-                          (sp->m_trg_chistics.event == TRG_EVENT_INSERT ||
-                           sp->m_trg_chistics.event == TRG_EVENT_UPDATE));
-              const bool read_only=
-                !(new_row && sp->m_trg_chistics.action_time == TRG_ACTION_BEFORE);
-              trg_fld= new (thd->mem_root)
-                         Item_trigger_field(Lex->current_context(),
-                                            new_row ?
-                                              Item_trigger_field::NEW_ROW:
-                                              Item_trigger_field::OLD_ROW,
-                                            (yyvsp[(3) - (3)].lex_str).str,
-                                            SELECT_ACL,
-                                            read_only);
-              if (trg_fld == NULL)
-                MYSQL_YYABORT;
-
-              /*
-                Let us add this item to list of all Item_trigger_field objects
-                in trigger.
-              */
-              lex->sphead->m_cur_instr_trig_field_items.link_in_list(
-                trg_fld, &trg_fld->next_trg_field);
-
-              (yyval.item)= trg_fld;
-            }
-            else
-            {
-              SELECT_LEX *sel= lex->current_select;
-              if (sel->no_table_names_allowed)
-              {
-                my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
-                         MYF(0), (yyvsp[(1) - (3)].lex_str).str, thd->where);
-              }
-              if ((sel->parsing_place != IN_HAVING) ||
-                  (sel->get_in_sum_expr() > 0))
-              {
-                (yyval.item)= new (thd->mem_root) Item_field(Lex->current_context(),
-                                                   NullS, (yyvsp[(1) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).str);
-              }
-              else
-              {
-                (yyval.item)= new (thd->mem_root) Item_ref(Lex->current_context(),
-                                                 NullS, (yyvsp[(1) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).str);
-              }
-              if ((yyval.item) == NULL)
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1960:
-
-/* Line 1455 of yacc.c  */
-#line 13756 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            SELECT_LEX *sel= lex->current_select;
-            if (sel->no_table_names_allowed)
-            {
-              my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
-                       MYF(0), (yyvsp[(2) - (4)].lex_str).str, thd->where);
-            }
-            if ((sel->parsing_place != IN_HAVING) ||
-                (sel->get_in_sum_expr() > 0))
-            {
-              (yyval.item)= new (thd->mem_root) Item_field(Lex->current_context(),
-                                                 NullS, (yyvsp[(2) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).str);
-
-            }
-            else
-            {
-              (yyval.item)= new (thd->mem_root) Item_ref(Lex->current_context(),
-                                               NullS, (yyvsp[(2) - (4)].lex_str).str, (yyvsp[(4) - (4)].lex_str).str);
-            }
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1961:
-
-/* Line 1455 of yacc.c  */
-#line 13781 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            SELECT_LEX *sel= lex->current_select;
-            const char* schema= (thd->client_capabilities & CLIENT_NO_SCHEMA ?
-                                 NullS : (yyvsp[(1) - (5)].lex_str).str);
-            if (sel->no_table_names_allowed)
-            {
-              my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
-                       MYF(0), (yyvsp[(3) - (5)].lex_str).str, thd->where);
-            }
-            if ((sel->parsing_place != IN_HAVING) ||
-                (sel->get_in_sum_expr() > 0))
-            {
-              (yyval.item)= new (thd->mem_root) Item_field(Lex->current_context(),
-                                                 schema,
-                                                 (yyvsp[(3) - (5)].lex_str).str, (yyvsp[(5) - (5)].lex_str).str);
-            }
-            else
-            {
-              (yyval.item)= new (thd->mem_root) Item_ref(Lex->current_context(),
-                                               schema,
-                                               (yyvsp[(3) - (5)].lex_str).str, (yyvsp[(5) - (5)].lex_str).str);
-            }
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1962:
-
-/* Line 1455 of yacc.c  */
-#line 13811 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);}
-    break;
-
-  case 1963:
-
-/* Line 1455 of yacc.c  */
-#line 13813 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            TABLE_LIST *table= Select->table_list.first;
-            if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (5)].lex_str).str, table->db))
-            {
-              my_error(ER_WRONG_DB_NAME, MYF(0), (yyvsp[(1) - (5)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            if (my_strcasecmp(table_alias_charset, (yyvsp[(3) - (5)].lex_str).str,
-                              table->table_name))
-            {
-              my_error(ER_WRONG_TABLE_NAME, MYF(0), (yyvsp[(3) - (5)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            (yyval.lex_str)=(yyvsp[(5) - (5)].lex_str);
-          }
-    break;
-
-  case 1964:
-
-/* Line 1455 of yacc.c  */
-#line 13829 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            TABLE_LIST *table= Select->table_list.first;
-            if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (3)].lex_str).str, table->alias))
-            {
-              my_error(ER_WRONG_TABLE_NAME, MYF(0), (yyvsp[(1) - (3)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            (yyval.lex_str)=(yyvsp[(3) - (3)].lex_str);
-          }
-    break;
-
-  case 1965:
-
-/* Line 1455 of yacc.c  */
-#line 13838 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str);}
-    break;
-
-  case 1966:
-
-/* Line 1455 of yacc.c  */
-#line 13843 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.table)= new Table_ident((yyvsp[(1) - (1)].lex_str));
-            if ((yyval.table) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1967:
-
-/* Line 1455 of yacc.c  */
-#line 13849 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.table)= new Table_ident(YYTHD, (yyvsp[(1) - (3)].lex_str),(yyvsp[(3) - (3)].lex_str),0);
-            if ((yyval.table) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1968:
-
-/* Line 1455 of yacc.c  */
-#line 13855 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /* For Delphi */
-            (yyval.table)= new Table_ident((yyvsp[(2) - (2)].lex_str));
-            if ((yyval.table) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1969:
-
-/* Line 1455 of yacc.c  */
-#line 13865 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.table)= new Table_ident((yyvsp[(1) - (2)].lex_str));
-            if ((yyval.table) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1970:
-
-/* Line 1455 of yacc.c  */
-#line 13871 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.table)= new Table_ident(YYTHD, (yyvsp[(1) - (4)].lex_str),(yyvsp[(3) - (4)].lex_str),0);
-            if ((yyval.table) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1971:
-
-/* Line 1455 of yacc.c  */
-#line 13880 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX_STRING db={(char*) any_db,3};
-            (yyval.table)= new Table_ident(YYTHD, db,(yyvsp[(1) - (1)].lex_str),0);
-            if ((yyval.table) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1972:
-
-/* Line 1455 of yacc.c  */
-#line 13889 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 1973:
-
-/* Line 1455 of yacc.c  */
-#line 13891 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-
-            if (thd->charset_is_system_charset)
-            {
-              const CHARSET_INFO *cs= system_charset_info;
-              int dummy_error;
-              uint wlen= cs->cset->well_formed_len(cs, (yyvsp[(1) - (1)].lex_str).str,
-                                                   (yyvsp[(1) - (1)].lex_str).str+(yyvsp[(1) - (1)].lex_str).length,
-                                                   (yyvsp[(1) - (1)].lex_str).length, &dummy_error);
-              if (wlen < (yyvsp[(1) - (1)].lex_str).length)
-              {
-                ErrConvString err((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, &my_charset_bin);
-                my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
-                         cs->csname, err.ptr());
-                MYSQL_YYABORT;
-              }
-              (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str);
-            }
-            else
-            {
-              if (thd->convert_string(&(yyval.lex_str), system_charset_info,
-                                  (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()))
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1974:
-
-/* Line 1455 of yacc.c  */
-#line 13921 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!strcont((yyvsp[(1) - (1)].lex_str).str, "\n"))
-              (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str);
-            else
-            {
-              my_error(ER_WRONG_VALUE, MYF(0), "argument contains not-allowed LF", (yyvsp[(1) - (1)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1975:
-
-/* Line 1455 of yacc.c  */
-#line 13934 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-
-            if (thd->charset_is_system_charset)
-              (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str);
-            else
-            {
-              if (thd->convert_string(&(yyval.lex_str), system_charset_info,
-                                  (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()))
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1976:
-
-/* Line 1455 of yacc.c  */
-#line 13950 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-
-            if (thd->charset_is_collation_connection)
-              (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str);
-            else
-            {
-              if (thd->convert_string(&(yyval.lex_str), thd->variables.collation_connection,
-                                  (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()))
-                MYSQL_YYABORT;
-            } 
-          }
-    break;
-
-  case 1977:
-
-/* Line 1455 of yacc.c  */
-#line 13966 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-
-            if (thd->charset_is_character_set_filesystem)
-              (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str);
-            else
-            {
-              if (thd->convert_string(&(yyval.lex_str),
-                                      thd->variables.character_set_filesystem,
-                                      (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, thd->charset()))
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 1978:
-
-/* Line 1455 of yacc.c  */
-#line 13982 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 1979:
-
-/* Line 1455 of yacc.c  */
-#line 13984 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length);
-            if ((yyval.lex_str).str == NULL)
-              MYSQL_YYABORT;
-            (yyval.lex_str).length= (yyvsp[(1) - (1)].symbol).length;
-          }
-    break;
-
-  case 1980:
-
-/* Line 1455 of yacc.c  */
-#line 13994 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); }
-    break;
-
-  case 1981:
-
-/* Line 1455 of yacc.c  */
-#line 13996 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length);
-            if ((yyval.lex_str).str == NULL)
-              MYSQL_YYABORT;
-            (yyval.lex_str).length= (yyvsp[(1) - (1)].symbol).length;
-          }
-    break;
-
-  case 1982:
-
-/* Line 1455 of yacc.c  */
-#line 14006 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);}
-    break;
-
-  case 1983:
-
-/* Line 1455 of yacc.c  */
-#line 14007 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);}
-    break;
-
-  case 1984:
-
-/* Line 1455 of yacc.c  */
-#line 14008 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);}
-    break;
-
-  case 1985:
-
-/* Line 1455 of yacc.c  */
-#line 14013 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
-              MYSQL_YYABORT;
-            (yyval.lex_user)->user= (yyvsp[(1) - (1)].lex_str);
-            (yyval.lex_user)->host.str= (char *) "%";
-            (yyval.lex_user)->host.length= 1;
-            (yyval.lex_user)->password= null_lex_str; 
-            (yyval.lex_user)->plugin= empty_lex_str;
-            (yyval.lex_user)->auth= empty_lex_str;
-            (yyval.lex_user)->uses_identified_by_clause= false;
-            (yyval.lex_user)->uses_identified_with_clause= false;
-            (yyval.lex_user)->uses_identified_by_password_clause= false;
-            (yyval.lex_user)->uses_authentication_string_clause= false;
-
-            /*
-              Trim whitespace as the values will go to a CHAR field
-              when stored.
-            */
-            trim_whitespace(system_charset_info, &(yyval.lex_user)->user);
-
-            if (check_string_char_length(&(yyval.lex_user)->user, ER(ER_USERNAME),
-                                         USERNAME_CHAR_LENGTH,
-                                         system_charset_info, 0))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 1986:
-
-/* Line 1455 of yacc.c  */
-#line 14040 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
-              MYSQL_YYABORT;
-            (yyval.lex_user)->user= (yyvsp[(1) - (3)].lex_str);
-            (yyval.lex_user)->host= (yyvsp[(3) - (3)].lex_str);
-            (yyval.lex_user)->password= null_lex_str; 
-            (yyval.lex_user)->plugin= empty_lex_str;
-            (yyval.lex_user)->auth= empty_lex_str;
-            (yyval.lex_user)->uses_identified_by_clause= false;
-            (yyval.lex_user)->uses_identified_with_clause= false;
-            (yyval.lex_user)->uses_identified_by_password_clause= false;
-            (yyval.lex_user)->uses_authentication_string_clause= false;
-
-            if (check_string_char_length(&(yyval.lex_user)->user, ER(ER_USERNAME),
-                                         USERNAME_CHAR_LENGTH,
-                                         system_charset_info, 0) ||
-                check_host_name(&(yyval.lex_user)->host))
-              MYSQL_YYABORT;
-            /*
-              Convert hostname part of username to lowercase.
-              It's OK to use in-place lowercase as long as
-              the character set is utf8.
-            */
-            my_casedn_str(system_charset_info, (yyval.lex_user)->host.str);
-            /*
-              Trim whitespace as the values will go to a CHAR field
-              when stored.
-            */
-            trim_whitespace(system_charset_info, &(yyval.lex_user)->user);
-            trim_whitespace(system_charset_info, &(yyval.lex_user)->host);
-          }
-    break;
-
-  case 1987:
-
-/* Line 1455 of yacc.c  */
-#line 14073 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (!((yyval.lex_user)=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user))))
-              MYSQL_YYABORT;
-            /* 
-              empty LEX_USER means current_user and 
-              will be handled in the  get_current_user() function
-              later
-            */
-            memset((yyval.lex_user), 0, sizeof(LEX_USER));
-          }
-    break;
-
-  case 1988:
-
-/* Line 1455 of yacc.c  */
-#line 14087 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1989:
-
-/* Line 1455 of yacc.c  */
-#line 14088 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1990:
-
-/* Line 1455 of yacc.c  */
-#line 14089 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1991:
-
-/* Line 1455 of yacc.c  */
-#line 14090 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1992:
-
-/* Line 1455 of yacc.c  */
-#line 14091 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1993:
-
-/* Line 1455 of yacc.c  */
-#line 14092 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1994:
-
-/* Line 1455 of yacc.c  */
-#line 14093 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1995:
-
-/* Line 1455 of yacc.c  */
-#line 14094 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1996:
-
-/* Line 1455 of yacc.c  */
-#line 14095 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1997:
-
-/* Line 1455 of yacc.c  */
-#line 14096 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1998:
-
-/* Line 1455 of yacc.c  */
-#line 14097 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 1999:
-
-/* Line 1455 of yacc.c  */
-#line 14098 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2000:
-
-/* Line 1455 of yacc.c  */
-#line 14099 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2001:
-
-/* Line 1455 of yacc.c  */
-#line 14100 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2002:
-
-/* Line 1455 of yacc.c  */
-#line 14101 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2003:
-
-/* Line 1455 of yacc.c  */
-#line 14102 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2004:
-
-/* Line 1455 of yacc.c  */
-#line 14103 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2005:
-
-/* Line 1455 of yacc.c  */
-#line 14104 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2006:
-
-/* Line 1455 of yacc.c  */
-#line 14105 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2007:
-
-/* Line 1455 of yacc.c  */
-#line 14106 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2008:
-
-/* Line 1455 of yacc.c  */
-#line 14107 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2009:
-
-/* Line 1455 of yacc.c  */
-#line 14108 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2010:
-
-/* Line 1455 of yacc.c  */
-#line 14109 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2011:
-
-/* Line 1455 of yacc.c  */
-#line 14110 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2012:
-
-/* Line 1455 of yacc.c  */
-#line 14111 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2013:
-
-/* Line 1455 of yacc.c  */
-#line 14112 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2014:
-
-/* Line 1455 of yacc.c  */
-#line 14113 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2015:
-
-/* Line 1455 of yacc.c  */
-#line 14114 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2016:
-
-/* Line 1455 of yacc.c  */
-#line 14115 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2017:
-
-/* Line 1455 of yacc.c  */
-#line 14116 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2018:
-
-/* Line 1455 of yacc.c  */
-#line 14117 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2019:
-
-/* Line 1455 of yacc.c  */
-#line 14118 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2020:
-
-/* Line 1455 of yacc.c  */
-#line 14119 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2021:
-
-/* Line 1455 of yacc.c  */
-#line 14120 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2022:
-
-/* Line 1455 of yacc.c  */
-#line 14121 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2023:
-
-/* Line 1455 of yacc.c  */
-#line 14122 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2024:
-
-/* Line 1455 of yacc.c  */
-#line 14123 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2025:
-
-/* Line 1455 of yacc.c  */
-#line 14124 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2026:
-
-/* Line 1455 of yacc.c  */
-#line 14125 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2027:
-
-/* Line 1455 of yacc.c  */
-#line 14126 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2028:
-
-/* Line 1455 of yacc.c  */
-#line 14127 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2029:
-
-/* Line 1455 of yacc.c  */
-#line 14128 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2030:
-
-/* Line 1455 of yacc.c  */
-#line 14129 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2031:
-
-/* Line 1455 of yacc.c  */
-#line 14130 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2032:
-
-/* Line 1455 of yacc.c  */
-#line 14131 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2033:
-
-/* Line 1455 of yacc.c  */
-#line 14132 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2034:
-
-/* Line 1455 of yacc.c  */
-#line 14133 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2035:
-
-/* Line 1455 of yacc.c  */
-#line 14134 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2036:
-
-/* Line 1455 of yacc.c  */
-#line 14135 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2037:
-
-/* Line 1455 of yacc.c  */
-#line 14136 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2038:
-
-/* Line 1455 of yacc.c  */
-#line 14146 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2039:
-
-/* Line 1455 of yacc.c  */
-#line 14147 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2040:
-
-/* Line 1455 of yacc.c  */
-#line 14148 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2041:
-
-/* Line 1455 of yacc.c  */
-#line 14149 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2042:
-
-/* Line 1455 of yacc.c  */
-#line 14150 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2043:
-
-/* Line 1455 of yacc.c  */
-#line 14151 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2044:
-
-/* Line 1455 of yacc.c  */
-#line 14152 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2045:
-
-/* Line 1455 of yacc.c  */
-#line 14153 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2046:
-
-/* Line 1455 of yacc.c  */
-#line 14154 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2047:
-
-/* Line 1455 of yacc.c  */
-#line 14155 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2048:
-
-/* Line 1455 of yacc.c  */
-#line 14156 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2049:
-
-/* Line 1455 of yacc.c  */
-#line 14157 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2050:
-
-/* Line 1455 of yacc.c  */
-#line 14158 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2051:
-
-/* Line 1455 of yacc.c  */
-#line 14159 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2052:
-
-/* Line 1455 of yacc.c  */
-#line 14160 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2053:
-
-/* Line 1455 of yacc.c  */
-#line 14161 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2054:
-
-/* Line 1455 of yacc.c  */
-#line 14162 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2055:
-
-/* Line 1455 of yacc.c  */
-#line 14163 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2056:
-
-/* Line 1455 of yacc.c  */
-#line 14164 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2057:
-
-/* Line 1455 of yacc.c  */
-#line 14165 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2058:
-
-/* Line 1455 of yacc.c  */
-#line 14166 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2059:
-
-/* Line 1455 of yacc.c  */
-#line 14167 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2060:
-
-/* Line 1455 of yacc.c  */
-#line 14168 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2061:
-
-/* Line 1455 of yacc.c  */
-#line 14169 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2062:
-
-/* Line 1455 of yacc.c  */
-#line 14170 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2063:
-
-/* Line 1455 of yacc.c  */
-#line 14171 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2064:
-
-/* Line 1455 of yacc.c  */
-#line 14172 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2065:
-
-/* Line 1455 of yacc.c  */
-#line 14173 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2066:
-
-/* Line 1455 of yacc.c  */
-#line 14174 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2067:
-
-/* Line 1455 of yacc.c  */
-#line 14175 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2068:
-
-/* Line 1455 of yacc.c  */
-#line 14176 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2069:
-
-/* Line 1455 of yacc.c  */
-#line 14177 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2070:
-
-/* Line 1455 of yacc.c  */
-#line 14178 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2071:
-
-/* Line 1455 of yacc.c  */
-#line 14179 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2072:
-
-/* Line 1455 of yacc.c  */
-#line 14180 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2073:
-
-/* Line 1455 of yacc.c  */
-#line 14181 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2074:
-
-/* Line 1455 of yacc.c  */
-#line 14182 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2075:
-
-/* Line 1455 of yacc.c  */
-#line 14183 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2076:
-
-/* Line 1455 of yacc.c  */
-#line 14184 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2077:
-
-/* Line 1455 of yacc.c  */
-#line 14185 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2078:
-
-/* Line 1455 of yacc.c  */
-#line 14186 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2079:
-
-/* Line 1455 of yacc.c  */
-#line 14187 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2080:
-
-/* Line 1455 of yacc.c  */
-#line 14188 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2081:
-
-/* Line 1455 of yacc.c  */
-#line 14189 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2082:
-
-/* Line 1455 of yacc.c  */
-#line 14190 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2083:
-
-/* Line 1455 of yacc.c  */
-#line 14195 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2084:
-
-/* Line 1455 of yacc.c  */
-#line 14196 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2085:
-
-/* Line 1455 of yacc.c  */
-#line 14197 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2086:
-
-/* Line 1455 of yacc.c  */
-#line 14198 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2087:
-
-/* Line 1455 of yacc.c  */
-#line 14199 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2088:
-
-/* Line 1455 of yacc.c  */
-#line 14200 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2089:
-
-/* Line 1455 of yacc.c  */
-#line 14201 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2090:
-
-/* Line 1455 of yacc.c  */
-#line 14202 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2091:
-
-/* Line 1455 of yacc.c  */
-#line 14203 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2092:
-
-/* Line 1455 of yacc.c  */
-#line 14204 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2093:
-
-/* Line 1455 of yacc.c  */
-#line 14205 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2094:
-
-/* Line 1455 of yacc.c  */
-#line 14206 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2095:
-
-/* Line 1455 of yacc.c  */
-#line 14207 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2096:
-
-/* Line 1455 of yacc.c  */
-#line 14208 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2097:
-
-/* Line 1455 of yacc.c  */
-#line 14209 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2098:
-
-/* Line 1455 of yacc.c  */
-#line 14210 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2099:
-
-/* Line 1455 of yacc.c  */
-#line 14211 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2100:
-
-/* Line 1455 of yacc.c  */
-#line 14212 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2101:
-
-/* Line 1455 of yacc.c  */
-#line 14213 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2102:
-
-/* Line 1455 of yacc.c  */
-#line 14214 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2103:
-
-/* Line 1455 of yacc.c  */
-#line 14215 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2104:
-
-/* Line 1455 of yacc.c  */
-#line 14216 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2105:
-
-/* Line 1455 of yacc.c  */
-#line 14217 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2106:
-
-/* Line 1455 of yacc.c  */
-#line 14218 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2107:
-
-/* Line 1455 of yacc.c  */
-#line 14219 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2108:
-
-/* Line 1455 of yacc.c  */
-#line 14220 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2109:
-
-/* Line 1455 of yacc.c  */
-#line 14221 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2110:
-
-/* Line 1455 of yacc.c  */
-#line 14222 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2111:
-
-/* Line 1455 of yacc.c  */
-#line 14223 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2112:
-
-/* Line 1455 of yacc.c  */
-#line 14224 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2113:
-
-/* Line 1455 of yacc.c  */
-#line 14225 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2114:
-
-/* Line 1455 of yacc.c  */
-#line 14226 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2115:
-
-/* Line 1455 of yacc.c  */
-#line 14227 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2116:
-
-/* Line 1455 of yacc.c  */
-#line 14228 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2117:
-
-/* Line 1455 of yacc.c  */
-#line 14229 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2118:
-
-/* Line 1455 of yacc.c  */
-#line 14230 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2119:
-
-/* Line 1455 of yacc.c  */
-#line 14231 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2120:
-
-/* Line 1455 of yacc.c  */
-#line 14232 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2121:
-
-/* Line 1455 of yacc.c  */
-#line 14233 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2122:
-
-/* Line 1455 of yacc.c  */
-#line 14234 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2123:
-
-/* Line 1455 of yacc.c  */
-#line 14235 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2124:
-
-/* Line 1455 of yacc.c  */
-#line 14236 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2125:
-
-/* Line 1455 of yacc.c  */
-#line 14237 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2126:
-
-/* Line 1455 of yacc.c  */
-#line 14238 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2127:
-
-/* Line 1455 of yacc.c  */
-#line 14239 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2128:
-
-/* Line 1455 of yacc.c  */
-#line 14240 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2129:
-
-/* Line 1455 of yacc.c  */
-#line 14241 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2130:
-
-/* Line 1455 of yacc.c  */
-#line 14242 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2131:
-
-/* Line 1455 of yacc.c  */
-#line 14243 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2132:
-
-/* Line 1455 of yacc.c  */
-#line 14244 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2133:
-
-/* Line 1455 of yacc.c  */
-#line 14245 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2134:
-
-/* Line 1455 of yacc.c  */
-#line 14246 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2135:
-
-/* Line 1455 of yacc.c  */
-#line 14247 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2136:
-
-/* Line 1455 of yacc.c  */
-#line 14248 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2137:
-
-/* Line 1455 of yacc.c  */
-#line 14249 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2138:
-
-/* Line 1455 of yacc.c  */
-#line 14250 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2139:
-
-/* Line 1455 of yacc.c  */
-#line 14251 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2140:
-
-/* Line 1455 of yacc.c  */
-#line 14252 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2141:
-
-/* Line 1455 of yacc.c  */
-#line 14253 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2142:
-
-/* Line 1455 of yacc.c  */
-#line 14254 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2143:
-
-/* Line 1455 of yacc.c  */
-#line 14255 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2144:
-
-/* Line 1455 of yacc.c  */
-#line 14256 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2145:
-
-/* Line 1455 of yacc.c  */
-#line 14257 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2146:
-
-/* Line 1455 of yacc.c  */
-#line 14258 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2147:
-
-/* Line 1455 of yacc.c  */
-#line 14259 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2148:
-
-/* Line 1455 of yacc.c  */
-#line 14260 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2149:
-
-/* Line 1455 of yacc.c  */
-#line 14261 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2150:
-
-/* Line 1455 of yacc.c  */
-#line 14262 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2151:
-
-/* Line 1455 of yacc.c  */
-#line 14263 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2152:
-
-/* Line 1455 of yacc.c  */
-#line 14264 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2153:
-
-/* Line 1455 of yacc.c  */
-#line 14265 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2154:
-
-/* Line 1455 of yacc.c  */
-#line 14266 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2155:
-
-/* Line 1455 of yacc.c  */
-#line 14267 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2156:
-
-/* Line 1455 of yacc.c  */
-#line 14268 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2157:
-
-/* Line 1455 of yacc.c  */
-#line 14269 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2158:
-
-/* Line 1455 of yacc.c  */
-#line 14270 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2159:
-
-/* Line 1455 of yacc.c  */
-#line 14271 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2160:
-
-/* Line 1455 of yacc.c  */
-#line 14272 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2161:
-
-/* Line 1455 of yacc.c  */
-#line 14273 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2162:
-
-/* Line 1455 of yacc.c  */
-#line 14274 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2163:
-
-/* Line 1455 of yacc.c  */
-#line 14275 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2164:
-
-/* Line 1455 of yacc.c  */
-#line 14276 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2165:
-
-/* Line 1455 of yacc.c  */
-#line 14277 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2166:
-
-/* Line 1455 of yacc.c  */
-#line 14278 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2167:
-
-/* Line 1455 of yacc.c  */
-#line 14279 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2168:
-
-/* Line 1455 of yacc.c  */
-#line 14280 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2169:
-
-/* Line 1455 of yacc.c  */
-#line 14281 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2170:
-
-/* Line 1455 of yacc.c  */
-#line 14282 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2171:
-
-/* Line 1455 of yacc.c  */
-#line 14283 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2172:
-
-/* Line 1455 of yacc.c  */
-#line 14284 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2173:
-
-/* Line 1455 of yacc.c  */
-#line 14285 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2174:
-
-/* Line 1455 of yacc.c  */
-#line 14286 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2175:
-
-/* Line 1455 of yacc.c  */
-#line 14287 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2176:
-
-/* Line 1455 of yacc.c  */
-#line 14288 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2177:
-
-/* Line 1455 of yacc.c  */
-#line 14289 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2178:
-
-/* Line 1455 of yacc.c  */
-#line 14290 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2179:
-
-/* Line 1455 of yacc.c  */
-#line 14291 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2180:
-
-/* Line 1455 of yacc.c  */
-#line 14292 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2181:
-
-/* Line 1455 of yacc.c  */
-#line 14293 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2182:
-
-/* Line 1455 of yacc.c  */
-#line 14294 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2183:
-
-/* Line 1455 of yacc.c  */
-#line 14295 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2184:
-
-/* Line 1455 of yacc.c  */
-#line 14296 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2185:
-
-/* Line 1455 of yacc.c  */
-#line 14297 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2186:
-
-/* Line 1455 of yacc.c  */
-#line 14298 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2187:
-
-/* Line 1455 of yacc.c  */
-#line 14299 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2188:
-
-/* Line 1455 of yacc.c  */
-#line 14300 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2189:
-
-/* Line 1455 of yacc.c  */
-#line 14301 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2190:
-
-/* Line 1455 of yacc.c  */
-#line 14302 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2191:
-
-/* Line 1455 of yacc.c  */
-#line 14303 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2192:
-
-/* Line 1455 of yacc.c  */
-#line 14304 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2193:
-
-/* Line 1455 of yacc.c  */
-#line 14305 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2194:
-
-/* Line 1455 of yacc.c  */
-#line 14306 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2195:
-
-/* Line 1455 of yacc.c  */
-#line 14307 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2196:
-
-/* Line 1455 of yacc.c  */
-#line 14308 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2197:
-
-/* Line 1455 of yacc.c  */
-#line 14309 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2198:
-
-/* Line 1455 of yacc.c  */
-#line 14310 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2199:
-
-/* Line 1455 of yacc.c  */
-#line 14311 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2200:
-
-/* Line 1455 of yacc.c  */
-#line 14312 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2201:
-
-/* Line 1455 of yacc.c  */
-#line 14313 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2202:
-
-/* Line 1455 of yacc.c  */
-#line 14314 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2203:
-
-/* Line 1455 of yacc.c  */
-#line 14315 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2204:
-
-/* Line 1455 of yacc.c  */
-#line 14316 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2205:
-
-/* Line 1455 of yacc.c  */
-#line 14317 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2206:
-
-/* Line 1455 of yacc.c  */
-#line 14318 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2207:
-
-/* Line 1455 of yacc.c  */
-#line 14319 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2208:
-
-/* Line 1455 of yacc.c  */
-#line 14320 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2209:
-
-/* Line 1455 of yacc.c  */
-#line 14321 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2210:
-
-/* Line 1455 of yacc.c  */
-#line 14322 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2211:
-
-/* Line 1455 of yacc.c  */
-#line 14323 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2212:
-
-/* Line 1455 of yacc.c  */
-#line 14324 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2213:
-
-/* Line 1455 of yacc.c  */
-#line 14325 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2214:
-
-/* Line 1455 of yacc.c  */
-#line 14326 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2215:
-
-/* Line 1455 of yacc.c  */
-#line 14327 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2216:
-
-/* Line 1455 of yacc.c  */
-#line 14328 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2217:
-
-/* Line 1455 of yacc.c  */
-#line 14329 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2218:
-
-/* Line 1455 of yacc.c  */
-#line 14330 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2219:
-
-/* Line 1455 of yacc.c  */
-#line 14331 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2220:
-
-/* Line 1455 of yacc.c  */
-#line 14332 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2221:
-
-/* Line 1455 of yacc.c  */
-#line 14333 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2222:
-
-/* Line 1455 of yacc.c  */
-#line 14334 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2223:
-
-/* Line 1455 of yacc.c  */
-#line 14335 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2224:
-
-/* Line 1455 of yacc.c  */
-#line 14336 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2225:
-
-/* Line 1455 of yacc.c  */
-#line 14337 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2226:
-
-/* Line 1455 of yacc.c  */
-#line 14338 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2227:
-
-/* Line 1455 of yacc.c  */
-#line 14339 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2228:
-
-/* Line 1455 of yacc.c  */
-#line 14340 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2229:
-
-/* Line 1455 of yacc.c  */
-#line 14341 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2230:
-
-/* Line 1455 of yacc.c  */
-#line 14342 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2231:
-
-/* Line 1455 of yacc.c  */
-#line 14343 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2232:
-
-/* Line 1455 of yacc.c  */
-#line 14344 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2233:
-
-/* Line 1455 of yacc.c  */
-#line 14345 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2234:
-
-/* Line 1455 of yacc.c  */
-#line 14346 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2235:
-
-/* Line 1455 of yacc.c  */
-#line 14347 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2236:
-
-/* Line 1455 of yacc.c  */
-#line 14348 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2237:
-
-/* Line 1455 of yacc.c  */
-#line 14349 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2238:
-
-/* Line 1455 of yacc.c  */
-#line 14350 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2239:
-
-/* Line 1455 of yacc.c  */
-#line 14351 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2240:
-
-/* Line 1455 of yacc.c  */
-#line 14352 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2241:
-
-/* Line 1455 of yacc.c  */
-#line 14353 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2242:
-
-/* Line 1455 of yacc.c  */
-#line 14354 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2243:
-
-/* Line 1455 of yacc.c  */
-#line 14355 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2244:
-
-/* Line 1455 of yacc.c  */
-#line 14356 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2245:
-
-/* Line 1455 of yacc.c  */
-#line 14357 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2246:
-
-/* Line 1455 of yacc.c  */
-#line 14358 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2247:
-
-/* Line 1455 of yacc.c  */
-#line 14359 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2248:
-
-/* Line 1455 of yacc.c  */
-#line 14360 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2249:
-
-/* Line 1455 of yacc.c  */
-#line 14361 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2250:
-
-/* Line 1455 of yacc.c  */
-#line 14362 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2251:
-
-/* Line 1455 of yacc.c  */
-#line 14363 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2252:
-
-/* Line 1455 of yacc.c  */
-#line 14364 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2253:
-
-/* Line 1455 of yacc.c  */
-#line 14365 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2254:
-
-/* Line 1455 of yacc.c  */
-#line 14366 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2255:
-
-/* Line 1455 of yacc.c  */
-#line 14367 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2256:
-
-/* Line 1455 of yacc.c  */
-#line 14368 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2257:
-
-/* Line 1455 of yacc.c  */
-#line 14369 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2258:
-
-/* Line 1455 of yacc.c  */
-#line 14370 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2259:
-
-/* Line 1455 of yacc.c  */
-#line 14371 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2260:
-
-/* Line 1455 of yacc.c  */
-#line 14372 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2261:
-
-/* Line 1455 of yacc.c  */
-#line 14373 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2262:
-
-/* Line 1455 of yacc.c  */
-#line 14374 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2263:
-
-/* Line 1455 of yacc.c  */
-#line 14375 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2264:
-
-/* Line 1455 of yacc.c  */
-#line 14376 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2265:
-
-/* Line 1455 of yacc.c  */
-#line 14377 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2266:
-
-/* Line 1455 of yacc.c  */
-#line 14378 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2267:
-
-/* Line 1455 of yacc.c  */
-#line 14379 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2268:
-
-/* Line 1455 of yacc.c  */
-#line 14380 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2269:
-
-/* Line 1455 of yacc.c  */
-#line 14381 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2270:
-
-/* Line 1455 of yacc.c  */
-#line 14382 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2271:
-
-/* Line 1455 of yacc.c  */
-#line 14383 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2272:
-
-/* Line 1455 of yacc.c  */
-#line 14384 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2273:
-
-/* Line 1455 of yacc.c  */
-#line 14385 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2274:
-
-/* Line 1455 of yacc.c  */
-#line 14386 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2275:
-
-/* Line 1455 of yacc.c  */
-#line 14387 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2276:
-
-/* Line 1455 of yacc.c  */
-#line 14388 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2277:
-
-/* Line 1455 of yacc.c  */
-#line 14389 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2278:
-
-/* Line 1455 of yacc.c  */
-#line 14390 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2279:
-
-/* Line 1455 of yacc.c  */
-#line 14391 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2280:
-
-/* Line 1455 of yacc.c  */
-#line 14392 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2281:
-
-/* Line 1455 of yacc.c  */
-#line 14393 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2282:
-
-/* Line 1455 of yacc.c  */
-#line 14394 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2283:
-
-/* Line 1455 of yacc.c  */
-#line 14395 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2284:
-
-/* Line 1455 of yacc.c  */
-#line 14396 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2285:
-
-/* Line 1455 of yacc.c  */
-#line 14397 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2286:
-
-/* Line 1455 of yacc.c  */
-#line 14398 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2287:
-
-/* Line 1455 of yacc.c  */
-#line 14399 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2288:
-
-/* Line 1455 of yacc.c  */
-#line 14400 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2289:
-
-/* Line 1455 of yacc.c  */
-#line 14401 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2290:
-
-/* Line 1455 of yacc.c  */
-#line 14402 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2291:
-
-/* Line 1455 of yacc.c  */
-#line 14403 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2292:
-
-/* Line 1455 of yacc.c  */
-#line 14404 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2293:
-
-/* Line 1455 of yacc.c  */
-#line 14405 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2294:
-
-/* Line 1455 of yacc.c  */
-#line 14406 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2295:
-
-/* Line 1455 of yacc.c  */
-#line 14407 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2296:
-
-/* Line 1455 of yacc.c  */
-#line 14408 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2297:
-
-/* Line 1455 of yacc.c  */
-#line 14409 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2298:
-
-/* Line 1455 of yacc.c  */
-#line 14410 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2299:
-
-/* Line 1455 of yacc.c  */
-#line 14411 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2300:
-
-/* Line 1455 of yacc.c  */
-#line 14412 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2301:
-
-/* Line 1455 of yacc.c  */
-#line 14413 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2302:
-
-/* Line 1455 of yacc.c  */
-#line 14414 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2303:
-
-/* Line 1455 of yacc.c  */
-#line 14415 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2304:
-
-/* Line 1455 of yacc.c  */
-#line 14416 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2305:
-
-/* Line 1455 of yacc.c  */
-#line 14417 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2306:
-
-/* Line 1455 of yacc.c  */
-#line 14418 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2307:
-
-/* Line 1455 of yacc.c  */
-#line 14419 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2308:
-
-/* Line 1455 of yacc.c  */
-#line 14420 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2309:
-
-/* Line 1455 of yacc.c  */
-#line 14421 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2310:
-
-/* Line 1455 of yacc.c  */
-#line 14422 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2311:
-
-/* Line 1455 of yacc.c  */
-#line 14423 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2312:
-
-/* Line 1455 of yacc.c  */
-#line 14424 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2313:
-
-/* Line 1455 of yacc.c  */
-#line 14425 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2314:
-
-/* Line 1455 of yacc.c  */
-#line 14426 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2315:
-
-/* Line 1455 of yacc.c  */
-#line 14427 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2316:
-
-/* Line 1455 of yacc.c  */
-#line 14428 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2317:
-
-/* Line 1455 of yacc.c  */
-#line 14429 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2318:
-
-/* Line 1455 of yacc.c  */
-#line 14430 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2319:
-
-/* Line 1455 of yacc.c  */
-#line 14431 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2320:
-
-/* Line 1455 of yacc.c  */
-#line 14432 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2321:
-
-/* Line 1455 of yacc.c  */
-#line 14433 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2322:
-
-/* Line 1455 of yacc.c  */
-#line 14434 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2323:
-
-/* Line 1455 of yacc.c  */
-#line 14435 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2324:
-
-/* Line 1455 of yacc.c  */
-#line 14436 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2325:
-
-/* Line 1455 of yacc.c  */
-#line 14437 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2326:
-
-/* Line 1455 of yacc.c  */
-#line 14438 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2327:
-
-/* Line 1455 of yacc.c  */
-#line 14439 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2328:
-
-/* Line 1455 of yacc.c  */
-#line 14440 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2329:
-
-/* Line 1455 of yacc.c  */
-#line 14441 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2330:
-
-/* Line 1455 of yacc.c  */
-#line 14442 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2331:
-
-/* Line 1455 of yacc.c  */
-#line 14443 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2332:
-
-/* Line 1455 of yacc.c  */
-#line 14444 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2333:
-
-/* Line 1455 of yacc.c  */
-#line 14445 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2334:
-
-/* Line 1455 of yacc.c  */
-#line 14446 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2335:
-
-/* Line 1455 of yacc.c  */
-#line 14447 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2336:
-
-/* Line 1455 of yacc.c  */
-#line 14448 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2337:
-
-/* Line 1455 of yacc.c  */
-#line 14449 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2338:
-
-/* Line 1455 of yacc.c  */
-#line 14450 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2339:
-
-/* Line 1455 of yacc.c  */
-#line 14462 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            mysql_init_select(lex);
-            lex->sql_command= SQLCOM_SET_OPTION;
-            lex->option_type= OPT_SESSION;
-            lex->var_list.empty();
-            lex->one_shot_set= 0;
-            lex->autocommit= 0;
-
-            sp_create_assignment_lex(YYTHD, YY_TOKEN_END);
-          }
-    break;
-
-  case 2340:
-
-/* Line 1455 of yacc.c  */
-#line 14474 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2341:
-
-/* Line 1455 of yacc.c  */
-#line 14481 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2343:
-
-/* Line 1455 of yacc.c  */
-#line 14487 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->option_type= OPT_DEFAULT;
-          }
-    break;
-
-  case 2344:
-
-/* Line 1455 of yacc.c  */
-#line 14491 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2345:
-
-/* Line 1455 of yacc.c  */
-#line 14496 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->option_type= (yyvsp[(1) - (1)].var_type);
-          }
-    break;
-
-  case 2347:
-
-/* Line 1455 of yacc.c  */
-#line 14506 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END))
-              MYSQL_YYABORT; 
-          }
-    break;
-
-  case 2349:
-
-/* Line 1455 of yacc.c  */
-#line 14512 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END))
-              MYSQL_YYABORT; 
-          }
-    break;
-
-  case 2352:
-
-/* Line 1455 of yacc.c  */
-#line 14526 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            sp_create_assignment_lex(YYTHD, YY_TOKEN_START);
-          }
-    break;
-
-  case 2353:
-
-/* Line 1455 of yacc.c  */
-#line 14530 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END))
-              MYSQL_YYABORT; 
-          }
-    break;
-
-  case 2354:
-
-/* Line 1455 of yacc.c  */
-#line 14535 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            sp_create_assignment_lex(YYTHD, YY_TOKEN_START);
-          }
-    break;
-
-  case 2355:
-
-/* Line 1455 of yacc.c  */
-#line 14539 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END))
-              MYSQL_YYABORT; 
-          }
-    break;
-
-  case 2356:
-
-/* Line 1455 of yacc.c  */
-#line 14548 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->option_type= (yyvsp[(1) - (1)].var_type);
-          }
-    break;
-
-  case 2359:
-
-/* Line 1455 of yacc.c  */
-#line 14556 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_GLOBAL; }
-    break;
-
-  case 2360:
-
-/* Line 1455 of yacc.c  */
-#line 14557 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_SESSION; }
-    break;
-
-  case 2361:
-
-/* Line 1455 of yacc.c  */
-#line 14558 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_SESSION; }
-    break;
-
-  case 2362:
-
-/* Line 1455 of yacc.c  */
-#line 14562 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_SESSION; }
-    break;
-
-  case 2363:
-
-/* Line 1455 of yacc.c  */
-#line 14563 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_GLOBAL; }
-    break;
-
-  case 2364:
-
-/* Line 1455 of yacc.c  */
-#line 14564 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_SESSION; }
-    break;
-
-  case 2365:
-
-/* Line 1455 of yacc.c  */
-#line 14565 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_SESSION; }
-    break;
-
-  case 2366:
-
-/* Line 1455 of yacc.c  */
-#line 14569 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_DEFAULT; }
-    break;
-
-  case 2367:
-
-/* Line 1455 of yacc.c  */
-#line 14570 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_GLOBAL; }
-    break;
-
-  case 2368:
-
-/* Line 1455 of yacc.c  */
-#line 14571 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_SESSION; }
-    break;
-
-  case 2369:
-
-/* Line 1455 of yacc.c  */
-#line 14572 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.var_type)=OPT_SESSION; }
-    break;
-
-  case 2370:
-
-/* Line 1455 of yacc.c  */
-#line 14578 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-
-            if ((yyvsp[(1) - (3)].variable).var && (yyvsp[(1) - (3)].variable).var != trg_new_row_fake_var)
-            {
-              /* It is a system variable. */
-              if (set_system_variable(thd, &(yyvsp[(1) - (3)].variable), lex->option_type, (yyvsp[(3) - (3)].item)))
-                MYSQL_YYABORT;
-            }
-            else
-            {
-              /*
-                Not in trigger assigning value to new row,
-                and option_type preceeding local variable is illegal.
-              */
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 2371:
-
-/* Line 1455 of yacc.c  */
-#line 14603 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            sp_head *sp= Lex->sphead;
-
-            if (sp)
-              sp->m_parser_data.push_expr_start_ptr(YY_TOKEN_START);
-          }
-    break;
-
-  case 2372:
-
-/* Line 1455 of yacc.c  */
-#line 14610 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            const char *expr_start_ptr= NULL;
-
-            if (sp)
-              expr_start_ptr= sp->m_parser_data.pop_expr_start_ptr();
-
-            if ((yyvsp[(1) - (4)].variable).var == trg_new_row_fake_var)
-            {
-              DBUG_ASSERT(sp);
-              DBUG_ASSERT(expr_start_ptr);
-
-              /* We are parsing trigger and this is a trigger NEW-field. */
-
-              LEX_STRING expr_query= EMPTY_STR;
-
-              if (!(yyvsp[(4) - (4)].item))
-              {
-                // This is: SET NEW.x = DEFAULT
-                // DEFAULT clause is not supported in triggers.
-
-                my_parse_error(ER(ER_SYNTAX_ERROR));
-                MYSQL_YYABORT;
-              }
-              else if (lex->is_metadata_used())
-              {
-                expr_query= make_string(thd, expr_start_ptr, YY_TOKEN_END);
-
-                if (!expr_query.str)
-                  MYSQL_YYABORT;
-              }
-
-              if (set_trigger_new_row(thd, (yyvsp[(1) - (4)].variable).base_name, (yyvsp[(4) - (4)].item), expr_query))
-                MYSQL_YYABORT;
-            }
-            else if ((yyvsp[(1) - (4)].variable).var)
-            {
-              /* We're not parsing SP and this is a system variable. */
-
-              if (set_system_variable(thd, &(yyvsp[(1) - (4)].variable), lex->option_type, (yyvsp[(4) - (4)].item)))
-                MYSQL_YYABORT;
-            }
-            else
-            {
-              DBUG_ASSERT(sp);
-              DBUG_ASSERT(expr_start_ptr);
-
-              /* We're parsing SP and this is an SP-variable. */
-
-              sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-              sp_variable *spv= pctx->find_variable((yyvsp[(1) - (4)].variable).base_name, false);
-
-              LEX_STRING expr_query= EMPTY_STR;
-
-              if (!(yyvsp[(4) - (4)].item))
-              {
-                // This is: SET x = DEFAULT, where x is a SP-variable.
-                // This is not supported.
-
-                my_parse_error(ER(ER_SYNTAX_ERROR));
-                MYSQL_YYABORT;
-              }
-              else if (lex->is_metadata_used())
-              {
-                expr_query= make_string(thd, expr_start_ptr, YY_TOKEN_END);
-
-                if (!expr_query.str)
-                  MYSQL_YYABORT;
-              }
-
-              /*
-                NOTE: every SET-expression has its own LEX-object, even if it is
-                a multiple SET-statement, like:
-
-                  SET spv1 = expr1, spv2 = expr2, ...
-
-                Every SET-expression has its own sp_instr_set. Thus, the
-                instruction owns the LEX-object, i.e. the instruction is
-                responsible for destruction of the LEX-object.
-              */
-
-              sp_instr_set *i=
-                new sp_instr_set(sp->instructions(), lex,
-                                 spv->offset, (yyvsp[(4) - (4)].item), expr_query,
-                                 true); // The instruction owns its lex.
-
-              if (!i || sp->add_instr(thd, i))
-                MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 2373:
-
-/* Line 1455 of yacc.c  */
-#line 14703 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Item_func_set_user_var *item;
-            item= new (YYTHD->mem_root) Item_func_set_user_var((yyvsp[(2) - (4)].lex_str), (yyvsp[(4) - (4)].item), false);
-            if (item == NULL)
-              MYSQL_YYABORT;
-            set_var_user *var= new set_var_user(item);
-            if (var == NULL)
-              MYSQL_YYABORT;
-            Lex->var_list.push_back(var);
-          }
-    break;
-
-  case 2374:
-
-/* Line 1455 of yacc.c  */
-#line 14714 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            struct sys_var_with_base tmp= (yyvsp[(4) - (6)].variable);
-            /* Lookup if necessary: must be a system variable. */
-            if (tmp.var == NULL)
-            {
-              if (find_sys_var_null_base(thd, &tmp))
-                MYSQL_YYABORT;
-            }
-            if (set_system_variable(thd, &tmp, (yyvsp[(3) - (6)].var_type), (yyvsp[(6) - (6)].item)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2375:
-
-/* Line 1455 of yacc.c  */
-#line 14727 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            int flags= (yyvsp[(2) - (2)].charset) ? 0 : set_var_collation_client::SET_CS_DEFAULT;
-            const CHARSET_INFO *cs2;
-            cs2= (yyvsp[(2) - (2)].charset) ? (yyvsp[(2) - (2)].charset): global_system_variables.character_set_client;
-            set_var_collation_client *var;
-            var= new set_var_collation_client(flags,
-                                              cs2,
-                                              thd->variables.collation_database,
-                                              cs2);
-            if (var == NULL)
-              MYSQL_YYABORT;
-            lex->var_list.push_back(var);
-          }
-    break;
-
-  case 2376:
-
-/* Line 1455 of yacc.c  */
-#line 14743 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            LEX_STRING names= { C_STRING_WITH_LEN("names") };
-
-            if (pctx && pctx->find_variable(names, false))
-              my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), names.str);
-            else
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-
-            MYSQL_YYABORT;
-          }
-    break;
-
-  case 2377:
-
-/* Line 1455 of yacc.c  */
-#line 14756 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            const CHARSET_INFO *cs2;
-            const CHARSET_INFO *cs3;
-            int flags= set_var_collation_client::SET_CS_NAMES
-                       | ((yyvsp[(2) - (3)].charset) ? 0 : set_var_collation_client::SET_CS_DEFAULT)
-                       | ((yyvsp[(3) - (3)].charset) ? set_var_collation_client::SET_CS_COLLATE : 0);
-            cs2= (yyvsp[(2) - (3)].charset) ? (yyvsp[(2) - (3)].charset) : global_system_variables.character_set_client;
-            cs3= (yyvsp[(3) - (3)].charset) ? (yyvsp[(3) - (3)].charset) : cs2;
-            if (!my_charset_same(cs2, cs3))
-            {
-              my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
-                       cs3->name, cs2->csname);
-              MYSQL_YYABORT;
-            }
-            set_var_collation_client *var;
-            var= new set_var_collation_client(flags, cs3, cs3, cs3);
-            if (var == NULL)
-              MYSQL_YYABORT;
-            lex->var_list.push_back(var);
-          }
-    break;
-
-  case 2378:
-
-/* Line 1455 of yacc.c  */
-#line 14778 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            LEX_STRING pw= { C_STRING_WITH_LEN("password") };
-
-            if (pctx && pctx->find_variable(pw, false))
-            {
-              my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), pw.str);
-              MYSQL_YYABORT;
-            }
-
-            LEX_USER *user= (LEX_USER*) thd->alloc(sizeof(LEX_USER));
-
-            if (!user)
-              MYSQL_YYABORT;
-
-            user->host=null_lex_str;
-            user->user.str=thd->security_ctx->user;
-            user->user.length= strlen(thd->security_ctx->user);
-
-            set_var_password *var= new set_var_password(user, (yyvsp[(3) - (3)].simple_string));
-            if (var == NULL)
-              MYSQL_YYABORT;
-
-            lex->var_list.push_back(var);
-            lex->autocommit= TRUE;
-            lex->is_set_password_sql= true;
-            lex->is_change_password= TRUE;
-
-            if (sp)
-              sp->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT;
-          }
-    break;
-
-  case 2379:
-
-/* Line 1455 of yacc.c  */
-#line 14813 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX_USER *user= (yyvsp[(3) - (5)].lex_user);
-            LEX *lex= Lex;
-            set_var_password *var;
-
-            var= new set_var_password(user,(yyvsp[(5) - (5)].simple_string));
-            if (var == NULL)
-              MYSQL_YYABORT;
-            lex->var_list.push_back(var);
-            lex->autocommit= TRUE;
-            lex->is_set_password_sql= true;
-            if (lex->sphead)
-              lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT;
-            /*
-              'is_change_password' should be set if the user is setting his
-              own password. This is later used to determine if the password
-              expiration flag should be reset.
-              Either the user exactly matches the currently authroized user or
-              the CURRENT_USER keyword was used.
-
-              If CURRENT_USER was used for the <user> rule then
-              user->user.str=0. See rule below:
-              
-              user:
-                 [..]
-              | CURRENT_USER optional_braces
-                {
-                 [..]
-                  memset($$, 0, sizeof(LEX_USER));
-                }
-            */
-            if (user->user.str ||
-                match_authorized_user(&current_thd->main_security_ctx,
-                                      user))
-              lex->is_change_password= TRUE;
-            else
-              lex->is_change_password= FALSE;
-          }
-    break;
-
-  case 2380:
-
-/* Line 1455 of yacc.c  */
-#line 14855 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_pcontext *pctx= lex->get_sp_current_parsing_ctx();
-            sp_variable *spv;
-
-            /* Best effort lookup for system variable. */
-            if (!pctx || !(spv= pctx->find_variable((yyvsp[(1) - (1)].lex_str), false)))
-            {
-              struct sys_var_with_base tmp= {NULL, (yyvsp[(1) - (1)].lex_str)};
-
-              /* Not an SP local variable */
-              if (find_sys_var_null_base(thd, &tmp))
-                MYSQL_YYABORT;
-
-              (yyval.variable)= tmp;
-            }
-            else
-            {
-              /*
-                Possibly an SP local variable (or a shadowed sysvar).
-                Will depend on the context of the SET statement.
-              */
-              (yyval.variable).var= NULL;
-              (yyval.variable).base_name= (yyvsp[(1) - (1)].lex_str);
-            }
-          }
-    break;
-
-  case 2381:
-
-/* Line 1455 of yacc.c  */
-#line 14883 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-
-            if (check_reserved_words(&(yyvsp[(1) - (3)].lex_str)))
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-
-            if (sp && sp->m_type == SP_TYPE_TRIGGER &&
-                (!my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "NEW") ||
-                 !my_strcasecmp(system_charset_info, (yyvsp[(1) - (3)].lex_str).str, "OLD")))
-            {
-              if ((yyvsp[(1) - (3)].lex_str).str[0]=='O' || (yyvsp[(1) - (3)].lex_str).str[0]=='o')
-              {
-                my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "OLD", "");
-                MYSQL_YYABORT;
-              }
-              if (sp->m_trg_chistics.event == TRG_EVENT_DELETE)
-              {
-                my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0),
-                         "NEW", "on DELETE");
-                MYSQL_YYABORT;
-              }
-              if (sp->m_trg_chistics.action_time == TRG_ACTION_AFTER)
-              {
-                my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "NEW", "after ");
-                MYSQL_YYABORT;
-              }
-              /* This special combination will denote field of NEW row */
-              (yyval.variable).var= trg_new_row_fake_var;
-              (yyval.variable).base_name= (yyvsp[(3) - (3)].lex_str);
-            }
-            else
-            {
-              sys_var *tmp=find_sys_var(YYTHD, (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length);
-              if (!tmp)
-                MYSQL_YYABORT;
-              if (!tmp->is_struct())
-                my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), (yyvsp[(3) - (3)].lex_str).str);
-              (yyval.variable).var= tmp;
-              (yyval.variable).base_name= (yyvsp[(1) - (3)].lex_str);
-            }
-          }
-    break;
-
-  case 2382:
-
-/* Line 1455 of yacc.c  */
-#line 14929 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            sys_var *tmp=find_sys_var(YYTHD, (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length);
-            if (!tmp)
-              MYSQL_YYABORT;
-            if (!tmp->is_struct())
-              my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), (yyvsp[(3) - (3)].lex_str).str);
-            (yyval.variable).var= tmp;
-            (yyval.variable).base_name.str=    (char*) "default";
-            (yyval.variable).base_name.length= 7;
-          }
-    break;
-
-  case 2387:
-
-/* Line 1455 of yacc.c  */
-#line 14950 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex=Lex;
-            Item *item= new (thd->mem_root) Item_int((int32) (yyvsp[(1) - (1)].num));
-            if (item == NULL)
-              MYSQL_YYABORT;
-            set_var *var= new set_var(lex->option_type,
-                                      find_sys_var(thd, "tx_read_only"),
-                                      &null_lex_str,
-                                      item);
-            if (var == NULL)
-              MYSQL_YYABORT;
-            lex->var_list.push_back(var);
-          }
-    break;
-
-  case 2388:
-
-/* Line 1455 of yacc.c  */
-#line 14968 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex=Lex;
-            Item *item= new (thd->mem_root) Item_int((int32) (yyvsp[(3) - (3)].tx_isolation));
-            if (item == NULL)
-              MYSQL_YYABORT;
-            set_var *var= new set_var(lex->option_type,
-                                      find_sys_var(thd, "tx_isolation"),
-                                      &null_lex_str,
-                                      item);
-            if (var == NULL)
-              MYSQL_YYABORT;
-            lex->var_list.push_back(var);
-          }
-    break;
-
-  case 2389:
-
-/* Line 1455 of yacc.c  */
-#line 14985 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= true; }
-    break;
-
-  case 2390:
-
-/* Line 1455 of yacc.c  */
-#line 14986 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= false; }
-    break;
-
-  case 2391:
-
-/* Line 1455 of yacc.c  */
-#line 14990 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.tx_isolation)= ISO_READ_UNCOMMITTED; }
-    break;
-
-  case 2392:
-
-/* Line 1455 of yacc.c  */
-#line 14991 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.tx_isolation)= ISO_READ_COMMITTED; }
-    break;
-
-  case 2393:
-
-/* Line 1455 of yacc.c  */
-#line 14992 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.tx_isolation)= ISO_REPEATABLE_READ; }
-    break;
-
-  case 2394:
-
-/* Line 1455 of yacc.c  */
-#line 14993 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.tx_isolation)= ISO_SERIALIZABLE; }
-    break;
-
-  case 2395:
-
-/* Line 1455 of yacc.c  */
-#line 14997 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str;}
-    break;
-
-  case 2396:
-
-/* Line 1455 of yacc.c  */
-#line 14999 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if ((yyvsp[(3) - (4)].lex_str).length == 0)
-             (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).str;
-            else
-            switch (YYTHD->variables.old_passwords) {
-              case 1: (yyval.simple_string)= Item_func_old_password::
-                alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str, (yyvsp[(3) - (4)].lex_str).length);
-                break;
-              case 0:
-              case 2: (yyval.simple_string)= Item_func_password::
-                create_password_hash_buffer(YYTHD, (yyvsp[(3) - (4)].lex_str).str, (yyvsp[(3) - (4)].lex_str).length);
-                break;
-            }
-            if ((yyval.simple_string) == NULL)
-              MYSQL_YYABORT;
-            Lex->contains_plaintext_password= true;
-          }
-    break;
-
-  case 2397:
-
-/* Line 1455 of yacc.c  */
-#line 15017 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-                   WARN_DEPRECATED(YYTHD, "OLD_PASSWORD", "PASSWORD");
-            (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? Item_func_old_password::
-              alloc(YYTHD, (yyvsp[(3) - (4)].lex_str).str, (yyvsp[(3) - (4)].lex_str).length) :
-              (yyvsp[(3) - (4)].lex_str).str;
-            if ((yyval.simple_string) == NULL)
-              MYSQL_YYABORT;
-            Lex->contains_plaintext_password= true;
-          }
-    break;
-
-  case 2398:
-
-/* Line 1455 of yacc.c  */
-#line 15030 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)=(yyvsp[(1) - (1)].item); }
-    break;
-
-  case 2399:
-
-/* Line 1455 of yacc.c  */
-#line 15031 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.item)=0; }
-    break;
-
-  case 2400:
-
-/* Line 1455 of yacc.c  */
-#line 15033 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)=new (YYTHD->mem_root) Item_string("ON",  2, system_charset_info);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2401:
-
-/* Line 1455 of yacc.c  */
-#line 15039 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)=new (YYTHD->mem_root) Item_string("ALL", 3, system_charset_info);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2402:
-
-/* Line 1455 of yacc.c  */
-#line 15045 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.item)=new (YYTHD->mem_root) Item_string("binary", 6, system_charset_info);
-            if ((yyval.item) == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2403:
-
-/* Line 1455 of yacc.c  */
-#line 15056 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "LOCK");
-              MYSQL_YYABORT;
-            }
-            lex->sql_command= SQLCOM_LOCK_TABLES;
-          }
-    break;
-
-  case 2404:
-
-/* Line 1455 of yacc.c  */
-#line 15067 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2409:
-
-/* Line 1455 of yacc.c  */
-#line 15082 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            thr_lock_type lock_type= (thr_lock_type) (yyvsp[(3) - (3)].num);
-            bool lock_for_write= (lock_type >= TL_WRITE_ALLOW_WRITE);
-            if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (3)].table), (yyvsp[(2) - (3)].lex_str_ptr), 0, lock_type,
-                                           (lock_for_write ?
-                                            MDL_SHARED_NO_READ_WRITE :
-                                            MDL_SHARED_READ)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2410:
-
-/* Line 1455 of yacc.c  */
-#line 15094 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= TL_READ_NO_INSERT; }
-    break;
-
-  case 2411:
-
-/* Line 1455 of yacc.c  */
-#line 15095 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= TL_WRITE_DEFAULT; }
-    break;
-
-  case 2412:
-
-/* Line 1455 of yacc.c  */
-#line 15097 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            (yyval.num)= TL_WRITE_LOW_PRIORITY; 
-            WARN_DEPRECATED(YYTHD, "LOW_PRIORITY WRITE", "WRITE");
-          }
-    break;
-
-  case 2413:
-
-/* Line 1455 of yacc.c  */
-#line 15101 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= TL_READ; }
-    break;
-
-  case 2414:
-
-/* Line 1455 of yacc.c  */
-#line 15106 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "UNLOCK");
-              MYSQL_YYABORT;
-            }
-            lex->sql_command= SQLCOM_UNLOCK_TABLES;
-          }
-    break;
-
-  case 2415:
-
-/* Line 1455 of yacc.c  */
-#line 15117 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2416:
-
-/* Line 1455 of yacc.c  */
-#line 15126 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            if (lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
-              MYSQL_YYABORT;
-            }
-            lex->sql_command = SQLCOM_HA_OPEN;
-            if (!lex->current_select->add_table_to_list(thd, (yyvsp[(2) - (4)].table), (yyvsp[(4) - (4)].lex_str_ptr), 0))
-              MYSQL_YYABORT;
-            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_handler_open();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2417:
-
-/* Line 1455 of yacc.c  */
-#line 15142 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            if (lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
-              MYSQL_YYABORT;
-            }
-            lex->sql_command = SQLCOM_HA_CLOSE;
-            if (!lex->current_select->add_table_to_list(thd, (yyvsp[(2) - (3)].table), 0, 0))
-              MYSQL_YYABORT;
-            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_handler_close();
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2418:
-
-/* Line 1455 of yacc.c  */
-#line 15158 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (lex->sphead)
-            {
-              my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
-              MYSQL_YYABORT;
-            }
-            lex->expr_allows_subselect= FALSE;
-            lex->sql_command = SQLCOM_HA_READ;
-            Item *one= new (YYTHD->mem_root) Item_int((int32) 1);
-            if (one == NULL)
-              MYSQL_YYABORT;
-            lex->current_select->select_limit= one;
-            lex->current_select->offset_limit= 0;
-            if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(2) - (3)].table), 0, 0))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2419:
-
-/* Line 1455 of yacc.c  */
-#line 15176 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            Lex->expr_allows_subselect= TRUE;
-            /* Stored functions are not supported for HANDLER READ. */
-            if (lex->uses_stored_routines())
-            {
-              my_error(ER_NOT_SUPPORTED_YET, MYF(0),
-                       "stored functions in HANDLER ... READ");
-              MYSQL_YYABORT;
-            }
-            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_handler_read((yyvsp[(5) - (7)].ha_read_mode),
-                                  lex->ident.str, lex->insert_list,
-                                  thd->m_parser_state->m_yacc.m_ha_rkey_mode);
-            if (lex->m_sql_cmd == NULL)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2420:
-
-/* Line 1455 of yacc.c  */
-#line 15196 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->ident= null_lex_str; (yyval.ha_read_mode)=(yyvsp[(1) - (1)].ha_read_mode); }
-    break;
-
-  case 2421:
-
-/* Line 1455 of yacc.c  */
-#line 15197 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->ident= (yyvsp[(1) - (2)].lex_str); (yyval.ha_read_mode)=(yyvsp[(2) - (2)].ha_read_mode); }
-    break;
-
-  case 2422:
-
-/* Line 1455 of yacc.c  */
-#line 15201 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_read_mode)= RFIRST; }
-    break;
-
-  case 2423:
-
-/* Line 1455 of yacc.c  */
-#line 15202 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_read_mode)= RNEXT;  }
-    break;
-
-  case 2424:
-
-/* Line 1455 of yacc.c  */
-#line 15206 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_read_mode)= RFIRST; }
-    break;
-
-  case 2425:
-
-/* Line 1455 of yacc.c  */
-#line 15207 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_read_mode)= RNEXT;  }
-    break;
-
-  case 2426:
-
-/* Line 1455 of yacc.c  */
-#line 15208 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_read_mode)= RPREV;  }
-    break;
-
-  case 2427:
-
-/* Line 1455 of yacc.c  */
-#line 15209 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_read_mode)= RLAST;  }
-    break;
-
-  case 2428:
-
-/* Line 1455 of yacc.c  */
-#line 15211 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            YYTHD->m_parser_state->m_yacc.m_ha_rkey_mode= (yyvsp[(1) - (1)].ha_rkey_mode);
-            Lex->insert_list= new List_item;
-            if (! Lex->insert_list)
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2429:
-
-/* Line 1455 of yacc.c  */
-#line 15218 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.ha_read_mode)= RKEY;
-          }
-    break;
-
-  case 2430:
-
-/* Line 1455 of yacc.c  */
-#line 15224 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_rkey_mode)=HA_READ_KEY_EXACT;   }
-    break;
-
-  case 2431:
-
-/* Line 1455 of yacc.c  */
-#line 15225 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_NEXT; }
-    break;
-
-  case 2432:
-
-/* Line 1455 of yacc.c  */
-#line 15226 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_PREV; }
-    break;
-
-  case 2433:
-
-/* Line 1455 of yacc.c  */
-#line 15227 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_rkey_mode)=HA_READ_AFTER_KEY;   }
-    break;
-
-  case 2434:
-
-/* Line 1455 of yacc.c  */
-#line 15228 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.ha_rkey_mode)=HA_READ_BEFORE_KEY;  }
-    break;
-
-  case 2435:
-
-/* Line 1455 of yacc.c  */
-#line 15234 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sql_command= SQLCOM_REVOKE; }
-    break;
-
-  case 2436:
-
-/* Line 1455 of yacc.c  */
-#line 15235 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2437:
-
-/* Line 1455 of yacc.c  */
-#line 15240 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->type= 0;
-          }
-    break;
-
-  case 2438:
-
-/* Line 1455 of yacc.c  */
-#line 15245 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->columns.elements)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            lex->type= TYPE_ENUM_FUNCTION;
-          }
-    break;
-
-  case 2439:
-
-/* Line 1455 of yacc.c  */
-#line 15255 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->columns.elements)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            lex->type= TYPE_ENUM_PROCEDURE;
-          }
-    break;
-
-  case 2440:
-
-/* Line 1455 of yacc.c  */
-#line 15265 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_REVOKE_ALL;
-          }
-    break;
-
-  case 2441:
-
-/* Line 1455 of yacc.c  */
-#line 15269 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->users_list.push_front ((yyvsp[(3) - (5)].lex_user));
-            lex->type= TYPE_ENUM_PROXY;
-          }
-    break;
-
-  case 2442:
-
-/* Line 1455 of yacc.c  */
-#line 15277 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->sql_command= SQLCOM_GRANT; }
-    break;
-
-  case 2443:
-
-/* Line 1455 of yacc.c  */
-#line 15278 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2444:
-
-/* Line 1455 of yacc.c  */
-#line 15284 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->type= 0;
-          }
-    break;
-
-  case 2445:
-
-/* Line 1455 of yacc.c  */
-#line 15290 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->columns.elements)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            lex->type= TYPE_ENUM_FUNCTION;
-          }
-    break;
-
-  case 2446:
-
-/* Line 1455 of yacc.c  */
-#line 15301 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->columns.elements)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            lex->type= TYPE_ENUM_PROCEDURE;
-          }
-    break;
-
-  case 2447:
-
-/* Line 1455 of yacc.c  */
-#line 15311 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->users_list.push_front ((yyvsp[(3) - (6)].lex_user));
-            lex->type= TYPE_ENUM_PROXY;
-          }
-    break;
-
-  case 2450:
-
-/* Line 1455 of yacc.c  */
-#line 15325 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            if (lex->grant == GLOBAL_ACLS &&
-                lex->sql_command == SQLCOM_REVOKE)
-              lex->sql_command= SQLCOM_REVOKE_ALL;
-          }
-    break;
-
-  case 2451:
-
-/* Line 1455 of yacc.c  */
-#line 15332 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            Lex->all_privileges= 1; 
-            Lex->grant= GLOBAL_ACLS;
-          }
-    break;
-
-  case 2456:
-
-/* Line 1455 of yacc.c  */
-#line 15350 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->which_columns = SELECT_ACL;}
-    break;
-
-  case 2457:
-
-/* Line 1455 of yacc.c  */
-#line 15351 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2458:
-
-/* Line 1455 of yacc.c  */
-#line 15353 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->which_columns = INSERT_ACL;}
-    break;
-
-  case 2459:
-
-/* Line 1455 of yacc.c  */
-#line 15354 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2460:
-
-/* Line 1455 of yacc.c  */
-#line 15356 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->which_columns = UPDATE_ACL; }
-    break;
-
-  case 2461:
-
-/* Line 1455 of yacc.c  */
-#line 15357 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2462:
-
-/* Line 1455 of yacc.c  */
-#line 15359 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->which_columns = REFERENCES_ACL;}
-    break;
-
-  case 2463:
-
-/* Line 1455 of yacc.c  */
-#line 15360 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2464:
-
-/* Line 1455 of yacc.c  */
-#line 15361 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= DELETE_ACL;}
-    break;
-
-  case 2465:
-
-/* Line 1455 of yacc.c  */
-#line 15362 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2466:
-
-/* Line 1455 of yacc.c  */
-#line 15363 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= INDEX_ACL;}
-    break;
-
-  case 2467:
-
-/* Line 1455 of yacc.c  */
-#line 15364 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= ALTER_ACL;}
-    break;
-
-  case 2468:
-
-/* Line 1455 of yacc.c  */
-#line 15365 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= CREATE_ACL;}
-    break;
-
-  case 2469:
-
-/* Line 1455 of yacc.c  */
-#line 15366 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= DROP_ACL;}
-    break;
-
-  case 2470:
-
-/* Line 1455 of yacc.c  */
-#line 15367 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= EXECUTE_ACL;}
-    break;
-
-  case 2471:
-
-/* Line 1455 of yacc.c  */
-#line 15368 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= RELOAD_ACL;}
-    break;
-
-  case 2472:
-
-/* Line 1455 of yacc.c  */
-#line 15369 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= SHUTDOWN_ACL;}
-    break;
-
-  case 2473:
-
-/* Line 1455 of yacc.c  */
-#line 15370 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= PROCESS_ACL;}
-    break;
-
-  case 2474:
-
-/* Line 1455 of yacc.c  */
-#line 15371 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= FILE_ACL;}
-    break;
-
-  case 2475:
-
-/* Line 1455 of yacc.c  */
-#line 15372 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= GRANT_ACL;}
-    break;
-
-  case 2476:
-
-/* Line 1455 of yacc.c  */
-#line 15373 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= SHOW_DB_ACL;}
-    break;
-
-  case 2477:
-
-/* Line 1455 of yacc.c  */
-#line 15374 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= SUPER_ACL;}
-    break;
-
-  case 2478:
-
-/* Line 1455 of yacc.c  */
-#line 15375 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= CREATE_TMP_ACL;}
-    break;
-
-  case 2479:
-
-/* Line 1455 of yacc.c  */
-#line 15376 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= LOCK_TABLES_ACL; }
-    break;
-
-  case 2480:
-
-/* Line 1455 of yacc.c  */
-#line 15377 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= REPL_SLAVE_ACL; }
-    break;
-
-  case 2481:
-
-/* Line 1455 of yacc.c  */
-#line 15378 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= REPL_CLIENT_ACL; }
-    break;
-
-  case 2482:
-
-/* Line 1455 of yacc.c  */
-#line 15379 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= CREATE_VIEW_ACL; }
-    break;
-
-  case 2483:
-
-/* Line 1455 of yacc.c  */
-#line 15380 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= SHOW_VIEW_ACL; }
-    break;
-
-  case 2484:
-
-/* Line 1455 of yacc.c  */
-#line 15381 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= CREATE_PROC_ACL; }
-    break;
-
-  case 2485:
-
-/* Line 1455 of yacc.c  */
-#line 15382 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= ALTER_PROC_ACL; }
-    break;
-
-  case 2486:
-
-/* Line 1455 of yacc.c  */
-#line 15383 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= CREATE_USER_ACL; }
-    break;
-
-  case 2487:
-
-/* Line 1455 of yacc.c  */
-#line 15384 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= EVENT_ACL;}
-    break;
-
-  case 2488:
-
-/* Line 1455 of yacc.c  */
-#line 15385 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= TRIGGER_ACL; }
-    break;
-
-  case 2489:
-
-/* Line 1455 of yacc.c  */
-#line 15386 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= CREATE_TABLESPACE_ACL; }
-    break;
-
-  case 2490:
-
-/* Line 1455 of yacc.c  */
-#line 15390 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2491:
-
-/* Line 1455 of yacc.c  */
-#line 15391 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2494:
-
-/* Line 1455 of yacc.c  */
-#line 15401 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (lex->x509_subject)
-            {
-              my_error(ER_DUP_ARGUMENT, MYF(0), "SUBJECT");
-              MYSQL_YYABORT;
-            }
-            lex->x509_subject=(yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 2495:
-
-/* Line 1455 of yacc.c  */
-#line 15411 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (lex->x509_issuer)
-            {
-              my_error(ER_DUP_ARGUMENT, MYF(0), "ISSUER");
-              MYSQL_YYABORT;
-            }
-            lex->x509_issuer=(yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 2496:
-
-/* Line 1455 of yacc.c  */
-#line 15421 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (lex->ssl_cipher)
-            {
-              my_error(ER_DUP_ARGUMENT, MYF(0), "CIPHER");
-              MYSQL_YYABORT;
-            }
-            lex->ssl_cipher=(yyvsp[(2) - (2)].lex_str).str;
-          }
-    break;
-
-  case 2497:
-
-/* Line 1455 of yacc.c  */
-#line 15434 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            size_t dummy;
-            if (lex->copy_db_to(&lex->current_select->db, &dummy))
-              MYSQL_YYABORT;
-            if (lex->grant == GLOBAL_ACLS)
-              lex->grant = DB_ACLS & ~GRANT_ACL;
-            else if (lex->columns.elements)
-            {
-              my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
-                         ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 2498:
-
-/* Line 1455 of yacc.c  */
-#line 15449 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->current_select->db = (yyvsp[(1) - (3)].lex_str).str;
-            if (lex->grant == GLOBAL_ACLS)
-              lex->grant = DB_ACLS & ~GRANT_ACL;
-            else if (lex->columns.elements)
-            {
-              my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
-                         ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 2499:
-
-/* Line 1455 of yacc.c  */
-#line 15462 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->current_select->db = NULL;
-            if (lex->grant == GLOBAL_ACLS)
-              lex->grant= GLOBAL_ACLS & ~GRANT_ACL;
-            else if (lex->columns.elements)
-            {
-              my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
-                         ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
-              MYSQL_YYABORT;
-            }
-          }
-    break;
-
-  case 2500:
-
-/* Line 1455 of yacc.c  */
-#line 15475 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(1) - (1)].table),NULL,
-                                                        TL_OPTION_UPDATING))
-              MYSQL_YYABORT;
-            if (lex->grant == GLOBAL_ACLS)
-              lex->grant =  TABLE_ACLS & ~GRANT_ACL;
-          }
-    break;
-
-  case 2501:
-
-/* Line 1455 of yacc.c  */
-#line 15487 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2502:
-
-/* Line 1455 of yacc.c  */
-#line 15492 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2503:
-
-/* Line 1455 of yacc.c  */
-#line 15500 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2504:
-
-/* Line 1455 of yacc.c  */
-#line 15505 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user)))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2505:
-
-/* Line 1455 of yacc.c  */
-#line 15513 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.lex_user)=(yyvsp[(1) - (4)].lex_user); (yyvsp[(1) - (4)].lex_user)->password=(yyvsp[(4) - (4)].lex_str);
-            if (Lex->sql_command == SQLCOM_REVOKE)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            String *password = new (YYTHD->mem_root) String((const char*)(yyvsp[(4) - (4)].lex_str).str,
-                                    YYTHD->variables.character_set_client);
-            check_password_policy(password);
-            /*
-              1. Plugin must be resolved
-              2. Password must be digested
-            */
-            (yyvsp[(1) - (4)].lex_user)->uses_identified_by_clause= true;
-            Lex->contains_plaintext_password= true;
-          }
-    break;
-
-  case 2506:
-
-/* Line 1455 of yacc.c  */
-#line 15531 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            if (Lex->sql_command == SQLCOM_REVOKE)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            (yyval.lex_user)= (yyvsp[(1) - (5)].lex_user); 
-            (yyvsp[(1) - (5)].lex_user)->password= (yyvsp[(5) - (5)].lex_str); 
-            if (!strcmp((yyvsp[(5) - (5)].lex_str).str, ""))
-            {
-              String *password= new (YYTHD->mem_root) String ((const char *)"",
-                                     YYTHD->variables.character_set_client);
-              check_password_policy(password);
-            }
-            /*
-              1. Plugin must be resolved
-            */
-            (yyvsp[(1) - (5)].lex_user)->uses_identified_by_password_clause= true;
-          }
-    break;
-
-  case 2507:
-
-/* Line 1455 of yacc.c  */
-#line 15551 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->sql_command == SQLCOM_REVOKE)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            (yyval.lex_user)= (yyvsp[(1) - (4)].lex_user);
-            (yyvsp[(1) - (4)].lex_user)->plugin= (yyvsp[(4) - (4)].lex_str);
-            (yyvsp[(1) - (4)].lex_user)->auth= empty_lex_str;
-            (yyvsp[(1) - (4)].lex_user)->uses_identified_with_clause= true;
-          }
-    break;
-
-  case 2508:
-
-/* Line 1455 of yacc.c  */
-#line 15563 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->sql_command == SQLCOM_REVOKE)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            (yyval.lex_user)= (yyvsp[(1) - (6)].lex_user);
-            (yyvsp[(1) - (6)].lex_user)->plugin= (yyvsp[(4) - (6)].lex_str);
-            (yyvsp[(1) - (6)].lex_user)->auth= (yyvsp[(6) - (6)].lex_str);
-            (yyvsp[(1) - (6)].lex_user)->uses_identified_with_clause= true;
-            (yyvsp[(1) - (6)].lex_user)->uses_authentication_string_clause= true;
-          }
-    break;
-
-  case 2509:
-
-/* Line 1455 of yacc.c  */
-#line 15576 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.lex_user)= (yyvsp[(1) - (1)].lex_user);
-            (yyvsp[(1) - (1)].lex_user)->password= null_lex_str;
-          }
-    break;
-
-  case 2510:
-
-/* Line 1455 of yacc.c  */
-#line 15584 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->grant |= lex->which_columns;
-          }
-    break;
-
-  case 2514:
-
-/* Line 1455 of yacc.c  */
-#line 15598 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            String *new_str = new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info);
-            if (new_str == NULL)
-              MYSQL_YYABORT;
-            List_iterator <LEX_COLUMN> iter(Lex->columns);
-            class LEX_COLUMN *point;
-            LEX *lex=Lex;
-            while ((point=iter++))
-            {
-              if (!my_strcasecmp(system_charset_info,
-                                 point->column.ptr(), new_str->ptr()))
-                break;
-            }
-            lex->grant_tot_col|= lex->which_columns;
-            if (point)
-              point->rights |= lex->which_columns;
-            else
-            {
-              LEX_COLUMN *col= new LEX_COLUMN (*new_str,lex->which_columns);
-              if (col == NULL)
-                MYSQL_YYABORT;
-              lex->columns.push_back(col);
-            }
-          }
-    break;
-
-  case 2516:
-
-/* Line 1455 of yacc.c  */
-#line 15627 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->ssl_type=SSL_TYPE_SPECIFIED;
-          }
-    break;
-
-  case 2517:
-
-/* Line 1455 of yacc.c  */
-#line 15631 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->ssl_type=SSL_TYPE_ANY;
-          }
-    break;
-
-  case 2518:
-
-/* Line 1455 of yacc.c  */
-#line 15635 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->ssl_type=SSL_TYPE_X509;
-          }
-    break;
-
-  case 2519:
-
-/* Line 1455 of yacc.c  */
-#line 15639 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->ssl_type=SSL_TYPE_NONE;
-          }
-    break;
-
-  case 2520:
-
-/* Line 1455 of yacc.c  */
-#line 15645 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2522:
-
-/* Line 1455 of yacc.c  */
-#line 15650 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2523:
-
-/* Line 1455 of yacc.c  */
-#line 15651 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= GRANT_ACL;}
-    break;
-
-  case 2524:
-
-/* Line 1455 of yacc.c  */
-#line 15655 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2525:
-
-/* Line 1455 of yacc.c  */
-#line 15656 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2526:
-
-/* Line 1455 of yacc.c  */
-#line 15660 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->grant |= GRANT_ACL;}
-    break;
-
-  case 2527:
-
-/* Line 1455 of yacc.c  */
-#line 15662 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->mqh.questions=(yyvsp[(2) - (2)].ulong_num);
-            lex->mqh.specified_limits|= USER_RESOURCES::QUERIES_PER_HOUR;
-          }
-    break;
-
-  case 2528:
-
-/* Line 1455 of yacc.c  */
-#line 15668 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->mqh.updates=(yyvsp[(2) - (2)].ulong_num);
-            lex->mqh.specified_limits|= USER_RESOURCES::UPDATES_PER_HOUR;
-          }
-    break;
-
-  case 2529:
-
-/* Line 1455 of yacc.c  */
-#line 15674 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->mqh.conn_per_hour= (yyvsp[(2) - (2)].ulong_num);
-            lex->mqh.specified_limits|= USER_RESOURCES::CONNECTIONS_PER_HOUR;
-          }
-    break;
-
-  case 2530:
-
-/* Line 1455 of yacc.c  */
-#line 15680 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->mqh.user_conn= (yyvsp[(2) - (2)].ulong_num);
-            lex->mqh.specified_limits|= USER_RESOURCES::USER_CONNECTIONS;
-          }
-    break;
-
-  case 2531:
-
-/* Line 1455 of yacc.c  */
-#line 15689 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command = SQLCOM_BEGIN;
-            lex->start_transaction_opt= 0;
-          }
-    break;
-
-  case 2532:
-
-/* Line 1455 of yacc.c  */
-#line 15694 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2533:
-
-/* Line 1455 of yacc.c  */
-#line 15698 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2534:
-
-/* Line 1455 of yacc.c  */
-#line 15699 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2535:
-
-/* Line 1455 of yacc.c  */
-#line 15704 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_yes_no_unk)= TVL_UNKNOWN; }
-    break;
-
-  case 2536:
-
-/* Line 1455 of yacc.c  */
-#line 15705 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_yes_no_unk)= TVL_NO; }
-    break;
-
-  case 2537:
-
-/* Line 1455 of yacc.c  */
-#line 15706 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_yes_no_unk)= TVL_YES; }
-    break;
-
-  case 2538:
-
-/* Line 1455 of yacc.c  */
-#line 15711 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_yes_no_unk)= TVL_UNKNOWN; }
-    break;
-
-  case 2539:
-
-/* Line 1455 of yacc.c  */
-#line 15712 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_yes_no_unk)= TVL_YES; }
-    break;
-
-  case 2540:
-
-/* Line 1455 of yacc.c  */
-#line 15713 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.m_yes_no_unk)= TVL_NO; }
-    break;
-
-  case 2541:
-
-/* Line 1455 of yacc.c  */
-#line 15717 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2542:
-
-/* Line 1455 of yacc.c  */
-#line 15718 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2543:
-
-/* Line 1455 of yacc.c  */
-#line 15723 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_COMMIT;
-            /* Don't allow AND CHAIN RELEASE. */
-            MYSQL_YYABORT_UNLESS((yyvsp[(3) - (4)].m_yes_no_unk) != TVL_YES || (yyvsp[(4) - (4)].m_yes_no_unk) != TVL_YES);
-            lex->tx_chain= (yyvsp[(3) - (4)].m_yes_no_unk);
-            lex->tx_release= (yyvsp[(4) - (4)].m_yes_no_unk);
-          }
-    break;
-
-  case 2544:
-
-/* Line 1455 of yacc.c  */
-#line 15735 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_ROLLBACK;
-            /* Don't allow AND CHAIN RELEASE. */
-            MYSQL_YYABORT_UNLESS((yyvsp[(3) - (4)].m_yes_no_unk) != TVL_YES || (yyvsp[(4) - (4)].m_yes_no_unk) != TVL_YES);
-            lex->tx_chain= (yyvsp[(3) - (4)].m_yes_no_unk);
-            lex->tx_release= (yyvsp[(4) - (4)].m_yes_no_unk);
-          }
-    break;
-
-  case 2545:
-
-/* Line 1455 of yacc.c  */
-#line 15745 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_ROLLBACK_TO_SAVEPOINT;
-            lex->ident= (yyvsp[(5) - (5)].lex_str);
-          }
-    break;
-
-  case 2546:
-
-/* Line 1455 of yacc.c  */
-#line 15754 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_SAVEPOINT;
-            lex->ident= (yyvsp[(2) - (2)].lex_str);
-          }
-    break;
-
-  case 2547:
-
-/* Line 1455 of yacc.c  */
-#line 15763 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            lex->sql_command= SQLCOM_RELEASE_SAVEPOINT;
-            lex->ident= (yyvsp[(3) - (3)].lex_str);
-          }
-    break;
-
-  case 2548:
-
-/* Line 1455 of yacc.c  */
-#line 15776 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2550:
-
-/* Line 1455 of yacc.c  */
-#line 15782 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_select_to_union_list(Lex, (bool)(yyvsp[(2) - (2)].num), TRUE))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2551:
-
-/* Line 1455 of yacc.c  */
-#line 15787 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              Remove from the name resolution context stack the context of the
-              last select in the union.
-            */
-            Lex->pop_context();
-          }
-    break;
-
-  case 2552:
-
-/* Line 1455 of yacc.c  */
-#line 15797 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 0; }
-    break;
-
-  case 2553:
-
-/* Line 1455 of yacc.c  */
-#line 15798 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 2554:
-
-/* Line 1455 of yacc.c  */
-#line 15799 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)= 1; }
-    break;
-
-  case 2555:
-
-/* Line 1455 of yacc.c  */
-#line 15803 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.is_not_empty)= false; }
-    break;
-
-  case 2556:
-
-/* Line 1455 of yacc.c  */
-#line 15804 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.is_not_empty)= true; }
-    break;
-
-  case 2557:
-
-/* Line 1455 of yacc.c  */
-#line 15808 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            DBUG_ASSERT(lex->current_select->linkage != GLOBAL_OPTIONS_TYPE);
-            SELECT_LEX *sel= lex->current_select;
-            SELECT_LEX_UNIT *unit= sel->master_unit();
-            SELECT_LEX *fake= unit->fake_select_lex;
-            if (fake)
-            {
-              unit->global_parameters= fake;
-              fake->no_table_names_allowed= 1;
-              lex->current_select= fake;
-            }
-            thd->where= "global ORDER clause";
-          }
-    break;
-
-  case 2558:
-
-/* Line 1455 of yacc.c  */
-#line 15824 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            thd->lex->current_select->no_table_names_allowed= 0;
-            thd->where= "";
-          }
-    break;
-
-  case 2561:
-
-/* Line 1455 of yacc.c  */
-#line 15837 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=1; }
-    break;
-
-  case 2562:
-
-/* Line 1455 of yacc.c  */
-#line 15838 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=1; }
-    break;
-
-  case 2563:
-
-/* Line 1455 of yacc.c  */
-#line 15839 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { (yyval.num)=0; }
-    break;
-
-  case 2564:
-
-/* Line 1455 of yacc.c  */
-#line 15844 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            (yyval.select_lex)= Lex->current_select->master_unit()->first_select();
-          }
-    break;
-
-  case 2565:
-
-/* Line 1455 of yacc.c  */
-#line 15848 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            (yyval.select_lex)= Lex->current_select->master_unit()->first_select();
-          }
-    break;
-
-  case 2567:
-
-/* Line 1455 of yacc.c  */
-#line 15857 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (add_select_to_union_list(Lex, (bool)(yyvsp[(3) - (3)].num), FALSE))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2568:
-
-/* Line 1455 of yacc.c  */
-#line 15863 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->pop_context();
-            (yyval.select_lex)= (yyvsp[(1) - (6)].select_lex);
-          }
-    break;
-
-  case 2569:
-
-/* Line 1455 of yacc.c  */
-#line 15872 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { 
-            (yyval.select_lex)= (yyvsp[(2) - (3)].select_lex);
-          }
-    break;
-
-  case 2570:
-
-/* Line 1455 of yacc.c  */
-#line 15878 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-            if (!lex->expr_allows_subselect ||
-               lex->sql_command == (int)SQLCOM_PURGE)
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            /* 
-              we are making a "derived table" for the parenthesis
-              as we need to have a lex level to fit the union 
-              after the parenthesis, e.g. 
-              (SELECT .. ) UNION ...  becomes 
-              SELECT * FROM ((SELECT ...) UNION ...)
-            */
-            if (mysql_new_select(Lex, 1))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2571:
-
-/* Line 1455 of yacc.c  */
-#line 15899 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex=Lex;
-
-            lex->pop_context();
-            SELECT_LEX *child= lex->current_select;
-            lex->current_select = lex->current_select->outer_select();
-            lex->nest_level--;
-            lex->current_select->n_child_sum_items += child->n_sum_items;
-            /*
-              A subselect can add fields to an outer select. Reserve space for
-              them.
-            */
-            lex->current_select->select_n_where_fields+=
-            child->select_n_where_fields;
-          }
-    break;
-
-  case 2576:
-
-/* Line 1455 of yacc.c  */
-#line 15927 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->options|= SELECT_STRAIGHT_JOIN; }
-    break;
-
-  case 2577:
-
-/* Line 1455 of yacc.c  */
-#line 15929 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (check_simple_select())
-              MYSQL_YYABORT;
-            YYPS->m_lock_type= TL_READ_HIGH_PRIORITY;
-            YYPS->m_mdl_type= MDL_SHARED_READ;
-            Select->options|= SELECT_HIGH_PRIORITY;
-          }
-    break;
-
-  case 2578:
-
-/* Line 1455 of yacc.c  */
-#line 15936 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->options|= SELECT_DISTINCT; }
-    break;
-
-  case 2579:
-
-/* Line 1455 of yacc.c  */
-#line 15937 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->options|= SELECT_SMALL_RESULT; }
-    break;
-
-  case 2580:
-
-/* Line 1455 of yacc.c  */
-#line 15938 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->options|= SELECT_BIG_RESULT; }
-    break;
-
-  case 2581:
-
-/* Line 1455 of yacc.c  */
-#line 15940 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (check_simple_select())
-              MYSQL_YYABORT;
-            Select->options|= OPTION_BUFFER_RESULT;
-          }
-    break;
-
-  case 2582:
-
-/* Line 1455 of yacc.c  */
-#line 15946 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (check_simple_select())
-              MYSQL_YYABORT;
-            Select->options|= OPTION_FOUND_ROWS;
-          }
-    break;
-
-  case 2583:
-
-/* Line 1455 of yacc.c  */
-#line 15951 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Select->options|= SELECT_ALL; }
-    break;
-
-  case 2584:
-
-/* Line 1455 of yacc.c  */
-#line 15962 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2585:
-
-/* Line 1455 of yacc.c  */
-#line 15964 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2586:
-
-/* Line 1455 of yacc.c  */
-#line 15966 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2600:
-
-/* Line 1455 of yacc.c  */
-#line 15999 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              We have to distinguish missing DEFINER-clause from case when
-              CURRENT_USER specified as definer explicitly in order to properly
-              handle CREATE TRIGGER statements which come to replication thread
-              from older master servers (i.e. to create non-suid trigger in this
-              case).
-            */
-            YYTHD->lex->definer= 0;
-          }
-    break;
-
-  case 2601:
-
-/* Line 1455 of yacc.c  */
-#line 16013 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            YYTHD->lex->definer= get_current_user(YYTHD, (yyvsp[(3) - (3)].lex_user));
-          }
-    break;
-
-  case 2602:
-
-/* Line 1455 of yacc.c  */
-#line 16026 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2603:
-
-/* Line 1455 of yacc.c  */
-#line 16028 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2604:
-
-/* Line 1455 of yacc.c  */
-#line 16030 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2605:
-
-/* Line 1455 of yacc.c  */
-#line 16035 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_mode= VIEW_CREATE_OR_REPLACE; }
-    break;
-
-  case 2606:
-
-/* Line 1455 of yacc.c  */
-#line 16040 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; }
-    break;
-
-  case 2607:
-
-/* Line 1455 of yacc.c  */
-#line 16042 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; }
-    break;
-
-  case 2608:
-
-/* Line 1455 of yacc.c  */
-#line 16044 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; }
-    break;
-
-  case 2609:
-
-/* Line 1455 of yacc.c  */
-#line 16049 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_suid= VIEW_SUID_DEFAULT; }
-    break;
-
-  case 2610:
-
-/* Line 1455 of yacc.c  */
-#line 16051 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_suid= VIEW_SUID_DEFINER; }
-    break;
-
-  case 2611:
-
-/* Line 1455 of yacc.c  */
-#line 16053 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_suid= VIEW_SUID_INVOKER; }
-    break;
-
-  case 2612:
-
-/* Line 1455 of yacc.c  */
-#line 16058 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            lex->sql_command= SQLCOM_CREATE_VIEW;
-            /* first table in list is target VIEW name */
-            if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(3) - (3)].table), NULL,
-                                                   TL_OPTION_UPDATING,
-                                                   TL_IGNORE,
-                                                   MDL_EXCLUSIVE))
-              MYSQL_YYABORT;
-            lex->query_tables->open_strategy= TABLE_LIST::OPEN_STUB;
-          }
-    break;
-
-  case 2614:
-
-/* Line 1455 of yacc.c  */
-#line 16075 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2616:
-
-/* Line 1455 of yacc.c  */
-#line 16081 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-              Lex->view_list.push_back((LEX_STRING*)
-              sql_memdup(&(yyvsp[(1) - (1)].lex_str), sizeof(LEX_STRING)));
-            }
-    break;
-
-  case 2617:
-
-/* Line 1455 of yacc.c  */
-#line 16086 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-              Lex->view_list.push_back((LEX_STRING*)
-              sql_memdup(&(yyvsp[(3) - (3)].lex_str), sizeof(LEX_STRING)));
-            }
-    break;
-
-  case 2618:
-
-/* Line 1455 of yacc.c  */
-#line 16093 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->parsing_options.allows_variable= FALSE;
-            lex->parsing_options.allows_select_into= FALSE;
-            lex->parsing_options.allows_select_procedure= FALSE;
-            lex->parsing_options.allows_derived= FALSE;
-            lex->create_view_select.str= (char *) YYLIP->get_cpp_ptr();
-          }
-    break;
-
-  case 2619:
-
-/* Line 1455 of yacc.c  */
-#line 16102 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            uint len= YYLIP->get_cpp_ptr() - lex->create_view_select.str;
-            void *create_view_select= thd->memdup(lex->create_view_select.str, len);
-            lex->create_view_select.length= len;
-            lex->create_view_select.str= (char *) create_view_select;
-            trim_whitespace(thd->charset(), &lex->create_view_select);
-            lex->parsing_options.allows_variable= TRUE;
-            lex->parsing_options.allows_select_into= TRUE;
-            lex->parsing_options.allows_select_procedure= TRUE;
-            lex->parsing_options.allows_derived= TRUE;
-          }
-    break;
-
-  case 2620:
-
-/* Line 1455 of yacc.c  */
-#line 16119 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (Lex->current_select->set_braces(0))
-            {
-              my_parse_error(ER(ER_SYNTAX_ERROR));
-              MYSQL_YYABORT;
-            }
-            /*
-              For statment as "CREATE VIEW v1 AS SELECT1 UNION SELECT2",
-              parsing of Select query (SELECT1) is completed and UNION_CLAUSE
-              is not yet parsed. So check for
-              Lex->current_select->master_unit()->first_select()->braces
-              (as its done in "select_init2" for "select_part2" rule) is not
-              done here.
-            */
-          }
-    break;
-
-  case 2623:
-
-/* Line 1455 of yacc.c  */
-#line 16140 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            if (setup_select_in_parentheses(Lex))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2625:
-
-/* Line 1455 of yacc.c  */
-#line 16149 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->current_select->table_list.save_and_clear(&Lex->save_list);
-          }
-    break;
-
-  case 2626:
-
-/* Line 1455 of yacc.c  */
-#line 16153 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->current_select->table_list.push_front(&Lex->save_list);
-          }
-    break;
-
-  case 2627:
-
-/* Line 1455 of yacc.c  */
-#line 16160 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_check= VIEW_CHECK_NONE; }
-    break;
-
-  case 2628:
-
-/* Line 1455 of yacc.c  */
-#line 16162 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_check= VIEW_CHECK_CASCADED; }
-    break;
-
-  case 2629:
-
-/* Line 1455 of yacc.c  */
-#line 16164 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_check= VIEW_CHECK_CASCADED; }
-    break;
-
-  case 2630:
-
-/* Line 1455 of yacc.c  */
-#line 16166 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->create_view_check= VIEW_CHECK_LOCAL; }
-    break;
-
-  case 2631:
-
-/* Line 1455 of yacc.c  */
-#line 16183 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {                 /* $8 */
-            Lex->raw_trg_on_table_name_begin= YYLIP->get_tok_start();
-          }
-    break;
-
-  case 2632:
-
-/* Line 1455 of yacc.c  */
-#line 16189 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {                 /* $12 */
-            Lex->raw_trg_on_table_name_end= YYLIP->get_tok_start();
-          }
-    break;
-
-  case 2633:
-
-/* Line 1455 of yacc.c  */
-#line 16194 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {                 /* $15 */
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            Lex_input_stream *lip= YYLIP;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "TRIGGER");
-              MYSQL_YYABORT;
-            }
-
-            sp_head *sp= sp_start_parsing(thd, SP_TYPE_TRIGGER, (yyvsp[(3) - (14)].spname));
-
-            if (!sp)
-              MYSQL_YYABORT;
-
-            sp->m_trg_chistics.action_time= (enum trg_action_time_type) (yyvsp[(4) - (14)].num);
-            sp->m_trg_chistics.event= (enum trg_event_type) (yyvsp[(5) - (14)].num);
-            lex->stmt_definition_begin= (yyvsp[(2) - (14)].simple_string);
-            lex->ident.str= (yyvsp[(7) - (14)].simple_string);
-            lex->ident.length= (yyvsp[(11) - (14)].simple_string) - (yyvsp[(7) - (14)].simple_string);
-
-            lex->sphead= sp;
-            lex->spname= (yyvsp[(3) - (14)].spname);
-
-            memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
-            sp->m_chistics= &lex->sp_chistics;
-            sp->set_body_start(thd, lip->get_cpp_ptr());
-          }
-    break;
-
-  case 2634:
-
-/* Line 1455 of yacc.c  */
-#line 16224 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* $17 */
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-
-            sp_finish_parsing(thd);
-
-            lex->sql_command= SQLCOM_CREATE_TRIGGER;
-
-            if (sp->is_not_allowed_in_function("trigger"))
-              MYSQL_YYABORT;
-
-            /*
-              We have to do it after parsing trigger body, because some of
-              sp_proc_stmt alternatives are not saving/restoring LEX, so
-              lex->query_tables can be wiped out.
-            */
-            if (!lex->select_lex.add_table_to_list(thd, (yyvsp[(9) - (16)].table),
-                                                   (LEX_STRING*) 0,
-                                                   TL_OPTION_UPDATING,
-                                                   TL_READ_NO_INSERT,
-                                                   MDL_SHARED_NO_WRITE))
-              MYSQL_YYABORT;
-          }
-    break;
-
-  case 2635:
-
-/* Line 1455 of yacc.c  */
-#line 16259 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            if (is_native_function(thd, & (yyvsp[(4) - (8)].lex_str)))
-            {
-              my_error(ER_NATIVE_FCT_NAME_COLLISION, MYF(0),
-                       (yyvsp[(4) - (8)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            lex->sql_command = SQLCOM_CREATE_FUNCTION;
-            lex->udf.type= UDFTYPE_AGGREGATE;
-            lex->stmt_definition_begin= (yyvsp[(2) - (8)].simple_string);
-            lex->udf.name = (yyvsp[(4) - (8)].lex_str);
-            lex->udf.returns=(Item_result) (yyvsp[(6) - (8)].num);
-            lex->udf.dl=(yyvsp[(8) - (8)].lex_str).str;
-          }
-    break;
-
-  case 2636:
-
-/* Line 1455 of yacc.c  */
-#line 16277 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            if (is_native_function(thd, & (yyvsp[(3) - (7)].lex_str)))
-            {
-              my_error(ER_NATIVE_FCT_NAME_COLLISION, MYF(0),
-                       (yyvsp[(3) - (7)].lex_str).str);
-              MYSQL_YYABORT;
-            }
-            lex->sql_command = SQLCOM_CREATE_FUNCTION;
-            lex->udf.type= UDFTYPE_FUNCTION;
-            lex->stmt_definition_begin= (yyvsp[(1) - (7)].simple_string);
-            lex->udf.name = (yyvsp[(3) - (7)].lex_str);
-            lex->udf.returns=(Item_result) (yyvsp[(5) - (7)].num);
-            lex->udf.dl=(yyvsp[(7) - (7)].lex_str).str;
-          }
-    break;
-
-  case 2637:
-
-/* Line 1455 of yacc.c  */
-#line 16300 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* $5 */
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-
-            lex->stmt_definition_begin= (yyvsp[(1) - (4)].simple_string);
-            lex->spname= (yyvsp[(3) - (4)].spname);
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION");
-              MYSQL_YYABORT;
-            }
-
-            sp_head *sp= sp_start_parsing(thd, SP_TYPE_FUNCTION, lex->spname);
-
-            if (!sp)
-              MYSQL_YYABORT;
-
-            lex->sphead= sp;
-
-            /*
-              NOTE: the start of the parameters in the query string is
-              YYLIP->get_cpp_tok_start() + 1. 1 is the length of '(', which the
-              tokenizer has just passed (just YYLIP->get_cpp_tok_start() points
-              to the '(').
-            */
-
-            sp->m_parser_data.set_parameter_start_ptr(
-              YYLIP->get_cpp_tok_start() + 1);
-          }
-    break;
-
-  case 2638:
-
-/* Line 1455 of yacc.c  */
-#line 16332 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* $8 */
-            Lex->sphead->m_parser_data.set_parameter_end_ptr(
-              YYLIP->get_cpp_tok_start());
-          }
-    break;
-
-  case 2639:
-
-/* Line 1455 of yacc.c  */
-#line 16337 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* $10 */
-            LEX *lex= Lex;
-            lex->charset= NULL;
-            lex->length= lex->dec= NULL;
-            lex->interval_list.empty();
-            lex->type= 0;
-          }
-    break;
-
-  case 2640:
-
-/* Line 1455 of yacc.c  */
-#line 16345 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* $12 */
-            LEX *lex= Lex;
-            sp_head *sp= lex->sphead;
-            /*
-              This was disabled in 5.1.12. See bug #20701
-              When collation support in SP is implemented, then this test
-              should be removed.
-            */
-            if (((yyvsp[(11) - (11)].num) == MYSQL_TYPE_STRING || (yyvsp[(11) - (11)].num) == MYSQL_TYPE_VARCHAR)
-                && (lex->type & BINCMP_FLAG))
-            {
-              my_error(ER_NOT_SUPPORTED_YET, MYF(0), "return value collation");
-              MYSQL_YYABORT;
-            }
-
-            if (fill_field_definition(YYTHD, sp,
-                                      (enum enum_field_types) (yyvsp[(11) - (11)].num),
-                                      &sp->m_return_field_def))
-              MYSQL_YYABORT;
-
-            memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
-          }
-    break;
-
-  case 2641:
-
-/* Line 1455 of yacc.c  */
-#line 16368 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { /* $14 */
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-
-            lex->sphead->m_chistics= &lex->sp_chistics;
-            lex->sphead->set_body_start(thd, YYLIP->get_cpp_tok_start());
-          }
-    break;
-
-  case 2642:
-
-/* Line 1455 of yacc.c  */
-#line 16376 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-            sp_head *sp= lex->sphead;
-
-            if (sp->is_not_allowed_in_function("function"))
-              MYSQL_YYABORT;
-
-            sp_finish_parsing(thd);
-
-            lex->sql_command= SQLCOM_CREATE_SPFUNCTION;
-
-            if (!(sp->m_flags & sp_head::HAS_RETURN))
-            {
-              my_error(ER_SP_NORETURN, MYF(0), sp->m_qname.str);
-              MYSQL_YYABORT;
-            }
-
-            if (is_native_function(thd, & sp->m_name))
-            {
-              /*
-                This warning will be printed when
-                [1] A client query is parsed,
-                [2] A stored function is loaded by db_load_routine.
-                Printing the warning for [2] is intentional, to cover the
-                following scenario:
-                - A user define a SF 'foo' using MySQL 5.N
-                - An application uses select foo(), and works.
-                - MySQL 5.{N+1} defines a new native function 'foo', as
-                part of a new feature.
-                - MySQL 5.{N+1} documentation is updated, and should mention
-                that there is a potential incompatible change in case of
-                existing stored function named 'foo'.
-                - The user deploys 5.{N+1}. At this point, 'select foo()'
-                means something different, and the user code is most likely
-                broken (it's only safe if the code is 'select db.foo()').
-                With a warning printed when the SF is loaded (which has to occur
-                before the call), the warning will provide a hint explaining
-                the root cause of a later failure of 'select foo()'.
-                With no warning printed, the user code will fail with no
-                apparent reason.
-                Printing a warning each time db_load_routine is executed for
-                an ambiguous function is annoying, since that can happen a lot,
-                but in practice should not happen unless there *are* name
-                collisions.
-                If a collision exists, it should not be silenced but fixed.
-              */
-              push_warning_printf(thd,
-                                  Sql_condition::WARN_LEVEL_NOTE,
-                                  ER_NATIVE_FCT_NAME_COLLISION,
-                                  ER(ER_NATIVE_FCT_NAME_COLLISION),
-                                  sp->m_name.str);
-            }
-          }
-    break;
-
-  case 2643:
-
-/* Line 1455 of yacc.c  */
-#line 16434 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-
-            if (lex->sphead)
-            {
-              my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "PROCEDURE");
-              MYSQL_YYABORT;
-            }
-
-            lex->stmt_definition_begin= (yyvsp[(2) - (3)].simple_string);
-
-            sp_head *sp= sp_start_parsing(thd, SP_TYPE_PROCEDURE, (yyvsp[(3) - (3)].spname));
-
-            if (!sp)
-              MYSQL_YYABORT;
-
-            lex->sphead= sp;
-          }
-    break;
-
-  case 2644:
-
-/* Line 1455 of yacc.c  */
-#line 16454 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            /*
-              NOTE: the start of the parameters in the query string is
-              YYLIP->get_cpp_tok_start() + 1. 1 is the length of '(', which the
-              tokenizer has just passed (just YYLIP->get_cpp_tok_start() points
-              to the '(').
-            */
-
-            Lex->sphead->m_parser_data.set_parameter_start_ptr(
-              YYLIP->get_cpp_tok_start() + 1);
-          }
-    break;
-
-  case 2645:
-
-/* Line 1455 of yacc.c  */
-#line 16467 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-
-            Lex->sphead->m_parser_data.set_parameter_end_ptr(
-              YYLIP->get_cpp_tok_start());
-
-            memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
-          }
-    break;
-
-  case 2646:
-
-/* Line 1455 of yacc.c  */
-#line 16477 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= thd->lex;
-
-            lex->sphead->m_chistics= &lex->sp_chistics;
-            lex->sphead->set_body_start(thd, YYLIP->get_cpp_tok_start());
-          }
-    break;
-
-  case 2647:
-
-/* Line 1455 of yacc.c  */
-#line 16485 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            THD *thd= YYTHD;
-            LEX *lex= Lex;
-
-            sp_finish_parsing(thd);
-
-            lex->sql_command= SQLCOM_CREATE_PROCEDURE;
-          }
-    break;
-
-  case 2648:
-
-/* Line 1455 of yacc.c  */
-#line 16499 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_XA_START;
-          }
-    break;
-
-  case 2649:
-
-/* Line 1455 of yacc.c  */
-#line 16503 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_XA_END;
-          }
-    break;
-
-  case 2650:
-
-/* Line 1455 of yacc.c  */
-#line 16507 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_XA_PREPARE;
-          }
-    break;
-
-  case 2651:
-
-/* Line 1455 of yacc.c  */
-#line 16511 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_XA_COMMIT;
-          }
-    break;
-
-  case 2652:
-
-/* Line 1455 of yacc.c  */
-#line 16515 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_XA_ROLLBACK;
-          }
-    break;
-
-  case 2653:
-
-/* Line 1455 of yacc.c  */
-#line 16519 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            Lex->sql_command = SQLCOM_XA_RECOVER;
-          }
-    break;
-
-  case 2654:
-
-/* Line 1455 of yacc.c  */
-#line 16526 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (1)].string)->length() <= MAXGTRIDSIZE);
-            if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
-              MYSQL_YYABORT;
-            Lex->xid->set(1L, (yyvsp[(1) - (1)].string)->ptr(), (yyvsp[(1) - (1)].string)->length(), 0, 0);
-          }
-    break;
-
-  case 2655:
-
-/* Line 1455 of yacc.c  */
-#line 16533 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (3)].string)->length() <= MAXBQUALSIZE);
-            if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
-              MYSQL_YYABORT;
-            Lex->xid->set(1L, (yyvsp[(1) - (3)].string)->ptr(), (yyvsp[(1) - (3)].string)->length(), (yyvsp[(3) - (3)].string)->ptr(), (yyvsp[(3) - (3)].string)->length());
-          }
-    break;
-
-  case 2656:
-
-/* Line 1455 of yacc.c  */
-#line 16540 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (5)].string)->length() <= MAXBQUALSIZE);
-            if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
-              MYSQL_YYABORT;
-            Lex->xid->set((yyvsp[(5) - (5)].ulong_num), (yyvsp[(1) - (5)].string)->ptr(), (yyvsp[(1) - (5)].string)->length(), (yyvsp[(3) - (5)].string)->ptr(), (yyvsp[(3) - (5)].string)->length());
-          }
-    break;
-
-  case 2657:
-
-/* Line 1455 of yacc.c  */
-#line 16549 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2658:
-
-/* Line 1455 of yacc.c  */
-#line 16550 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2659:
-
-/* Line 1455 of yacc.c  */
-#line 16554 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->xa_opt=XA_NONE;        }
-    break;
-
-  case 2660:
-
-/* Line 1455 of yacc.c  */
-#line 16555 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->xa_opt=XA_JOIN;        }
-    break;
-
-  case 2661:
-
-/* Line 1455 of yacc.c  */
-#line 16556 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->xa_opt=XA_RESUME;      }
-    break;
-
-  case 2662:
-
-/* Line 1455 of yacc.c  */
-#line 16560 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->xa_opt=XA_NONE;        }
-    break;
-
-  case 2663:
-
-/* Line 1455 of yacc.c  */
-#line 16561 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->xa_opt=XA_ONE_PHASE;   }
-    break;
-
-  case 2664:
-
-/* Line 1455 of yacc.c  */
-#line 16566 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->xa_opt=XA_NONE;        }
-    break;
-
-  case 2665:
-
-/* Line 1455 of yacc.c  */
-#line 16568 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->xa_opt=XA_SUSPEND;     }
-    break;
-
-  case 2667:
-
-/* Line 1455 of yacc.c  */
-#line 16573 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {}
-    break;
-
-  case 2668:
-
-/* Line 1455 of yacc.c  */
-#line 16574 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    { Lex->xa_opt=XA_FOR_MIGRATE; }
-    break;
-
-  case 2669:
-
-/* Line 1455 of yacc.c  */
-#line 16579 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_INSTALL_PLUGIN;
-            lex->comment= (yyvsp[(3) - (5)].lex_str);
-            lex->ident= (yyvsp[(5) - (5)].lex_str);
-          }
-    break;
-
-  case 2670:
-
-/* Line 1455 of yacc.c  */
-#line 16589 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-    {
-            LEX *lex= Lex;
-            lex->sql_command= SQLCOM_UNINSTALL_PLUGIN;
-            lex->comment= (yyvsp[(3) - (3)].lex_str);
-          }
-    break;
-
-
-
-/* Line 1455 of yacc.c  */
-#line 42040 "/export/home/pb2/build/sb_0-14135359-1421674846.01/dist_GPL/sql/sql_yacc.cc"
-      default: break;
-    }
-  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-
-  *++yyvsp = yyval;
-
-  /* Now `shift' the result of the reduction.  Determine what state
-     that goes to, based on the state we popped back to and the rule
-     number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
-
-  goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
-  /* If not already recovering from an error, report this error.  */
-  if (!yyerrstatus)
-    {
-      ++yynerrs;
-#if ! YYERROR_VERBOSE
-      yyerror (YYTHD, YY_("syntax error"));
-#else
-      {
-       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
-       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
-         {
-           YYSIZE_T yyalloc = 2 * yysize;
-           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
-             yyalloc = YYSTACK_ALLOC_MAXIMUM;
-           if (yymsg != yymsgbuf)
-             YYSTACK_FREE (yymsg);
-           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
-           if (yymsg)
-             yymsg_alloc = yyalloc;
-           else
-             {
-               yymsg = yymsgbuf;
-               yymsg_alloc = sizeof yymsgbuf;
-             }
-         }
-
-       if (0 < yysize && yysize <= yymsg_alloc)
-         {
-           (void) yysyntax_error (yymsg, yystate, yychar);
-           yyerror (YYTHD, yymsg);
-         }
-       else
-         {
-           yyerror (YYTHD, YY_("syntax error"));
-           if (yysize != 0)
-             goto yyexhaustedlab;
-         }
-      }
-#endif
-    }
-
-
-
-  if (yyerrstatus == 3)
-    {
-      /* If just tried and failed to reuse lookahead token after an
-        error, discard it.  */
-
-      if (yychar <= YYEOF)
-       {
-         /* Return failure if at end of input.  */
-         if (yychar == YYEOF)
-           YYABORT;
-       }
-      else
-       {
-         yydestruct ("Error: discarding",
-                     yytoken, &yylval, YYTHD);
-         yychar = YYEMPTY;
-       }
-    }
-
-  /* Else will try to reuse lookahead token after shifting the error
-     token.  */
-  goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
-
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYERROR.  */
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-  yystate = *yyssp;
-  goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-  yyerrstatus = 3;     /* Each real token shifted decrements this.  */
-
-  for (;;)
-    {
-      yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
-       {
-         yyn += YYTERROR;
-         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-           {
-             yyn = yytable[yyn];
-             if (0 < yyn)
-               break;
-           }
-       }
-
-      /* Pop the current state because it cannot handle the error token.  */
-      if (yyssp == yyss)
-       YYABORT;
-
-
-      yydestruct ("Error: popping",
-                 yystos[yystate], yyvsp, YYTHD);
-      YYPOPSTACK (1);
-      yystate = *yyssp;
-      YY_STACK_PRINT (yyss, yyssp);
-    }
-
-  *++yyvsp = yylval;
-
-
-  /* Shift the error token.  */
-  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
-  yystate = yyn;
-  goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-  yyresult = 0;
-  goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-  yyresult = 1;
-  goto yyreturn;
-
-#if !defined(yyoverflow) || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
-yyexhaustedlab:
-  yyerror (YYTHD, YY_("memory exhausted"));
-  yyresult = 2;
-  /* Fall through.  */
-#endif
-
-yyreturn:
-  if (yychar != YYEMPTY)
-     yydestruct ("Cleanup: discarding lookahead",
-                yytoken, &yylval, YYTHD);
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYABORT or YYACCEPT.  */
-  YYPOPSTACK (yylen);
-  YY_STACK_PRINT (yyss, yyssp);
-  while (yyssp != yyss)
-    {
-      yydestruct ("Cleanup: popping",
-                 yystos[*yyssp], yyvsp, YYTHD);
-      YYPOPSTACK (1);
-    }
-#ifndef yyoverflow
-  if (yyss != yyssa)
-    YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
-  if (yymsg != yymsgbuf)
-    YYSTACK_FREE (yymsg);
-#endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
-}
-
-
-
diff --git a/mysql-wsrep-5.6/sql/sql_yacc.h b/mysql-wsrep-5.6/sql/sql_yacc.h
deleted file mode 100644 (file)
index 7d57b94..0000000
+++ /dev/null
@@ -1,1360 +0,0 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-   
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-   
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     ABORT_SYM = 258,
-     ACCESSIBLE_SYM = 259,
-     ACTION = 260,
-     ADD = 261,
-     ADDDATE_SYM = 262,
-     AFTER_SYM = 263,
-     AGAINST = 264,
-     AGGREGATE_SYM = 265,
-     ALGORITHM_SYM = 266,
-     ALL = 267,
-     ALTER = 268,
-     ANALYSE_SYM = 269,
-     ANALYZE_SYM = 270,
-     AND_AND_SYM = 271,
-     AND_SYM = 272,
-     ANY_SYM = 273,
-     AS = 274,
-     ASC = 275,
-     ASCII_SYM = 276,
-     ASENSITIVE_SYM = 277,
-     AT_SYM = 278,
-     AUTOEXTEND_SIZE_SYM = 279,
-     AUTO_INC = 280,
-     AVG_ROW_LENGTH = 281,
-     AVG_SYM = 282,
-     BACKUP_SYM = 283,
-     BEFORE_SYM = 284,
-     BEGIN_SYM = 285,
-     BETWEEN_SYM = 286,
-     BIGINT = 287,
-     BINARY = 288,
-     BINLOG_SYM = 289,
-     BIN_NUM = 290,
-     BIT_AND = 291,
-     BIT_OR = 292,
-     BIT_SYM = 293,
-     BIT_XOR = 294,
-     BLOB_SYM = 295,
-     BLOCK_SYM = 296,
-     BOOLEAN_SYM = 297,
-     BOOL_SYM = 298,
-     BOTH = 299,
-     BTREE_SYM = 300,
-     BY = 301,
-     BYTE_SYM = 302,
-     CACHE_SYM = 303,
-     CALL_SYM = 304,
-     CASCADE = 305,
-     CASCADED = 306,
-     CASE_SYM = 307,
-     CAST_SYM = 308,
-     CATALOG_NAME_SYM = 309,
-     CHAIN_SYM = 310,
-     CHANGE = 311,
-     CHANGED = 312,
-     CHARSET = 313,
-     CHAR_SYM = 314,
-     CHECKSUM_SYM = 315,
-     CHECK_SYM = 316,
-     CIPHER_SYM = 317,
-     CLASS_ORIGIN_SYM = 318,
-     CLIENT_SYM = 319,
-     CLOSE_SYM = 320,
-     COALESCE = 321,
-     CODE_SYM = 322,
-     COLLATE_SYM = 323,
-     COLLATION_SYM = 324,
-     COLUMNS = 325,
-     COLUMN_SYM = 326,
-     COLUMN_FORMAT_SYM = 327,
-     COLUMN_NAME_SYM = 328,
-     COMMENT_SYM = 329,
-     COMMITTED_SYM = 330,
-     COMMIT_SYM = 331,
-     COMPACT_SYM = 332,
-     COMPLETION_SYM = 333,
-     COMPRESSED_SYM = 334,
-     CONCURRENT = 335,
-     CONDITION_SYM = 336,
-     CONNECTION_SYM = 337,
-     CONSISTENT_SYM = 338,
-     CONSTRAINT = 339,
-     CONSTRAINT_CATALOG_SYM = 340,
-     CONSTRAINT_NAME_SYM = 341,
-     CONSTRAINT_SCHEMA_SYM = 342,
-     CONTAINS_SYM = 343,
-     CONTEXT_SYM = 344,
-     CONTINUE_SYM = 345,
-     CONVERT_SYM = 346,
-     COUNT_SYM = 347,
-     CPU_SYM = 348,
-     CREATE = 349,
-     CROSS = 350,
-     CUBE_SYM = 351,
-     CURDATE = 352,
-     CURRENT_SYM = 353,
-     CURRENT_USER = 354,
-     CURSOR_SYM = 355,
-     CURSOR_NAME_SYM = 356,
-     CURTIME = 357,
-     DATABASE = 358,
-     DATABASES = 359,
-     DATAFILE_SYM = 360,
-     DATA_SYM = 361,
-     DATETIME = 362,
-     DATE_ADD_INTERVAL = 363,
-     DATE_SUB_INTERVAL = 364,
-     DATE_SYM = 365,
-     DAY_HOUR_SYM = 366,
-     DAY_MICROSECOND_SYM = 367,
-     DAY_MINUTE_SYM = 368,
-     DAY_SECOND_SYM = 369,
-     DAY_SYM = 370,
-     DEALLOCATE_SYM = 371,
-     DECIMAL_NUM = 372,
-     DECIMAL_SYM = 373,
-     DECLARE_SYM = 374,
-     DEFAULT = 375,
-     DEFAULT_AUTH_SYM = 376,
-     DEFINER_SYM = 377,
-     DELAYED_SYM = 378,
-     DELAY_KEY_WRITE_SYM = 379,
-     DELETE_SYM = 380,
-     DESC = 381,
-     DESCRIBE = 382,
-     DES_KEY_FILE = 383,
-     DETERMINISTIC_SYM = 384,
-     DIAGNOSTICS_SYM = 385,
-     DIRECTORY_SYM = 386,
-     DISABLE_SYM = 387,
-     DISCARD = 388,
-     DISK_SYM = 389,
-     DISTINCT = 390,
-     DIV_SYM = 391,
-     DOUBLE_SYM = 392,
-     DO_SYM = 393,
-     DROP = 394,
-     DUAL_SYM = 395,
-     DUMPFILE = 396,
-     DUPLICATE_SYM = 397,
-     DYNAMIC_SYM = 398,
-     EACH_SYM = 399,
-     ELSE = 400,
-     ELSEIF_SYM = 401,
-     ENABLE_SYM = 402,
-     ENCLOSED = 403,
-     END = 404,
-     ENDS_SYM = 405,
-     END_OF_INPUT = 406,
-     ENGINES_SYM = 407,
-     ENGINE_SYM = 408,
-     ENUM = 409,
-     EQ = 410,
-     EQUAL_SYM = 411,
-     ERROR_SYM = 412,
-     ERRORS = 413,
-     ESCAPED = 414,
-     ESCAPE_SYM = 415,
-     EVENTS_SYM = 416,
-     EVENT_SYM = 417,
-     EVERY_SYM = 418,
-     EXCHANGE_SYM = 419,
-     EXECUTE_SYM = 420,
-     EXISTS = 421,
-     EXIT_SYM = 422,
-     EXPANSION_SYM = 423,
-     EXPIRE_SYM = 424,
-     EXPORT_SYM = 425,
-     EXTENDED_SYM = 426,
-     EXTENT_SIZE_SYM = 427,
-     EXTRACT_SYM = 428,
-     FALSE_SYM = 429,
-     FAST_SYM = 430,
-     FAULTS_SYM = 431,
-     FETCH_SYM = 432,
-     FILE_SYM = 433,
-     FIRST_SYM = 434,
-     FIXED_SYM = 435,
-     FLOAT_NUM = 436,
-     FLOAT_SYM = 437,
-     FLUSH_SYM = 438,
-     FORCE_SYM = 439,
-     FOREIGN = 440,
-     FOR_SYM = 441,
-     FORMAT_SYM = 442,
-     FOUND_SYM = 443,
-     FROM = 444,
-     FULL = 445,
-     FULLTEXT_SYM = 446,
-     FUNCTION_SYM = 447,
-     GE = 448,
-     GENERAL = 449,
-     GEOMETRYCOLLECTION = 450,
-     GEOMETRY_SYM = 451,
-     GET_FORMAT = 452,
-     GET_SYM = 453,
-     GLOBAL_SYM = 454,
-     GRANT = 455,
-     GRANTS = 456,
-     GROUP_SYM = 457,
-     GROUP_CONCAT_SYM = 458,
-     GT_SYM = 459,
-     HANDLER_SYM = 460,
-     HASH_SYM = 461,
-     HAVING = 462,
-     HELP_SYM = 463,
-     HEX_NUM = 464,
-     HIGH_PRIORITY = 465,
-     HOST_SYM = 466,
-     HOSTS_SYM = 467,
-     HOUR_MICROSECOND_SYM = 468,
-     HOUR_MINUTE_SYM = 469,
-     HOUR_SECOND_SYM = 470,
-     HOUR_SYM = 471,
-     IDENT = 472,
-     IDENTIFIED_SYM = 473,
-     IDENT_QUOTED = 474,
-     IF = 475,
-     IGNORE_SYM = 476,
-     IGNORE_SERVER_IDS_SYM = 477,
-     IMPORT = 478,
-     INDEXES = 479,
-     INDEX_SYM = 480,
-     INFILE = 481,
-     INITIAL_SIZE_SYM = 482,
-     INNER_SYM = 483,
-     INOUT_SYM = 484,
-     INSENSITIVE_SYM = 485,
-     INSERT = 486,
-     INSERT_METHOD = 487,
-     INSTALL_SYM = 488,
-     INTERVAL_SYM = 489,
-     INTO = 490,
-     INT_SYM = 491,
-     INVOKER_SYM = 492,
-     IN_SYM = 493,
-     IO_AFTER_GTIDS = 494,
-     IO_BEFORE_GTIDS = 495,
-     IO_SYM = 496,
-     IPC_SYM = 497,
-     IS = 498,
-     ISOLATION = 499,
-     ISSUER_SYM = 500,
-     ITERATE_SYM = 501,
-     JOIN_SYM = 502,
-     KEYS = 503,
-     KEY_BLOCK_SIZE = 504,
-     KEY_SYM = 505,
-     KILL_SYM = 506,
-     LANGUAGE_SYM = 507,
-     LAST_SYM = 508,
-     LE = 509,
-     LEADING = 510,
-     LEAVES = 511,
-     LEAVE_SYM = 512,
-     LEFT = 513,
-     LESS_SYM = 514,
-     LEVEL_SYM = 515,
-     LEX_HOSTNAME = 516,
-     LIKE = 517,
-     LIMIT = 518,
-     LINEAR_SYM = 519,
-     LINES = 520,
-     LINESTRING = 521,
-     LIST_SYM = 522,
-     LOAD = 523,
-     LOCAL_SYM = 524,
-     LOCATOR_SYM = 525,
-     LOCKS_SYM = 526,
-     LOCK_SYM = 527,
-     LOGFILE_SYM = 528,
-     LOGS_SYM = 529,
-     LONGBLOB = 530,
-     LONGTEXT = 531,
-     LONG_NUM = 532,
-     LONG_SYM = 533,
-     LOOP_SYM = 534,
-     LOW_PRIORITY = 535,
-     LT = 536,
-     MASTER_AUTO_POSITION_SYM = 537,
-     MASTER_BIND_SYM = 538,
-     MASTER_CONNECT_RETRY_SYM = 539,
-     MASTER_DELAY_SYM = 540,
-     MASTER_HOST_SYM = 541,
-     MASTER_LOG_FILE_SYM = 542,
-     MASTER_LOG_POS_SYM = 543,
-     MASTER_PASSWORD_SYM = 544,
-     MASTER_PORT_SYM = 545,
-     MASTER_RETRY_COUNT_SYM = 546,
-     MASTER_SERVER_ID_SYM = 547,
-     MASTER_SSL_CAPATH_SYM = 548,
-     MASTER_SSL_CA_SYM = 549,
-     MASTER_SSL_CERT_SYM = 550,
-     MASTER_SSL_CIPHER_SYM = 551,
-     MASTER_SSL_CRL_SYM = 552,
-     MASTER_SSL_CRLPATH_SYM = 553,
-     MASTER_SSL_KEY_SYM = 554,
-     MASTER_SSL_SYM = 555,
-     MASTER_SSL_VERIFY_SERVER_CERT_SYM = 556,
-     MASTER_SYM = 557,
-     MASTER_USER_SYM = 558,
-     MASTER_HEARTBEAT_PERIOD_SYM = 559,
-     MATCH = 560,
-     MAX_CONNECTIONS_PER_HOUR = 561,
-     MAX_QUERIES_PER_HOUR = 562,
-     MAX_ROWS = 563,
-     MAX_SIZE_SYM = 564,
-     MAX_SYM = 565,
-     MAX_UPDATES_PER_HOUR = 566,
-     MAX_USER_CONNECTIONS_SYM = 567,
-     MAX_VALUE_SYM = 568,
-     MEDIUMBLOB = 569,
-     MEDIUMINT = 570,
-     MEDIUMTEXT = 571,
-     MEDIUM_SYM = 572,
-     MEMORY_SYM = 573,
-     MERGE_SYM = 574,
-     MESSAGE_TEXT_SYM = 575,
-     MICROSECOND_SYM = 576,
-     MIGRATE_SYM = 577,
-     MINUTE_MICROSECOND_SYM = 578,
-     MINUTE_SECOND_SYM = 579,
-     MINUTE_SYM = 580,
-     MIN_ROWS = 581,
-     MIN_SYM = 582,
-     MODE_SYM = 583,
-     MODIFIES_SYM = 584,
-     MODIFY_SYM = 585,
-     MOD_SYM = 586,
-     MONTH_SYM = 587,
-     MULTILINESTRING = 588,
-     MULTIPOINT = 589,
-     MULTIPOLYGON = 590,
-     MUTEX_SYM = 591,
-     MYSQL_ERRNO_SYM = 592,
-     NAMES_SYM = 593,
-     NAME_SYM = 594,
-     NATIONAL_SYM = 595,
-     NATURAL = 596,
-     NCHAR_STRING = 597,
-     NCHAR_SYM = 598,
-     NDBCLUSTER_SYM = 599,
-     NE = 600,
-     NEG = 601,
-     NEW_SYM = 602,
-     NEXT_SYM = 603,
-     NODEGROUP_SYM = 604,
-     NONE_SYM = 605,
-     NOT2_SYM = 606,
-     NOT_SYM = 607,
-     NOW_SYM = 608,
-     NO_SYM = 609,
-     NO_WAIT_SYM = 610,
-     NO_WRITE_TO_BINLOG = 611,
-     NULL_SYM = 612,
-     NUM = 613,
-     NUMBER_SYM = 614,
-     NUMERIC_SYM = 615,
-     NVARCHAR_SYM = 616,
-     OFFSET_SYM = 617,
-     OLD_PASSWORD = 618,
-     ON = 619,
-     ONE_SYM = 620,
-     ONLY_SYM = 621,
-     OPEN_SYM = 622,
-     OPTIMIZE = 623,
-     OPTIONS_SYM = 624,
-     OPTION = 625,
-     OPTIONALLY = 626,
-     OR2_SYM = 627,
-     ORDER_SYM = 628,
-     OR_OR_SYM = 629,
-     OR_SYM = 630,
-     OUTER = 631,
-     OUTFILE = 632,
-     OUT_SYM = 633,
-     OWNER_SYM = 634,
-     PACK_KEYS_SYM = 635,
-     PAGE_SYM = 636,
-     PARAM_MARKER = 637,
-     PARSER_SYM = 638,
-     PARTIAL = 639,
-     PARTITION_SYM = 640,
-     PARTITIONS_SYM = 641,
-     PARTITIONING_SYM = 642,
-     PASSWORD = 643,
-     PHASE_SYM = 644,
-     PLUGIN_DIR_SYM = 645,
-     PLUGIN_SYM = 646,
-     PLUGINS_SYM = 647,
-     POINT_SYM = 648,
-     POLYGON = 649,
-     PORT_SYM = 650,
-     POSITION_SYM = 651,
-     PRECISION = 652,
-     PREPARE_SYM = 653,
-     PRESERVE_SYM = 654,
-     PREV_SYM = 655,
-     PRIMARY_SYM = 656,
-     PRIVILEGES = 657,
-     PROCEDURE_SYM = 658,
-     PROCESS = 659,
-     PROCESSLIST_SYM = 660,
-     PROFILE_SYM = 661,
-     PROFILES_SYM = 662,
-     PROXY_SYM = 663,
-     PURGE = 664,
-     QUARTER_SYM = 665,
-     QUERY_SYM = 666,
-     QUICK = 667,
-     RANGE_SYM = 668,
-     READS_SYM = 669,
-     READ_ONLY_SYM = 670,
-     READ_SYM = 671,
-     READ_WRITE_SYM = 672,
-     REAL = 673,
-     REBUILD_SYM = 674,
-     RECOVER_SYM = 675,
-     REDOFILE_SYM = 676,
-     REDO_BUFFER_SIZE_SYM = 677,
-     REDUNDANT_SYM = 678,
-     REFERENCES = 679,
-     REGEXP = 680,
-     RELAY = 681,
-     RELAYLOG_SYM = 682,
-     RELAY_LOG_FILE_SYM = 683,
-     RELAY_LOG_POS_SYM = 684,
-     RELAY_THREAD = 685,
-     RELEASE_SYM = 686,
-     RELOAD = 687,
-     REMOVE_SYM = 688,
-     RENAME = 689,
-     REORGANIZE_SYM = 690,
-     REPAIR = 691,
-     REPEATABLE_SYM = 692,
-     REPEAT_SYM = 693,
-     REPLACE = 694,
-     REPLICATION = 695,
-     REQUIRE_SYM = 696,
-     RESET_SYM = 697,
-     RESIGNAL_SYM = 698,
-     RESOURCES = 699,
-     RESTORE_SYM = 700,
-     RESTRICT = 701,
-     RESUME_SYM = 702,
-     RETURNED_SQLSTATE_SYM = 703,
-     RETURNS_SYM = 704,
-     RETURN_SYM = 705,
-     REVERSE_SYM = 706,
-     REVOKE = 707,
-     RIGHT = 708,
-     ROLLBACK_SYM = 709,
-     ROLLUP_SYM = 710,
-     ROUTINE_SYM = 711,
-     ROWS_SYM = 712,
-     ROW_FORMAT_SYM = 713,
-     ROW_SYM = 714,
-     ROW_COUNT_SYM = 715,
-     RTREE_SYM = 716,
-     SAVEPOINT_SYM = 717,
-     SCHEDULE_SYM = 718,
-     SCHEMA_NAME_SYM = 719,
-     SECOND_MICROSECOND_SYM = 720,
-     SECOND_SYM = 721,
-     SECURITY_SYM = 722,
-     SELECT_SYM = 723,
-     SENSITIVE_SYM = 724,
-     SEPARATOR_SYM = 725,
-     SERIALIZABLE_SYM = 726,
-     SERIAL_SYM = 727,
-     SESSION_SYM = 728,
-     SERVER_SYM = 729,
-     SERVER_OPTIONS = 730,
-     SET = 731,
-     SET_VAR = 732,
-     SHARE_SYM = 733,
-     SHIFT_LEFT = 734,
-     SHIFT_RIGHT = 735,
-     SHOW = 736,
-     SHUTDOWN = 737,
-     SIGNAL_SYM = 738,
-     SIGNED_SYM = 739,
-     SIMPLE_SYM = 740,
-     SLAVE = 741,
-     SLOW = 742,
-     SMALLINT = 743,
-     SNAPSHOT_SYM = 744,
-     SOCKET_SYM = 745,
-     SONAME_SYM = 746,
-     SOUNDS_SYM = 747,
-     SOURCE_SYM = 748,
-     SPATIAL_SYM = 749,
-     SPECIFIC_SYM = 750,
-     SQLEXCEPTION_SYM = 751,
-     SQLSTATE_SYM = 752,
-     SQLWARNING_SYM = 753,
-     SQL_AFTER_GTIDS = 754,
-     SQL_AFTER_MTS_GAPS = 755,
-     SQL_BEFORE_GTIDS = 756,
-     SQL_BIG_RESULT = 757,
-     SQL_BUFFER_RESULT = 758,
-     SQL_CACHE_SYM = 759,
-     SQL_CALC_FOUND_ROWS = 760,
-     SQL_NO_CACHE_SYM = 761,
-     SQL_SMALL_RESULT = 762,
-     SQL_SYM = 763,
-     SQL_THREAD = 764,
-     SSL_SYM = 765,
-     STARTING = 766,
-     STARTS_SYM = 767,
-     START_SYM = 768,
-     STATS_AUTO_RECALC_SYM = 769,
-     STATS_PERSISTENT_SYM = 770,
-     STATS_SAMPLE_PAGES_SYM = 771,
-     STATUS_SYM = 772,
-     STDDEV_SAMP_SYM = 773,
-     STD_SYM = 774,
-     STOP_SYM = 775,
-     STORAGE_SYM = 776,
-     STRAIGHT_JOIN = 777,
-     STRING_SYM = 778,
-     SUBCLASS_ORIGIN_SYM = 779,
-     SUBDATE_SYM = 780,
-     SUBJECT_SYM = 781,
-     SUBPARTITIONS_SYM = 782,
-     SUBPARTITION_SYM = 783,
-     SUBSTRING = 784,
-     SUM_SYM = 785,
-     SUPER_SYM = 786,
-     SUSPEND_SYM = 787,
-     SWAPS_SYM = 788,
-     SWITCHES_SYM = 789,
-     SYSDATE = 790,
-     TABLES = 791,
-     TABLESPACE = 792,
-     TABLE_REF_PRIORITY = 793,
-     TABLE_SYM = 794,
-     TABLE_CHECKSUM_SYM = 795,
-     TABLE_NAME_SYM = 796,
-     TEMPORARY = 797,
-     TEMPTABLE_SYM = 798,
-     TERMINATED = 799,
-     TEXT_STRING = 800,
-     TEXT_SYM = 801,
-     THAN_SYM = 802,
-     THEN_SYM = 803,
-     TIMESTAMP = 804,
-     TIMESTAMP_ADD = 805,
-     TIMESTAMP_DIFF = 806,
-     TIME_SYM = 807,
-     TINYBLOB = 808,
-     TINYINT = 809,
-     TINYTEXT = 810,
-     TO_SYM = 811,
-     TRAILING = 812,
-     TRANSACTION_SYM = 813,
-     TRIGGERS_SYM = 814,
-     TRIGGER_SYM = 815,
-     TRIM = 816,
-     TRUE_SYM = 817,
-     TRUNCATE_SYM = 818,
-     TYPES_SYM = 819,
-     TYPE_SYM = 820,
-     UDF_RETURNS_SYM = 821,
-     ULONGLONG_NUM = 822,
-     UNCOMMITTED_SYM = 823,
-     UNDEFINED_SYM = 824,
-     UNDERSCORE_CHARSET = 825,
-     UNDOFILE_SYM = 826,
-     UNDO_BUFFER_SIZE_SYM = 827,
-     UNDO_SYM = 828,
-     UNICODE_SYM = 829,
-     UNINSTALL_SYM = 830,
-     UNION_SYM = 831,
-     UNIQUE_SYM = 832,
-     UNKNOWN_SYM = 833,
-     UNLOCK_SYM = 834,
-     UNSIGNED = 835,
-     UNTIL_SYM = 836,
-     UPDATE_SYM = 837,
-     UPGRADE_SYM = 838,
-     USAGE = 839,
-     USER = 840,
-     USE_FRM = 841,
-     USE_SYM = 842,
-     USING = 843,
-     UTC_DATE_SYM = 844,
-     UTC_TIMESTAMP_SYM = 845,
-     UTC_TIME_SYM = 846,
-     VALUES = 847,
-     VALUE_SYM = 848,
-     VARBINARY = 849,
-     VARCHAR = 850,
-     VARIABLES = 851,
-     VARIANCE_SYM = 852,
-     VARYING = 853,
-     VAR_SAMP_SYM = 854,
-     VIEW_SYM = 855,
-     WAIT_SYM = 856,
-     WARNINGS = 857,
-     WEEK_SYM = 858,
-     WEIGHT_STRING_SYM = 859,
-     WHEN_SYM = 860,
-     WHERE = 861,
-     WHILE_SYM = 862,
-     WITH = 863,
-     WITH_CUBE_SYM = 864,
-     WITH_ROLLUP_SYM = 865,
-     WORK_SYM = 866,
-     WRAPPER_SYM = 867,
-     WRITE_SYM = 868,
-     X509_SYM = 869,
-     XA_SYM = 870,
-     XML_SYM = 871,
-     XOR = 872,
-     YEAR_MONTH_SYM = 873,
-     YEAR_SYM = 874,
-     ZEROFILL = 875
-   };
-#endif
-/* Tokens.  */
-#define ABORT_SYM 258
-#define ACCESSIBLE_SYM 259
-#define ACTION 260
-#define ADD 261
-#define ADDDATE_SYM 262
-#define AFTER_SYM 263
-#define AGAINST 264
-#define AGGREGATE_SYM 265
-#define ALGORITHM_SYM 266
-#define ALL 267
-#define ALTER 268
-#define ANALYSE_SYM 269
-#define ANALYZE_SYM 270
-#define AND_AND_SYM 271
-#define AND_SYM 272
-#define ANY_SYM 273
-#define AS 274
-#define ASC 275
-#define ASCII_SYM 276
-#define ASENSITIVE_SYM 277
-#define AT_SYM 278
-#define AUTOEXTEND_SIZE_SYM 279
-#define AUTO_INC 280
-#define AVG_ROW_LENGTH 281
-#define AVG_SYM 282
-#define BACKUP_SYM 283
-#define BEFORE_SYM 284
-#define BEGIN_SYM 285
-#define BETWEEN_SYM 286
-#define BIGINT 287
-#define BINARY 288
-#define BINLOG_SYM 289
-#define BIN_NUM 290
-#define BIT_AND 291
-#define BIT_OR 292
-#define BIT_SYM 293
-#define BIT_XOR 294
-#define BLOB_SYM 295
-#define BLOCK_SYM 296
-#define BOOLEAN_SYM 297
-#define BOOL_SYM 298
-#define BOTH 299
-#define BTREE_SYM 300
-#define BY 301
-#define BYTE_SYM 302
-#define CACHE_SYM 303
-#define CALL_SYM 304
-#define CASCADE 305
-#define CASCADED 306
-#define CASE_SYM 307
-#define CAST_SYM 308
-#define CATALOG_NAME_SYM 309
-#define CHAIN_SYM 310
-#define CHANGE 311
-#define CHANGED 312
-#define CHARSET 313
-#define CHAR_SYM 314
-#define CHECKSUM_SYM 315
-#define CHECK_SYM 316
-#define CIPHER_SYM 317
-#define CLASS_ORIGIN_SYM 318
-#define CLIENT_SYM 319
-#define CLOSE_SYM 320
-#define COALESCE 321
-#define CODE_SYM 322
-#define COLLATE_SYM 323
-#define COLLATION_SYM 324
-#define COLUMNS 325
-#define COLUMN_SYM 326
-#define COLUMN_FORMAT_SYM 327
-#define COLUMN_NAME_SYM 328
-#define COMMENT_SYM 329
-#define COMMITTED_SYM 330
-#define COMMIT_SYM 331
-#define COMPACT_SYM 332
-#define COMPLETION_SYM 333
-#define COMPRESSED_SYM 334
-#define CONCURRENT 335
-#define CONDITION_SYM 336
-#define CONNECTION_SYM 337
-#define CONSISTENT_SYM 338
-#define CONSTRAINT 339
-#define CONSTRAINT_CATALOG_SYM 340
-#define CONSTRAINT_NAME_SYM 341
-#define CONSTRAINT_SCHEMA_SYM 342
-#define CONTAINS_SYM 343
-#define CONTEXT_SYM 344
-#define CONTINUE_SYM 345
-#define CONVERT_SYM 346
-#define COUNT_SYM 347
-#define CPU_SYM 348
-#define CREATE 349
-#define CROSS 350
-#define CUBE_SYM 351
-#define CURDATE 352
-#define CURRENT_SYM 353
-#define CURRENT_USER 354
-#define CURSOR_SYM 355
-#define CURSOR_NAME_SYM 356
-#define CURTIME 357
-#define DATABASE 358
-#define DATABASES 359
-#define DATAFILE_SYM 360
-#define DATA_SYM 361
-#define DATETIME 362
-#define DATE_ADD_INTERVAL 363
-#define DATE_SUB_INTERVAL 364
-#define DATE_SYM 365
-#define DAY_HOUR_SYM 366
-#define DAY_MICROSECOND_SYM 367
-#define DAY_MINUTE_SYM 368
-#define DAY_SECOND_SYM 369
-#define DAY_SYM 370
-#define DEALLOCATE_SYM 371
-#define DECIMAL_NUM 372
-#define DECIMAL_SYM 373
-#define DECLARE_SYM 374
-#define DEFAULT 375
-#define DEFAULT_AUTH_SYM 376
-#define DEFINER_SYM 377
-#define DELAYED_SYM 378
-#define DELAY_KEY_WRITE_SYM 379
-#define DELETE_SYM 380
-#define DESC 381
-#define DESCRIBE 382
-#define DES_KEY_FILE 383
-#define DETERMINISTIC_SYM 384
-#define DIAGNOSTICS_SYM 385
-#define DIRECTORY_SYM 386
-#define DISABLE_SYM 387
-#define DISCARD 388
-#define DISK_SYM 389
-#define DISTINCT 390
-#define DIV_SYM 391
-#define DOUBLE_SYM 392
-#define DO_SYM 393
-#define DROP 394
-#define DUAL_SYM 395
-#define DUMPFILE 396
-#define DUPLICATE_SYM 397
-#define DYNAMIC_SYM 398
-#define EACH_SYM 399
-#define ELSE 400
-#define ELSEIF_SYM 401
-#define ENABLE_SYM 402
-#define ENCLOSED 403
-#define END 404
-#define ENDS_SYM 405
-#define END_OF_INPUT 406
-#define ENGINES_SYM 407
-#define ENGINE_SYM 408
-#define ENUM 409
-#define EQ 410
-#define EQUAL_SYM 411
-#define ERROR_SYM 412
-#define ERRORS 413
-#define ESCAPED 414
-#define ESCAPE_SYM 415
-#define EVENTS_SYM 416
-#define EVENT_SYM 417
-#define EVERY_SYM 418
-#define EXCHANGE_SYM 419
-#define EXECUTE_SYM 420
-#define EXISTS 421
-#define EXIT_SYM 422
-#define EXPANSION_SYM 423
-#define EXPIRE_SYM 424
-#define EXPORT_SYM 425
-#define EXTENDED_SYM 426
-#define EXTENT_SIZE_SYM 427
-#define EXTRACT_SYM 428
-#define FALSE_SYM 429
-#define FAST_SYM 430
-#define FAULTS_SYM 431
-#define FETCH_SYM 432
-#define FILE_SYM 433
-#define FIRST_SYM 434
-#define FIXED_SYM 435
-#define FLOAT_NUM 436
-#define FLOAT_SYM 437
-#define FLUSH_SYM 438
-#define FORCE_SYM 439
-#define FOREIGN 440
-#define FOR_SYM 441
-#define FORMAT_SYM 442
-#define FOUND_SYM 443
-#define FROM 444
-#define FULL 445
-#define FULLTEXT_SYM 446
-#define FUNCTION_SYM 447
-#define GE 448
-#define GENERAL 449
-#define GEOMETRYCOLLECTION 450
-#define GEOMETRY_SYM 451
-#define GET_FORMAT 452
-#define GET_SYM 453
-#define GLOBAL_SYM 454
-#define GRANT 455
-#define GRANTS 456
-#define GROUP_SYM 457
-#define GROUP_CONCAT_SYM 458
-#define GT_SYM 459
-#define HANDLER_SYM 460
-#define HASH_SYM 461
-#define HAVING 462
-#define HELP_SYM 463
-#define HEX_NUM 464
-#define HIGH_PRIORITY 465
-#define HOST_SYM 466
-#define HOSTS_SYM 467
-#define HOUR_MICROSECOND_SYM 468
-#define HOUR_MINUTE_SYM 469
-#define HOUR_SECOND_SYM 470
-#define HOUR_SYM 471
-#define IDENT 472
-#define IDENTIFIED_SYM 473
-#define IDENT_QUOTED 474
-#define IF 475
-#define IGNORE_SYM 476
-#define IGNORE_SERVER_IDS_SYM 477
-#define IMPORT 478
-#define INDEXES 479
-#define INDEX_SYM 480
-#define INFILE 481
-#define INITIAL_SIZE_SYM 482
-#define INNER_SYM 483
-#define INOUT_SYM 484
-#define INSENSITIVE_SYM 485
-#define INSERT 486
-#define INSERT_METHOD 487
-#define INSTALL_SYM 488
-#define INTERVAL_SYM 489
-#define INTO 490
-#define INT_SYM 491
-#define INVOKER_SYM 492
-#define IN_SYM 493
-#define IO_AFTER_GTIDS 494
-#define IO_BEFORE_GTIDS 495
-#define IO_SYM 496
-#define IPC_SYM 497
-#define IS 498
-#define ISOLATION 499
-#define ISSUER_SYM 500
-#define ITERATE_SYM 501
-#define JOIN_SYM 502
-#define KEYS 503
-#define KEY_BLOCK_SIZE 504
-#define KEY_SYM 505
-#define KILL_SYM 506
-#define LANGUAGE_SYM 507
-#define LAST_SYM 508
-#define LE 509
-#define LEADING 510
-#define LEAVES 511
-#define LEAVE_SYM 512
-#define LEFT 513
-#define LESS_SYM 514
-#define LEVEL_SYM 515
-#define LEX_HOSTNAME 516
-#define LIKE 517
-#define LIMIT 518
-#define LINEAR_SYM 519
-#define LINES 520
-#define LINESTRING 521
-#define LIST_SYM 522
-#define LOAD 523
-#define LOCAL_SYM 524
-#define LOCATOR_SYM 525
-#define LOCKS_SYM 526
-#define LOCK_SYM 527
-#define LOGFILE_SYM 528
-#define LOGS_SYM 529
-#define LONGBLOB 530
-#define LONGTEXT 531
-#define LONG_NUM 532
-#define LONG_SYM 533
-#define LOOP_SYM 534
-#define LOW_PRIORITY 535
-#define LT 536
-#define MASTER_AUTO_POSITION_SYM 537
-#define MASTER_BIND_SYM 538
-#define MASTER_CONNECT_RETRY_SYM 539
-#define MASTER_DELAY_SYM 540
-#define MASTER_HOST_SYM 541
-#define MASTER_LOG_FILE_SYM 542
-#define MASTER_LOG_POS_SYM 543
-#define MASTER_PASSWORD_SYM 544
-#define MASTER_PORT_SYM 545
-#define MASTER_RETRY_COUNT_SYM 546
-#define MASTER_SERVER_ID_SYM 547
-#define MASTER_SSL_CAPATH_SYM 548
-#define MASTER_SSL_CA_SYM 549
-#define MASTER_SSL_CERT_SYM 550
-#define MASTER_SSL_CIPHER_SYM 551
-#define MASTER_SSL_CRL_SYM 552
-#define MASTER_SSL_CRLPATH_SYM 553
-#define MASTER_SSL_KEY_SYM 554
-#define MASTER_SSL_SYM 555
-#define MASTER_SSL_VERIFY_SERVER_CERT_SYM 556
-#define MASTER_SYM 557
-#define MASTER_USER_SYM 558
-#define MASTER_HEARTBEAT_PERIOD_SYM 559
-#define MATCH 560
-#define MAX_CONNECTIONS_PER_HOUR 561
-#define MAX_QUERIES_PER_HOUR 562
-#define MAX_ROWS 563
-#define MAX_SIZE_SYM 564
-#define MAX_SYM 565
-#define MAX_UPDATES_PER_HOUR 566
-#define MAX_USER_CONNECTIONS_SYM 567
-#define MAX_VALUE_SYM 568
-#define MEDIUMBLOB 569
-#define MEDIUMINT 570
-#define MEDIUMTEXT 571
-#define MEDIUM_SYM 572
-#define MEMORY_SYM 573
-#define MERGE_SYM 574
-#define MESSAGE_TEXT_SYM 575
-#define MICROSECOND_SYM 576
-#define MIGRATE_SYM 577
-#define MINUTE_MICROSECOND_SYM 578
-#define MINUTE_SECOND_SYM 579
-#define MINUTE_SYM 580
-#define MIN_ROWS 581
-#define MIN_SYM 582
-#define MODE_SYM 583
-#define MODIFIES_SYM 584
-#define MODIFY_SYM 585
-#define MOD_SYM 586
-#define MONTH_SYM 587
-#define MULTILINESTRING 588
-#define MULTIPOINT 589
-#define MULTIPOLYGON 590
-#define MUTEX_SYM 591
-#define MYSQL_ERRNO_SYM 592
-#define NAMES_SYM 593
-#define NAME_SYM 594
-#define NATIONAL_SYM 595
-#define NATURAL 596
-#define NCHAR_STRING 597
-#define NCHAR_SYM 598
-#define NDBCLUSTER_SYM 599
-#define NE 600
-#define NEG 601
-#define NEW_SYM 602
-#define NEXT_SYM 603
-#define NODEGROUP_SYM 604
-#define NONE_SYM 605
-#define NOT2_SYM 606
-#define NOT_SYM 607
-#define NOW_SYM 608
-#define NO_SYM 609
-#define NO_WAIT_SYM 610
-#define NO_WRITE_TO_BINLOG 611
-#define NULL_SYM 612
-#define NUM 613
-#define NUMBER_SYM 614
-#define NUMERIC_SYM 615
-#define NVARCHAR_SYM 616
-#define OFFSET_SYM 617
-#define OLD_PASSWORD 618
-#define ON 619
-#define ONE_SYM 620
-#define ONLY_SYM 621
-#define OPEN_SYM 622
-#define OPTIMIZE 623
-#define OPTIONS_SYM 624
-#define OPTION 625
-#define OPTIONALLY 626
-#define OR2_SYM 627
-#define ORDER_SYM 628
-#define OR_OR_SYM 629
-#define OR_SYM 630
-#define OUTER 631
-#define OUTFILE 632
-#define OUT_SYM 633
-#define OWNER_SYM 634
-#define PACK_KEYS_SYM 635
-#define PAGE_SYM 636
-#define PARAM_MARKER 637
-#define PARSER_SYM 638
-#define PARTIAL 639
-#define PARTITION_SYM 640
-#define PARTITIONS_SYM 641
-#define PARTITIONING_SYM 642
-#define PASSWORD 643
-#define PHASE_SYM 644
-#define PLUGIN_DIR_SYM 645
-#define PLUGIN_SYM 646
-#define PLUGINS_SYM 647
-#define POINT_SYM 648
-#define POLYGON 649
-#define PORT_SYM 650
-#define POSITION_SYM 651
-#define PRECISION 652
-#define PREPARE_SYM 653
-#define PRESERVE_SYM 654
-#define PREV_SYM 655
-#define PRIMARY_SYM 656
-#define PRIVILEGES 657
-#define PROCEDURE_SYM 658
-#define PROCESS 659
-#define PROCESSLIST_SYM 660
-#define PROFILE_SYM 661
-#define PROFILES_SYM 662
-#define PROXY_SYM 663
-#define PURGE 664
-#define QUARTER_SYM 665
-#define QUERY_SYM 666
-#define QUICK 667
-#define RANGE_SYM 668
-#define READS_SYM 669
-#define READ_ONLY_SYM 670
-#define READ_SYM 671
-#define READ_WRITE_SYM 672
-#define REAL 673
-#define REBUILD_SYM 674
-#define RECOVER_SYM 675
-#define REDOFILE_SYM 676
-#define REDO_BUFFER_SIZE_SYM 677
-#define REDUNDANT_SYM 678
-#define REFERENCES 679
-#define REGEXP 680
-#define RELAY 681
-#define RELAYLOG_SYM 682
-#define RELAY_LOG_FILE_SYM 683
-#define RELAY_LOG_POS_SYM 684
-#define RELAY_THREAD 685
-#define RELEASE_SYM 686
-#define RELOAD 687
-#define REMOVE_SYM 688
-#define RENAME 689
-#define REORGANIZE_SYM 690
-#define REPAIR 691
-#define REPEATABLE_SYM 692
-#define REPEAT_SYM 693
-#define REPLACE 694
-#define REPLICATION 695
-#define REQUIRE_SYM 696
-#define RESET_SYM 697
-#define RESIGNAL_SYM 698
-#define RESOURCES 699
-#define RESTORE_SYM 700
-#define RESTRICT 701
-#define RESUME_SYM 702
-#define RETURNED_SQLSTATE_SYM 703
-#define RETURNS_SYM 704
-#define RETURN_SYM 705
-#define REVERSE_SYM 706
-#define REVOKE 707
-#define RIGHT 708
-#define ROLLBACK_SYM 709
-#define ROLLUP_SYM 710
-#define ROUTINE_SYM 711
-#define ROWS_SYM 712
-#define ROW_FORMAT_SYM 713
-#define ROW_SYM 714
-#define ROW_COUNT_SYM 715
-#define RTREE_SYM 716
-#define SAVEPOINT_SYM 717
-#define SCHEDULE_SYM 718
-#define SCHEMA_NAME_SYM 719
-#define SECOND_MICROSECOND_SYM 720
-#define SECOND_SYM 721
-#define SECURITY_SYM 722
-#define SELECT_SYM 723
-#define SENSITIVE_SYM 724
-#define SEPARATOR_SYM 725
-#define SERIALIZABLE_SYM 726
-#define SERIAL_SYM 727
-#define SESSION_SYM 728
-#define SERVER_SYM 729
-#define SERVER_OPTIONS 730
-#define SET 731
-#define SET_VAR 732
-#define SHARE_SYM 733
-#define SHIFT_LEFT 734
-#define SHIFT_RIGHT 735
-#define SHOW 736
-#define SHUTDOWN 737
-#define SIGNAL_SYM 738
-#define SIGNED_SYM 739
-#define SIMPLE_SYM 740
-#define SLAVE 741
-#define SLOW 742
-#define SMALLINT 743
-#define SNAPSHOT_SYM 744
-#define SOCKET_SYM 745
-#define SONAME_SYM 746
-#define SOUNDS_SYM 747
-#define SOURCE_SYM 748
-#define SPATIAL_SYM 749
-#define SPECIFIC_SYM 750
-#define SQLEXCEPTION_SYM 751
-#define SQLSTATE_SYM 752
-#define SQLWARNING_SYM 753
-#define SQL_AFTER_GTIDS 754
-#define SQL_AFTER_MTS_GAPS 755
-#define SQL_BEFORE_GTIDS 756
-#define SQL_BIG_RESULT 757
-#define SQL_BUFFER_RESULT 758
-#define SQL_CACHE_SYM 759
-#define SQL_CALC_FOUND_ROWS 760
-#define SQL_NO_CACHE_SYM 761
-#define SQL_SMALL_RESULT 762
-#define SQL_SYM 763
-#define SQL_THREAD 764
-#define SSL_SYM 765
-#define STARTING 766
-#define STARTS_SYM 767
-#define START_SYM 768
-#define STATS_AUTO_RECALC_SYM 769
-#define STATS_PERSISTENT_SYM 770
-#define STATS_SAMPLE_PAGES_SYM 771
-#define STATUS_SYM 772
-#define STDDEV_SAMP_SYM 773
-#define STD_SYM 774
-#define STOP_SYM 775
-#define STORAGE_SYM 776
-#define STRAIGHT_JOIN 777
-#define STRING_SYM 778
-#define SUBCLASS_ORIGIN_SYM 779
-#define SUBDATE_SYM 780
-#define SUBJECT_SYM 781
-#define SUBPARTITIONS_SYM 782
-#define SUBPARTITION_SYM 783
-#define SUBSTRING 784
-#define SUM_SYM 785
-#define SUPER_SYM 786
-#define SUSPEND_SYM 787
-#define SWAPS_SYM 788
-#define SWITCHES_SYM 789
-#define SYSDATE 790
-#define TABLES 791
-#define TABLESPACE 792
-#define TABLE_REF_PRIORITY 793
-#define TABLE_SYM 794
-#define TABLE_CHECKSUM_SYM 795
-#define TABLE_NAME_SYM 796
-#define TEMPORARY 797
-#define TEMPTABLE_SYM 798
-#define TERMINATED 799
-#define TEXT_STRING 800
-#define TEXT_SYM 801
-#define THAN_SYM 802
-#define THEN_SYM 803
-#define TIMESTAMP 804
-#define TIMESTAMP_ADD 805
-#define TIMESTAMP_DIFF 806
-#define TIME_SYM 807
-#define TINYBLOB 808
-#define TINYINT 809
-#define TINYTEXT 810
-#define TO_SYM 811
-#define TRAILING 812
-#define TRANSACTION_SYM 813
-#define TRIGGERS_SYM 814
-#define TRIGGER_SYM 815
-#define TRIM 816
-#define TRUE_SYM 817
-#define TRUNCATE_SYM 818
-#define TYPES_SYM 819
-#define TYPE_SYM 820
-#define UDF_RETURNS_SYM 821
-#define ULONGLONG_NUM 822
-#define UNCOMMITTED_SYM 823
-#define UNDEFINED_SYM 824
-#define UNDERSCORE_CHARSET 825
-#define UNDOFILE_SYM 826
-#define UNDO_BUFFER_SIZE_SYM 827
-#define UNDO_SYM 828
-#define UNICODE_SYM 829
-#define UNINSTALL_SYM 830
-#define UNION_SYM 831
-#define UNIQUE_SYM 832
-#define UNKNOWN_SYM 833
-#define UNLOCK_SYM 834
-#define UNSIGNED 835
-#define UNTIL_SYM 836
-#define UPDATE_SYM 837
-#define UPGRADE_SYM 838
-#define USAGE 839
-#define USER 840
-#define USE_FRM 841
-#define USE_SYM 842
-#define USING 843
-#define UTC_DATE_SYM 844
-#define UTC_TIMESTAMP_SYM 845
-#define UTC_TIME_SYM 846
-#define VALUES 847
-#define VALUE_SYM 848
-#define VARBINARY 849
-#define VARCHAR 850
-#define VARIABLES 851
-#define VARIANCE_SYM 852
-#define VARYING 853
-#define VAR_SAMP_SYM 854
-#define VIEW_SYM 855
-#define WAIT_SYM 856
-#define WARNINGS 857
-#define WEEK_SYM 858
-#define WEIGHT_STRING_SYM 859
-#define WHEN_SYM 860
-#define WHERE 861
-#define WHILE_SYM 862
-#define WITH 863
-#define WITH_CUBE_SYM 864
-#define WITH_ROLLUP_SYM 865
-#define WORK_SYM 866
-#define WRAPPER_SYM 867
-#define WRITE_SYM 868
-#define X509_SYM 869
-#define XA_SYM 870
-#define XML_SYM 871
-#define XOR 872
-#define YEAR_MONTH_SYM 873
-#define YEAR_SYM 874
-#define ZEROFILL 875
-
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-{
-
-/* Line 1676 of yacc.c  */
-#line 967 "/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/sql/sql_yacc.yy"
-
-  int  num;
-  ulong ulong_num;
-  ulonglong ulonglong_number;
-  longlong longlong_number;
-  LEX_STRING lex_str;
-  LEX_STRING *lex_str_ptr;
-  LEX_SYMBOL symbol;
-  Table_ident *table;
-  char *simple_string;
-  Item *item;
-  Item_num *item_num;
-  List<Item> *item_list;
-  List<String> *string_list;
-  String *string;
-  Key_part_spec *key_part;
-  TABLE_LIST *table_list;
-  udf_func *udf;
-  LEX_USER *lex_user;
-  struct sys_var_with_base variable;
-  enum enum_var_type var_type;
-  Key::Keytype key_type;
-  enum ha_key_alg key_alg;
-  handlerton *db_type;
-  enum row_type row_type;
-  enum ha_rkey_function ha_rkey_mode;
-  enum enum_ha_read_modes ha_read_mode;
-  enum enum_tx_isolation tx_isolation;
-  enum Cast_target cast_type;
-  enum Item_udftype udf_type;
-  const CHARSET_INFO *charset;
-  thr_lock_type lock_type;
-  interval_type interval, interval_time_st;
-  timestamp_type date_time_type;
-  st_select_lex *select_lex;
-  chooser_compare_func_creator boolfunc2creator;
-  class sp_condition_value *spcondvalue;
-  struct { int vars, conds, hndlrs, curs; } spblock;
-  sp_name *spname;
-  LEX *lex;
-  sp_head *sphead;
-  struct p_elem_val *p_elem_value;
-  enum index_hint_type index_hint;
-  enum enum_filetype filetype;
-  enum Foreign_key::fk_option m_fk_option;
-  enum enum_yes_no_unknown m_yes_no_unk;
-  Diag_condition_item_name diag_condition_item_name;
-  Diagnostics_information::Which_area diag_area;
-  Diagnostics_information *diag_info;
-  Statement_information_item *stmt_info_item;
-  Statement_information_item::Name stmt_info_item_name;
-  List<Statement_information_item> *stmt_info_list;
-  Condition_information_item *cond_info_item;
-  Condition_information_item::Name cond_info_item_name;
-  List<Condition_information_item> *cond_info_list;
-  bool is_not_empty;
-
-
-
-/* Line 1676 of yacc.c  */
-#line 1352 "/export/home/pb2/build/sb_0-14135359-1421674846.01/dist_GPL/sql/sql_yacc.h"
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-
-
index b7cbd96cb3d28f6591104ac4d85a8b093e322f49..1b94b6df10978d8ed5c19f1ebb7cccf8ecfacbed 100644 (file)
@@ -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
@@ -64,6 +64,7 @@ Note: YYTHD is passed as an argument to yyparse(), and subsequently to yylex().
 #include "set_var.h"
 #include "opt_explain_traditional.h"
 #include "opt_explain_json.h"
+#include "lex_token.h"
 
 /* this is to get the bison compilation windows warnings out */
 #ifdef _MSC_VER
@@ -7433,7 +7434,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 +7446,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 +7459,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 +7469,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
           {
@@ -7957,7 +7964,7 @@ alter_list_item:
             lex->create_info.default_table_charset= $5;
             lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
               HA_CREATE_USED_DEFAULT_CHARSET);
-            lex->alter_info.flags|= Alter_info::ALTER_CONVERT;
+            lex->alter_info.flags|= Alter_info::ALTER_OPTIONS;
           }
         | create_table_options_space_separated
           {
@@ -8774,15 +8781,21 @@ select_lock_type:
         | FOR_SYM UPDATE_SYM
           {
             LEX *lex=Lex;
-            lex->current_select->set_lock_for_tables(TL_WRITE);
-            lex->safe_to_cache_query=0;
+            if (!lex->describe)
+            {
+              lex->current_select->set_lock_for_tables(TL_WRITE);
+              lex->safe_to_cache_query=0;
+            }
           }
         | LOCK_SYM IN_SYM SHARE_SYM MODE_SYM
           {
             LEX *lex=Lex;
-            lex->current_select->
-              set_lock_for_tables(TL_READ_WITH_SHARED_LOCKS);
-            lex->safe_to_cache_query=0;
+            if (!lex->describe)
+            {
+              lex->current_select->
+                set_lock_for_tables(TL_READ_WITH_SHARED_LOCKS);
+              lex->safe_to_cache_query=0;
+            }
           }
         ;
 
@@ -13397,6 +13410,14 @@ literal:
         | temporal_literal { $$= $1; }
         | NULL_SYM
           {
+            Lex_input_stream *lip= YYLIP;
+            /*
+              For the digest computation, in this context only,
+              NULL is considered a literal, hence reduced to '?'
+              REDUCE:
+                TOK_GENERIC_VALUE := NULL_SYM
+            */
+            lip->reduce_digest_token(TOK_GENERIC_VALUE, NULL_SYM);
             $$ = new (YYTHD->mem_root) Item_null();
             if ($$ == NULL)
               MYSQL_YYABORT;
@@ -13445,7 +13466,9 @@ literal:
                                     str ? str->length() : 0,
                                     $1);
             if (!item_str ||
-                !item_str->check_well_formed_result(&item_str->str_value, TRUE))
+                !item_str->check_well_formed_result(&item_str->str_value,
+                                                    true, //send error
+                                                    true))  //truncate
             {
               MYSQL_YYABORT;
             }
@@ -13474,7 +13497,9 @@ literal:
                                     str ? str->length() : 0,
                                     $1);
             if (!item_str ||
-                !item_str->check_well_formed_result(&item_str->str_value, TRUE))
+                !item_str->check_well_formed_result(&item_str->str_value,
+                                                    true, //send error
+                                                    true)) //truncate
             {
               MYSQL_YYABORT;
             }
@@ -15910,6 +15935,13 @@ subselect_end:
             */
             lex->current_select->select_n_where_fields+=
             child->select_n_where_fields;
+
+            /*
+              Aggregate functions in having clause may add fields to an outer
+              select. Count them also.
+            */
+            lex->current_select->select_n_having_items+=
+            child->select_n_having_items;
           }
         ;
 
index f44196e52dbd65487f81007ed624eec609f430cc..8f403d085e5c8db22ff78b2e29dc0c7a02eb668c 100644 (file)
@@ -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
@@ -520,6 +520,14 @@ static Sys_var_long Sys_pfs_digest_size(
        DEFAULT(-1),
        BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
 
+static Sys_var_long Sys_pfs_max_digest_length(
+       "performance_schema_max_digest_length",
+       "Maximum length considered for digest text, when stored in performance_schema tables.",
+       READ_ONLY GLOBAL_VAR(pfs_param.m_max_digest_length),
+       CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024 * 1024),
+       DEFAULT(1024),
+       BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
+
 static Sys_var_long Sys_pfs_connect_attrs_size(
        "performance_schema_session_connect_attrs_size",
        "Size of session attribute string buffer per thread."
@@ -822,13 +830,12 @@ static Sys_var_mybool Sys_explicit_defaults_for_timestamp(
 static bool repository_check(sys_var *self, THD *thd, set_var *var, SLAVE_THD_TYPE thread_mask)
 {
   bool ret= FALSE;
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
-  if (!(thd->security_ctx->master_access & SUPER_ACL))
+  if (thd->in_active_multi_stmt_transaction())
   {
-    my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
-    return TRUE;
+    my_error(ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION, MYF(0),
+             var->var->name.str);
+    return true;
   }
-#endif
 #ifdef HAVE_REPLICATION
   int running= 0;
   const char *msg= NULL;
@@ -1779,6 +1786,14 @@ static Sys_var_ulong Sys_max_connect_errors(
        VALID_RANGE(1, ULONG_MAX), DEFAULT(100),
        BLOCK_SIZE(1));
 
+static Sys_var_long Sys_max_digest_length(
+       "max_digest_length",
+       "Maximum length considered for digest text.",
+       READ_ONLY GLOBAL_VAR(max_digest_length),
+       CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024 * 1024),
+       DEFAULT(1024),
+       BLOCK_SIZE(1));
+
 static bool check_max_delayed_threads(sys_var *self, THD *thd, set_var *var)
 {
   return var->type != OPT_GLOBAL &&
@@ -2042,7 +2057,7 @@ static Sys_var_ulong Sys_open_files_limit(
        "open_files_limit",
        "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 "
+       "will reserve max_connections*5 or max_connections + table_open_cache*2 "
        "(whichever is larger) number of file descriptors",
        READ_ONLY GLOBAL_VAR(open_files_limit), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(0, OS_FILE_LIMIT), DEFAULT(0), BLOCK_SIZE(1),
@@ -2469,7 +2484,7 @@ static Sys_var_ulong Sys_trans_alloc_block_size(
        "transaction_alloc_block_size",
        "Allocation block size for transactions to be stored in binary log",
        SESSION_VAR(trans_alloc_block_size), CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(1024, ULONG_MAX), DEFAULT(QUERY_ALLOC_BLOCK_SIZE),
+       VALID_RANGE(1024, 128 * 1024), DEFAULT(QUERY_ALLOC_BLOCK_SIZE),
        BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
        ON_UPDATE(fix_trans_mem_root));
 
@@ -2477,7 +2492,7 @@ static Sys_var_ulong Sys_trans_prealloc_size(
        "transaction_prealloc_size",
        "Persistent buffer for transactions to be stored in binary log",
        SESSION_VAR(trans_prealloc_size), CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(1024, ULONG_MAX), DEFAULT(TRANS_ALLOC_PREALLOC_SIZE),
+       VALID_RANGE(1024, 128 * 1024), DEFAULT(TRANS_ALLOC_PREALLOC_SIZE),
        BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
        ON_UPDATE(fix_trans_mem_root));
 
@@ -3222,6 +3237,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 +4235,289 @@ 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",
+       SESSION_VAR(wsrep_OSU_method), 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 const char *wsrep_reject_queries_names[]= { "NONE", "ALL", "ALL_KILL", NullS };
+static Sys_var_enum Sys_wsrep_reject_queries(
+       "wsrep_reject_queries", "Variable to set to reject queries",
+       GLOBAL_VAR(wsrep_reject_queries), CMD_LINE(OPT_ARG),
+       wsrep_reject_queries_names, DEFAULT(WSREP_REJECT_NONE),
+       NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+       ON_UPDATE(wsrep_reject_queries_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));
+
+static Sys_var_mybool Sys_wsrep_dirty_reads(
+       "wsrep_dirty_reads",
+       "Allow reads from a node is not in primary component",
+       SESSION_VAR(wsrep_dirty_reads),
+       CMD_LINE(OPT_ARG), DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG);
+
+#endif /* WITH_WSREP */
 
 static bool fix_host_cache_size(sys_var *, THD *, enum_var_type)
 {
@@ -4283,15 +4585,20 @@ static Sys_var_mybool Sys_enforce_gtid_consistency(
 
 static Sys_var_mybool Sys_binlog_gtid_simple_recovery(
        "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.",
        READ_ONLY GLOBAL_VAR(binlog_gtid_simple_recovery),
        CMD_LINE(OPT_ARG), DEFAULT(FALSE));
 
@@ -4659,3 +4966,28 @@ static Sys_var_enum Sys_block_encryption_mode(
   "block_encryption_mode", "mode for AES_ENCRYPT/AES_DECRYPT",
   SESSION_VAR(my_aes_mode), CMD_LINE(REQUIRED_ARG),
   my_aes_opmode_names, DEFAULT(my_aes_128_ecb));
+
+static Sys_var_mybool Sys_avoid_temporal_upgrade(
+       "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.",
+        GLOBAL_VAR(avoid_temporal_upgrade),
+        CMD_LINE(OPT_ARG, OPT_AVOID_TEMPORAL_UPGRADE),
+        DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+        ON_CHECK(0), ON_UPDATE(0),
+        DEPRECATED(""));
+
+static Sys_var_mybool Sys_show_old_temporals(
+       "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.",
+        SESSION_VAR(show_old_temporals),
+        CMD_LINE(OPT_ARG, OPT_SHOW_OLD_TEMPORALS),
+        DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+        ON_CHECK(0), ON_UPDATE(0),
+        DEPRECATED(""));
+
index afd3947e2deacbaf41021444e71058a30d9a4baa..7481677ed3358e2f1ffe80b8d29e88d68cdfa53b 100644 (file)
@@ -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
@@ -2100,6 +2100,8 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
   bool error_reported= FALSE;
   uchar *record, *bitmaps;
   Field **field_ptr;
+  Field *fts_doc_id_field= NULL;
+
   DBUG_ENTER("open_table_from_share");
   DBUG_PRINT("enter",("name: '%s.%s'  form: 0x%lx", share->db.str,
                       share->table_name.str, (long) outparam));
@@ -2163,18 +2165,6 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
       outparam->record[1]= outparam->record[0];   // Safety
   }
 
-#ifdef HAVE_purify
-  /*
-    We need this because when we read var-length rows, we are not updating
-    bytes after end of varchar
-  */
-  if (records > 1)
-  {
-    memcpy(outparam->record[0], share->default_values, share->rec_buff_length);
-    memcpy(outparam->record[1], share->default_values, share->null_bytes);
-  }
-#endif
-
   if (!(field_ptr = (Field **) alloc_root(&outparam->mem_root,
                                           (uint) ((share->fields+1)*
                                                   sizeof(Field*)))))
@@ -2199,6 +2189,11 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
     new_field->init(outparam);
     new_field->move_field_offset((my_ptrdiff_t) (outparam->record[0] -
                                                  outparam->s->default_values));
+    /* Check if FTS_DOC_ID column is present in the table */
+    if (outparam->file &&
+        (outparam->file->ha_table_flags() & HA_CAN_FULLTEXT_EXT) &&
+        !strcmp(outparam->field[i]->field_name, FTS_DOC_ID_COL_NAME))
+      fts_doc_id_field= new_field;
   }
   (*field_ptr)= 0;                              // End marker
 
@@ -2253,6 +2248,10 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
       }
       /* Skip unused key parts if they exist */
       key_part+= key_info->unused_key_parts;
+
+      /* Set TABLE::fts_doc_id_field for tables with FT KEY */
+      if ((key_info->flags & HA_FULLTEXT))
+        outparam->fts_doc_id_field= fts_doc_id_field;
     }
   }
 
@@ -3696,6 +3695,7 @@ void TABLE::init(THD *thd, TABLE_LIST *tl)
   fulltext_searched= 0;
   file->ft_handler= 0;
   reginfo.impossible_range= 0;
+  reginfo.join_tab= NULL;
 
   /* Catch wrong handling of the auto_increment_field_not_null. */
   DBUG_ASSERT(!auto_increment_field_not_null);
@@ -3887,6 +3887,13 @@ void TABLE_LIST::set_underlying_merge()
         updatable= false;
       schema_table= merge_underlying_list->schema_table;
     }
+    else
+    {
+      for (tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
+      {
+          updatable&= tbl->updatable;
+      }
+    }
   }
 }
 
@@ -5321,8 +5328,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 +5404,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 +5466,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;
@@ -5743,12 +5774,23 @@ void TABLE_LIST::reinit_before_use(THD *thd)
  /*
    Reset table_name and table_name_length,if it is a anonymous derived table
    or schema table. They are not valid as TABLEs were closed in the end of
-   previous prepare or execute call.
+   previous prepare or execute call. For derived table of view, restore view's
+   name and database wiped out by derived table processing.
  */
-  if (derived)
+  if (derived != NULL)
   {
-    table_name= NULL;
-    table_name_length= 0;
+    if (view != NULL)
+    {
+      db= view_db.str;
+      db_length= view_db.length;
+      table_name= view_name.str;
+      table_name_length= view_name.length;
+    }
+    else
+    {
+      table_name= NULL;
+      table_name_length= 0;
+    }
   }
   else if (schema_table_name)
   {
@@ -6152,12 +6194,12 @@ static bool add_derived_key(List<Derived_key> &derived_key_list, Field *field,
   {
     THD *thd= field->table->in_use;
     key++;
-    entry= new (thd->stmt_arena->mem_root) Derived_key();
+    entry= new (thd->mem_root) Derived_key();
     if (!entry)
       return TRUE;
     entry->referenced_by= ref_by_tbl;
     entry->used_fields.clear_all();
-    if (derived_key_list.push_back(entry, thd->stmt_arena->mem_root))
+    if (derived_key_list.push_back(entry, thd->mem_root))
       return TRUE;
     field->table->max_keys++;
   }
index 586589ac36e0bad940a6776cf7b2d62f9eb31c98..ea790ec4c6a65c7734959b4d8518dbdaa31e25d5 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef TABLE_INCLUDED
 #define TABLE_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
@@ -639,6 +639,11 @@ struct TABLE_SHARE
   key_map keys_for_keyread;
   ha_rows min_rows, max_rows;          /* create information */
   ulong   avg_row_length;              /* create information */
+  /**
+    TABLE_SHARE version, if changed the TABLE_SHARE must be reopened.
+    NOTE: The TABLE_SHARE will not be reopened during LOCK TABLES in
+    close_thread_tables!!!
+  */
   ulong   version;
   ulong   mysql_version;               /* 0 if .frm is created before 5.0 */
   ulong   reclength;                   /* Recordlength */
@@ -1046,6 +1051,7 @@ public:
 
   Field *next_number_field;            /* Set if next_number is activated */
   Field *found_next_number_field;      /* Set on open */
+  Field *fts_doc_id_field;              /* Set if FTS_DOC_ID field is present */
 
   /* Table's triggers, 0 if there are no of them */
   Table_triggers_list *triggers;
@@ -1169,6 +1175,11 @@ public:
   my_bool insert_or_update;             /* Can be used by the handler */
   my_bool alias_name_used;             /* true if table_name is alias */
   my_bool get_fields_in_item_tree;      /* Signal to fix_field */
+  /**
+    This table must be reopened and is not to be reused.
+    NOTE: The TABLE will not be reopened during LOCK TABLES in
+    close_thread_tables!!!
+  */
   my_bool m_needs_reopen;
 private:
   bool created; /* For tmp tables. TRUE <=> tmp table has been instantiated.*/
index a307e8ac808cd1924fa87d01527810af23db7a01..124791786471394b88c77aa4ea4ea0e812563681 100644 (file)
@@ -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));
     }
index 37523cb2b03696d3e60939b3ef7810be75de48fe..a96d5da848e69642a40cfafb5a126ed5b2f693e2 100644 (file)
@@ -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
@@ -905,7 +905,6 @@ static bool pack_fields(File file, List<Create_field> &create_fields,
     recpos= field->offset+1 + (uint) data_offset;
     int3store(buff+5,recpos);
     int2store(buff+8,field->pack_flag);
-    DBUG_ASSERT(field->unireg_check < 256);
     buff[10]= (uchar) field->unireg_check;
     buff[12]= (uchar) field->interval_id;
     buff[13]= (uchar) field->sql_type; 
diff --git a/mysql-wsrep-5.6/sql/wsrep_applier.cc b/mysql-wsrep-5.6/sql/wsrep_applier.cc
new file mode 100644 (file)
index 0000000..ad2265c
--- /dev/null
@@ -0,0 +1,390 @@
+/* Copyright (C) 2013-2015 Codership Oy <info@codership.com>
+
+   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_applier.h"
+
+#include "wsrep_priv.h"
+#include "wsrep_binlog.h" // wsrep_dump_rbr_buf()
+#include "wsrep_xid.h"
+
+#include "log_event.h" // class THD, EVENT_LEN_OFFSET, etc.
+#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)
+{
+#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();
+    if (thd->wsrep_apply_toi)
+    {
+      wsrep_set_SE_checkpoint(thd->wsrep_trx_meta.gtid.uuid,
+                              thd->wsrep_trx_meta.gtid.seqno);
+    }
+  }
+
+  return rcode;
+}
+
+static wsrep_cb_status_t wsrep_rollback(THD* const thd)
+{
+#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);
+  else
+    rcode = wsrep_rollback(thd);
+
+  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/mysql-wsrep-5.6/sql/wsrep_applier.h b/mysql-wsrep-5.6/sql/wsrep_applier.h
new file mode 100644 (file)
index 0000000..247c8d1
--- /dev/null
@@ -0,0 +1,38 @@
+/* Copyright 2013 Codership Oy <http://www.codership.com>
+
+   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/wsrep_api.h"
+
+/* 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/mysql-wsrep-5.6/sql/wsrep_binlog.cc b/mysql-wsrep-5.6/sql/wsrep_binlog.cc
new file mode 100644 (file)
index 0000000..e33422f
--- /dev/null
@@ -0,0 +1,414 @@
+/* Copyright (C) 2013 Codership Oy <info@codership.com>
+
+   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/mysql-wsrep-5.6/sql/wsrep_binlog.h b/mysql-wsrep-5.6/sql/wsrep_binlog.h
new file mode 100644 (file)
index 0000000..a7b680f
--- /dev/null
@@ -0,0 +1,56 @@
+/* Copyright (C) 2013 Codership Oy <info@codership.com>
+
+   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/mysql-wsrep-5.6/sql/wsrep_check_opts.cc b/mysql-wsrep-5.6/sql/wsrep_check_opts.cc
new file mode 100644 (file)
index 0000000..5ec18c7
--- /dev/null
@@ -0,0 +1,379 @@
+/* Copyright 2011 Codership Oy <http://www.codership.com>
+
+   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 <mysqld.h>
+#include <sql_class.h>
+//#include <sql_plugin.h>
+//#include <set_var.h>
+
+#include "wsrep_mysqld.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+
+/* 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<char**>(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<void*>(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/mysql-wsrep-5.6/sql/wsrep_hton.cc b/mysql-wsrep-5.6/sql/wsrep_hton.cc
new file mode 100644 (file)
index 0000000..3366748
--- /dev/null
@@ -0,0 +1,618 @@
+/* Copyright 2008-2015 Codership Oy <http://www.codership.com>
+
+   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 <mysqld.h>
+#include "sql_base.h"
+#include "binlog.h"
+#include "rpl_filter.h"
+#include <sql_class.h>
+#include "wsrep_mysqld.h"
+#include "wsrep_binlog.h"
+#include "wsrep_xid.h"
+#include <cstdio>
+#include <cstdlib>
+#include "debug_sync.h"
+
+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)
+  {
+    if (thd->wsrep_exec_mode == LOCAL_STATE      &&
+        (thd_sql_command(thd) == SQLCOM_OPTIMIZE ||
+        thd_sql_command(thd) == SQLCOM_ANALYZE   ||
+        thd_sql_command(thd) == SQLCOM_REPAIR)   &&
+            thd->lex->no_write_to_binlog == 1)
+    {
+      WSREP_DEBUG("Skipping wsrep_register_hton for LOCAL admin command: %s",
+                  WSREP_QUERY(thd));
+        return;
+    }
+
+    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",
+                 WSREP_QUERY(thd));
+     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", 
+                  WSREP_QUERY(thd));
+      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, schema: %s, SQL: %s",
+                  (long long)thd->real_id, (thd->db ? thd->db : "(null)"),
+                  WSREP_QUERY(thd));
+    }
+    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, schema: %s, SQL: %s",
+                    (long long)thd->real_id, (thd->db ? thd->db : "(null)"),
+                    WSREP_QUERY(thd));
+      }
+      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");
+#ifdef WITH_WSREP
+  DEBUG_SYNC(thd, "wsrep_before_replication");
+#endif /* WITH_WSREP */
+
+  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", WSREP_QUERY(thd));
+    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);
+    WSREP_DEBUG("innobase_commit, abort %s", WSREP_QUERY(thd));
+    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;
+    clock_gettime(CLOCK_REALTIME, &wtime);
+    long prev_nsec = wtime.tv_nsec;
+    wtime.tv_nsec = (wtime.tv_nsec + 1000000) % 1000000000;
+    // If nsecs rolled over, increment seconds.
+    wtime.tv_sec += (wtime.tv_nsec < prev_nsec ? 1 : 0);
+    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",
+                WSREP_QUERY(thd));
+    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)",
+                  WSREP_QUERY(thd),
+                  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", WSREP_QUERY(thd));
+    }
+    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"
+               "schema: %s \n"
+              "QUERY: %s\n"
+              " => Skipping replication",
+              thd->thread_id, data_len,
+               (thd->db ? thd->db : "(null)"),
+               WSREP_QUERY(thd));
+    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 schema: %s SQL: %s",
+                 thd->thread_id, (thd->db ? thd->db : "(null)"),
+                 WSREP_QUERY(thd));
+      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, WSREP_QUERY(thd));
+    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/mysql-wsrep-5.6/sql/wsrep_mysqld.cc b/mysql-wsrep-5.6/sql/wsrep_mysqld.cc
new file mode 100644 (file)
index 0000000..edceaa8
--- /dev/null
@@ -0,0 +1,1540 @@
+/* Copyright 2008-2015 Codership Oy <http://www.codership.com>
+
+   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 <mysqld.h>
+#include <sql_class.h>
+#include <sql_parse.h>
+#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 "wsrep_xid.h"
+#include <cstdio>
+#include <cstdlib>
+#include "log_event.h"
+#include <rpl_slave.h>
+
+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);
+}
+
+void wsrep_init_sidno(const wsrep_uuid_t& wsrep_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] = ~wsrep_uuid.data[i];
+  }
+
+  sid.copy_from(ltid_uuid.data);
+  global_sid_lock->wrlock();
+  wsrep_sidno= global_sid_map->add_sid(sid);
+  WSREP_INFO("Initialized 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 */
+      wsrep_set_SE_checkpoint(local_uuid, local_seqno);
+      wsrep_init_sidno(local_uuid);
+      new_status= WSREP_MEMBER_JOINED;
+    }
+
+    // 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 */
+  wsrep_uuid_t uuid;
+  wsrep_seqno_t seqno;
+  wsrep_get_SE_checkpoint(uuid, seqno);
+
+  if (!memcmp(&uuid, &WSREP_UUID_UNDEFINED, sizeof(wsrep_uuid_t)))
+  {
+    WSREP_INFO("Read nil XID from storage engines, skipping position init");
+    return;
+  }
+
+  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;
+  }
+  wsrep_uuid_t uuid;
+  wsrep_seqno_t seqno;
+  wsrep_get_SE_checkpoint(uuid, seqno);
+  char uuid_str[40];
+  wsrep_uuid_print(&uuid, uuid_str, sizeof(uuid_str));
+  WSREP_INFO("Recovered position: %s:%lld", uuid_str, (long long)seqno);
+}
+
+
+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)))
+  {
+    DBUG_PRINT("wsrep",("wsrep->connect(%s) failed: %d",
+                        wsrep_cluster_address, rcode));
+    WSREP_ERROR("wsrep::connect(%s) failed: %d",
+                wsrep_cluster_address, 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_must_sync_wait (THD* thd, uint mask)
+{
+  return (thd->variables.wsrep_sync_wait & mask) &&
+    thd->variables.wsrep_on &&
+    !thd->in_active_multi_stmt_transaction() &&
+    thd->wsrep_conflict_state != REPLAYING &&
+    thd->wsrep_sync_wait_gtid.seqno == WSREP_SEQNO_UNDEFINED;
+}
+
+bool wsrep_sync_wait (THD* thd, uint mask)
+{
+  if (wsrep_must_sync_wait(thd, mask))
+  {
+    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_status_t ret= wsrep->causal_read (wsrep, &thd->wsrep_sync_wait_gtid);
+
+    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<LEX_STRING> 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, WSREP_QUERY(thd));
+  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, schema: %s, sql: %s. Check wsrep "
+               "connection state and retry the query.",
+               ret, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+    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, WSREP_QUERY(thd));
+    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, WSREP_QUERY(thd));
+
+  wsrep_set_SE_checkpoint(thd->wsrep_trx_meta.gtid.uuid,
+                          thd->wsrep_trx_meta.gtid.seqno);
+  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, schema: %s, sql: %s",
+               ret, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+  }
+}
+
+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, WSREP_QUERY(thd));
+
+  ret = wsrep->desync(wsrep);
+  if (ret != WSREP_OK)
+  {
+    WSREP_WARN("RSU desync failed %d for schema: %s, query: %s",
+               ret, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+    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, schema: %s, query %s",
+               (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+    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 schema: %s, query: %s",
+                 ret, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+    }
+
+    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 schema: %s, query: %s", (long long)seqno,
+               (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+    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, WSREP_QUERY(thd));
+
+
+  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 schema: %s, query: %s", ret,
+               (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+  }
+
+  ret = wsrep->resync(wsrep);
+  if (ret != WSREP_OK)
+  {
+    WSREP_WARN("resync failed %d for schema: %s, query: %s", ret,
+               (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+    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, schema: %s, query: %s has been aborted due to multi-master conflict",
+               thd->thread_id, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+    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",
+                WSREP_QUERY(thd), thd->thread_id);
+    return -1;
+  }
+
+  if (wsrep_debug && thd->mdl_context.has_locks())
+  {
+    WSREP_DEBUG("thread holds MDL locks at TI begin: %s %lu",
+                WSREP_QUERY(thd), 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 (thd->variables.wsrep_OSU_method) {
+    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;
+    default:
+      WSREP_ERROR("Unsupported OSU method: %lu",
+                  thd->variables.wsrep_OSU_method);
+      ret= -1;
+      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(thd->variables.wsrep_OSU_method)
+    {
+    case WSREP_OSU_TOI: wsrep_TOI_end(thd); break;
+    case WSREP_OSU_RSU: wsrep_RSU_end(thd); break;
+    default:
+      WSREP_WARN("Unsupported wsrep OSU method at isolation end: %lu",
+                 thd->variables.wsrep_OSU_method);
+      break;
+    }
+    wsrep_cleanup_transaction(thd);
+  }
+}
+
+#define WSREP_MDL_LOG(severity, msg, schema, schema_len, req, gra)             \
+    WSREP_##severity(                                                          \
+      "%s\n"                                                                   \
+      "schema:  %.*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, schema_len, schema,                                                 \
+      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,
+                          const MDL_key *key
+) {
+  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;
+
+  const char* schema= key->db_name();
+  int schema_len= key->db_name_length();
+
+  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 ", schema, schema_len,
+                  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", schema, schema_len,
+                    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 ||
+             granted_thd->mdl_context.wsrep_has_explicit_locks())
+    {
+      WSREP_DEBUG("BF thread waiting for FLUSH");
+      ticket->wsrep_report(wsrep_debug);
+      mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd);
+      ret = FALSE;
+    }
+    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", schema, schema_len,
+                    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;
+}
+
+bool wsrep_node_is_donor()
+{
+  return (WSREP_ON) ? (local_status.get() == 2) : false;
+}
+bool wsrep_node_is_synced()
+{
+  return (WSREP_ON) ? (local_status.get() == 4) : false;
+}
diff --git a/mysql-wsrep-5.6/sql/wsrep_mysqld.h b/mysql-wsrep-5.6/sql/wsrep_mysqld.h
new file mode 100644 (file)
index 0000000..8a25588
--- /dev/null
@@ -0,0 +1,333 @@
+/* Copyright 2008-2015 Codership Oy <http://www.codership.com>
+
+   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 <sql_priv.h>
+#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 my_bool     wsrep_desync;
+extern ulong       wsrep_reject_queries;
+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_reject_types {
+  WSREP_REJECT_NONE,    /* nothing rejected */
+  WSREP_REJECT_ALL,     /* reject all queries, with UNKNOWN_COMMAND error */
+  WSREP_REJECT_ALL_KILL /* kill existing connections and reject all queries*/
+};
+
+enum enum_wsrep_OSU_method {
+    WSREP_OSU_TOI,
+    WSREP_OSU_RSU,
+    WSREP_OSU_NONE,
+};
+
+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_must_sync_wait (THD* thd, uint mask = WSREP_SYNC_WAIT_BEFORE_READ);
+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");       \
+  }
+
+#define WSREP_QUERY(thd)                                \
+  ((!opt_log_raw) && thd->rewritten_query.length()      \
+   ? thd->rewritten_query.c_ptr_safe() : thd->query())
+
+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);
+
+bool wsrep_stmt_rollback_is_safe(THD* thd);
+
+void wsrep_init_sidno(const wsrep_uuid_t&);
+bool wsrep_node_is_donor();
+bool wsrep_node_is_synced();
+#endif /* WSREP_MYSQLD_H */
diff --git a/mysql-wsrep-5.6/sql/wsrep_notify.cc b/mysql-wsrep-5.6/sql/wsrep_notify.cc
new file mode 100644 (file)
index 0000000..2679ad4
--- /dev/null
@@ -0,0 +1,111 @@
+/* Copyright 2010 Codership Oy <http://www.codership.com>
+
+   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 <mysqld.h>
+#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", NULL);
+
+  p.wait();
+  int err = p.error();
+
+  if (err)
+  {
+    WSREP_ERROR("Notification command failed: %d (%s): \"%s\"",
+                err, strerror(err), cmd_ptr);
+  }
+}
+
diff --git a/mysql-wsrep-5.6/sql/wsrep_priv.h b/mysql-wsrep-5.6/sql/wsrep_priv.h
new file mode 100644 (file)
index 0000000..30dce78
--- /dev/null
@@ -0,0 +1,51 @@
+/* Copyright 2010 Codership Oy <http://www.codership.com>
+
+   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 <log.h>
+#include <pthread.h>
+#include <cstdio>
+
+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/mysql-wsrep-5.6/sql/wsrep_sst.cc b/mysql-wsrep-5.6/sql/wsrep_sst.cc
new file mode 100644 (file)
index 0000000..54d165c
--- /dev/null
@@ -0,0 +1,1173 @@
+/* Copyright 2008-2015 Codership Oy <http://www.codership.com>
+
+   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 <mysqld.h>
+#include <sql_class.h>
+#include <set_var.h>
+#include <sql_acl.h>
+#include <sql_reload.h>
+#include <sql_parse.h>
+#include "wsrep_priv.h"
+#include "wsrep_utils.h"
+#include "wsrep_xid.h"
+#include <cstdio>
+#include <cstdlib>
+
+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<char*>(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& uuid,
+                         wsrep_seqno_t const seqno,
+                         const void* const   state,
+                         size_t const        state_len)
+{
+    wsrep_get_SE_checkpoint(local_uuid, local_seqno);
+
+    if (memcmp(&local_uuid, &uuid, sizeof(wsrep_uuid_t)) ||
+        local_seqno < seqno || seqno < 0)
+    {
+        wsrep_set_SE_checkpoint(uuid, seqno);
+        local_uuid = uuid;
+        local_seqno = seqno;
+    }
+    else if (local_seqno > seqno)
+    {
+        WSREP_WARN("SST postion is in the past: %lld, current: %lld. "
+                   "Can't continue.",
+                   (long long)seqno, (long long)local_seqno);
+        unireg_abort(1);
+    }
+
+    wsrep_init_sidno(uuid);
+
+    if (wsrep)
+    {
+        int const rcode(seqno < 0 ? seqno : 0);
+        wsrep_gtid_t const state_id = {
+            uuid, (rcode ? WSREP_SEQNO_UNDEFINED : seqno)
+        };
+
+        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;
+  char**          env;
+  char*           ret_str;
+  int             err;
+  mysql_mutex_t   lock;
+  mysql_cond_t    cond;
+
+  sst_thread_arg (const char* c, char** e)
+    : cmd(c), env(e), ret_str(0), err(-1)
+  {
+    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", arg->env);
+
+    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 <addr>' 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;
+}
+
+#define WSREP_SST_AUTH_ENV "WSREP_SST_OPT_AUTH"
+
+static int sst_append_auth_env(wsp::env& env, const char* sst_auth)
+{
+  int const sst_auth_size= strlen(WSREP_SST_AUTH_ENV) + 1 /* = */
+    + (sst_auth ? strlen(sst_auth) : 0) + 1 /* \0 */;
+
+  wsp::string sst_auth_str(sst_auth_size); // for automatic cleanup on return
+  if (!sst_auth_str()) return -ENOMEM;
+
+  int ret= snprintf(sst_auth_str(), sst_auth_size, "%s=%s",
+                    WSREP_SST_AUTH_ENV, sst_auth ? sst_auth : "");
+
+  if (ret < 0 || ret >= sst_auth_size)
+  {
+    WSREP_ERROR("sst_append_auth_env(): snprintf() failed: %d", ret);
+    return (ret < 0 ? ret : -EMSGSIZE);
+  }
+
+  env.append(sst_auth_str());
+  return -env.error();
+}
+
+static ssize_t sst_prepare_other (const char*  method,
+                                  const char*  sst_auth,
+                                  const char*  addr_in,
+                                  const char** addr_out)
+{
+  int const cmd_len= 4096;
+  wsp::string cmd_str(cmd_len);
+
+  if (!cmd_str())
+  {
+    WSREP_ERROR("sst_prepare_other(): could not allocate cmd buffer of %d bytes",
+                cmd_len);
+    return -ENOMEM;
+  }
+
+  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_DATA" '%s' "
+                 WSREP_SST_OPT_CONF" '%s' "
+                 WSREP_SST_OPT_CONF_SUFFIX" '%s' "
+                 WSREP_SST_OPT_PARENT" '%d'"
+                 " %s '%s' ",
+                 method, addr_in, mysql_real_data_home,
+                 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);
+  }
+
+  wsp::env env(NULL);
+  if (env.error())
+  {
+    WSREP_ERROR("sst_prepare_other(): env. var ctor failed: %d", -env.error());
+    return -env.error();
+  }
+
+  if ((ret= sst_append_auth_env(env, sst_auth)))
+  {
+    WSREP_ERROR("sst_prepare_other(): appending auth failed: %d", ret);
+    return ret;
+  }
+
+  pthread_t tmp;
+  sst_thread_arg arg(cmd_str(), env());
+  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, sst_auth_real,
+                                  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<char*>(*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, char** env, int max_tries)
+{
+  int ret = 0;
+
+  for (int tries=1; tries <= max_tries; tries++)
+  {
+    wsp::process proc (cmd_str, "r", env);
+
+    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_donate_mysqldump (const char*         addr,
+                                 const wsrep_uuid_t* uuid,
+                                 const char*         uuid_str,
+                                 wsrep_seqno_t       seqno,
+                                 bool                bypass,
+                                 char**              env) // carries auth info
+{
+  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';
+
+  int const cmd_len= 4096;
+  wsp::string  cmd_str(cmd_len);
+
+  if (!cmd_str())
+  {
+    WSREP_ERROR("sst_donate_mysqldump(): "
+                "could not allocate cmd buffer of %d bytes", cmd_len);
+    return -ENOMEM;
+  }
+
+  if (!bypass && wsrep_sst_donor_rejects_queries) sst_reject_queries(TRUE);
+
+  int ret= snprintf (cmd_str(), cmd_len,
+                     "wsrep_sst_mysqldump "
+                     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",
+                     host, port, mysqld_port, mysqld_unix_port,
+                     wsrep_defaults_file, uuid_str,
+                     (long long)seqno, bypass ? " "WSREP_SST_OPT_BYPASS : "");
+
+  if (ret < 0 || ret >= cmd_len)
+  {
+    WSREP_ERROR("sst_donate_mysqldump(): snprintf() failed: %d", ret);
+    return (ret < 0 ? ret : -EMSGSIZE);
+  }
+
+  WSREP_DEBUG("Running: '%s'", cmd_str());
+
+  ret= sst_run_shell (cmd_str(), env, 3);
+
+  wsrep_gtid_t const state_id = { *uuid, (ret ? WSREP_SEQNO_UNDEFINED : seqno)};
+
+  wsrep->sst_sent (wsrep, &state_id, ret);
+
+  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, &not_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", arg->env);
+
+  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,
+                             char**        env) // carries auth info
+{
+  int const cmd_len= 4096;
+  wsp::string  cmd_str(cmd_len);
+
+  if (!cmd_str())
+  {
+    WSREP_ERROR("sst_donate_other(): "
+                "could not allocate cmd buffer of %d bytes", cmd_len);
+    return -ENOMEM;
+  }
+
+  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_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, 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(), env);
+  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 (&current_gtid->uuid, uuid_str, sizeof(uuid_str));
+
+  wsp::env env(NULL);
+  if (env.error())
+  {
+    WSREP_ERROR("wsrep_sst_donate_cb(): env var ctor failed: %d", -env.error());
+    return WSREP_CB_FAILURE;
+  }
+
+  int ret;
+  if ((ret= sst_append_auth_env(env, sst_auth_real)))
+  {
+    WSREP_ERROR("wsrep_sst_donate_cb(): appending auth env failed: %d", ret);
+    return WSREP_CB_FAILURE;
+  }
+
+  if (!strcmp (WSREP_SST_MYSQLDUMP, method))
+  {
+    ret = sst_donate_mysqldump(data, &current_gtid->uuid, uuid_str,
+                               current_gtid->seqno, bypass, env());
+  }
+  else
+  {
+    ret = sst_donate_other(method, data, uuid_str,
+                           current_gtid->seqno, bypass, env());
+  }
+
+  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/mysql-wsrep-5.6/sql/wsrep_sst.h b/mysql-wsrep-5.6/sql/wsrep_sst.h
new file mode 100644 (file)
index 0000000..b7f0e26
--- /dev/null
@@ -0,0 +1,40 @@
+/* Copyright (C) 2013 Codership Oy <info@codership.com>
+
+   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 <mysql.h> // 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/mysql-wsrep-5.6/sql/wsrep_thd.cc b/mysql-wsrep-5.6/sql/wsrep_thd.cc
new file mode 100644 (file)
index 0000000..9a64386
--- /dev/null
@@ -0,0 +1,597 @@
+/* Copyright (C) 2013 Codership Oy <info@codership.com>
+
+   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, WSREP_QUERY(thd));
+
+  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;
+
+  // Disable general logging on applier threads
+  thd->variables.option_bits |= OPTION_LOG_OFF;
+  // Enable binlogging if opt_log_slave_updates is set
+  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)
+{
+  DBUG_ENTER("wsrep_replay_transaction");
+  /* 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");
+      }
+
+      /* PS reprepare observer should have been removed already
+         open_table() will fail if we have dangling observer here
+       */
+      if (thd->get_reprepare_observer() && wsrep_log_conflicts)
+      {
+        WSREP_WARN("dangling observer in replay transaction: (thr %lu %lld %s)",
+                   thd->thread_id, thd->query_id, thd->query());
+      }
+      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->m_digest= NULL;
+      thd_proc_info(thd, "wsrep replaying trx");
+      WSREP_DEBUG("replay trx: %s %lld",
+                  WSREP_QUERY(thd),
+                  (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, schema: %s, query: %s",
+                    rcode, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+        /* 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);
+    }
+  }
+  DBUG_VOID_RETURN;
+}
+
+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 || bf_thd->variables.wsrep_OSU_method == 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;
+}
+
+bool wsrep_thd_has_explicit_locks(THD *thd)
+{
+  assert(thd);
+  return (thd->mdl_context.wsrep_has_explicit_locks());
+}
diff --git a/mysql-wsrep-5.6/sql/wsrep_thd.h b/mysql-wsrep-5.6/sql/wsrep_thd.h
new file mode 100644 (file)
index 0000000..cbf03e6
--- /dev/null
@@ -0,0 +1,38 @@
+/* Copyright (C) 2013 Codership Oy <info@codership.com>
+
+   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/mysql-wsrep-5.6/sql/wsrep_utils.cc b/mysql-wsrep-5.6/sql/wsrep_utils.cc
new file mode 100644 (file)
index 0000000..53ebb99
--- /dev/null
@@ -0,0 +1,556 @@
+/* Copyright 2010-2015 Codership Oy <http://www.codership.com>
+
+   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 <sql_class.h>
+
+#include <spawn.h>    // posix_spawn()
+#include <unistd.h>   // pipe()
+#include <errno.h>    // errno
+#include <string.h>   // strerror()
+#include <sys/wait.h> // waitpid()
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>    // getaddrinfo()
+
+#ifdef HAVE_GETIFADDRS
+#include <net/if.h>
+#include <ifaddrs.h>
+#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 (static_cast<char*>(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
+{
+
+bool
+env::ctor_common(char** e)
+{
+    env_ = static_cast<char**>(malloc((len_ + 1) * sizeof(char*)));
+
+    if (env_)
+    {
+        for (size_t i(0); i < len_; ++i)
+        {
+            assert(e[i]); // caller should make sure about len_
+            env_[i] = strdup(e[i]);
+            if (!env_[i])
+            {
+                errno_ = errno;
+                WSREP_ERROR("Failed to allocate env. var: %s", e[i]);
+                return true;
+            }
+        }
+
+        env_[len_] = NULL;
+        return false;
+    }
+    else
+    {
+        errno_ = errno;
+        WSREP_ERROR("Failed to allocate env. var vector of length: %zu", len_);
+        return true;
+    }
+}
+
+void
+env::dtor()
+{
+    if (env_)
+    {
+        /* don't need to go beyond the first NULL */
+        for (size_t i(0); env_[i] != NULL; ++i) { free(env_[i]); }
+        free(env_);
+        env_ = NULL;
+    }
+    len_ = 0;
+}
+
+env::env(char** e)
+    : len_(0), env_(NULL), errno_(0)
+{
+    if (!e) { e = environ; }
+    /* count the size of the vector */
+    while (e[len_]) { ++len_; }
+
+    if (ctor_common(e)) dtor();
+}
+
+env::env(const env& e)
+    : len_(e.len_), env_(0), errno_(0)
+{
+    if (ctor_common(e.env_)) dtor();
+}
+
+env::~env() { dtor(); }
+
+int
+env::append(const char* val)
+{
+    char** tmp = static_cast<char**>(realloc(env_, (len_ + 2)*sizeof(char*)));
+
+    if (tmp)
+    {
+        env_ = tmp;
+        env_[len_] = strdup(val);
+
+        if (env_[len_])
+        {
+            ++len_;
+            env_[len_] = NULL;
+        }
+        else errno_ = errno;
+    }
+    else errno_ = errno;
+
+    return errno_;
+}
+
+
+#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, char** env)
+    : 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;
+    }
+
+    if (NULL == env) { env = environ; } // default to global environment
+
+    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, env);
+    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<char*>(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 */
+              case 143: err_ = EINTR;  break; /* Subprocess killed */
+              }
+              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;
+}
diff --git a/mysql-wsrep-5.6/sql/wsrep_utils.h b/mysql-wsrep-5.6/sql/wsrep_utils.h
new file mode 100644 (file)
index 0000000..7d86460
--- /dev/null
@@ -0,0 +1,229 @@
+/* Copyright (C) 2013-2015 Codership Oy <info@codership.com>
+
+   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 class to manage env vars array */
+class env
+{
+private:
+    size_t len_;
+    char** env_;
+    int    errno_;
+    bool ctor_common(char** e);
+    void dtor();
+    env& operator =(env);
+public:
+    explicit env(char** env);
+    explicit env(const env&);
+    ~env();
+    int append(const char* var); /* add a new env. var */
+    int error() const { return errno_; }
+    char** operator()() { return env_; }
+};
+
+/* 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.
+    @arg env optional null-terminated vector of environment variables
+ */
+    process  (const char* cmd, const char* type, char** env);
+    ~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) {}
+    explicit string(size_t s) : string_(static_cast<char*>(malloc(s))) {}
+    char* operator()() { return string_; }
+    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/mysql-wsrep-5.6/sql/wsrep_var.cc b/mysql-wsrep-5.6/sql/wsrep_var.cc
new file mode 100644 (file)
index 0000000..7993fc9
--- /dev/null
@@ -0,0 +1,656 @@
+/* Copyright 2008-2015 Codership Oy <http://www.codership.com>
+
+   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 <mysqld.h>
+#include <sql_class.h>
+#include <sql_plugin.h>
+#include <set_var.h>
+#include <sql_acl.h>
+#include "wsrep_priv.h"
+#include "wsrep_thd.h"
+#include "wsrep_xid.h"
+#include <my_dir.h>
+#include <cstdio>
+#include <cstdlib>
+
+#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_reject_queries;
+
+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;
+}
+
+static
+void wsrep_set_local_position(const char* const value, bool const sst)
+{
+  size_t const value_len = strlen(value);
+  wsrep_uuid_t uuid;
+  size_t const uuid_len = wsrep_uuid_scan(value, value_len, &uuid);
+  wsrep_seqno_t const seqno = strtoll(value + uuid_len + 1, NULL, 10);
+
+  if (sst) {
+    wsrep_sst_received (wsrep, uuid, seqno, NULL, 0);
+  } else {
+    // initialization
+    local_uuid = uuid;
+    local_seqno = seqno;
+  }
+}
+
+bool wsrep_start_position_update (sys_var *self, THD* thd, enum_var_type type)
+{
+  WSREP_INFO ("wsrep_start_position var submitted: '%s'",
+              wsrep_start_position);
+  // since this value passed wsrep_start_position_check, don't check anything
+  // here
+  wsrep_set_local_position (wsrep_start_position, true);
+  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, false);
+}
+
+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;
+}
+
+bool wsrep_reject_queries_update(sys_var *self, THD* thd, enum_var_type type)
+{
+    switch (wsrep_reject_queries) {
+        case WSREP_REJECT_NONE:
+            WSREP_INFO("Allowing client queries due to manual setting");
+            break;
+        case WSREP_REJECT_ALL:
+            WSREP_INFO("Rejecting client queries due to manual setting");
+            break;
+        case WSREP_REJECT_ALL_KILL:
+            wsrep_close_client_connections(FALSE);
+            WSREP_INFO("Rejecting client queries and killing connections due to manual setting");
+            break;
+        default:
+          WSREP_INFO("Unknown value for wsrep_reject_queries: %lu",
+                     wsrep_reject_queries);
+            return true;
+    }
+    return false;
+}
+
+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 false;
+  }
+  wsrep_status_t ret(WSREP_WARNING);
+  if (new_wsrep_desync) {
+    ret = wsrep->desync (wsrep);
+    if (ret != WSREP_OK) {
+      WSREP_WARN ("SET desync failed %d for schema: %s, query: %s", ret,
+                  (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+      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 schema: %s, query: %s", ret,
+                  (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
+      my_error (ER_CANNOT_USER, MYF(0), "'resync'", thd->query());
+      return true;
+    }
+  }
+  return false;
+}
+
+bool wsrep_desync_update (sys_var *self, THD* thd, enum_var_type type)
+{
+  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;
+
+  wsrep_free_status(thd);
+
+  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/mysql-wsrep-5.6/sql/wsrep_var.h b/mysql-wsrep-5.6/sql/wsrep_var.h
new file mode 100644 (file)
index 0000000..da18854
--- /dev/null
@@ -0,0 +1,86 @@
+/* Copyright (C) 2013 Codership Oy <info@codership.com>
+
+   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;
+
+extern bool wsrep_reject_queries_update    UPDATE_ARGS;
+
+#endif /* WSREP_VAR_H */
diff --git a/mysql-wsrep-5.6/sql/wsrep_xid.cc b/mysql-wsrep-5.6/sql/wsrep_xid.cc
new file mode 100644 (file)
index 0000000..056da57
--- /dev/null
@@ -0,0 +1,150 @@
+/* Copyright 2015 Codership Oy <http://www.codership.com>
+
+   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
+
+#include "wsrep_xid.h"
+#include "sql_class.h"
+#include "wsrep_mysqld.h" // for logging macros
+
+/*
+ * 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));
+}
+
+int wsrep_is_wsrep_xid(const void* xid_ptr)
+{
+  const XID* xid= reinterpret_cast<const XID*>(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));
+}
+
+const wsrep_uuid_t* wsrep_xid_uuid(const XID& xid)
+{
+  if (wsrep_is_wsrep_xid(&xid))
+    return reinterpret_cast<const wsrep_uuid_t*>(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;
+  }
+}
+
+static my_bool set_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg)
+{
+  XID* xid= static_cast<XID*>(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);
+}
+
+void wsrep_set_SE_checkpoint(const wsrep_uuid_t& uuid, wsrep_seqno_t seqno)
+{
+  XID xid;
+  wsrep_xid_init(&xid, uuid, seqno);
+  wsrep_set_SE_checkpoint(xid);
+}
+
+static my_bool get_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg)
+{
+  XID* xid= reinterpret_cast<XID*>(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_get_SE_checkpoint(wsrep_uuid_t& uuid, wsrep_seqno_t& seqno)
+{
+  uuid= WSREP_UUID_UNDEFINED;
+  seqno= WSREP_SEQNO_UNDEFINED;
+
+  XID xid;
+  memset(&xid, 0, sizeof(xid));
+  xid.formatID= -1;
+
+  wsrep_get_SE_checkpoint(xid);
+
+  if (xid.formatID == -1) return; // nil XID
+
+  if (!wsrep_is_wsrep_xid(&xid))
+  {
+    WSREP_WARN("Read non-wsrep XID from storage engines.");
+    return;
+  }
+
+  uuid= *wsrep_xid_uuid(xid);
+  seqno= wsrep_xid_seqno(xid);
+}
diff --git a/mysql-wsrep-5.6/sql/wsrep_xid.h b/mysql-wsrep-5.6/sql/wsrep_xid.h
new file mode 100644 (file)
index 0000000..04de2d3
--- /dev/null
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Codership Oy <info@codership.com>
+
+   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_XID_H
+#define WSREP_XID_H
+
+#include "../wsrep/wsrep_api.h"
+#include "handler.h" // XID typedef
+
+void wsrep_xid_init(xid_t*, const wsrep_uuid_t&, wsrep_seqno_t);
+int wsrep_is_wsrep_xid(const void* xid);
+const wsrep_uuid_t* wsrep_xid_uuid(const XID&);
+wsrep_seqno_t wsrep_xid_seqno(const XID&);
+
+//void wsrep_get_SE_checkpoint(XID&); uncomment if needed
+void wsrep_get_SE_checkpoint(wsrep_uuid_t&, wsrep_seqno_t&);
+//void wsrep_set_SE_checkpoint(XID&); uncomment if needed
+void wsrep_set_SE_checkpoint(const wsrep_uuid_t&, wsrep_seqno_t);
+
+#endif /* WSREP_UTILS_H */
index 6fda4a7bac8c94930427a10d6412a951100d51b3..9af193652edf4d9a5f530fb2167d8ca52b7105fa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 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
@@ -402,7 +402,6 @@ static const int bulk_padding= 64;              // bytes "overhead" in packet
 
 /* Variables used when chopping off trailing characters */
 static const uint sizeof_trailing_comma= sizeof(", ") - 1;
-static const uint sizeof_trailing_closeparen= sizeof(") ") - 1;
 static const uint sizeof_trailing_and= sizeof(" AND ") - 1;
 static const uint sizeof_trailing_where= sizeof(" WHERE ") - 1;
 
@@ -1672,6 +1671,7 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked)
 
 int ha_federated::close(void)
 {
+  THD *thd= current_thd;
   DBUG_ENTER("ha_federated::close");
 
   free_result();
@@ -1683,7 +1683,7 @@ int ha_federated::close(void)
     FLUSH TABLES will quit the connection and if connection is broken,
     it will reconnect again and quit silently.
   */
-  if (mysql && !vio_is_connected(mysql->net.vio))
+  if (mysql && (!mysql->net.vio || !vio_is_connected(mysql->net.vio)))
      mysql->net.error= 2;
 
   /* Disconnect from mysql */
@@ -1697,9 +1697,16 @@ int ha_federated::close(void)
     if the original query was not issued against the FEDERATED table.
     So, don't propagate errors from mysql_close().
   */
-  if (table->in_use)
+  if (table->in_use && thd != table->in_use)
     table->in_use->clear_error();
 
+  /*
+    Errors from mysql_close() are silently ignored for flush tables.
+    Close the connection silently.
+  */
+  if (thd && thd->lex->sql_command == SQLCOM_FLUSH)
+     thd->clear_error();
+
   DBUG_RETURN(free_share(share));
 }
 
@@ -2902,7 +2909,7 @@ int ha_federated::info(uint flag)
 
   }
 
-  if (flag & HA_STATUS_AUTO)
+  if ((flag & HA_STATUS_AUTO) && mysql)
     stats.auto_increment_value= mysql->insert_id;
 
   mysql_free_result(result);
index eeb53f96c9fde79b66ba9b3d13056756f43ce5ca..d612c3d851e5b5014eebe8f320094e359d00d27a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2011, 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
@@ -29,6 +29,9 @@ IF(UNIX)
       ADD_DEFINITIONS(-DLINUX_NATIVE_AIO=1)
       LINK_LIBRARIES(aio)
     ENDIF()
+    IF(HAVE_LIBNUMA)
+      LINK_LIBRARIES(numa)
+    ENDIF()
   ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP*")
     ADD_DEFINITIONS("-DUNIV_HPUX")
   ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "AIX")
@@ -145,6 +148,18 @@ IF(NOT CMAKE_CROSSCOMPILING)
   }"
   HAVE_IB_GCC_ATOMIC_THREAD_FENCE
   )
+  CHECK_C_SOURCE_RUNS(
+  "#include<stdint.h>
+  int main()
+  {
+    unsigned char      c;
+
+    __atomic_test_and_set(&c, __ATOMIC_ACQUIRE);
+    __atomic_clear(&c, __ATOMIC_RELEASE);
+    return(0);
+  }"
+  HAVE_IB_GCC_ATOMIC_TEST_AND_SET
+  )
 ENDIF()
 
 IF(HAVE_IB_GCC_ATOMIC_BUILTINS)
@@ -167,6 +182,12 @@ IF(HAVE_IB_GCC_ATOMIC_THREAD_FENCE)
  ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_THREAD_FENCE=1)
 ENDIF()
 
+IF(HAVE_IB_GCC_ATOMIC_TEST_AND_SET)
+IF(NOT WITH_WSREP)
+ ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_TEST_AND_SET=1)
+ENDIF()
+ENDIF()
+
  # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
 IF(NOT CMAKE_CROSSCOMPILING)
   CHECK_C_SOURCE_RUNS(
index 2f5999e9a3a45ff9d6f58ae58b8417ab2e44eb87..07eecdc46d0be9ae2089ccfb87e832a773da9047 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2008, 2014, 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 the Free Software
@@ -245,7 +245,7 @@ ib_open_table_by_id(
                dict_mutex_enter_for_mysql();
        }
 
-       table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL);
+       table = dict_table_open_on_id(table_id, TRUE, DICT_TABLE_OP_NORMAL);
 
        if (table != NULL && table->ibd_file_missing) {
                table = NULL;
@@ -318,35 +318,6 @@ ib_wake_master_thread(void)
         }
 }
 
-/*********************************************************************//**
-Calculate the max row size of the columns in a cluster index.
-@return        max row length */
-UNIV_INLINE
-ulint
-ib_get_max_row_len(
-/*===============*/
-       dict_index_t*   cluster)                /*!< in: cluster index */
-{
-       ulint           i;
-       ulint           max_len = 0;
-       ulint           n_fields = cluster->n_fields;
-
-       /* Add the size of the ordering columns in the
-       clustered index. */
-       for (i = 0; i < n_fields; ++i) {
-               const dict_col_t*       col;
-
-               col = dict_index_get_nth_col(cluster, i);
-
-               /* Use the maximum output size of
-               mach_write_compressed(), although the encoded
-               length should always fit in 2 bytes. */
-               max_len += dict_col_get_max_size(col);
-       }
-
-       return(max_len);
-}
-
 /*****************************************************************//**
 Read the columns from a rec into a tuple. */
 static
@@ -624,6 +595,21 @@ ib_trx_begin(
        return(static_cast<ib_trx_t>(trx));
 }
 
+
+/*****************************************************************//**
+Check if transaction is read_only
+@return transaction read_only status */
+UNIV_INTERN
+ib_u32_t
+ib_trx_read_only(
+/*=============*/
+       ib_trx_t        ib_trx)         /*!< in: trx handle */
+{
+       trx_t*          trx = (trx_t*) ib_trx;
+
+       return(trx->read_only);
+}
+
 /*****************************************************************//**
 Get the transaction's state.
 @return        transaction state */
@@ -710,120 +696,6 @@ ib_trx_rollback(
        return(err);
 }
 
-/*****************************************************************//**
-Find an index definition from the index vector using index name.
-@return        index def. if found else NULL */
-UNIV_INLINE
-const ib_index_def_t*
-ib_table_find_index(
-/*================*/
-       ib_vector_t*    indexes,        /*!< in: vector of indexes */
-       const char*     name)           /*!< in: index name */
-{
-       ulint           i;
-
-       for (i = 0; i < ib_vector_size(indexes); ++i) {
-               const ib_index_def_t*   index_def;
-
-               index_def = (ib_index_def_t*) ib_vector_get(indexes, i);
-
-               if (innobase_strcasecmp(name, index_def->name) == 0) {
-                       return(index_def);
-               }
-       }
-
-       return(NULL);
-}
-
-/*****************************************************************//**
-Get the InnoDB internal precise type from the schema column definition.
-@return        precise type in api format */
-UNIV_INLINE
-ulint
-ib_col_get_prtype(
-/*==============*/
-       const ib_col_t* ib_col)         /*!< in: column definition */
-{
-       ulint           prtype = 0;
-
-       if (ib_col->ib_col_attr & IB_COL_UNSIGNED) {
-               prtype |= DATA_UNSIGNED;
-
-               ut_a(ib_col->ib_col_type == IB_INT);
-       }
-
-       if (ib_col->ib_col_attr & IB_COL_NOT_NULL) {
-               prtype |= DATA_NOT_NULL;
-       }
-
-       return(prtype);
-}
-
-/*****************************************************************//**
-Get the InnoDB internal main type from the schema column definition.
-@return        column main type */
-UNIV_INLINE
-ulint
-ib_col_get_mtype(
-/*==============*/
-       const ib_col_t* ib_col)         /*!< in: column definition */
-{
-       /* Note: The api0api.h types should map directly to
-       the internal numeric codes. */
-       return(ib_col->ib_col_type);
-}
-
-/*****************************************************************//**
-Find a column in the the column vector with the same name.
-@return        col. def. if found else NULL */
-UNIV_INLINE
-const ib_col_t*
-ib_table_find_col(
-/*==============*/
-       const ib_vector_t*      cols,   /*!< in: column list head */
-       const char*     name)           /*!< in: column name to find */
-{
-       ulint           i;
-
-       for (i = 0; i < ib_vector_size(cols); ++i) {
-               const ib_col_t* ib_col;
-
-               ib_col =  static_cast<const ib_col_t*>(
-                       ib_vector_get((ib_vector_t*) cols, i));
-
-               if (innobase_strcasecmp(ib_col->name, name) == 0) {
-                       return(ib_col);
-               }
-       }
-
-       return(NULL);
-}
-
-/*****************************************************************//**
-Find a column in the the column list with the same name.
-@return        col. def. if found else NULL */
-UNIV_INLINE
-const ib_key_col_t*
-ib_index_find_col(
-/*==============*/
-       ib_vector_t*    cols,           /*!< in: column list head */
-       const char*     name)           /*!< in: column name to find */
-{
-       ulint           i;
-
-       for (i = 0; i < ib_vector_size(cols); ++i) {
-               const ib_key_col_t*     ib_col;
-
-               ib_col = static_cast<ib_key_col_t*>(ib_vector_get(cols, i));
-
-               if (innobase_strcasecmp(ib_col->name, name) == 0) {
-                       return(ib_col);
-               }
-       }
-
-       return(NULL);
-}
-
 #ifdef __WIN__
 /*****************************************************************//**
 Convert a string to lower case. */
@@ -946,34 +818,6 @@ ib_table_name_check(
 
 
 
-/*****************************************************************//**
-Get an index definition that is tagged as a clustered index.
-@return        cluster index schema */
-UNIV_INLINE
-ib_index_def_t*
-ib_find_clustered_index(
-/*====================*/
-       ib_vector_t*    indexes)        /*!< in: index defs. to search */
-{
-       ulint           i;
-       ulint           n_indexes;
-
-       n_indexes = ib_vector_size(indexes);
-
-       for (i = 0; i < n_indexes; ++i) {
-               ib_index_def_t* ib_index_def;
-
-               ib_index_def = static_cast<ib_index_def_t*>(
-                       ib_vector_get(indexes, i));
-
-               if (ib_index_def->clustered) {
-                       return(ib_index_def);
-               }
-       }
-
-       return(NULL);
-}
-
 /*****************************************************************//**
 Get a table id. The caller must have acquired the dictionary mutex.
 @return        DB_SUCCESS if found */
@@ -2260,6 +2104,10 @@ ib_cursor_moveto(
 
        n_fields = dict_index_get_n_ordering_defined_by_user(prebuilt->index);
 
+       if (n_fields > dtuple_get_n_fields(tuple->ptr)) {
+               n_fields = dtuple_get_n_fields(tuple->ptr);
+       }
+
        dtuple_set_n_fields(search_tuple, n_fields);
        dtuple_set_n_fields_cmp(search_tuple, n_fields);
 
@@ -3552,41 +3400,6 @@ ib_cursor_set_cluster_access(
        prebuilt->need_to_access_clustered = TRUE;
 }
 
-/*************************************************************//**
-Convert and write an INT column value to an InnoDB tuple.
-@return        DB_SUCCESS or error */
-UNIV_INLINE
-ib_err_t
-ib_tuple_write_int(
-/*===============*/
-       ib_tpl_t        ib_tpl,         /*!< in/out: tuple to write to */
-       ulint           col_no,         /*!< in: column number */
-       const void*     value,          /*!< in: integer value */
-       ulint           value_len)      /*!< in: sizeof value type */
-{
-       const dfield_t* dfield;
-       ulint           data_len;
-       ulint           type_len;
-       ib_tuple_t*     tuple = (ib_tuple_t*) ib_tpl;
-
-       ut_a(col_no < ib_tuple_get_n_cols(ib_tpl));
-
-       dfield = ib_col_get_dfield(tuple, col_no);
-
-       data_len = dfield_get_len(dfield);
-       type_len = dtype_get_len(dfield_get_type(dfield));
-
-       if (dtype_get_mtype(dfield_get_type(dfield)) != DATA_INT
-           || value_len != data_len) {
-
-               return(DB_DATA_MISMATCH);
-       }
-
-       return(ib_col_set_value(
-               ib_tpl, static_cast<ib_ulint_t>(col_no),
-               value, static_cast<ib_ulint_t>(type_len), true));
-}
-
 /*****************************************************************//**
 Write an integer value to a column. Integers are stored in big-endian
 format and will need to be converted from the host format.
@@ -3932,14 +3745,14 @@ ib_table_truncate(
        if (trunc_err == DB_SUCCESS) {
                ut_a(ib_trx_state(ib_trx) == static_cast<ib_trx_state_t>(
                        TRX_STATE_NOT_STARTED));
-
-               err = ib_trx_release(ib_trx);
-               ut_a(err == DB_SUCCESS);
        } else {
                err = ib_trx_rollback(ib_trx);
                ut_a(err == DB_SUCCESS);
        }
 
+       err = ib_trx_release(ib_trx);
+       ut_a(err == DB_SUCCESS);
+
        /* Set the memcached_sync_count back. */
        if (table != NULL && memcached_sync != 0) {
                dict_mutex_enter_for_mysql();
index 79b533481b799e920372b6a9e142e115e45c261f..99bb42466d01677c82c64c3a2696c4244aa31239 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -2101,7 +2101,7 @@ the tuple. It is assumed that mtr contains an x-latch on the tree.
 NOTE that the operation of this function must always succeed,
 we cannot reverse it: therefore enough free disk space must be
 guaranteed to be available before this function is called.
-@return        inserted record */
+@return        inserted record or NULL if run out of space */
 UNIV_INTERN
 rec_t*
 btr_root_raise_and_insert(
@@ -2162,6 +2162,11 @@ btr_root_raise_and_insert(
        level = btr_page_get_level(root, mtr);
 
        new_block = btr_page_alloc(index, 0, FSP_NO_DIR, level, mtr, mtr);
+
+       if (new_block == NULL && os_has_said_disk_full) {
+               return(NULL);
+        }
+
        new_page = buf_block_get_frame(new_block);
        new_page_zip = buf_block_get_page_zip(new_block);
        ut_a(!new_page_zip == !root_page_zip);
@@ -2938,7 +2943,7 @@ function must always succeed, we cannot reverse it: therefore enough
 free disk space (2 pages) must be guaranteed to be available before
 this function is called.
 
-@return inserted record */
+@return inserted record or NULL if run out of space */
 UNIV_INTERN
 rec_t*
 btr_page_split_and_insert(
@@ -3052,9 +3057,18 @@ func_start:
                }
        }
 
+       DBUG_EXECUTE_IF("disk_is_full",
+                       os_has_said_disk_full = true;
+                        return(NULL););
+
        /* 2. Allocate a new page to the index */
        new_block = btr_page_alloc(cursor->index, hint_page_no, direction,
                                   btr_page_get_level(page, mtr), mtr, mtr);
+
+       if (new_block == NULL && os_has_said_disk_full) {
+               return(NULL);
+        }
+
        new_page = buf_block_get_frame(new_block);
        new_page_zip = buf_block_get_page_zip(new_block);
        btr_page_create(new_block, new_page_zip, cursor->index,
index 1611fb6394c6fb4fd842f2c27fdbedda722d2837..eeed866d69161838dcab7c09b3b5c1cf11c95ec7 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 Copyright (c) 2012, Facebook Inc.
 
@@ -1604,6 +1604,10 @@ btr_cur_pessimistic_insert(
                        flags, cursor, offsets, heap, entry, n_ext, mtr);
        }
 
+       if (*rec == NULL && os_has_said_disk_full) {
+               return(DB_OUT_OF_FILE_SPACE);
+       }
+
        ut_ad(page_rec_get_next(btr_cur_get_rec(cursor)) == *rec);
 
        if (!(flags & BTR_NO_LOCKING_FLAG)) {
@@ -2117,6 +2121,7 @@ btr_cur_optimistic_update(
        ulint           max_size;
        ulint           new_rec_size;
        ulint           old_rec_size;
+       ulint           max_ins_size = 0;
        dtuple_t*       new_entry;
        roll_ptr_t      roll_ptr;
        ulint           i;
@@ -2245,6 +2250,10 @@ any_extern:
                : (old_rec_size
                   + page_get_max_insert_size_after_reorganize(page, 1));
 
+       if (!page_zip) {
+               max_ins_size = page_get_max_insert_size_after_reorganize(page, 1);
+       }
+
        if (!(((max_size >= BTR_CUR_PAGE_REORGANIZE_LIMIT)
               && (max_size >= new_rec_size))
              || (page_get_n_recs(page) <= 1))) {
@@ -2304,12 +2313,15 @@ any_extern:
        ut_ad(err == DB_SUCCESS);
 
 func_exit:
-       if (page_zip
-           && !(flags & BTR_KEEP_IBUF_BITMAP)
+       if (!(flags & BTR_KEEP_IBUF_BITMAP)
            && !dict_index_is_clust(index)
            && page_is_leaf(page)) {
-               /* Update the free bits in the insert buffer. */
-               ibuf_update_free_bits_zip(block, mtr);
+
+               if (page_zip) {
+                       ibuf_update_free_bits_zip(block, mtr);
+               } else {
+                       ibuf_update_free_bits_low(block, max_ins_size, mtr);
+               }
        }
 
        return(err);
@@ -2444,6 +2456,7 @@ btr_cur_pessimistic_update(
        ibool           was_first;
        ulint           n_reserved      = 0;
        ulint           n_ext;
+       ulint           max_ins_size    = 0;
 
        *offsets = NULL;
        *big_rec = NULL;
@@ -2622,6 +2635,10 @@ make_external:
                }
        }
 
+       if (!page_zip) {
+               max_ins_size = page_get_max_insert_size_after_reorganize(page, 1);
+       }
+
        /* Store state of explicit locks on rec on the page infimum record,
        before deleting rec. The page infimum acts as a dummy carrier of the
        locks, taking care also of lock releases, before we can move the locks
@@ -2667,13 +2684,18 @@ make_external:
                                rec_offs_make_valid(
                                        page_cursor->rec, index, *offsets);
                        }
-               } else if (page_zip &&
-                          !dict_index_is_clust(index)
+               } else if (!dict_index_is_clust(index)
                           && page_is_leaf(page)) {
+
                        /* Update the free bits in the insert buffer.
                        This is the same block which was skipped by
                        BTR_KEEP_IBUF_BITMAP. */
-                       ibuf_update_free_bits_zip(block, mtr);
+                       if (page_zip) {
+                               ibuf_update_free_bits_zip(block, mtr);
+                       } else {
+                               ibuf_update_free_bits_low(block, max_ins_size,
+                                                         mtr);
+                       }
                }
 
                err = DB_SUCCESS;
@@ -2946,7 +2968,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);
index a676d70a9922e691808bd508e78636ed4633ba76..85e44294e6081d71d70af374e1f922b8e08f6c08 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -53,6 +53,10 @@ Created 11/5/1995 Heikki Tuuri
 #include "page0zip.h"
 #include "srv0mon.h"
 #include "buf0checksum.h"
+#ifdef HAVE_LIBNUMA
+#include <numa.h>
+#include <numaif.h>
+#endif // HAVE_LIBNUMA
 
 /*
                IMPLEMENTATION OF THE BUFFER POOL
@@ -486,6 +490,79 @@ buf_page_is_zeroes(
        return(true);
 }
 
+/** Checks if the page is in crc32 checksum format.
+@param[in]     read_buf        database page
+@param[in]     checksum_field1 new checksum field
+@param[in]     checksum_field2 old checksum field
+@return true if the page is in crc32 checksum format */
+UNIV_INLINE
+bool
+buf_page_is_checksum_valid_crc32(
+       const byte*     read_buf,
+       ulint           checksum_field1,
+       ulint           checksum_field2)
+{
+       ib_uint32_t     crc32 = buf_calc_page_crc32(read_buf);
+
+       return(checksum_field1 == crc32 && checksum_field2 == crc32);
+}
+
+/** Checks if the page is in innodb checksum format.
+@param[in]     read_buf        database page
+@param[in]     checksum_field1 new checksum field
+@param[in]     checksum_field2 old checksum field
+@return true if the page is in innodb checksum format */
+UNIV_INLINE
+bool
+buf_page_is_checksum_valid_innodb(
+       const byte*     read_buf,
+       ulint           checksum_field1,
+       ulint           checksum_field2)
+{
+       /* There are 2 valid formulas for
+       checksum_field2 (old checksum field) which algo=innodb could have
+       written to the page:
+
+       1. Very old versions of InnoDB only stored 8 byte lsn to the
+       start and the end of the page.
+
+       2. Newer InnoDB versions store the old formula checksum
+       (buf_calc_page_old_checksum()). */
+
+       if (checksum_field2 != mach_read_from_4(read_buf + FIL_PAGE_LSN)
+           && checksum_field2 != buf_calc_page_old_checksum(read_buf)) {
+               return(false);
+       }
+
+       /* old field is fine, check the new field */
+
+       /* InnoDB versions < 4.0.14 and < 4.1.1 stored the space id
+       (always equal to 0), to FIL_PAGE_SPACE_OR_CHKSUM */
+
+       if (checksum_field1 != 0
+           && checksum_field1 != buf_calc_page_new_checksum(read_buf)) {
+               return(false);
+       }
+
+       return(true);
+}
+
+/** Checks if the page is in none checksum format.
+@param[in]     read_buf        database page
+@param[in]     checksum_field1 new checksum field
+@param[in]     checksum_field2 old checksum field
+@return true if the page is in none checksum format */
+UNIV_INLINE
+bool
+buf_page_is_checksum_valid_none(
+       const byte*     read_buf,
+       ulint           checksum_field1,
+       ulint           checksum_field2)
+{
+       return(checksum_field1 == checksum_field2
+              && checksum_field1 == BUF_NO_CHECKSUM_MAGIC);
+}
+
 /********************************************************************//**
 Checks if a page is corrupt.
 @return        TRUE if corrupted */
@@ -501,8 +578,6 @@ buf_page_is_corrupted(
 {
        ulint           checksum_field1;
        ulint           checksum_field2;
-       ibool           crc32_inited = FALSE;
-       ib_uint32_t     crc32 = ULINT32_UNDEFINED;
 
        if (!zip_size
            && memcmp(read_buf + FIL_PAGE_LSN + 4,
@@ -582,148 +657,121 @@ buf_page_is_corrupted(
                return(FALSE);
        }
 
-       switch ((srv_checksum_algorithm_t) srv_checksum_algorithm) {
-       case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
-
-               crc32 = buf_calc_page_crc32(read_buf);
-
-               return(checksum_field1 != crc32 || checksum_field2 != crc32);
-
-       case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
-
-               return(checksum_field1
-                      != buf_calc_page_new_checksum(read_buf)
-                      || checksum_field2
-                      != buf_calc_page_old_checksum(read_buf));
-
-       case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
+       DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", return(TRUE); );
 
-               return(checksum_field1 != BUF_NO_CHECKSUM_MAGIC
-                      || checksum_field2 != BUF_NO_CHECKSUM_MAGIC);
+       ulint   page_no = mach_read_from_4(read_buf + FIL_PAGE_OFFSET);
+       ulint   space_id = mach_read_from_4(read_buf + FIL_PAGE_SPACE_ID);
+       const srv_checksum_algorithm_t  curr_algo =
+               static_cast<srv_checksum_algorithm_t>(srv_checksum_algorithm);
 
+       switch (curr_algo) {
        case SRV_CHECKSUM_ALGORITHM_CRC32:
-       case SRV_CHECKSUM_ALGORITHM_INNODB:
-               /* There are 3 valid formulas for
-               checksum_field2 (old checksum field):
-
-               1. Very old versions of InnoDB only stored 8 byte lsn to the
-               start and the end of the page.
-
-               2. InnoDB versions before MySQL 5.6.3 store the old formula
-               checksum (buf_calc_page_old_checksum()).
-
-               3. InnoDB versions 5.6.3 and newer with
-               innodb_checksum_algorithm=strict_crc32|crc32 store CRC32. */
-
-               /* since innodb_checksum_algorithm is not strict_* allow
-               any of the algos to match for the old field */
-
-               if (checksum_field2
-                   != mach_read_from_4(read_buf + FIL_PAGE_LSN)
-                   && checksum_field2 != BUF_NO_CHECKSUM_MAGIC) {
-
-                       /* The checksum does not match any of the
-                       fast to check. First check the selected algorithm
-                       for writing checksums because we assume that the
-                       chance of it matching is higher. */
-
-                       if (srv_checksum_algorithm
-                           == SRV_CHECKSUM_ALGORITHM_CRC32) {
-
-                               crc32 = buf_calc_page_crc32(read_buf);
-                               crc32_inited = TRUE;
-
-                               if (checksum_field2 != crc32
-                                   && checksum_field2
-                                   != buf_calc_page_old_checksum(read_buf)) {
+       case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
 
-                                       return(TRUE);
-                               }
-                       } else {
-                               ut_ad(srv_checksum_algorithm
-                                    == SRV_CHECKSUM_ALGORITHM_INNODB);
+               if (buf_page_is_checksum_valid_crc32(read_buf,
+                       checksum_field1, checksum_field2)) {
+                       return(FALSE);
+               }
 
-                               if (checksum_field2
-                                   != buf_calc_page_old_checksum(read_buf)) {
+               if (buf_page_is_checksum_valid_none(read_buf,
+                       checksum_field1, checksum_field2)) {
+                       if (curr_algo
+                           == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
+                               page_warn_strict_checksum(
+                                       curr_algo,
+                                       SRV_CHECKSUM_ALGORITHM_NONE,
+                                       space_id, page_no);
+                       }
 
-                                       crc32 = buf_calc_page_crc32(read_buf);
-                                       crc32_inited = TRUE;
+                       return(FALSE);
+               }
 
-                                       if (checksum_field2 != crc32) {
-                                               return(TRUE);
-                                       }
-                               }
+               if (buf_page_is_checksum_valid_innodb(read_buf,
+                       checksum_field1, checksum_field2)) {
+                       if (curr_algo
+                           == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
+                               page_warn_strict_checksum(
+                                       curr_algo,
+                                       SRV_CHECKSUM_ALGORITHM_INNODB,
+                                       space_id, page_no);
                        }
-               }
 
-               /* old field is fine, check the new field */
+                       return(FALSE);
+               }
 
-               /* InnoDB versions < 4.0.14 and < 4.1.1 stored the space id
-               (always equal to 0), to FIL_PAGE_SPACE_OR_CHKSUM */
+               return(TRUE);
 
-               if (checksum_field1 != 0
-                   && checksum_field1 != BUF_NO_CHECKSUM_MAGIC) {
+       case SRV_CHECKSUM_ALGORITHM_INNODB:
+       case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
 
-                       /* The checksum does not match any of the
-                       fast to check. First check the selected algorithm
-                       for writing checksums because we assume that the
-                       chance of it matching is higher. */
+               if (buf_page_is_checksum_valid_innodb(read_buf,
+                       checksum_field1, checksum_field2)) {
+                       return(FALSE);
+               }
 
-                       if (srv_checksum_algorithm
-                           == SRV_CHECKSUM_ALGORITHM_CRC32) {
+               if (buf_page_is_checksum_valid_none(read_buf,
+                       checksum_field1, checksum_field2)) {
+                       if (curr_algo
+                           == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
+                               page_warn_strict_checksum(
+                                       curr_algo,
+                                       SRV_CHECKSUM_ALGORITHM_NONE,
+                                       space_id, page_no);
+                       }
 
-                               if (!crc32_inited) {
-                                       crc32 = buf_calc_page_crc32(read_buf);
-                                       crc32_inited = TRUE;
-                               }
+                       return(FALSE);
+               }
 
-                               if (checksum_field1 != crc32
-                                   && checksum_field1
-                                   != buf_calc_page_new_checksum(read_buf)) {
+               if (buf_page_is_checksum_valid_crc32(read_buf,
+                       checksum_field1, checksum_field2)) {
+                       if (curr_algo
+                           == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
+                               page_warn_strict_checksum(
+                                       curr_algo,
+                                       SRV_CHECKSUM_ALGORITHM_CRC32,
+                                       space_id, page_no);
+                       }
 
-                                       return(TRUE);
-                               }
-                       } else {
-                               ut_ad(srv_checksum_algorithm
-                                    == SRV_CHECKSUM_ALGORITHM_INNODB);
+                       return(FALSE);
+               }
 
-                               if (checksum_field1
-                                   != buf_calc_page_new_checksum(read_buf)) {
+               return(TRUE);
 
-                                       if (!crc32_inited) {
-                                               crc32 = buf_calc_page_crc32(
-                                                       read_buf);
-                                               crc32_inited = TRUE;
-                                       }
+       case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
 
-                                       if (checksum_field1 != crc32) {
-                                               return(TRUE);
-                                       }
-                               }
-                       }
+               if (buf_page_is_checksum_valid_none(read_buf,
+                       checksum_field1, checksum_field2)) {
+                       return(FALSE);
                }
 
-               /* If CRC32 is stored in at least one of the fields, then the
-               other field must also be CRC32 */
-               if (crc32_inited
-                   && ((checksum_field1 == crc32
-                        && checksum_field2 != crc32)
-                       || (checksum_field1 != crc32
-                           && checksum_field2 == crc32))) {
+               if (buf_page_is_checksum_valid_crc32(read_buf,
+                       checksum_field1, checksum_field2)) {
+                       page_warn_strict_checksum(
+                               curr_algo,
+                               SRV_CHECKSUM_ALGORITHM_CRC32,
+                               space_id, page_no);
+                       return(FALSE);
+               }
 
-                       return(TRUE);
+               if (buf_page_is_checksum_valid_innodb(read_buf,
+                       checksum_field1, checksum_field2)) {
+                       page_warn_strict_checksum(
+                               curr_algo,
+                               SRV_CHECKSUM_ALGORITHM_INNODB,
+                               space_id, page_no);
+                       return(FALSE);
                }
 
-               break;
+               return(TRUE);
+
        case SRV_CHECKSUM_ALGORITHM_NONE:
                /* should have returned FALSE earlier */
-               ut_error;
+               break;
        /* no default so the compiler will emit a warning if new enum
        is added and not handled here */
        }
 
-       DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", return(TRUE); );
-
+       ut_error;
        return(FALSE);
 }
 
@@ -1068,6 +1116,22 @@ buf_chunk_init(
                return(NULL);
        }
 
+#ifdef HAVE_LIBNUMA
+       if (srv_numa_interleave) {
+               int     st = mbind(chunk->mem, chunk->mem_size,
+                                  MPOL_INTERLEAVE,
+                                  numa_all_nodes_ptr->maskp,
+                                  numa_all_nodes_ptr->size,
+                                  MPOL_MF_MOVE);
+               if (st != 0) {
+                       ib_logf(IB_LOG_LEVEL_WARN,
+                               "Failed to set NUMA memory policy of buffer"
+                               " pool page frames to MPOL_INTERLEAVE"
+                               " (error: %s).", strerror(errno));
+               }
+       }
+#endif // HAVE_LIBNUMA
+
        /* Allocate the block descriptors from
        the start of the memory block. */
        chunk->blocks = (buf_block_t*) chunk->mem;
@@ -1398,6 +1462,21 @@ buf_pool_init(
        ut_ad(n_instances <= MAX_BUFFER_POOLS);
        ut_ad(n_instances == srv_buf_pool_instances);
 
+#ifdef HAVE_LIBNUMA
+       if (srv_numa_interleave) {
+               ib_logf(IB_LOG_LEVEL_INFO,
+                       "Setting NUMA memory policy to MPOL_INTERLEAVE");
+               if (set_mempolicy(MPOL_INTERLEAVE,
+                                 numa_all_nodes_ptr->maskp,
+                                 numa_all_nodes_ptr->size) != 0) {
+                       ib_logf(IB_LOG_LEVEL_WARN,
+                               "Failed to set NUMA memory policy to"
+                               " MPOL_INTERLEAVE (error: %s).",
+                               strerror(errno));
+               }
+       }
+#endif // HAVE_LIBNUMA
+
        buf_pool_ptr = (buf_pool_t*) mem_zalloc(
                n_instances * sizeof *buf_pool_ptr);
 
@@ -1418,6 +1497,18 @@ buf_pool_init(
 
        btr_search_sys_create(buf_pool_get_curr_size() / sizeof(void*) / 64);
 
+#ifdef HAVE_LIBNUMA
+       if (srv_numa_interleave) {
+               ib_logf(IB_LOG_LEVEL_INFO,
+                       "Setting NUMA memory policy to MPOL_DEFAULT");
+               if (set_mempolicy(MPOL_DEFAULT, NULL, 0) != 0) {
+                       ib_logf(IB_LOG_LEVEL_WARN,
+                               "Failed to set NUMA memory policy to"
+                               " MPOL_DEFAULT (error: %s).", strerror(errno));
+               }
+       }
+#endif // HAVE_LIBNUMA
+
        return(DB_SUCCESS);
 }
 
@@ -1673,6 +1764,9 @@ page_found:
                goto page_found;
        }
 
+       /* The maximum number of purge threads should never exceed
+       BUF_POOL_WATCH_SIZE. So there is no way for purge thread
+       instance to hold a watch when setting another watch. */
        for (i = 0; i < BUF_POOL_WATCH_SIZE; i++) {
                bpage = &buf_pool->watch[i];
 
index ec79bbe6be91f31b26ab83dade95e56cf0025e42..5289cd8cef2859a4034f468e03db8c5b3a7cd377 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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 the Free Software
@@ -138,14 +138,17 @@ buf_checksum_algorithm_name(
 {
        switch (algo) {
        case SRV_CHECKSUM_ALGORITHM_CRC32:
-       case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
                return("crc32");
+       case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
+               return("strict_crc32");
        case SRV_CHECKSUM_ALGORITHM_INNODB:
-       case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
                return("innodb");
+       case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
+               return("strict_innodb");
        case SRV_CHECKSUM_ALGORITHM_NONE:
-       case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
                return("none");
+       case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
+               return("strict_none");
        }
 
        ut_error;
index 467f817a2d1a7a8878454fa1d956bcf6536d7a3c..cb67381f0c882fbd3edb2d6ee72be543e46debb1 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2011, 2012, 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 the Free Software
@@ -167,6 +167,25 @@ buf_load_status(
        va_end(ap);
 }
 
+/** Returns the directory path where the buffer pool dump file will be created.
+@return directory path */
+static
+const char*
+get_buf_dump_dir()
+{
+       const char*     dump_dir;
+
+       /* The dump file should be created in the default data directory if
+       innodb_data_home_dir is set as an empty string. */
+       if (strcmp(srv_data_home, "") == 0) {
+               dump_dir = fil_path_to_mysql_datadir;
+       } else {
+               dump_dir = srv_data_home;
+       }
+
+       return(dump_dir);
+}
+
 /*****************************************************************//**
 Perform a buffer pool dump into the file specified by
 innodb_buffer_pool_filename. If any errors occur then the value of
@@ -190,7 +209,7 @@ buf_dump(
        int     ret;
 
        ut_snprintf(full_filename, sizeof(full_filename),
-                   "%s%c%s", srv_data_home, SRV_PATH_SEPARATOR,
+                   "%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR,
                    srv_buf_dump_filename);
 
        ut_snprintf(tmp_filename, sizeof(tmp_filename),
@@ -387,7 +406,7 @@ buf_load()
        buf_load_abort_flag = FALSE;
 
        ut_snprintf(full_filename, sizeof(full_filename),
-                   "%s%c%s", srv_data_home, SRV_PATH_SEPARATOR,
+                   "%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR,
                    srv_buf_dump_filename);
 
        buf_load_status(STATUS_NOTICE,
index f3437c202f6552fce571e035f03ce286b33afa28..540d6383813d2440b735aba15982fcc962b1eef4 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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 the Free Software
@@ -929,11 +929,11 @@ buf_flush_write_block_low(
                break;
        case BUF_BLOCK_ZIP_DIRTY:
                frame = bpage->zip.data;
+               mach_write_to_8(frame + FIL_PAGE_LSN,
+                               bpage->newest_modification);
 
                ut_a(page_zip_verify_checksum(frame, zip_size));
 
-               mach_write_to_8(frame + FIL_PAGE_LSN,
-                               bpage->newest_modification);
                memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);
                break;
        case BUF_BLOCK_FILE_PAGE:
index 80453898a23fa945c3f0c3b8e801b6018994e459..35bf505805e346c8c07846add555430c94705f4d 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -207,14 +207,6 @@ dict_index_remove_from_cache_low(
        dict_index_t*   index,          /*!< in, own: index */
        ibool           lru_evict);     /*!< in: TRUE if page being evicted
                                        to make room in the table LRU list */
-/**********************************************************************//**
-Removes a table object from the dictionary cache. */
-static
-void
-dict_table_remove_from_cache_low(
-/*=============================*/
-       dict_table_t*   table,          /*!< in, own: table */
-       ibool           lru_evict);     /*!< in: TRUE if evicting from LRU */
 #ifdef UNIV_DEBUG
 /**********************************************************************//**
 Validate the dictionary table LRU list.
@@ -644,6 +636,33 @@ dict_table_get_col_name(
 }
 
 #ifndef UNIV_HOTBACKUP
+/** Allocate and init the autoinc latch of a given table.
+This function must not be called concurrently on the same table object.
+@param[in,out] table_void      table whose autoinc latch to create */
+void
+dict_table_autoinc_alloc(
+       void*   table_void)
+{
+       dict_table_t*   table = static_cast<dict_table_t*>(table_void);
+       table->autoinc_mutex = new (std::nothrow) ib_mutex_t();
+       ut_a(table->autoinc_mutex != NULL);
+       mutex_create(autoinc_mutex_key,
+                    table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
+}
+
+/** Allocate and init the zip_pad_mutex of a given index.
+This function must not be called concurrently on the same index object.
+@param[in,out] index_void      index whose zip_pad_mutex to create */
+void
+dict_index_zip_pad_alloc(
+       void*   index_void)
+{
+       dict_index_t*   index = static_cast<dict_index_t*>(index_void);
+       index->zip_pad.mutex = new (std::nothrow) os_fast_mutex_t;
+       ut_a(index->zip_pad.mutex != NULL);
+       os_fast_mutex_init(zip_pad_mutex_key, index->zip_pad.mutex);
+}
+
 /********************************************************************//**
 Acquire the autoinc lock. */
 UNIV_INTERN
@@ -652,7 +671,32 @@ dict_table_autoinc_lock(
 /*====================*/
        dict_table_t*   table)  /*!< in/out: table */
 {
-       mutex_enter(&table->autoinc_mutex);
+#ifdef HAVE_ATOMIC_BUILTINS
+       os_once::do_or_wait_for_done(
+               &table->autoinc_mutex_created,
+               dict_table_autoinc_alloc, table);
+#else /* HAVE_ATOMIC_BUILTINS */
+       ut_ad(table->autoinc_mutex_created == os_once::DONE);
+#endif /* HAVE_ATOMIC_BUILTINS */
+
+       mutex_enter(table->autoinc_mutex);
+}
+
+/** Acquire the zip_pad_mutex latch.
+@param[in,out] index   the index whose zip_pad_mutex to acquire.*/
+void
+dict_index_zip_pad_lock(
+       dict_index_t*   index)
+{
+#ifdef HAVE_ATOMIC_BUILTINS
+       os_once::do_or_wait_for_done(
+               &index->zip_pad.mutex_created,
+               dict_index_zip_pad_alloc, index);
+#else /* HAVE_ATOMIC_BUILTINS */
+       ut_ad(index->zip_pad.mutex_created == os_once::DONE);
+#endif /* HAVE_ATOMIC_BUILTINS */
+
+       os_fast_mutex_lock(index->zip_pad.mutex);
 }
 
 /********************************************************************//**
@@ -664,7 +708,7 @@ dict_table_autoinc_initialize(
        dict_table_t*   table,  /*!< in/out: table */
        ib_uint64_t     value)  /*!< in: next value to assign to a row */
 {
-       ut_ad(mutex_own(&table->autoinc_mutex));
+       ut_ad(dict_table_autoinc_own(table));
 
        table->autoinc = value;
 }
@@ -696,6 +740,45 @@ dict_table_get_all_fts_indexes(
        return(ib_vector_size(indexes));
 }
 
+/** Store autoinc value when the table is evicted.
+@param[in]     table   table evicted */
+UNIV_INTERN
+void
+dict_table_autoinc_store(
+       const dict_table_t*     table)
+{
+       ut_ad(mutex_own(&dict_sys->mutex));
+
+       if (table->autoinc != 0) {
+               ut_ad(dict_sys->autoinc_map->find(table->id)
+                     == dict_sys->autoinc_map->end());
+
+               dict_sys->autoinc_map->insert(
+                       std::pair<table_id_t, ib_uint64_t>(
+                       table->id, table->autoinc));
+       }
+}
+
+/** Restore autoinc value when the table is loaded.
+@param[in]     table   table loaded */
+UNIV_INTERN
+void
+dict_table_autoinc_restore(
+       dict_table_t*   table)
+{
+       ut_ad(mutex_own(&dict_sys->mutex));
+
+       autoinc_map_t::iterator it;
+       it = dict_sys->autoinc_map->find(table->id);
+
+       if (it != dict_sys->autoinc_map->end()) {
+               table->autoinc = it->second;
+               ut_ad(table->autoinc != 0);
+
+               dict_sys->autoinc_map->erase(it);
+       }
+}
+
 /********************************************************************//**
 Reads the next autoinc value (== autoinc counter value), 0 if not yet
 initialized.
@@ -706,7 +789,7 @@ dict_table_autoinc_read(
 /*====================*/
        const dict_table_t*     table)  /*!< in: table */
 {
-       ut_ad(mutex_own(&table->autoinc_mutex));
+       ut_ad(dict_table_autoinc_own(table));
 
        return(table->autoinc);
 }
@@ -722,7 +805,7 @@ dict_table_autoinc_update_if_greater(
        dict_table_t*   table,  /*!< in/out: table */
        ib_uint64_t     value)  /*!< in: value which was assigned to a row */
 {
-       ut_ad(mutex_own(&table->autoinc_mutex));
+       ut_ad(dict_table_autoinc_own(table));
 
        if (value > table->autoinc) {
 
@@ -738,7 +821,7 @@ dict_table_autoinc_unlock(
 /*======================*/
        dict_table_t*   table)  /*!< in/out: table */
 {
-       mutex_exit(&table->autoinc_mutex);
+       mutex_exit(table->autoinc_mutex);
 }
 #endif /* !UNIV_HOTBACKUP */
 
@@ -983,12 +1066,14 @@ dict_init(void)
                       &dict_operation_lock, SYNC_DICT_OPERATION);
 
        if (!srv_read_only_mode) {
-               dict_foreign_err_file = os_file_create_tmpfile();
+               dict_foreign_err_file = os_file_create_tmpfile(NULL);
                ut_a(dict_foreign_err_file);
 
                mutex_create(dict_foreign_err_mutex_key,
                             &dict_foreign_err_mutex, SYNC_NO_ORDER_CHECK);
        }
+
+       dict_sys->autoinc_map = new autoinc_map_t();
 }
 
 /**********************************************************************//**
@@ -1236,6 +1321,8 @@ dict_table_add_to_cache(
                UT_LIST_ADD_FIRST(table_LRU, dict_sys->table_non_LRU, table);
        }
 
+       dict_table_autoinc_restore(table);
+
        ut_ad(dict_lru_validate());
 
        dict_sys->size += mem_heap_get_size(table->heap)
@@ -1503,10 +1590,13 @@ dict_table_rename_in_cache(
                                        to preserve the original table name
                                        in constraints which reference it */
 {
+       dberr_t         err;
        dict_foreign_t* foreign;
        dict_index_t*   index;
        ulint           fold;
        char            old_name[MAX_FULL_NAME_LEN + 1];
+       os_file_type_t  ftype;
+       ibool           exists;
 
        ut_ad(mutex_own(&(dict_sys->mutex)));
 
@@ -1544,8 +1634,6 @@ dict_table_rename_in_cache(
        .ibd file and rebuild the .isl file if needed. */
 
        if (dict_table_is_discarded(table)) {
-               os_file_type_t  type;
-               ibool           exists;
                char*           filepath;
 
                ut_ad(table->space != TRX_SYS_SPACE);
@@ -1564,7 +1652,7 @@ dict_table_rename_in_cache(
                fil_delete_tablespace(table->space, BUF_REMOVE_ALL_NO_WRITE);
 
                /* Delete any temp file hanging around. */
-               if (os_file_status(filepath, &exists, &type)
+               if (os_file_status(filepath, &exists, &ftype)
                    && exists
                    && !os_file_delete_if_exists(innodb_file_temp_key,
                                                 filepath)) {
@@ -1576,46 +1664,56 @@ dict_table_rename_in_cache(
                mem_free(filepath);
 
        } else if (table->space != TRX_SYS_SPACE) {
-               char*   new_path = NULL;
-
-               if (table->dir_path_of_temp_table != NULL) {
+               if (DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY)) {
                        ut_print_timestamp(stderr);
                        fputs("  InnoDB: Error: trying to rename a"
                              " TEMPORARY TABLE ", stderr);
                        ut_print_name(stderr, NULL, TRUE, old_name);
-                       fputs(" (", stderr);
-                       ut_print_filename(stderr,
-                                         table->dir_path_of_temp_table);
-                       fputs(" )\n", stderr);
-                       return(DB_ERROR);
+                       if (table->dir_path_of_temp_table != NULL) {
+                               fputs(" (", stderr);
+                               ut_print_filename(
+                                       stderr, table->dir_path_of_temp_table);
+                               fputs(" )\n", stderr);
+                       }
 
-               } else if (DICT_TF_HAS_DATA_DIR(table->flags)) {
-                       char*           old_path;
+                       return(DB_ERROR);
+               }
 
-                       old_path = fil_space_get_first_path(table->space);
+               char*   new_path = NULL;
+               char*   old_path = fil_space_get_first_path(table->space);
 
+               if (DICT_TF_HAS_DATA_DIR(table->flags)) {
                        new_path = os_file_make_new_pathname(
                                old_path, new_name);
 
-                       mem_free(old_path);
-
-                       dberr_t err = fil_create_link_file(
-                               new_name, new_path);
-
+                       err = fil_create_link_file(new_name, new_path);
                        if (err != DB_SUCCESS) {
                                mem_free(new_path);
+                               mem_free(old_path);
                                return(DB_TABLESPACE_EXISTS);
                        }
+               } else {
+                       new_path = fil_make_ibd_name(new_name, false);
+               }
+
+               /* New filepath must not exist. */
+               err = fil_rename_tablespace_check(
+                       table->space, old_path, new_path, false);
+               if (err != DB_SUCCESS) {
+                       mem_free(old_path);
+                       mem_free(new_path);
+                       return(err);
                }
 
                ibool   success = fil_rename_tablespace(
                        old_name, table->space, new_name, new_path);
 
+               mem_free(old_path);
+               mem_free(new_path);
+
                /* If the tablespace is remote, a new .isl file was created
                If success, delete the old one. If not, delete the new one.  */
-               if (new_path) {
-
-                       mem_free(new_path);
+               if (DICT_TF_HAS_DATA_DIR(table->flags)) {
                        fil_delete_link_file(success ? old_name : new_name);
                }
 
@@ -1923,7 +2021,6 @@ dict_table_change_id_in_cache(
 
 /**********************************************************************//**
 Removes a table object from the dictionary cache. */
-static
 void
 dict_table_remove_from_cache_low(
 /*=============================*/
@@ -1985,6 +2082,10 @@ dict_table_remove_from_cache_low(
 
        ut_ad(dict_lru_validate());
 
+       if (lru_evict) {
+               dict_table_autoinc_store(table);
+       }
+
        if (lru_evict && table->drop_aborted) {
                /* Do as dict_table_try_drop_aborted() does. */
 
@@ -3178,71 +3279,6 @@ dict_table_is_referenced_by_foreign_key(
        return(!table->referenced_set.empty());
 }
 
-/*********************************************************************//**
-Check if the index is referenced by a foreign key, if TRUE return foreign
-else return NULL
-@return pointer to foreign key struct if index is defined for foreign
-key, otherwise NULL */
-UNIV_INTERN
-dict_foreign_t*
-dict_table_get_referenced_constraint(
-/*=================================*/
-       dict_table_t*   table,  /*!< in: InnoDB table */
-       dict_index_t*   index)  /*!< in: InnoDB index */
-{
-       dict_foreign_t* foreign;
-
-       ut_ad(index != NULL);
-       ut_ad(table != NULL);
-
-       for (dict_foreign_set::iterator it = table->referenced_set.begin();
-            it != table->referenced_set.end();
-            ++it) {
-
-               foreign = *it;
-
-               if (foreign->referenced_index == index) {
-
-                       return(foreign);
-               }
-       }
-
-       return(NULL);
-}
-
-/*********************************************************************//**
-Checks if a index is defined for a foreign key constraint. Index is a part
-of a foreign key constraint if the index is referenced by foreign key
-or index is a foreign key index.
-@return pointer to foreign key struct if index is defined for foreign
-key, otherwise NULL */
-UNIV_INTERN
-dict_foreign_t*
-dict_table_get_foreign_constraint(
-/*==============================*/
-       dict_table_t*   table,  /*!< in: InnoDB table */
-       dict_index_t*   index)  /*!< in: InnoDB index */
-{
-       dict_foreign_t* foreign;
-
-       ut_ad(index != NULL);
-       ut_ad(table != NULL);
-
-       for (dict_foreign_set::iterator it = table->foreign_set.begin();
-            it != table->foreign_set.end();
-            ++it) {
-
-               foreign = *it;
-
-               if (foreign->foreign_index == index) {
-
-                       return(foreign);
-               }
-       }
-
-       return(NULL);
-}
-
 /**********************************************************************//**
 Removes a foreign constraint struct from the dictionary cache. */
 UNIV_INTERN
@@ -3347,7 +3383,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
@@ -6340,6 +6398,8 @@ dict_close(void)
                mutex_free(&dict_foreign_err_mutex);
        }
 
+       delete dict_sys->autoinc_map;
+
        mem_free(dict_sys);
        dict_sys = NULL;
 }
@@ -6608,10 +6668,10 @@ dict_index_zip_success(
                return;
        }
 
-       os_fast_mutex_lock(&index->zip_pad.mutex);
+       dict_index_zip_pad_lock(index);
        ++index->zip_pad.success;
        dict_index_zip_pad_update(&index->zip_pad, zip_threshold);
-       os_fast_mutex_unlock(&index->zip_pad.mutex);
+       dict_index_zip_pad_unlock(index);
 }
 
 /*********************************************************************//**
@@ -6631,10 +6691,10 @@ dict_index_zip_failure(
                return;
        }
 
-       os_fast_mutex_lock(&index->zip_pad.mutex);
+       dict_index_zip_pad_lock(index);
        ++index->zip_pad.failure;
        dict_index_zip_pad_update(&index->zip_pad, zip_threshold);
-       os_fast_mutex_unlock(&index->zip_pad.mutex);
+       dict_index_zip_pad_unlock(index);
 }
 
 
@@ -6666,9 +6726,9 @@ dict_index_zip_pad_optimal_page_size(
 #ifdef HAVE_ATOMIC_BUILTINS
        pad = os_atomic_increment_ulint(&index->zip_pad.pad, 0);
 #else /* HAVE_ATOMIC_BUILTINS */
-       os_fast_mutex_lock(&index->zip_pad.mutex);
+       dict_index_zip_pad_lock(index);
        pad = index->zip_pad.pad;
-       os_fast_mutex_unlock(&index->zip_pad.mutex);
+       dict_index_zip_pad_unlock(index);
 #endif /* HAVE_ATOMIC_BUILTINS */
 
        ut_ad(pad < UNIV_PAGE_SIZE);
index 9ef878bd870fabdc36ab8025d467f80f2e024515..846ce302b08e37c44c64cc08885186ea8c9d8d75 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -109,8 +109,7 @@ dict_mem_table_create(
        table->autoinc_lock = static_cast<ib_lock_t*>(
                mem_heap_alloc(heap, lock_get_size()));
 
-       mutex_create(autoinc_mutex_key,
-                    &table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
+       dict_table_autoinc_create_lazy(table);
 
        table->autoinc = 0;
 
@@ -160,7 +159,7 @@ dict_mem_table_free(
                }
        }
 #ifndef UNIV_HOTBACKUP
-       mutex_free(&(table->autoinc_mutex));
+       dict_table_autoinc_destroy(table);
 #endif /* UNIV_HOTBACKUP */
 
        dict_table_stats_latch_destroy(table);
@@ -525,8 +524,7 @@ dict_mem_index_create(
        dict_mem_fill_index_struct(index, heap, table_name, index_name,
                                   space, type, n_fields);
 
-       os_fast_mutex_init(zip_pad_mutex_key, &index->zip_pad.mutex);
-
+       dict_index_zip_pad_mutex_create_lazy(index);
        return(index);
 }
 
@@ -659,7 +657,7 @@ dict_mem_index_free(
        }
 #endif /* UNIV_BLOB_DEBUG */
 
-       os_fast_mutex_free(&index->zip_pad.mutex);
+       dict_index_zip_pad_mutex_destroy(index);
 
        mem_heap_free(index->heap);
 }
index 9cd909686ed42af13c416330583dae78a38e1239..9aa63caa579a81aa43659009e93f224ed87b2b97 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-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 the Free Software
@@ -1434,7 +1434,6 @@ on the leaf page.
 when comparing records
 @param[out]    n_diff                  number of distinct records
 @param[out]    n_external_pages        number of external pages
-@param[in,out] mtr                     mini-transaction
 @return number of distinct records on the leaf page */
 static
 void
@@ -1442,8 +1441,7 @@ dict_stats_analyze_index_below_cur(
        const btr_cur_t*        cur,
        ulint                   n_prefix,
        ib_uint64_t*            n_diff,
-       ib_uint64_t*            n_external_pages,
-       mtr_t*                  mtr)
+       ib_uint64_t*            n_external_pages)
 {
        dict_index_t*   index;
        ulint           space;
@@ -1457,6 +1455,7 @@ dict_stats_analyze_index_below_cur(
        ulint*          offsets2;
        ulint*          offsets_rec;
        ulint           size;
+       mtr_t           mtr;
 
        index = btr_cur_get_index(cur);
 
@@ -1495,12 +1494,14 @@ dict_stats_analyze_index_below_cur(
        function without analyzing any leaf pages */
        *n_external_pages = 0;
 
+       mtr_start(&mtr);
+
        /* descend to the leaf level on the B-tree */
        for (;;) {
 
                block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH,
                                         NULL /* no guessed block */,
-                                        BUF_GET, __FILE__, __LINE__, mtr);
+                                        BUF_GET, __FILE__, __LINE__, &mtr);
 
                page = buf_block_get_frame(block);
 
@@ -1522,6 +1523,8 @@ dict_stats_analyze_index_below_cur(
                ut_a(*n_diff > 0);
 
                if (*n_diff == 1) {
+                       mtr_commit(&mtr);
+
                        /* page has all keys equal and the end of the page
                        was reached by dict_stats_scan_page(), no need to
                        descend to the leaf level */
@@ -1546,7 +1549,7 @@ dict_stats_analyze_index_below_cur(
        }
 
        /* make sure we got a leaf page as a result from the above loop */
-       ut_ad(btr_page_get_level(page, mtr) == 0);
+       ut_ad(btr_page_get_level(page, &mtr) == 0);
 
        /* scan the leaf page and find the number of distinct keys,
        when looking only at the first n_prefix columns; also estimate
@@ -1563,6 +1566,7 @@ dict_stats_analyze_index_below_cur(
                     __func__, page_no, n_diff);
 #endif
 
+       mtr_commit(&mtr);
        mem_heap_free(heap);
 }
 
@@ -1772,8 +1776,7 @@ dict_stats_analyze_index_for_n_prefix(
                dict_stats_analyze_index_below_cur(btr_pcur_get_btr_cur(&pcur),
                                                   n_prefix,
                                                   &n_diff_on_leaf_page,
-                                                  &n_external_pages,
-                                                  mtr);
+                                                  &n_external_pages);
 
                /* We adjust n_diff_on_leaf_page here to avoid counting
                one record twice - once as the last on some page and once
index 9755ef2ee6886670ef4ef915d9bb0de247f71492..77c1353843cee3e3001fc83f30bafd433ddf9b3d 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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 the Free Software
@@ -2990,6 +2990,48 @@ fil_make_isl_name(
        return(filename);
 }
 
+/** Test if a tablespace file can be renamed to a new filepath by checking
+if that the old filepath exists and the new filepath does not exist.
+@param[in]     space_id        tablespace id
+@param[in]     old_path        old filepath
+@param[in]     new_path        new filepath
+@param[in]     is_discarded    whether the tablespace is discarded
+@return innodb error code */
+dberr_t
+fil_rename_tablespace_check(
+       ulint           space_id,
+       const char*     old_path,
+       const char*     new_path,
+       bool            is_discarded)
+{
+       ulint   exists = false;
+       os_file_type_t  ftype;
+
+       if (!is_discarded
+           && os_file_status(old_path, &exists, &ftype)
+           && !exists) {
+               ib_logf(IB_LOG_LEVEL_ERROR,
+                       "Cannot rename '%s' to '%s' for space ID %lu"
+                       " because the source file does not exist.",
+                       old_path, new_path, space_id);
+
+               return(DB_TABLESPACE_NOT_FOUND);
+       }
+
+       exists = false;
+       if (!os_file_status(new_path, &exists, &ftype) || exists) {
+               ib_logf(IB_LOG_LEVEL_ERROR,
+                       "Cannot rename '%s' to '%s' for space ID %lu"
+                       " because the target file exists."
+                       " Remove the target file and try again.",
+                       old_path, new_path, space_id);
+
+               return(DB_TABLESPACE_EXISTS);
+       }
+
+       return(DB_SUCCESS);
+}
+
 /*******************************************************************//**
 Renames a single-table tablespace. The tablespace must be cached in the
 tablespace memory cache.
@@ -3174,8 +3216,6 @@ fil_create_link_file(
        const char*     tablename,      /*!< in: tablename */
        const char*     filepath)       /*!< in: pathname of tablespace */
 {
-       os_file_t       file;
-       ibool           success;
        dberr_t         err = DB_SUCCESS;
        char*           link_filepath;
        char*           prev_filepath = fil_read_link_file(tablename);
@@ -3194,13 +3234,24 @@ fil_create_link_file(
 
        link_filepath = fil_make_isl_name(tablename);
 
-       file = os_file_create_simple_no_error_handling(
-               innodb_file_data_key, link_filepath,
-               OS_FILE_CREATE, OS_FILE_READ_WRITE, &success);
+       /** Check if the file already exists. */
+       FILE*                   file = NULL;
+       ibool                   exists;
+       os_file_type_t          ftype;
 
-       if (!success) {
-               /* The following call will print an error message */
-               ulint   error = os_file_get_last_error(true);
+       bool success = os_file_status(link_filepath, &exists, &ftype);
+
+       ulint error = 0;
+       if (success && !exists) {
+               file = fopen(link_filepath, "w");
+               if (file == NULL) {
+                       /* This call will print its own error message */
+                       error = os_file_get_last_error(true);
+               }
+       } else {
+               error = OS_FILE_ALREADY_EXISTS;
+       }
+       if (error != 0) {
 
                ut_print_timestamp(stderr);
                fputs("  InnoDB: Cannot create file ", stderr);
@@ -3225,13 +3276,17 @@ fil_create_link_file(
                return(err);
        }
 
-       if (!os_file_write(link_filepath, file, filepath, 0,
-                           strlen(filepath))) {
+       ulint rbytes = fwrite(filepath, 1, strlen(filepath), file);
+       if (rbytes != strlen(filepath)) {
+               os_file_get_last_error(true);
+               ib_logf(IB_LOG_LEVEL_ERROR,
+                       "cannot write link file "
+                        "%s",filepath);
                err = DB_ERROR;
        }
 
        /* Close the file, we only need it at startup */
-       os_file_close(file);
+       fclose(file);
 
        mem_free(link_filepath);
 
@@ -5575,9 +5630,10 @@ fil_io(
 
        space = fil_space_get_by_id(space_id);
 
-       /* If we are deleting a tablespace we don't allow any read
-       operations on that. However, we do allow write operations. */
-       if (space == 0 || (type == OS_FILE_READ && space->stop_new_ops)) {
+       /* If we are deleting a tablespace we don't allow async read operations
+       on that. However, we do allow write and sync read operations */
+       if (space == 0
+           || (type == OS_FILE_READ && !sync && space->stop_new_ops)) {
                mutex_exit(&fil_system->mutex);
 
                ib_logf(IB_LOG_LEVEL_ERROR,
@@ -6519,29 +6575,108 @@ fil_get_space_names(
        return(err);
 }
 
-/****************************************************************//**
-Generate redo logs for swapping two .ibd files */
+/** Generate redo log for swapping two .ibd files
+@param[in]     old_table       old table
+@param[in]     new_table       new table
+@param[in]     tmp_name        temporary table name
+@param[in,out] mtr             mini-transaction
+@return innodb error code */
 UNIV_INTERN
-void
+dberr_t
 fil_mtr_rename_log(
-/*===============*/
-       ulint           old_space_id,   /*!< in: tablespace id of the old
-                                       table. */
-       const char*     old_name,       /*!< in: old table name */
-       ulint           new_space_id,   /*!< in: tablespace id of the new
-                                       table */
-       const char*     new_name,       /*!< in: new table name */
-       const char*     tmp_name,       /*!< in: temp table name used while
-                                       swapping */
-       mtr_t*          mtr)            /*!< in/out: mini-transaction */
+       const dict_table_t*     old_table,
+       const dict_table_t*     new_table,
+       const char*             tmp_name,
+       mtr_t*                  mtr)
 {
-       if (old_space_id != TRX_SYS_SPACE) {
-               fil_op_write_log(MLOG_FILE_RENAME, old_space_id,
-                                0, 0, old_name, tmp_name, mtr);
+       dberr_t err = DB_SUCCESS;
+       char*   old_path;
+
+       /* If neither table is file-per-table,
+       there will be no renaming of files. */
+       if (old_table->space == TRX_SYS_SPACE
+           && new_table->space == TRX_SYS_SPACE) {
+               return(DB_SUCCESS);
        }
 
-       if (new_space_id != TRX_SYS_SPACE) {
-               fil_op_write_log(MLOG_FILE_RENAME, new_space_id,
-                                0, 0, new_name, old_name, mtr);
+       if (DICT_TF_HAS_DATA_DIR(old_table->flags)) {
+               old_path = os_file_make_remote_pathname(
+                       old_table->data_dir_path, old_table->name, "ibd");
+       } else {
+               old_path = fil_make_ibd_name(old_table->name, false);
+       }
+       if (old_path == NULL) {
+               return(DB_OUT_OF_MEMORY);
+       }
+
+       if (old_table->space != TRX_SYS_SPACE) {
+               char*   tmp_path;
+
+               if (DICT_TF_HAS_DATA_DIR(old_table->flags)) {
+                       tmp_path = os_file_make_remote_pathname(
+                               old_table->data_dir_path, tmp_name, "ibd");
+               }
+               else {
+                       tmp_path = fil_make_ibd_name(tmp_name, false);
+               }
+
+               if (tmp_path == NULL) {
+                       mem_free(old_path);
+                       return(DB_OUT_OF_MEMORY);
+               }
+
+               /* Temp filepath must not exist. */
+               err = fil_rename_tablespace_check(
+                       old_table->space, old_path, tmp_path,
+                       dict_table_is_discarded(old_table));
+               mem_free(tmp_path);
+               if (err != DB_SUCCESS) {
+                       mem_free(old_path);
+                       return(err);
+               }
+
+               fil_op_write_log(MLOG_FILE_RENAME, old_table->space,
+                                0, 0, old_table->name, tmp_name, mtr);
        }
+
+       if (new_table->space != TRX_SYS_SPACE) {
+
+               /* Destination filepath must not exist unless this ALTER
+               TABLE starts and ends with a file_per-table tablespace. */
+               if (old_table->space == TRX_SYS_SPACE) {
+                       char*   new_path = NULL;
+
+                       if (DICT_TF_HAS_DATA_DIR(new_table->flags)) {
+                               new_path = os_file_make_remote_pathname(
+                                       new_table->data_dir_path,
+                                       new_table->name, "ibd");
+                       }
+                       else {
+                               new_path = fil_make_ibd_name(
+                                       new_table->name, false);
+                       }
+
+                       if (new_path == NULL) {
+                               mem_free(old_path);
+                               return(DB_OUT_OF_MEMORY);
+                       }
+
+                       err = fil_rename_tablespace_check(
+                               new_table->space, new_path, old_path,
+                               dict_table_is_discarded(new_table));
+                       mem_free(new_path);
+                       if (err != DB_SUCCESS) {
+                               mem_free(old_path);
+                               return(err);
+                       }
+               }
+
+               fil_op_write_log(MLOG_FILE_RENAME, new_table->space,
+                                0, 0, new_table->name, old_table->name, mtr);
+
+       }
+
+       mem_free(old_path);
+
+       return(err);
 }
index d1bb22ed7a942c2098fa4ea6792f459542c8df63..0f8d6bcc4f065fed12e3a0a04fea26d38bc79999 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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 the Free Software
@@ -300,44 +300,6 @@ xdes_find_bit(
        return(ULINT_UNDEFINED);
 }
 
-/**********************************************************************//**
-Looks for a descriptor bit having the desired value. Scans the extent in
-a direction opposite to xdes_find_bit.
-@return        bit index of the bit, ULINT_UNDEFINED if not found */
-UNIV_INLINE
-ulint
-xdes_find_bit_downward(
-/*===================*/
-       xdes_t* descr,  /*!< in: descriptor */
-       ulint   bit,    /*!< in: XDES_FREE_BIT or XDES_CLEAN_BIT */
-       ibool   val,    /*!< in: desired bit value */
-       ulint   hint,   /*!< in: hint of which bit position would
-                       be desirable */
-       mtr_t*  mtr)    /*!< in/out: mini-transaction */
-{
-       ulint   i;
-
-       ut_ad(descr && mtr);
-       ut_ad(val <= TRUE);
-       ut_ad(hint < FSP_EXTENT_SIZE);
-       ut_ad(mtr_memo_contains_page(mtr, descr, MTR_MEMO_PAGE_X_FIX));
-       for (i = hint + 1; i > 0; i--) {
-               if (val == xdes_mtr_get_bit(descr, bit, i - 1, mtr)) {
-
-                       return(i - 1);
-               }
-       }
-
-       for (i = FSP_EXTENT_SIZE - 1; i > hint; i--) {
-               if (val == xdes_mtr_get_bit(descr, bit, i, mtr)) {
-
-                       return(i);
-               }
-       }
-
-       return(ULINT_UNDEFINED);
-}
-
 /**********************************************************************//**
 Returns the number of used pages in a descriptor.
 @return        number of pages used */
@@ -990,10 +952,20 @@ fsp_try_extend_data_file(
                }
        } else {
                /* We extend single-table tablespaces first one extent
-               at a time, but for bigger tablespaces more. It is not
-               enough to extend always by one extent, because some
-               extents are frag page extents. */
+               at a time, but 4 at a time for bigger tablespaces. It is
+               not enough to extend always by one extent, because we need
+               to add at least one extent to FSP_FREE.
+               A single extent descriptor page will track many extents.
+               And the extent that uses its extent descriptor page is
+               put onto the FSP_FREE_FRAG list. Extents that do not
+               use their extent descriptor page are added to FSP_FREE.
+               The physical page size is used to determine how many
+               extents are tracked on one extent descriptor page. */
                ulint   extent_size;    /*!< one megabyte, in pages */
+               ulint   threshold;      /*!< The size of the tablespace
+                                       (in number of pages) where we
+                                       start allocating more than one
+                                       extent at a time. */
 
                if (!zip_size) {
                        extent_size = FSP_EXTENT_SIZE;
@@ -1002,6 +974,14 @@ fsp_try_extend_data_file(
                                * UNIV_PAGE_SIZE / zip_size;
                }
 
+               /* Threshold is set at 32mb except when the page
+               size is small enough that it must be done sooner.
+               For page size less than 4k, we may reach the
+               extent contains extent descriptor page before
+               32 mb. */
+               threshold = ut_min((32 * extent_size),
+                                  (zip_size ? zip_size : UNIV_PAGE_SIZE));
+
                if (size < extent_size) {
                        /* Let us first extend the file to extent_size */
                        success = fsp_try_extend_data_file_with_pages(
@@ -1018,7 +998,7 @@ fsp_try_extend_data_file(
                        size = extent_size;
                }
 
-               if (size < 32 * extent_size) {
+               if (size < threshold) {
                        size_increase = extent_size;
                } else {
                        /* Below in fsp_fill_free_list() we assume
index ef940ca78aa762cf95d5b1aab2330e207111933a..25047b38b9de09b5bc124bc43789afab22846d5a 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2011, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 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 the Free Software
@@ -81,11 +81,13 @@ ulint n_nodes = 0;
 /** Error condition reported by fts_utf8_decode() */
 const ulint UTF8_ERROR = 0xFFFFFFFF;
 
+#ifdef FTS_CACHE_SIZE_DEBUG
 /** The cache size permissible lower limit (1K) */
 static const ulint FTS_CACHE_SIZE_LOWER_LIMIT_IN_MB = 1;
 
 /** The cache size permissible upper limit (1G) */
 static const ulint FTS_CACHE_SIZE_UPPER_LIMIT_IN_MB = 1024;
+#endif /* FTS_CACHE_SIZE_DEBUG */
 
 /** Time to sleep after DEADLOCK error before retrying operation. */
 static const ulint FTS_DEADLOCK_RETRY_WAIT = 100000;
@@ -191,7 +193,7 @@ static const char* fts_create_common_tables_sql = {
        ""
        "CREATE TABLE \"%s_CONFIG\" (\n"
        "  key CHAR(50),\n"
-       "  value CHAR(50) NOT NULL\n"
+       "  value CHAR(200) NOT NULL\n"
        ") COMPACT;\n"
        "CREATE UNIQUE CLUSTERED INDEX IND ON \"%s_CONFIG\"(key);\n"
 };
@@ -258,16 +260,18 @@ static const char* fts_config_table_insert_values_sql =
        "INSERT INTO \"%s\" VALUES ('"
                FTS_TABLE_STATE "', '0');\n";
 
-/****************************************************************//**
-Run SYNC on the table, i.e., write out data from the cache to the
+/** Run SYNC on the table, i.e., write out data from the cache to the
 FTS auxiliary INDEX table and clear the cache at the end.
-@return DB_SUCCESS if all OK  */
+@param[in,out] sync            sync state
+@param[in]     unlock_cache    whether unlock cache lock when write node
+@param[in]     wait            whether wait when a sync is in progress
+@return DB_SUCCESS if all OK */
 static
 dberr_t
 fts_sync(
-/*=====*/
-       fts_sync_t*     sync)           /*!< in: sync state */
-       __attribute__((nonnull));
+       fts_sync_t*     sync,
+       bool            unlock_cache,
+       bool            wait);
 
 /****************************************************************//**
 Release all resources help by the words rb tree e.g., the node ilist. */
@@ -329,27 +333,6 @@ fts_update_sync_doc_id(
        doc_id_t                doc_id,         /*!< in: last document id */
        trx_t*                  trx)            /*!< in: update trx, or NULL */
        __attribute__((nonnull(1)));
-/********************************************************************
-Check if we should stop. */
-UNIV_INLINE
-ibool
-fts_is_stop_signalled(
-/*==================*/
-       fts_t*          fts)                    /*!< in: fts instance */
-{
-       ibool           stop_signalled = FALSE;
-
-       mutex_enter(&fts->bg_threads_mutex);
-
-       if (fts->fts_status & BG_THREAD_STOP) {
-
-               stop_signalled = TRUE;
-       }
-
-       mutex_exit(&fts->bg_threads_mutex);
-
-       return(stop_signalled);
-}
 
 /****************************************************************//**
 This function loads the default InnoDB stopword list */
@@ -672,6 +655,7 @@ fts_cache_create(
                mem_heap_zalloc(heap, sizeof(fts_sync_t)));
 
        cache->sync->table = table;
+       cache->sync->event = os_event_create();
 
        /* Create the index cache vector that will hold the inverted indexes. */
        cache->indexes = ib_vector_create(
@@ -1226,6 +1210,7 @@ fts_cache_destroy(
        mutex_free(&cache->optimize_lock);
        mutex_free(&cache->deleted_lock);
        mutex_free(&cache->doc_id_lock);
+       os_event_free(cache->sync->event);
 
        if (cache->stopword_info.cached_stopword) {
                rbt_free(cache->stopword_info.cached_stopword);
@@ -1454,7 +1439,7 @@ fts_cache_add_doc(
                                ib_vector_last(word->nodes));
                }
 
-               if (fts_node == NULL
+               if (fts_node == NULL || fts_node->synced
                    || fts_node->ilist_size > FTS_ILIST_MAX_SIZE
                    || doc_id < fts_node->last_doc_id) {
 
@@ -2905,35 +2890,28 @@ fts_doc_ids_free(
 }
 
 /*********************************************************************//**
-Do commit-phase steps necessary for the insertion of a new row.
-@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
-dberr_t
+Do commit-phase steps necessary for the insertion of a new row. */
+void
 fts_add(
 /*====*/
        fts_trx_table_t*ftt,                    /*!< in: FTS trx table */
        fts_trx_row_t*  row)                    /*!< in: row */
 {
        dict_table_t*   table = ftt->table;
-       dberr_t         error = DB_SUCCESS;
        doc_id_t        doc_id = row->doc_id;
 
        ut_a(row->state == FTS_INSERT || row->state == FTS_MODIFY);
 
        fts_add_doc_by_id(ftt, doc_id, row->fts_indexes);
 
-       if (error == DB_SUCCESS) {
-               mutex_enter(&table->fts->cache->deleted_lock);
-               ++table->fts->cache->added;
-               mutex_exit(&table->fts->cache->deleted_lock);
+       mutex_enter(&table->fts->cache->deleted_lock);
+       ++table->fts->cache->added;
+       mutex_exit(&table->fts->cache->deleted_lock);
 
-               if (!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID)
-                   && doc_id >= table->fts->cache->next_doc_id) {
-                       table->fts->cache->next_doc_id = doc_id + 1;
-               }
+       if (!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID)
+           && doc_id >= table->fts->cache->next_doc_id) {
+               table->fts->cache->next_doc_id = doc_id + 1;
        }
-
-       return(error);
 }
 
 /*********************************************************************//**
@@ -3044,7 +3022,7 @@ fts_modify(
        error = fts_delete(ftt, row);
 
        if (error == DB_SUCCESS) {
-               error = fts_add(ftt, row);
+               fts_add(ftt, row);
        }
 
        return(error);
@@ -3133,7 +3111,7 @@ fts_commit_table(
 
                switch (row->state) {
                case FTS_INSERT:
-                       error = fts_add(ftt, row);
+                       fts_add(ftt, row);
                        break;
 
                case FTS_MODIFY:
@@ -3408,7 +3386,7 @@ fts_fetch_doc_from_rec(
                doc->charset = get_doc->index_cache->charset;
 
                /* Null Field */
-               if (doc->text.f_len == UNIV_SQL_NULL) {
+               if (doc->text.f_len == UNIV_SQL_NULL || doc->text.f_len == 0) {
                        continue;
                }
 
@@ -3572,16 +3550,34 @@ fts_add_doc_by_id(
                                        get_doc->index_cache,
                                        doc_id, doc.tokens);
 
+                               bool    need_sync = false;
+                               if ((cache->total_size > fts_max_cache_size / 10
+                                    || fts_need_sync)
+                                   && !cache->sync->in_progress) {
+                                       need_sync = true;
+                               }
+
                                rw_lock_x_unlock(&table->fts->cache->lock);
 
                                DBUG_EXECUTE_IF(
                                        "fts_instrument_sync",
-                                       fts_sync(cache->sync);
+                                       fts_optimize_request_sync_table(table);
+                                       os_event_wait(cache->sync->event);
+                               );
+
+                               DBUG_EXECUTE_IF(
+                                       "fts_instrument_sync_debug",
+                                       fts_sync(cache->sync, true, true);
+                               );
+
+                               DEBUG_SYNC_C("fts_instrument_sync_request");
+                               DBUG_EXECUTE_IF(
+                                       "fts_instrument_sync_request",
+                                       fts_optimize_request_sync_table(table);
                                );
 
-                               if (cache->total_size > fts_max_cache_size
-                                   || fts_need_sync) {
-                                       fts_sync(cache->sync);
+                               if (need_sync) {
+                                       fts_optimize_request_sync_table(table);
                                }
 
                                mtr_start(&mtr);
@@ -3952,16 +3948,17 @@ fts_sync_add_deleted_cache(
        return(error);
 }
 
-/*********************************************************************//**
-Write the words and ilist to disk.
+/** Write the words and ilist to disk.
+@param[in,out] trx             transaction
+@param[in]     index_cache     index cache
+@param[in]     unlock_cache    whether unlock cache when write node
 @return DB_SUCCESS if all went well else error code */
 static __attribute__((nonnull, warn_unused_result))
 dberr_t
 fts_sync_write_words(
-/*=================*/
-       trx_t*          trx,                    /*!< in: transaction */
-       fts_index_cache_t*
-                       index_cache)            /*!< in: index cache */
+       trx_t*                  trx,
+       fts_index_cache_t*      index_cache,
+       bool                    unlock_cache)
 {
        fts_table_t     fts_table;
        ulint           n_nodes = 0;
@@ -3969,8 +3966,8 @@ fts_sync_write_words(
        const ib_rbt_node_t* rbt_node;
        dberr_t         error = DB_SUCCESS;
        ibool           print_error = FALSE;
-#ifdef FTS_DOC_STATS_DEBUG
        dict_table_t*   table = index_cache->index->table;
+#ifdef FTS_DOC_STATS_DEBUG
        ulint           n_new_words = 0;
 #endif /* FTS_DOC_STATS_DEBUG */
 
@@ -3983,7 +3980,7 @@ fts_sync_write_words(
        since we want to free the memory used during caching. */
        for (rbt_node = rbt_first(index_cache->words);
             rbt_node;
-            rbt_node = rbt_first(index_cache->words)) {
+            rbt_node = rbt_next(index_cache->words, rbt_node)) {
 
                ulint                   i;
                ulint                   selected;
@@ -4016,27 +4013,47 @@ fts_sync_write_words(
                }
 #endif /* FTS_DOC_STATS_DEBUG */
 
-               n_nodes += ib_vector_size(word->nodes);
-
-               /* We iterate over all the nodes even if there was an error,
-               this is to free the memory of the fts_node_t elements. */
+               /* We iterate over all the nodes even if there was an error */
                for (i = 0; i < ib_vector_size(word->nodes); ++i) {
 
                        fts_node_t* fts_node = static_cast<fts_node_t*>(
                                ib_vector_get(word->nodes, i));
 
+                       if (fts_node->synced) {
+                               continue;
+                       } else {
+                               fts_node->synced = true;
+                       }
+
+                       /*FIXME: we need to handle the error properly. */
                        if (error == DB_SUCCESS) {
+                               if (unlock_cache) {
+                                       rw_lock_x_unlock(
+                                               &table->fts->cache->lock);
+                               }
 
                                error = fts_write_node(
                                        trx,
                                        &index_cache->ins_graph[selected],
                                        &fts_table, &word->text, fts_node);
-                       }
 
-                       ut_free(fts_node->ilist);
-                       fts_node->ilist = NULL;
+                               DEBUG_SYNC_C("fts_write_node");
+                               DBUG_EXECUTE_IF("fts_write_node_crash",
+                                       DBUG_SUICIDE(););
+
+                               DBUG_EXECUTE_IF("fts_instrument_sync_sleep",
+                                       os_thread_sleep(1000000);
+                               );
+
+                               if (unlock_cache) {
+                                       rw_lock_x_lock(
+                                               &table->fts->cache->lock);
+                               }
+                       }
                }
 
+               n_nodes += ib_vector_size(word->nodes);
+
                if (error != DB_SUCCESS && !print_error) {
                        ut_print_timestamp(stderr);
                        fprintf(stderr, "  InnoDB: Error (%s) writing "
@@ -4045,9 +4062,6 @@ fts_sync_write_words(
 
                        print_error = TRUE;
                }
-
-               /* NOTE: We are responsible for free'ing the node */
-               ut_free(rbt_remove_node(index_cache->words, rbt_node));
        }
 
 #ifdef FTS_DOC_STATS_DEBUG
@@ -4348,7 +4362,7 @@ fts_sync_index(
 
        ut_ad(rbt_validate(index_cache->words));
 
-       error = fts_sync_write_words(trx, index_cache);
+       error = fts_sync_write_words(sync->trx, index_cache, sync->unlock_cache);
 
 #ifdef FTS_DOC_STATS_DEBUG
        /* FTS_RESOLVE: the word counter info in auxiliary table "DOC_ID"
@@ -4364,6 +4378,36 @@ fts_sync_index(
        return(error);
 }
 
+/** Check if index cache has been synced completely
+@param[in,out] sync            sync state
+@param[in,out] index_cache     index cache
+@return true if index is synced, otherwise false. */
+static
+bool
+fts_sync_index_check(
+       fts_sync_t*             sync,
+       fts_index_cache_t*      index_cache)
+{
+       const ib_rbt_node_t*    rbt_node;
+
+       for (rbt_node = rbt_first(index_cache->words);
+            rbt_node != NULL;
+            rbt_node = rbt_next(index_cache->words, rbt_node)) {
+
+               fts_tokenizer_word_t*   word;
+               word = rbt_value(fts_tokenizer_word_t, rbt_node);
+
+               fts_node_t*     fts_node;
+               fts_node = static_cast<fts_node_t*>(ib_vector_last(word->nodes));
+
+               if (!fts_node->synced) {
+                       return(false);
+               }
+       }
+
+       return(true);
+}
+
 /*********************************************************************//**
 Commit the SYNC, change state of processed doc ids etc.
 @return DB_SUCCESS if all OK */
@@ -4440,21 +4484,53 @@ fts_sync_rollback(
        trx_t*          trx = sync->trx;
        fts_cache_t*    cache = sync->table->fts->cache;
 
+       for (ulint i = 0; i < ib_vector_size(cache->indexes); ++i) {
+               ulint                   j;
+               fts_index_cache_t*      index_cache;
+
+               index_cache = static_cast<fts_index_cache_t*>(
+                       ib_vector_get(cache->indexes, i));
+
+               for (j = 0; fts_index_selector[j].value; ++j) {
+
+                       if (index_cache->ins_graph[j] != NULL) {
+
+                               fts_que_graph_free_check_lock(
+                                       NULL, index_cache,
+                                       index_cache->ins_graph[j]);
+
+                               index_cache->ins_graph[j] = NULL;
+                       }
+
+                       if (index_cache->sel_graph[j] != NULL) {
+
+                               fts_que_graph_free_check_lock(
+                                       NULL, index_cache,
+                                       index_cache->sel_graph[j]);
+
+                               index_cache->sel_graph[j] = NULL;
+                       }
+               }
+       }
+
        rw_lock_x_unlock(&cache->lock);
 
        fts_sql_rollback(trx);
        trx_free_for_background(trx);
 }
 
-/****************************************************************//**
-Run SYNC on the table, i.e., write out data from the cache to the
+/** Run SYNC on the table, i.e., write out data from the cache to the
 FTS auxiliary INDEX table and clear the cache at the end.
+@param[in,out] sync            sync state
+@param[in]     unlock_cache    whether unlock cache lock when write node
+@param[in]     wait            whether wait when a sync is in progress
 @return DB_SUCCESS if all OK */
 static
 dberr_t
 fts_sync(
-/*=====*/
-       fts_sync_t*     sync)           /*!< in: sync state */
+       fts_sync_t*     sync,
+       bool            unlock_cache,
+       bool            wait)
 {
        ulint           i;
        dberr_t         error = DB_SUCCESS;
@@ -4462,8 +4538,35 @@ fts_sync(
 
        rw_lock_x_lock(&cache->lock);
 
+       /* Check if cache is being synced.
+       Note: we release cache lock in fts_sync_write_words() to
+       avoid long wait for the lock by other threads. */
+       while (sync->in_progress) {
+               rw_lock_x_unlock(&cache->lock);
+
+               if (wait) {
+                       os_event_wait(sync->event);
+               } else {
+                       return(DB_SUCCESS);
+               }
+
+               rw_lock_x_lock(&cache->lock);
+       }
+
+       sync->unlock_cache = unlock_cache;
+       sync->in_progress = true;
+
+       DEBUG_SYNC_C("fts_sync_begin");
        fts_sync_begin(sync);
 
+begin_sync:
+       if (cache->total_size > fts_max_cache_size) {
+               /* Avoid the case: sync never finish when
+               insert/update keeps comming. */
+               ut_ad(sync->unlock_cache);
+               sync->unlock_cache = false;
+       }
+
        for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
                fts_index_cache_t*      index_cache;
 
@@ -4478,21 +4581,43 @@ fts_sync(
 
                if (error != DB_SUCCESS && !sync->interrupted) {
 
-                       break;
+                       goto end_sync;
                }
        }
 
        DBUG_EXECUTE_IF("fts_instrument_sync_interrupted",
                        sync->interrupted = true;
                        error = DB_INTERRUPTED;
+                       goto end_sync;
        );
 
+       /* Make sure all the caches are synced. */
+       for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
+               fts_index_cache_t*      index_cache;
+
+               index_cache = static_cast<fts_index_cache_t*>(
+                       ib_vector_get(cache->indexes, i));
+
+               if (index_cache->index->to_be_dropped
+                   || fts_sync_index_check(sync, index_cache)) {
+                       continue;
+               }
+
+               goto begin_sync;
+       }
+
+end_sync:
        if (error == DB_SUCCESS && !sync->interrupted) {
                error = fts_sync_commit(sync);
        }  else {
                fts_sync_rollback(sync);
        }
 
+       rw_lock_x_lock(&cache->lock);
+       sync->in_progress = false;
+       os_event_set(sync->event);
+       rw_lock_x_unlock(&cache->lock);
+
        /* We need to check whether an optimize is required, for that
        we make copies of the two variables that control the trigger. These
        variables can change behind our back and we don't want to hold the
@@ -4507,21 +4632,25 @@ fts_sync(
        return(error);
 }
 
-/****************************************************************//**
-Run SYNC on the table, i.e., write out data from the cache to the
-FTS auxiliary INDEX table and clear the cache at the end. */
+/** Run SYNC on the table, i.e., write out data from the cache to the
+FTS auxiliary INDEX table and clear the cache at the end.
+@param[in,out] table           fts table
+@param[in]     unlock_cache    whether unlock cache when write node
+@param[in]     wait            whether wait for existing sync to finish
+@return DB_SUCCESS on success, error code on failure. */
 UNIV_INTERN
 dberr_t
 fts_sync_table(
-/*===========*/
-       dict_table_t*   table)          /*!< in: table */
+       dict_table_t*   table,
+       bool            unlock_cache,
+       bool            wait)
 {
        dberr_t err = DB_SUCCESS;
 
        ut_ad(table->fts);
 
        if (!dict_table_is_discarded(table) && table->fts->cache) {
-               err = fts_sync(table->fts->cache->sync);
+               err = fts_sync(table->fts->cache->sync, unlock_cache, wait);
        }
 
        return(err);
@@ -5544,7 +5673,7 @@ fts_savepoint_lookup(
 
 /*********************************************************************//**
 Release the savepoint data identified by  name. All savepoints created
-after the named savepoint are also released.
+after the named savepoint are kept.
 @return DB_SUCCESS or error code */
 UNIV_INTERN
 void
@@ -5553,81 +5682,37 @@ fts_savepoint_release(
        trx_t*          trx,            /*!< in: transaction */
        const char*     name)           /*!< in: savepoint name */
 {
-       ulint                   i;
-       ib_vector_t*            savepoints;
-       ulint                   top_of_stack = 0;
-
        ut_a(name != NULL);
 
-       savepoints = trx->fts_trx->savepoints;
+       ib_vector_t*    savepoints = trx->fts_trx->savepoints;
 
        ut_a(ib_vector_size(savepoints) > 0);
 
-       /* Skip the implied savepoint (first element). */
-       for (i = 1; i < ib_vector_size(savepoints); ++i) {
-               fts_savepoint_t*        savepoint;
+       ulint   i = fts_savepoint_lookup(savepoints, name);
+       if (i != ULINT_UNDEFINED) {
+               ut_a(i >= 1);
 
+               fts_savepoint_t*        savepoint;
                savepoint = static_cast<fts_savepoint_t*>(
                        ib_vector_get(savepoints, i));
 
-               /* Even though we release the resources that are part
-               of the savepoint, we don't (always) actually delete the
-               entry.  We simply set the savepoint name to NULL. Therefore
-               we have to skip deleted/released entries. */
-               if (savepoint->name != NULL
-                   && strcmp(name, savepoint->name) == 0) {
-                       break;
+               if (i == ib_vector_size(savepoints) - 1) {
+                       /* If the savepoint is the last, we save its
+                       tables to the  previous savepoint. */
+                       fts_savepoint_t*        prev_savepoint;
+                       prev_savepoint = static_cast<fts_savepoint_t*>(
+                               ib_vector_get(savepoints, i - 1));
 
-               /* Track the previous savepoint instance that will
-               be at the top of the stack after the release. */
-               } else if (savepoint->name != NULL) {
-                       /* We need to delete all entries
-                       greater than this element. */
-                       top_of_stack = i;
+                       ib_rbt_t*       tables = savepoint->tables;
+                       savepoint->tables = prev_savepoint->tables;
+                       prev_savepoint->tables = tables;
                }
-       }
-
-       /* Only if we found and element to release. */
-       if (i < ib_vector_size(savepoints)) {
-               fts_savepoint_t*        last_savepoint;
-               fts_savepoint_t*        top_savepoint;
-               ib_rbt_t*               tables;
-
-               ut_a(top_of_stack < ib_vector_size(savepoints));
 
-               /* Exchange tables between last savepoint and top savepoint */
-               last_savepoint = static_cast<fts_savepoint_t*>(
-                               ib_vector_last(trx->fts_trx->savepoints));
-               top_savepoint = static_cast<fts_savepoint_t*>(
-                               ib_vector_get(savepoints, top_of_stack));
-               tables = top_savepoint->tables;
-               top_savepoint->tables = last_savepoint->tables;
-               last_savepoint->tables = tables;
-
-               /* Skip the implied savepoint. */
-               for (i = ib_vector_size(savepoints) - 1;
-                    i > top_of_stack;
-                    --i) {
-
-                       fts_savepoint_t*        savepoint;
-
-                       savepoint = static_cast<fts_savepoint_t*>(
-                               ib_vector_get(savepoints, i));
-
-                       /* Skip savepoints that were released earlier. */
-                       if (savepoint->name != NULL) {
-                               savepoint->name = NULL;
-                               fts_savepoint_free(savepoint);
-                       }
-
-                       ib_vector_pop(savepoints);
-               }
+               fts_savepoint_free(savepoint);
+               ib_vector_remove(savepoints, *(void**)savepoint);
 
                /* Make sure we don't delete the implied savepoint. */
                ut_a(ib_vector_size(savepoints) > 0);
-
-               /* This must hold. */
-               ut_a(ib_vector_size(savepoints) == (top_of_stack + 1));
        }
 }
 
@@ -6329,7 +6414,7 @@ fts_fake_hex_to_dec(
 {
        ib_id_t         dec_id = 0;
        char            tmp_id[FTS_AUX_MIN_TABLE_ID_LENGTH];
-       int             ret;
+       int             ret __attribute__((unused));
 
        ret = sprintf(tmp_id, UINT64PFx, id);
        ut_ad(ret == 16);
index 5891b53a6e27d43732c0218d89f915ab99d1330b..72c3c4fddcf12b14a56997d5eabc99dd3986dcd8 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2007, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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 the Free Software
@@ -42,9 +42,6 @@ Completed 2011/7/10 Sunny and Jimmy Yang
 /** The FTS optimize thread's work queue. */
 static ib_wqueue_t* fts_optimize_wq;
 
-/** The number of document ids to delete in one statement. */
-static const ulint FTS_MAX_DELETE_DOC_IDS = 1000;
-
 /** Time to wait for a message. */
 static const ulint FTS_QUEUE_WAIT_IN_USECS = 5000000;
 
@@ -90,6 +87,7 @@ enum fts_msg_type_t {
 
        FTS_MSG_DEL_TABLE,              /*!< Remove a table from the optimize
                                        threads work queue */
+       FTS_MSG_SYNC_TABLE              /*!< Sync fts cache of a table */
 };
 
 /** Compressed list of words that have been read from FTS INDEX
@@ -583,7 +581,7 @@ fts_zip_read_word(
 #ifdef UNIV_DEBUG
        ulint           i;
 #endif
-       byte            len = 0;
+       short           len = 0;
        void*           null = NULL;
        byte*           ptr = word->f_str;
        int             flush = Z_NO_FLUSH;
@@ -593,7 +591,7 @@ fts_zip_read_word(
                return(NULL);
        }
 
-       zip->zp->next_out = &len;
+       zip->zp->next_out = reinterpret_cast<byte*>(&len);
        zip->zp->avail_out = sizeof(len);
 
        while (zip->status == Z_OK && zip->zp->avail_out > 0) {
@@ -691,11 +689,12 @@ fts_fetch_index_words(
        fts_zip_t*      zip = static_cast<fts_zip_t*>(user_arg);
        que_node_t*     exp = sel_node->select_list;
        dfield_t*       dfield = que_node_get_val(exp);
-       byte            len = (byte) dfield_get_len(dfield);
+       short           len =  static_cast<short>(dfield_get_len(dfield));
        void*           data = dfield_get_data(dfield);
 
        /* Skip the duplicate words. */
-       if (zip->word.f_len == len && !memcmp(zip->word.f_str, data, len)) {
+       if (zip->word.f_len == static_cast<ulint>(len)
+           && !memcmp(zip->word.f_str, data, len)) {
 
                return(TRUE);
        }
@@ -709,7 +708,7 @@ fts_fetch_index_words(
        ut_a(zip->zp->next_in == NULL);
 
        /* The string is prefixed by len. */
-       zip->zp->next_in = &len;
+       zip->zp->next_in = reinterpret_cast<byte*>(&len);
        zip->zp->avail_in = sizeof(len);
 
        /* Compress the word, create output blocks as necessary. */
@@ -1154,6 +1153,7 @@ fts_optimize_encode_node(
        }
 
        /* Calculate the space required to store the ilist. */
+       ut_ad(doc_id > node->last_doc_id);
        doc_id_delta = doc_id - node->last_doc_id;
        enc_len = fts_get_encoded_len(static_cast<ulint>(doc_id_delta));
 
@@ -1396,7 +1396,8 @@ fts_optimize_word(
 
                src_node = (fts_node_t*) ib_vector_get(word->nodes, i);
 
-               if (!dst_node) {
+               if (dst_node == NULL
+                   || dst_node->last_doc_id > src_node->first_doc_id) {
 
                        dst_node = static_cast<fts_node_t*>(
                                ib_vector_push(nodes, NULL));
@@ -2577,6 +2578,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);
@@ -2652,6 +2655,39 @@ fts_optimize_remove_table(
        os_event_free(event);
 }
 
+/** Send sync fts cache for the table.
+@param[in]     table   table to sync */
+UNIV_INTERN
+void
+fts_optimize_request_sync_table(
+       dict_table_t*   table)
+{
+       fts_msg_t*      msg;
+       table_id_t*     table_id;
+
+       /* if the optimize system not yet initialized, return */
+       if (!fts_optimize_wq) {
+               return;
+       }
+
+       /* FTS optimizer thread is already exited */
+       if (fts_opt_start_shutdown) {
+               ib_logf(IB_LOG_LEVEL_INFO,
+                       "Try to sync table %s after FTS optimize"
+                       " thread exiting.", table->name);
+               return;
+       }
+
+       msg = fts_optimize_create_msg(FTS_MSG_SYNC_TABLE, NULL);
+
+       table_id = static_cast<table_id_t*>(
+               mem_heap_alloc(msg->heap, sizeof(table_id_t)));
+       *table_id = table->id;
+       msg->ptr = table_id;
+
+       ib_wqueue_add(fts_optimize_wq, msg, msg->heap);
+}
+
 /**********************************************************************//**
 Find the slot for a particular table.
 @return slot if found else NULL. */
@@ -2932,6 +2968,25 @@ fts_optimize_need_sync(
 }
 #endif
 
+/** Sync fts cache of a table
+@param[in]     table_id        table id */
+void
+fts_optimize_sync_table(
+       table_id_t      table_id)
+{
+       dict_table_t*   table = NULL;
+
+       table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL);
+
+       if (table) {
+               if (dict_table_has_fts_index(table) && table->fts->cache) {
+                       fts_sync_table(table, true, false);
+               }
+
+               dict_table_close(table, FALSE, FALSE);
+       }
+}
+
 /**********************************************************************//**
 Optimize all FTS tables.
 @return Dummy return */
@@ -3053,6 +3108,11 @@ fts_optimize_thread(
                                        ((fts_msg_del_t*) msg->ptr)->event);
                                break;
 
+                       case FTS_MSG_SYNC_TABLE:
+                               fts_optimize_sync_table(
+                                       *static_cast<table_id_t*>(msg->ptr));
+                               break;
+
                        default:
                                ut_error;
                        }
@@ -3079,26 +3139,7 @@ fts_optimize_thread(
                                ib_vector_get(tables, i));
 
                        if (slot->state != FTS_STATE_EMPTY) {
-                               dict_table_t*   table = NULL;
-
-                               /*slot->table may be freed, so we try to open
-                               table by slot->table_id.*/
-                               table = dict_table_open_on_id(
-                                       slot->table_id, FALSE,
-                                       DICT_TABLE_OP_NORMAL);
-
-                               if (table) {
-
-                                       if (dict_table_has_fts_index(table)) {
-                                               fts_sync_table(table);
-                                       }
-
-                                       if (table->fts) {
-                                               fts_free(table);
-                                       }
-
-                                       dict_table_close(table, FALSE, FALSE);
-                               }
+                               fts_optimize_sync_table(slot->table_id);
                        }
                }
        }
index 4629e3b7e91139656860bb2b6e6aa8c8e32a49b7..fcae656176498c53317243642bb234f96c058441 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2007, 2014, 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 the Free Software
@@ -57,9 +57,6 @@ Completed 2011/7/10 Sunny and Jimmy Yang
 /*Initial byte length for 'words' in fts_ranking_t */
 #define RANKING_WORDS_INIT_LEN 4
 
-/* Coeffecient to use for normalize relevance ranking. */
-static const double FTS_NORMALIZE_COEFF = 0.0115F;
-
 // FIXME: Need to have a generic iterator that traverses the ilist.
 
 typedef std::vector<fts_string_t>      word_vector_t;
index b8f6351ae27649d99697c99f44dd01a8eadb04bd..834b0e3033f0d94c92213bfd533156a3a715a68e 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2000, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, 2009 Google Inc.
 Copyright (c) 2009, Percona Inc.
 Copyright (c) 2012, Facebook Inc.
@@ -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 <wsrep_mysqld.h>
+#include <my_md5.h>
+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;
@@ -482,7 +514,8 @@ ib_cb_t innodb_api_cb[] = {
        (ib_cb_t) ib_get_idx_field_name,
        (ib_cb_t) ib_trx_get_start_time,
        (ib_cb_t) ib_cfg_bk_commit_interval,
-       (ib_cb_t) ib_cursor_stmt_begin
+       (ib_cb_t) ib_cursor_stmt_begin,
+       (ib_cb_t) ib_trx_read_only
 };
 
 /*************************************************************//**
@@ -500,6 +533,108 @@ innodb_stopword_table_validate(
                                                for update function */
        struct st_mysql_value*          value); /*!< in: incoming string */
 
+/** Validate passed-in "value" is a valid directory name.
+This function is registered as a callback with MySQL.
+@param[in,out] thd     thread handle
+@param[in]     var     pointer to system variable
+@param[out]    save    immediate result for update
+@param[in]     value   incoming string
+@return 0 for valid name */
+static
+int
+innodb_tmpdir_validate(
+       THD*                            thd,
+       struct st_mysql_sys_var*        var,
+       void*                           save,
+       struct st_mysql_value*          value)
+{
+
+       char*   alter_tmp_dir;
+       char*   innodb_tmp_dir;
+       char    buff[OS_FILE_MAX_PATH];
+       int     len = sizeof(buff);
+       char    tmp_abs_path[FN_REFLEN + 2];
+
+       ut_ad(save != NULL);
+       ut_ad(value != NULL);
+
+       if (check_global_access(thd, FILE_ACL)) {
+               push_warning_printf(
+                       thd, Sql_condition::WARN_LEVEL_WARN,
+                       ER_WRONG_ARGUMENTS,
+                       "InnoDB: FILE Permissions required");
+               *static_cast<const char**>(save) = NULL;
+               return(1);
+       }
+
+       alter_tmp_dir = (char*) value->val_str(value, buff, &len);
+
+       if (!alter_tmp_dir) {
+               *static_cast<const char**>(save) = alter_tmp_dir;
+               return(0);
+       }
+
+       if (strlen(alter_tmp_dir) > FN_REFLEN) {
+               push_warning_printf(
+                       thd, Sql_condition::WARN_LEVEL_WARN,
+                       ER_WRONG_ARGUMENTS,
+                       "Path length should not exceed %d bytes", FN_REFLEN);
+               *static_cast<const char**>(save) = NULL;
+               return(1);
+       }
+
+       my_realpath(tmp_abs_path, alter_tmp_dir, 0);
+       size_t  tmp_abs_len = strlen(tmp_abs_path);
+
+       if (my_access(tmp_abs_path, F_OK)) {
+
+               push_warning_printf(
+                       thd, Sql_condition::WARN_LEVEL_WARN,
+                       ER_WRONG_ARGUMENTS,
+                       "InnoDB: Path doesn't exist.");
+               *static_cast<const char**>(save) = NULL;
+               return(1);
+       } else if (my_access(tmp_abs_path, R_OK | W_OK)) {
+               push_warning_printf(
+                       thd, Sql_condition::WARN_LEVEL_WARN,
+                       ER_WRONG_ARGUMENTS,
+                       "InnoDB: Server doesn't have permission in "
+                       "the given location.");
+               *static_cast<const char**>(save) = NULL;
+               return(1);
+       }
+
+       MY_STAT stat_info_dir;
+
+       if (my_stat(tmp_abs_path, &stat_info_dir, MYF(0))) {
+               if ((stat_info_dir.st_mode & S_IFDIR) != S_IFDIR) {
+
+                       push_warning_printf(
+                               thd, Sql_condition::WARN_LEVEL_WARN,
+                               ER_WRONG_ARGUMENTS,
+                               "Given path is not a directory. ");
+                       *static_cast<const char**>(save) = NULL;
+                       return(1);
+               }
+       }
+
+       if (!is_mysql_datadir_path(tmp_abs_path)) {
+
+               push_warning_printf(
+                       thd, Sql_condition::WARN_LEVEL_WARN,
+                       ER_WRONG_ARGUMENTS,
+                       "InnoDB: Path Location should not be same as "
+                       "mysql data directory location.");
+               *static_cast<const char**>(save) = NULL;
+               return(1);
+       }
+
+       innodb_tmp_dir = static_cast<char*>(
+               thd_memdup(thd, tmp_abs_path, tmp_abs_len + 1));
+       *static_cast<const char**>(save) = innodb_tmp_dir;
+       return(0);
+}
+
 /** "GEN_CLUST_INDEX" is the name reserved for InnoDB default
 system clustered index when there is no primary key. */
 const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX";
@@ -543,6 +678,11 @@ static MYSQL_THDVAR_STR(ft_user_stopword_table,
   "User supplied stopword table name, effective in the session level.",
   innodb_stopword_table_validate, NULL, NULL);
 
+static MYSQL_THDVAR_STR(tmpdir,
+  PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_MEMALLOC,
+  "Directory for temporary non-tablespace files.",
+  innodb_tmpdir_validate, NULL, NULL);
+
 static SHOW_VAR innodb_status_variables[]= {
   {"buffer_pool_dump_status",
   (char*) &export_vars.innodb_buffer_pool_dump_status,   SHOW_CHAR},
@@ -1152,6 +1292,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 +1330,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
@@ -1265,6 +1413,26 @@ thd_supports_xa(
        return(THDVAR(thd, support_xa));
 }
 
+/** Get the value of innodb_tmpdir.
+@param[in]     thd     thread handle, or NULL to query
+                       the global innodb_tmpdir.
+@retval NULL if innodb_tmpdir="" */
+UNIV_INTERN
+const char*
+thd_innodb_tmpdir(
+       THD*    thd)
+{
+#ifdef UNIV_SYNC_DEBUG
+       ut_ad(!sync_thread_levels_nonempty_trx(false));
+#endif /* UNIV_SYNC_DEBUG */
+
+       const char*     tmp_dir = THDVAR(thd, tmpdir);
+       if (tmp_dir != NULL && *tmp_dir == '\0') {
+               tmp_dir = NULL;
+       }
+
+       return(tmp_dir);
+}
 /******************************************************************//**
 Returns the lock wait timeout for the current connection.
 @return        the lock wait timeout, in seconds */
@@ -1306,6 +1474,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 +1512,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
@@ -1792,14 +1978,18 @@ innobase_get_lower_case_table_names(void)
        return(lower_case_table_names);
 }
 
-/*********************************************************************//**
-Creates a temporary file.
+/** Create a temporary file in the location specified by the parameter
+path. If the path is null, then it will be created in tmpdir.
+@param[in]     path    location for creating temporary file
 @return        temporary file descriptor, or < 0 on error */
 UNIV_INTERN
 int
-innobase_mysql_tmpfile(void)
-/*========================*/
+innobase_mysql_tmpfile(
+       const char*     path)
 {
+#ifdef WITH_INNODB_DISALLOW_WRITES
+       os_event_wait(srv_allow_writes_event);
+#endif /* WITH_INNODB_DISALLOW_WRITES */
        int     fd2 = -1;
        File    fd;
 
@@ -1808,7 +1998,11 @@ innobase_mysql_tmpfile(void)
                return(-1);
        );
 
-       fd = mysql_tmpfile("ib");
+       if (path == NULL) {
+               fd = mysql_tmpfile("ib");
+       } else {
+               fd = mysql_tmpfile_path(path, "ib");
+       }
 
        if (fd >= 0) {
                /* Copy the file descriptor, so that the additional resources
@@ -2696,19 +2890,6 @@ trx_is_strict(
        return(trx && trx->mysql_thd && THDVAR(trx->mysql_thd, strict_mode));
 }
 
-/**********************************************************************//**
-Determines if the current MySQL thread is running in strict mode.
-If thd==NULL, THDVAR returns the global value of innodb-strict-mode.
-@return        TRUE if strict */
-UNIV_INLINE
-ibool
-thd_is_strict(
-/*==========*/
-       THD*    thd)    /*!< in: MySQL thread descriptor */
-{
-       return(THDVAR(thd, strict_mode));
-}
-
 /**************************************************************//**
 Resets some fields of a prebuilt struct. The template is used in fast
 retrieval of just those column values MySQL needs in its processing. */
@@ -2720,6 +2901,13 @@ ha_innobase::reset_template(void)
        ut_ad(prebuilt->magic_n == ROW_PREBUILT_ALLOCATED);
        ut_ad(prebuilt->magic_n2 == prebuilt->magic_n);
 
+       /* Force table to be freed in close_thread_table(). */
+       DBUG_EXECUTE_IF("free_table_in_fts_query",
+               if (prebuilt->in_fts_query) {
+                       table->m_needs_reopen = true;
+               }
+       );
+
        prebuilt->keep_other_fields_on_keyread = 0;
        prebuilt->read_just_key = 0;
        prebuilt->in_fts_query = 0;
@@ -2844,6 +3032,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);
 
@@ -3217,6 +3411,16 @@ innobase_change_buffering_inited_ok:
                        innobase_open_files = table_cache_size;
                }
        }
+
+       if (innobase_open_files > (long) open_files_limit) {
+               fprintf(stderr,
+                       "innodb_open_files should not be greater"
+                       " than the open_files_limit.\n");
+               if (innobase_open_files > (long) table_cache_size) {
+                       innobase_open_files = table_cache_size;
+               }
+       }
+
        srv_max_n_open_files = (ulint) innobase_open_files;
        srv_innodb_status = (ibool) innobase_create_status_file;
 
@@ -3407,10 +3611,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 +4287,11 @@ ha_innobase::max_supported_key_length() const
        case 8192:
                return(1536);
        default:
+#ifdef WITH_WSREP
                return(3500);
+#else
+               return(3500);
+#endif
        }
 }
 
@@ -5163,6 +5391,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 +6009,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,12 +7137,15 @@ 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);
 
        DBUG_ENTER("ha_innobase::write_row");
 
-       if (srv_read_only_mode) {
+       if (high_level_read_only) {
                ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
                DBUG_RETURN(HA_ERR_TABLE_READONLY);
        } else if (prebuilt->trx != trx) {
@@ -6535,8 +7173,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 +7220,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 +7250,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 +7298,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 +7379,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;
                        }
@@ -6728,34 +7454,129 @@ set_max_autoinc:
                        }
                        break;
                default:
-                       break;
+                       break;
+               }
+       }
+
+       innobase_srv_conc_exit_innodb(prebuilt->trx);
+
+report_error:
+       if (error == DB_TABLESPACE_DELETED) {
+               ib_senderrf(
+                       trx->mysql_thd, IB_LOG_LEVEL_ERROR,
+                       ER_TABLESPACE_DISCARDED,
+                       table->s->table_name.str);
+       }
+
+       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));
+       }
+
+func_exit:
+       innobase_active_small();
+
+       DBUG_RETURN(error_result);
+}
+#ifdef WITH_WSREP
+#if defined(HAVE_YASSL)
+#include "my_config.h"
+#include "md5.hpp"
+#elif defined(HAVE_OPENSSL)
+#include <openssl/md5.h>
+#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:
+                       ;
                }
-       }
-
-       innobase_srv_conc_exit_innodb(prebuilt->trx);
-
-report_error:
-       if (error == DB_TABLESPACE_DELETED) {
-               ib_senderrf(
-                       trx->mysql_thd, IB_LOG_LEVEL_ERROR,
-                       ER_TABLESPACE_DISCARDED,
-                       table->s->table_name.str);
-       }
-
-       error_result = convert_error_code_to_mysql(error,
-                                                  prebuilt->table->flags,
-                                                  user_thd);
 
-       if (error_result == HA_FTS_INVALID_DOCID) {
-               my_error(HA_FTS_INVALID_DOCID, MYF(0));
+               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);
+               }
        }
-
-func_exit:
-       innobase_active_small();
-
-       DBUG_RETURN(error_result);
+       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.
@@ -7051,7 +7872,7 @@ ha_innobase::update_row(
 
        ut_a(prebuilt->trx == trx);
 
-       if (srv_read_only_mode) {
+       if (high_level_read_only) {
                ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
                DBUG_RETURN(HA_ERR_TABLE_READONLY);
        } else if (!trx_is_started(trx)) {
@@ -7164,6 +7985,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);
 }
 
@@ -7183,7 +8018,7 @@ ha_innobase::delete_row(
 
        ut_a(prebuilt->trx == trx);
 
-       if (srv_read_only_mode) {
+       if (high_level_read_only) {
                ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
                DBUG_RETURN(HA_ERR_TABLE_READONLY);
        } else if (!trx_is_started(trx)) {
@@ -7211,6 +8046,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 +9045,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 +9217,414 @@ 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,            /*!<in: clustered index record */
+       dict_index_t*   index,          /*!<in: clustered index */
+       ibool           referenced,     /*!<in: is check for referenced table */
+       ibool           shared)         /*!<in: is shared access */
+{
+       THD*    thd             = (THD*)trx->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; j<len+1; j++) {
+               fprintf(stderr, " %hhX, ", key[j]);
+       }
+       fprintf(stderr, "\n");
+#endif
+       char *p = strchr(cache_key, '/');
+       if (p) {
+               *p = '\0';
+       } else {
+               WSREP_WARN("unexpected foreign key table %s %s",
+                          foreign->referenced_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; i<key_len; i++) {
+               fprintf(stderr, "%hhX, ", key[i]);
+       }
+       fprintf(stderr, "\n");
+#endif
+       wsrep_buf_t wkey_part[3];
+       wsrep_key_t wkey = {wkey_part, 3};
+       if (!wsrep_prepare_key_for_innodb(
+                       (const uchar*)table_share->table_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
+
+bool
+wsrep_is_FK_index(dict_table_t* table,
+                  dict_index_t* index)
+{
+       const dict_foreign_set* fks = &table->referenced_set;
+
+       /* Check for all FK references from other tables to the index. */
+       for (dict_foreign_set::const_iterator it = fks->begin();
+            it != fks->end(); ++it) {
+
+               dict_foreign_t* foreign = *it;
+               if (foreign->referenced_index == index) {
+                       ut_ad(table == foreign->referenced_table);
+                       return true;
+               }
+        }
+        return false;
+}
+
+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; i<table->s->keys; ++i) {
+                       KEY*  key_info  = table->key_info + i;
+                       if (key_info->flags & HA_NOSAME) {
+                               hasPK = true;
+                       }
+               }
+
+               for (i=0; i<table->s->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 && wsrep_is_FK_index(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
@@ -8518,7 +9771,8 @@ create_table_def(
 
        /* MySQL does the name length check. But we do additional check
        on the name length here */
-       if (strlen(table_name) > MAX_FULL_NAME_LEN) {
+       const size_t    table_name_len = strlen(table_name);
+       if (table_name_len > MAX_FULL_NAME_LEN) {
                push_warning_printf(
                        thd, Sql_condition::WARN_LEVEL_WARN,
                        ER_TABLE_NAME,
@@ -8527,6 +9781,15 @@ create_table_def(
                DBUG_RETURN(ER_TABLE_NAME);
        }
 
+       if (table_name[table_name_len - 1] == '/') {
+               push_warning_printf(
+                       thd, Sql_condition::WARN_LEVEL_WARN,
+                       ER_TABLE_NAME,
+                       "InnoDB: Table name is empty");
+
+               DBUG_RETURN(ER_WRONG_TABLE_NAME);
+       }
+
        n_cols = form->s->fields;
 
        /* Check whether there already exists a FTS_DOC_ID column */
@@ -9501,7 +10764,7 @@ ha_innobase::create(
 
        if (form->s->fields > REC_MAX_N_USER_FIELDS) {
                DBUG_RETURN(HA_ERR_TOO_MANY_FIELDS);
-       } else if (srv_read_only_mode) {
+       } else if (high_level_read_only) {
                DBUG_RETURN(HA_ERR_INNODB_READ_ONLY);
        }
 
@@ -9831,7 +11094,7 @@ ha_innobase::discard_or_import_tablespace(
        ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
        ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
 
-       if (srv_read_only_mode) {
+       if (high_level_read_only) {
                DBUG_RETURN(HA_ERR_TABLE_READONLY);
        }
 
@@ -9925,7 +11188,7 @@ ha_innobase::truncate()
 
        DBUG_ENTER("ha_innobase::truncate");
 
-       if (srv_read_only_mode) {
+       if (high_level_read_only) {
                DBUG_RETURN(HA_ERR_TABLE_READONLY);
        }
 
@@ -10276,7 +11539,7 @@ ha_innobase::rename_table(
 
        DBUG_ENTER("ha_innobase::rename_table");
 
-       if (srv_read_only_mode) {
+       if (high_level_read_only) {
                ib_senderrf(thd, IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
                DBUG_RETURN(HA_ERR_TABLE_READONLY);
        }
@@ -10522,6 +11785,13 @@ ha_innobase::estimate_rows_upper_bound()
 
        prebuilt->trx->op_info = "";
 
+        /* Set num_rows less than MERGEBUFF to simulate the case where we do
+        not have enough space to merge the externally sorted file blocks. */
+        DBUG_EXECUTE_IF("set_num_rows_lt_MERGEBUFF",
+                        estimate = 2;
+                        DBUG_SET("-d,set_num_rows_lt_MERGEBUFF");
+                       );
+
        DBUG_RETURN((ha_rows) estimate);
 }
 
@@ -10792,7 +12062,6 @@ ha_innobase::info_low(
        dict_table_t*   ib_table;
        ha_rows         rec_per_key;
        ib_uint64_t     n_rows;
-       char            path[FN_REFLEN];
        os_file_stat_t  stat_info;
 
        DBUG_ENTER("info");
@@ -10850,17 +12119,6 @@ ha_innobase::info_low(
                                "returning various info to MySQL";
                }
 
-               my_snprintf(path, sizeof(path), "%s/%s%s",
-                           mysql_data_home, ib_table->name, reg_ext);
-
-               unpack_filename(path,path);
-
-               /* Note that we do not know the access time of the table,
-               nor the CHECK TABLE time, nor the UPDATE or INSERT time. */
-
-               if (os_file_get_status(path, &stat_info, false) == DB_SUCCESS) {
-                       stats.create_time = (ulong) stat_info.ctime;
-               }
        }
 
        if (flag & HA_STATUS_VARIABLE) {
@@ -10995,6 +12253,7 @@ ha_innobase::info_low(
 
        if (flag & HA_STATUS_CONST) {
                ulong   i;
+               char    path[FN_REFLEN];
                /* Verify the number of index in InnoDB and MySQL
                matches up. If prebuilt->clust_index_was_generated
                holds, InnoDB defines GEN_CLUST_INDEX internally */
@@ -11118,6 +12377,20 @@ ha_innobase::info_low(
                if (!(flag & HA_STATUS_NO_LOCK)) {
                        dict_table_stats_unlock(ib_table, RW_S_LATCH);
                }
+
+               my_snprintf(path, sizeof(path), "%s/%s%s",
+                           mysql_data_home,
+                           table->s->normalized_path.str,
+                           reg_ext);
+
+               unpack_filename(path,path);
+
+               /* Note that we do not know the access time of the table,
+               nor the CHECK TABLE time, nor the UPDATE or INSERT time. */
+
+               if (os_file_get_status(path, &stat_info, false) == DB_SUCCESS) {
+                       stats.create_time = (ulong) stat_info.ctime;
+               }
        }
 
        if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
@@ -11216,7 +12489,7 @@ ha_innobase::optimize(
        if (innodb_optimize_fulltext_only) {
                if (prebuilt->table->fts && prebuilt->table->fts->cache
                    && !dict_table_is_discarded(prebuilt->table)) {
-                       fts_sync_table(prebuilt->table);
+                       fts_sync_table(prebuilt->table, false, true);
                        fts_optimize_table(prebuilt->table);
                }
                return(HA_ADMIN_OK);
@@ -12128,12 +13401,46 @@ 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 */
+               }
+       }
+
+       /* 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);
                }
+
        }
 
        /* Check for UPDATEs in read-only mode. */
@@ -13218,8 +14525,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 +14899,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);
        }
 
@@ -14280,6 +15602,12 @@ innodb_internal_table_validate(
                }
 
                dict_table_close(user_table, FALSE, TRUE);
+
+               DBUG_EXECUTE_IF("innodb_evict_autoinc_table",
+                       mutex_enter(&dict_sys->mutex);
+                       dict_table_remove_from_cache_low(user_table, TRUE);
+                       mutex_exit(&dict_sys->mutex);
+               );
        }
 
        return(ret);
@@ -15335,15 +16663,12 @@ innobase_fts_close_ranking(
 {
        fts_result_t*   result;
 
-       ((NEW_FT_INFO*) fts_hdl)->ft_prebuilt->in_fts_query = false;
-
        result = ((NEW_FT_INFO*) fts_hdl)->ft_result;
 
        fts_query_free_result(result);
 
        my_free((uchar*) fts_hdl);
 
-
        return;
 }
 
@@ -15648,6 +16973,301 @@ 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);
+        DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock",
+                 {
+                   const char act[]=
+                     "now "
+                     "wait_for signal.wsrep_after_BF_victim_lock";
+                   DBUG_ASSERT(!debug_sync_set_action(bf_thd,
+                                                      STRING_WITH_LEN(act)));
+                 };);
+
+
+       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,
@@ -16293,6 +17913,13 @@ static MYSQL_SYSVAR_BOOL(use_native_aio, srv_use_native_aio,
   "Use native AIO if supported on this platform.",
   NULL, NULL, TRUE);
 
+#ifdef HAVE_LIBNUMA
+static MYSQL_SYSVAR_BOOL(numa_interleave, srv_numa_interleave,
+  PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
+  "Use NUMA interleave memory policy to allocate InnoDB buffer pool.",
+  NULL, NULL, FALSE);
+#endif // HAVE_LIBNUMA
+
 static MYSQL_SYSVAR_BOOL(api_enable_binlog, ib_binlog_enabled,
   PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
   "Enable binlog for applications direct access InnoDB through InnoDB APIs",
@@ -16359,6 +17986,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.",
@@ -16571,12 +18232,18 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
   MYSQL_SYSVAR(version),
   MYSQL_SYSVAR(use_sys_malloc),
   MYSQL_SYSVAR(use_native_aio),
+#ifdef HAVE_LIBNUMA
+  MYSQL_SYSVAR(numa_interleave),
+#endif // HAVE_LIBNUMA
   MYSQL_SYSVAR(change_buffering),
   MYSQL_SYSVAR(change_buffer_max_size),
 #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
   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),
@@ -16616,6 +18283,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
   MYSQL_SYSVAR(fil_make_page_dirty_debug),
   MYSQL_SYSVAR(saved_page_number_debug),
 #endif /* UNIV_DEBUG */
+  MYSQL_SYSVAR(tmpdir),
   NULL
 };
 
index f735b6fef2dc8ef362b32d22bd1471a8a4f8337f..45b8fd384e08d1b88f5c2cfcc5c0a17c1517f30a 100644 (file)
@@ -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 <wsrep_mysqld.h>
+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;
index 19812ce12f2521983a4e36144e05518aaefe60f5..6a8aa9e723cc7a2ce665e3c2a9f8578befa6bda1 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved.
+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 the Free Software
@@ -28,6 +28,7 @@ Smart ALTER TABLE
 #include <mysql/innodb_priv.h>
 #include <sql_alter.h>
 #include <sql_class.h>
+#include <sql_table.h>
 
 #include "dict0crea.h"
 #include "dict0dict.h"
@@ -46,6 +47,10 @@ Smart ALTER TABLE
 #include "srv0mon.h"
 #include "fts0priv.h"
 #include "pars0pars.h"
+#ifdef WITH_WSREP
+//#include "wsrep_api.h"
+#include <sql_acl.h>   // PROCESS_ACL
+#endif
 #include "row0sel.h"
 #include "ha_innodb.h"
 
@@ -155,10 +160,13 @@ my_error_innodb(
                /* TODO: report the row, as we do for DB_DUPLICATE_KEY */
                my_error(ER_INVALID_USE_OF_NULL, MYF(0));
                break;
+       case DB_TABLESPACE_EXISTS:
+               my_error(ER_TABLESPACE_EXISTS, MYF(0), table);
+               break;
+
 #ifdef UNIV_DEBUG
        case DB_SUCCESS:
        case DB_DUPLICATE_KEY:
-       case DB_TABLESPACE_EXISTS:
        case DB_ONLINE_LOG_TOO_BIG:
                /* These codes should not be passed here. */
                ut_error;
@@ -233,7 +241,7 @@ ha_innobase::check_if_supported_inplace_alter(
 {
        DBUG_ENTER("check_if_supported_inplace_alter");
 
-       if (srv_read_only_mode) {
+       if (high_level_read_only) {
                ha_alter_info->unsupported_reason =
                        innobase_get_err_msg(ER_READ_ONLY_MODE);
                DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
@@ -465,12 +473,9 @@ ha_innobase::check_if_supported_inplace_alter(
        } else if (((ha_alter_info->handler_flags
                     & Alter_inplace_info::ADD_PK_INDEX)
                    || innobase_need_rebuild(ha_alter_info))
-                  && (innobase_fulltext_exist(altered_table)
-                      || (prebuilt->table->flags2
-                          & DICT_TF2_FTS_HAS_DOC_ID))) {
+                  && (innobase_fulltext_exist(altered_table))) {
                /* Refuse to rebuild the table online, if
-               fulltext indexes are to survive the rebuild,
-               or if the table contains a hidden FTS_DOC_ID column. */
+               fulltext indexes are to survive the rebuild. */
                online = false;
                /* If the table already contains fulltext indexes,
                refuse to rebuild the table natively altogether. */
@@ -828,10 +833,8 @@ innobase_get_foreign_key_info(
                char*           tbl_namep = NULL;
                ulint           db_name_len = 0;
                ulint           tbl_name_len = 0;
-#ifdef __WIN__
                char            db_name[MAX_DATABASE_NAME_LEN];
                char            tbl_name[MAX_TABLE_NAME_LEN];
-#endif
 
                fk_key = static_cast<Foreign_key*>(key);
 
@@ -884,24 +887,29 @@ innobase_get_foreign_key_info(
                add_fk[num_fk] = dict_mem_foreign_create();
 
 #ifndef __WIN__
-               tbl_namep = fk_key->ref_table.str;
-               tbl_name_len = fk_key->ref_table.length;
-               db_namep = fk_key->ref_db.str;
-               db_name_len = fk_key->ref_db.length;
+               if(fk_key->ref_db.str) {
+                       tablename_to_filename(fk_key->ref_db.str, db_name,
+                                             MAX_DATABASE_NAME_LEN);
+                       db_namep = db_name;
+                       db_name_len = strlen(db_name);
+               }
+               if (fk_key->ref_table.str) {
+                       tablename_to_filename(fk_key->ref_table.str, tbl_name,
+                                             MAX_TABLE_NAME_LEN);
+                       tbl_namep = tbl_name;
+                       tbl_name_len = strlen(tbl_name);
+               }
 #else
                ut_ad(fk_key->ref_table.str);
-
-               memcpy(tbl_name, fk_key->ref_table.str,
-                      fk_key->ref_table.length);
-               tbl_name[fk_key->ref_table.length] = 0;
+               tablename_to_filename(fk_key->ref_table.str, tbl_name,
+                                     MAX_TABLE_NAME_LEN);
                innobase_casedn_str(tbl_name);
                tbl_name_len = strlen(tbl_name);
                tbl_namep = &tbl_name[0];
 
                if (fk_key->ref_db.str != NULL) {
-                       memcpy(db_name, fk_key->ref_db.str,
-                              fk_key->ref_db.length);
-                       db_name[fk_key->ref_db.length] = 0;
+                       tablename_to_filename(fk_key->ref_db.str, db_name,
+                                             MAX_DATABASE_NAME_LEN);
                        innobase_casedn_str(db_name);
                        db_name_len = strlen(db_name);
                        db_namep = &db_name[0];
@@ -2608,6 +2616,10 @@ prepare_inplace_alter_table_dict(
 
        ctx->num_to_add_index = ha_alter_info->index_add_count;
 
+       ut_ad(ctx->prebuilt->trx->mysql_thd != NULL);
+       const char*     path = thd_innodb_tmpdir(
+               ctx->prebuilt->trx->mysql_thd);
+
        index_defs = innobase_create_key_defs(
                ctx->heap, ha_alter_info, altered_table, ctx->num_to_add_index,
                num_fts_index,
@@ -2946,8 +2958,10 @@ prepare_inplace_alter_table_dict(
                                        error = DB_OUT_OF_MEMORY;
                                        goto error_handling;);
                        rw_lock_x_lock(&ctx->add_index[a]->lock);
+
                        bool ok = row_log_allocate(ctx->add_index[a],
-                                                  NULL, true, NULL, NULL);
+                                                  NULL, true, NULL,
+                                                  NULL, path);
                        rw_lock_x_unlock(&ctx->add_index[a]->lock);
 
                        if (!ok) {
@@ -2973,7 +2987,7 @@ prepare_inplace_alter_table_dict(
                        clust_index, ctx->new_table,
                        !(ha_alter_info->handler_flags
                          & Alter_inplace_info::ADD_PK_INDEX),
-                       ctx->add_cols, ctx->col_map);
+                       ctx->add_cols, ctx->col_map, path);
                rw_lock_x_unlock(&clust_index->lock);
 
                if (!ok) {
@@ -3201,58 +3215,72 @@ innobase_check_foreign_key_index(
        ulint                   n_drop_fk)      /*!< in: Number of foreign keys
                                                to drop */
 {
-       dict_foreign_t* foreign;
+       ut_ad(index != NULL);
+       ut_ad(indexed_table != NULL);
 
-       /* Check if the index is referenced. */
-       foreign = dict_table_get_referenced_constraint(indexed_table, index);
-
-       ut_ad(!foreign || indexed_table
-             == foreign->referenced_table);
-
-       if (foreign
-           && !dict_foreign_find_index(
-                   indexed_table, col_names,
-                   foreign->referenced_col_names,
-                   foreign->n_fields, index,
-                   /*check_charsets=*/TRUE,
-                   /*check_null=*/FALSE)
-           && !innobase_find_equiv_index(
-                   foreign->referenced_col_names,
-                   foreign->n_fields,
-                   ha_alter_info->key_info_buffer,
-                   ha_alter_info->index_add_buffer,
-                   ha_alter_info->index_add_count)
-           ) {
-               trx->error_info = index;
-               return(true);
+       const dict_foreign_set* fks = &indexed_table->referenced_set;
+
+       /* Check for all FK references from other tables to the index. */
+       for (dict_foreign_set::const_iterator it = fks->begin();
+            it != fks->end(); ++it) {
+
+               dict_foreign_t* foreign = *it;
+               if (foreign->referenced_index != index) {
+                       continue;
+               }
+               ut_ad(indexed_table == foreign->referenced_table);
+
+               if (NULL == dict_foreign_find_index(
+                           indexed_table, col_names,
+                           foreign->referenced_col_names,
+                           foreign->n_fields, index,
+                           /*check_charsets=*/TRUE,
+                           /*check_null=*/FALSE)
+                   && NULL == innobase_find_equiv_index(
+                           foreign->referenced_col_names,
+                           foreign->n_fields,
+                           ha_alter_info->key_info_buffer,
+                           ha_alter_info->index_add_buffer,
+                           ha_alter_info->index_add_count)) {
+
+                       /* Index cannot be dropped. */
+                       trx->error_info = index;
+                       return(true);
+               }
        }
 
-       /* Check if this index references some
-       other table */
-       foreign = dict_table_get_foreign_constraint(
-               indexed_table, index);
-
-       ut_ad(!foreign || indexed_table
-             == foreign->foreign_table);
-
-       if (foreign
-           && !innobase_dropping_foreign(
-                   foreign, drop_fk, n_drop_fk)
-           && !dict_foreign_find_index(
-                   indexed_table, col_names,
-                   foreign->foreign_col_names,
-                   foreign->n_fields, index,
-                   /*check_charsets=*/TRUE,
-                   /*check_null=*/FALSE)
-           && !innobase_find_equiv_index(
-                   foreign->foreign_col_names,
-                   foreign->n_fields,
-                   ha_alter_info->key_info_buffer,
-                   ha_alter_info->index_add_buffer,
-                   ha_alter_info->index_add_count)
-           ) {
-               trx->error_info = index;
-               return(true);
+       fks = &indexed_table->foreign_set;
+
+       /* Check for all FK references in current table using the index. */
+       for (dict_foreign_set::const_iterator it = fks->begin();
+            it != fks->end(); ++it) {
+
+               dict_foreign_t* foreign = *it;
+               if (foreign->foreign_index != index) {
+                       continue;
+               }
+
+               ut_ad(indexed_table == foreign->foreign_table);
+
+               if (!innobase_dropping_foreign(
+                           foreign, drop_fk, n_drop_fk)
+                   && NULL == dict_foreign_find_index(
+                           indexed_table, col_names,
+                           foreign->foreign_col_names,
+                           foreign->n_fields, index,
+                           /*check_charsets=*/TRUE,
+                           /*check_null=*/FALSE)
+                   && NULL == innobase_find_equiv_index(
+                           foreign->foreign_col_names,
+                           foreign->n_fields,
+                           ha_alter_info->key_info_buffer,
+                           ha_alter_info->index_add_buffer,
+                           ha_alter_info->index_add_count)) {
+
+                       /* Index cannot be dropped. */
+                       trx->error_info = index;
+                       return(true);
+               }
        }
 
        return(false);
@@ -3471,6 +3499,19 @@ check_if_ok_to_rename:
                if (index->type & DICT_FTS) {
                        DBUG_ASSERT(index->type == DICT_FTS
                                    || (index->type & DICT_CORRUPT));
+
+                       /* We need to drop any corrupted fts indexes
+                       before we add a new fts index. */
+                       if (add_fts_idx && index->type & DICT_CORRUPT) {
+                               ib_errf(user_thd, IB_LOG_LEVEL_ERROR,
+                                       ER_INNODB_INDEX_CORRUPT,
+                                       "Fulltext index '%s' is corrupt. "
+                                       "you should drop this index first.",
+                                       index->name);
+
+                               goto err_exit_no_heap;
+                       }
+
                        continue;
                }
 
@@ -3913,6 +3954,7 @@ ok_exit:
        files and merge sort. */
        DBUG_EXECUTE_IF("innodb_OOM_inplace_alter",
                        error = DB_OUT_OF_MEMORY; goto oom;);
+
        error = row_merge_build_indexes(
                prebuilt->trx,
                prebuilt->table, ctx->new_table,
@@ -4998,6 +5040,61 @@ commit_cache_rebuild(
        DBUG_VOID_RETURN;
 }
 
+/** Store the column number of the columns in a list belonging
+to indexes which are not being dropped.
+@param[in]     ctx             In-place ALTER TABLE context
+@param[out]    drop_col_list   list which will be set, containing columns
+                               which is part of index being dropped */
+static
+void
+get_col_list_to_be_dropped(
+       ha_innobase_inplace_ctx*        ctx,
+       std::set<ulint>&                drop_col_list)
+{
+       for (ulint index_count = 0; index_count < ctx->num_to_drop_index;
+            index_count++) {
+               dict_index_t*   index = ctx->drop_index[index_count];
+
+               for (ulint col = 0; col < index->n_user_defined_cols; col++) {
+                       ulint   col_no = dict_index_get_nth_col_no(index, col);
+                       drop_col_list.insert(col_no);
+               }
+       }
+}
+
+/** For each column, which is part of an index which is not going to be
+dropped, it checks if the column number of the column is same as col_no
+argument passed.
+@param[in]     table   table object
+@param[in]     col_no  column number of the column which is to be checked
+@retval true column exists
+@retval false column does not exist. */
+static
+bool
+check_col_exists_in_indexes(
+       const dict_table_t*     table,
+       ulint                   col_no)
+{
+       for (dict_index_t* index = dict_table_get_first_index(table); index;
+            index = dict_table_get_next_index(index)) {
+
+               if (index->to_be_dropped) {
+                       continue;
+               }
+
+               for (ulint col = 0; col < index->n_user_defined_cols; col++) {
+
+                       ulint   index_col_no = dict_index_get_nth_col_no(
+                                               index, col);
+                       if (col_no == index_col_no) {
+                               return(true);
+                       }
+               }
+       }
+
+       return(false);
+}
+
 /** Commit the changes made during prepare_inplace_alter_table()
 and inplace_alter_table() inside the data dictionary tables,
 when not rebuilding the table.
@@ -5133,6 +5230,20 @@ commit_cache_norebuild(
 
        DBUG_ASSERT(!ctx->need_rebuild());
 
+       std::set<ulint>                 drop_list;
+       std::set<ulint>::const_iterator col_it;
+
+       /* Check if the column, part of an index to be dropped is part of any
+       other index which is not being dropped. If it so, then set the ord_part
+       of the column to 0. */
+       get_col_list_to_be_dropped(ctx, drop_list);
+
+       for(col_it = drop_list.begin(); col_it != drop_list.end(); ++col_it) {
+               if (!check_col_exists_in_indexes(ctx->new_table, *col_it)) {
+                       ctx->new_table->cols[*col_it].ord_part = 0;
+               }
+       }
+
        for (ulint i = 0; i < ctx->num_to_add_index; i++) {
                dict_index_t*   index = ctx->add_index[i];
                DBUG_ASSERT(dict_index_get_online_status(index)
@@ -5333,6 +5444,7 @@ ha_innobase::commit_inplace_alter_table(
        Alter_inplace_info*     ha_alter_info,
        bool                    commit)
 {
+       dberr_t                         error;
        ha_innobase_inplace_ctx*        ctx0
                = static_cast<ha_innobase_inplace_ctx*>
                (ha_alter_info->handler_ctx);
@@ -5414,7 +5526,7 @@ ha_innobase::commit_inplace_alter_table(
                transactions collected during crash recovery could be
                holding InnoDB locks only, not MySQL locks. */
 
-               dberr_t error = row_merge_lock_table(
+               error = row_merge_lock_table(
                        prebuilt->trx, ctx->old_table, LOCK_X);
 
                if (error != DB_SUCCESS) {
@@ -5549,14 +5661,20 @@ ha_innobase::commit_inplace_alter_table(
                                = static_cast<ha_innobase_inplace_ctx*>(*pctx);
 
                        DBUG_ASSERT(ctx->need_rebuild());
-                       /* Generate the redo log for the file
-                       operations that will be performed in
-                       commit_cache_rebuild(). */
-                       fil_mtr_rename_log(ctx->old_table->space,
-                                          ctx->old_table->name,
-                                          ctx->new_table->space,
-                                          ctx->new_table->name,
-                                          ctx->tmp_name, &mtr);
+                       /* Check for any possible problems for any
+                       file operations that will be performed in
+                       commit_cache_rebuild(), and if none, generate
+                       the redo log for these operations. */
+                       error = fil_mtr_rename_log(ctx->old_table,
+                                                  ctx->new_table,
+                                                  ctx->tmp_name, &mtr);
+                       if (error != DB_SUCCESS) {
+                               /* Out of memory or a problem will occur
+                               when renaming files. */
+                               fail = true;
+                               my_error_innodb(error, ctx->old_table->name,
+                                               ctx->old_table->flags);
+                       }
                        DBUG_INJECT_CRASH("ib_commit_inplace_crash",
                                          crash_inject_count++);
                }
@@ -5569,18 +5687,25 @@ ha_innobase::commit_inplace_alter_table(
                DBUG_EXECUTE_IF("innodb_alter_commit_crash_before_commit",
                                log_buffer_flush_to_disk();
                                DBUG_SUICIDE(););
-               ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
                ut_ad(!trx->fts_trx);
-               ut_ad(trx->insert_undo || trx->update_undo);
 
-               /* The following call commits the
-               mini-transaction, making the data dictionary
-               transaction committed at mtr.end_lsn. The
-               transaction becomes 'durable' by the time when
-               log_buffer_flush_to_disk() returns. In the
-               logical sense the commit in the file-based
-               data structures happens here. */
-               trx_commit_low(trx, &mtr);
+               if (fail) {
+                       mtr_set_log_mode(&mtr, MTR_LOG_NO_REDO);
+                       mtr_commit(&mtr);
+                       trx_rollback_for_mysql(trx);
+               } else {
+                       /* The following call commits the
+                       mini-transaction, making the data dictionary
+                       transaction committed at mtr.end_lsn. The
+                       transaction becomes 'durable' by the time when
+                       log_buffer_flush_to_disk() returns. In the
+                       logical sense the commit in the file-based
+                       data structures happens here. */
+                       ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
+                       ut_ad(trx->insert_undo || trx->update_undo);
+
+                       trx_commit_low(trx, &mtr);
+               }
 
                /* If server crashes here, the dictionary in
                InnoDB and MySQL will differ.  The .ibd files
@@ -5602,7 +5727,6 @@ ha_innobase::commit_inplace_alter_table(
        update the in-memory structures, close some handles, release
        temporary files, and (unless we rolled back) update persistent
        statistics. */
-       dberr_t error           = DB_SUCCESS;
 
        for (inplace_alter_handler_ctx** pctx = ctx_array;
             *pctx; pctx++) {
index cfe69274e8ed433b9ff8d6b74e2ae70b33aaa8e3..192003a19d2d877d7659df153af2c4cde1ca3c17 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2007, 2013, 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 the Free Software
@@ -3312,8 +3312,6 @@ i_s_fts_index_cache_fill_one_index(
        for (rbt_node = rbt_first(index_cache->words);
             rbt_node;
             rbt_node = rbt_next(index_cache->words, rbt_node)) {
-               doc_id_t        doc_id = 0;
-
                fts_tokenizer_word_t* word;
 
                word = rbt_value(fts_tokenizer_word_t, rbt_node);
@@ -3339,6 +3337,7 @@ i_s_fts_index_cache_fill_one_index(
                        fts_node_t*     node;
                        byte*           ptr;
                        ulint           decoded = 0;
+                       doc_id_t        doc_id = 0;
 
                        node = static_cast<fts_node_t*> (ib_vector_get(
                                word->nodes, i));
@@ -4019,11 +4018,15 @@ i_s_fts_config_fill(
                fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
 
        if (!user_table) {
+               DBUG_RETURN(0);
+       } else if (!dict_table_has_fts_index(user_table)) {
+               dict_table_close(user_table, FALSE, FALSE);
+
                DBUG_RETURN(0);
        }
 
        trx = trx_allocate_for_background();
-       trx->op_info = "Select for FTS DELETE TABLE";
+       trx->op_info = "Select for FTS CONFIG TABLE";
 
        FTS_INIT_FTS_TABLE(&fts_table, "CONFIG", FTS_COMMON_TABLE, user_table);
 
index d77d691becce2a8795bce93ff4ecf0cd90bb7511..e4c9c941de51a1ba80c6a36873bd2bb682bb6db4 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-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 the Free Software
@@ -494,6 +494,14 @@ ib_trx_state(
 /*=========*/
        ib_trx_t        ib_trx);        /*!< in: trx handle */
 
+
+/*****************************************************************//**
+Check if the transaction is read_only */
+ib_u32_t
+ib_trx_read_only(
+/*=============*/
+        ib_trx_t        ib_trx);         /*!< in: trx handle */
+
 /*****************************************************************//**
 Release the resources of the transaction. If the transaction was
 selected as a victim by InnoDB and rolled back then use this function
index dd61e5becc11f542b53be0ca1602b4a704ef2fee..dea4a9a2a508dd32d4224002560299508383980c 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -309,6 +309,21 @@ dict_table_autoinc_initialize(
        dict_table_t*   table,  /*!< in/out: table */
        ib_uint64_t     value)  /*!< in: next value to assign to a row */
        __attribute__((nonnull));
+
+/** Store autoinc value when the table is evicted.
+@param[in]     table   table evicted */
+UNIV_INTERN
+void
+dict_table_autoinc_store(
+       const dict_table_t*     table);
+
+/** Restore autoinc value when the table is loaded.
+@param[in]     table   table loaded */
+UNIV_INTERN
+void
+dict_table_autoinc_restore(
+       dict_table_t*   table);
+
 /********************************************************************//**
 Reads the next autoinc value (== autoinc counter value), 0 if not yet
 initialized.
@@ -368,6 +383,15 @@ dict_table_remove_from_cache(
        dict_table_t*   table)  /*!< in, own: table */
        __attribute__((nonnull));
 /**********************************************************************//**
+Removes a table object from the dictionary cache. */
+UNIV_INTERN
+void
+dict_table_remove_from_cache_low(
+/*=============================*/
+       dict_table_t*   table,          /*!< in, own: table */
+       ibool           lru_evict);     /*!< in: TRUE if table being evicted
+                                       to make room in the table LRU list */
+/**********************************************************************//**
 Renames a table object.
 @return        TRUE if success */
 UNIV_INTERN
@@ -430,18 +454,6 @@ dict_foreign_add_to_cache(
                                /*!< in: error to be ignored */
        __attribute__((nonnull(1), warn_unused_result));
 /*********************************************************************//**
-Check if the index is referenced by a foreign key, if TRUE return the
-matching instance NULL otherwise.
-@return pointer to foreign key struct if index is defined for foreign
-key, otherwise NULL */
-UNIV_INTERN
-dict_foreign_t*
-dict_table_get_referenced_constraint(
-/*=================================*/
-       dict_table_t*   table,  /*!< in: InnoDB table */
-       dict_index_t*   index)  /*!< in: InnoDB index */
-       __attribute__((nonnull, warn_unused_result));
-/*********************************************************************//**
 Checks if a table is referenced by foreign keys.
 @return        TRUE if table is referenced by a foreign key */
 UNIV_INTERN
@@ -476,19 +488,6 @@ dict_str_starts_with_keyword(
        const char*     keyword)        /*!< in: keyword to look for */
        __attribute__((nonnull, warn_unused_result));
 /*********************************************************************//**
-Checks if a index is defined for a foreign key constraint. Index is a part
-of a foreign key constraint if the index is referenced by foreign key
-or index is a foreign key index
-@return pointer to foreign key struct if index is defined for foreign
-key, otherwise NULL */
-UNIV_INTERN
-dict_foreign_t*
-dict_table_get_foreign_constraint(
-/*==============================*/
-       dict_table_t*   table,  /*!< in: InnoDB table */
-       dict_index_t*   index)  /*!< in: InnoDB index */
-       __attribute__((nonnull, warn_unused_result));
-/*********************************************************************//**
 Scans a table create SQL string and adds to the data dictionary
 the foreign key constraints declared in the string. This function
 should be called after the indexes for a table have been created.
@@ -1568,6 +1567,8 @@ extern dict_sys_t*        dict_sys;
 /** the data dictionary rw-latch protecting dict_sys */
 extern rw_lock_t       dict_operation_lock;
 
+typedef std::map<table_id_t, ib_uint64_t> autoinc_map_t;
+
 /* Dictionary system struct */
 struct dict_sys_t{
        ib_mutex_t              mutex;          /*!< mutex protecting the data
@@ -1602,6 +1603,8 @@ struct dict_sys_t{
        UT_LIST_BASE_NODE_T(dict_table_t)
                        table_non_LRU;  /*!< List of tables that can't be
                                        evicted from the cache */
+       autoinc_map_t*  autoinc_map;    /*!< Map to store table id and autoinc
+                                       when table is evicted */
 };
 #endif /* !UNIV_HOTBACKUP */
 
index 066ffe47e4a4c56e555bff5e8cfcc395add167eb..fac54d9488bc59b22b02d83baccd1baa01efe395 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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 the Free Software
index 460a7e125ad50b85845af6f5e0d528f2cd4f023e..cec6e6d45e51079de4da052b3c0a4df485bed7d5 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -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{
@@ -540,11 +543,12 @@ extern ulong      zip_failure_threshold_pct;
 compression failures */
 extern ulong   zip_pad_max;
 
-/** Data structure to hold information about about how much space in
+/** Data structure to hold information about how much space in
 an uncompressed page should be left as padding to avoid compression
 failures. This estimate is based on a self-adapting heuristic. */
 struct zip_pad_info_t {
-       os_fast_mutex_t mutex;  /*!< mutex protecting the info */
+       os_fast_mutex_t*
+                       mutex;  /*!< mutex protecting the info */
        ulint           pad;    /*!< number of bytes used as pad */
        ulint           success;/*!< successful compression ops during
                                current round */
@@ -552,6 +556,9 @@ struct zip_pad_info_t {
                                current round */
        ulint           n_rounds;/*!< number of currently successful
                                rounds */
+       volatile os_once::state_t
+                       mutex_created;
+                               /*!< Creation state of mutex member */
 };
 
 /** Data structure for an index.  Most fields will be
@@ -767,6 +774,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. */
@@ -1142,9 +1166,14 @@ struct dict_table_t{
                                space from the lock heap of the trx:
                                otherwise the lock heap would grow rapidly
                                if we do a large insert from a select */
-       ib_mutex_t              autoinc_mutex;
+       ib_mutex_t*     autoinc_mutex;
                                /*!< mutex protecting the autoincrement
                                counter */
+
+       /** Creation state of autoinc_mutex member */
+       volatile os_once::state_t
+                       autoinc_mutex_created;
+
        ib_uint64_t     autoinc;/*!< autoinc counter value to give to the
                                next inserted row */
        ulong           n_waiting_or_granted_auto_inc_locks;
@@ -1207,6 +1236,111 @@ struct dict_foreign_add_to_referenced_table {
        }
 };
 
+/** Destroy the autoinc latch of the given table.
+This function is only called from either single threaded environment
+or from a thread that has not shared the table object with other threads.
+@param[in,out] table   table whose stats latch to destroy */
+inline
+void
+dict_table_autoinc_destroy(
+       dict_table_t*   table)
+{
+       if (table->autoinc_mutex_created == os_once::DONE
+           && table->autoinc_mutex != NULL) {
+               mutex_free(table->autoinc_mutex);
+               delete table->autoinc_mutex;
+       }
+}
+
+/** Allocate and init the autoinc latch of a given table.
+This function must not be called concurrently on the same table object.
+@param[in,out] table_void      table whose autoinc latch to create */
+void
+dict_table_autoinc_alloc(
+       void*   table_void);
+
+/** Allocate and init the zip_pad_mutex of a given index.
+This function must not be called concurrently on the same index object.
+@param[in,out] index_void      index whose zip_pad_mutex to create */
+void
+dict_index_zip_pad_alloc(
+       void*   index_void);
+
+/** Request for lazy creation of the autoinc latch of a given table.
+This function is only called from either single threaded environment
+or from a thread that has not shared the table object with other threads.
+@param[in,out] table   table whose autoinc latch is to be created. */
+inline
+void
+dict_table_autoinc_create_lazy(
+       dict_table_t*   table)
+{
+#ifdef HAVE_ATOMIC_BUILTINS
+       table->autoinc_mutex = NULL;
+       table->autoinc_mutex_created = os_once::NEVER_DONE;
+#else /* HAVE_ATOMIC_BUILTINS */
+       dict_table_autoinc_alloc(table);
+       table->autoinc_mutex_created = os_once::DONE;
+#endif /* HAVE_ATOMIC_BUILTINS */
+}
+
+/** Request a lazy creation of dict_index_t::zip_pad::mutex.
+This function is only called from either single threaded environment
+or from a thread that has not shared the table object with other threads.
+@param[in,out] index   index whose zip_pad mutex is to be created */
+inline
+void
+dict_index_zip_pad_mutex_create_lazy(
+       dict_index_t*   index)
+{
+#ifdef HAVE_ATOMIC_BUILTINS
+       index->zip_pad.mutex = NULL;
+       index->zip_pad.mutex_created = os_once::NEVER_DONE;
+#else /* HAVE_ATOMIC_BUILTINS */
+       dict_index_zip_pad_alloc(index);
+       index->zip_pad.mutex_created = os_once::DONE;
+#endif /* HAVE_ATOMIC_BUILTINS */
+}
+
+/** Destroy the zip_pad_mutex of the given index.
+This function is only called from either single threaded environment
+or from a thread that has not shared the table object with other threads.
+@param[in,out] table   table whose stats latch to destroy */
+inline
+void
+dict_index_zip_pad_mutex_destroy(
+       dict_index_t*   index)
+{
+       if (index->zip_pad.mutex_created == os_once::DONE
+           && index->zip_pad.mutex != NULL) {
+               os_fast_mutex_free(index->zip_pad.mutex);
+               delete index->zip_pad.mutex;
+       }
+}
+
+/** Release the zip_pad_mutex of a given index.
+@param[in,out] index   index whose zip_pad_mutex is to be released */
+inline
+void
+dict_index_zip_pad_unlock(
+       dict_index_t*   index)
+{
+       os_fast_mutex_unlock(index->zip_pad.mutex);
+}
+
+#ifdef UNIV_DEBUG
+/** Check if the current thread owns the autoinc_mutex of a given table.
+@param[in]     table   the autoinc_mutex belongs to this table
+@return true, if the current thread owns the autoinc_mutex, false otherwise.*/
+inline
+bool
+dict_table_autoinc_own(
+       const dict_table_t*     table)
+{
+       return(mutex_own(table->autoinc_mutex));
+}
+#endif /* UNIV_DEBUG */
+
 #ifndef UNIV_NONINL
 #include "dict0mem.ic"
 #endif
index 168f2f5b594ec2bc5c50e81cb177c9d3103a172b..43c9162914fed92f423c7b22d291d5d654e69cd7 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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 the Free Software
@@ -490,6 +490,21 @@ fil_discard_tablespace(
        ulint   id)     /*!< in: space id */
        __attribute__((warn_unused_result));
 #endif /* !UNIV_HOTBACKUP */
+
+/** Test if a tablespace file can be renamed to a new filepath by checking
+if that the old filepath exists and the new filepath does not exist.
+@param[in]     space_id        tablespace id
+@param[in]     old_path        old filepath
+@param[in]     new_path        new filepath
+@param[in]     is_discarded    whether the tablespace is discarded
+@return innodb error code */
+dberr_t
+fil_rename_tablespace_check(
+       ulint           space_id,
+       const char*     old_path,
+       const char*     new_path,
+       bool            is_discarded);
+
 /*******************************************************************//**
 Renames a single-table tablespace. The tablespace must be cached in the
 tablespace memory cache.
@@ -986,21 +1001,19 @@ fil_get_space_names(
                                /*!< in/out: Vector for collecting the names. */
        __attribute__((warn_unused_result));
 
-/****************************************************************//**
-Generate redo logs for swapping two .ibd files */
+/** Generate redo log for swapping two .ibd files
+@param[in]     old_table       old table
+@param[in]     new_table       new table
+@param[in]     tmp_name        temporary table name
+@param[in,out] mtr             mini-transaction
+@return innodb error code */
 UNIV_INTERN
-void
+dberr_t
 fil_mtr_rename_log(
-/*===============*/
-       ulint           old_space_id,   /*!< in: tablespace id of the old
-                                       table. */
-       const char*     old_name,       /*!< in: old table name */
-       ulint           new_space_id,   /*!< in: tablespace id of the new
-                                       table */
-       const char*     new_name,       /*!< in: new table name */
-       const char*     tmp_name,       /*!< in: temp table name used while
-                                       swapping */
-       mtr_t*          mtr)            /*!< in/out: mini-transaction */
+       const dict_table_t*     old_table,
+       const dict_table_t*     new_table,
+       const char*             tmp_name,
+       mtr_t*                  mtr)
        __attribute__((nonnull));
 
 /*******************************************************************//**
index a2996ecacc88de6efc721272afdfb16435f651c7..9f7b0216d9b8896c943dd4e5307cd83b697218ce 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 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 the Free Software
@@ -724,6 +724,13 @@ fts_optimize_remove_table(
 /*======================*/
        dict_table_t*   table);                 /*!< in: table to remove */
 
+/** Send sync fts cache for the table.
+@param[in]     table   table to sync */
+UNIV_INTERN
+void
+fts_optimize_request_sync_table(
+       dict_table_t*   table);
+
 /**********************************************************************//**
 Signal the optimize thread to prepare for shutdown. */
 UNIV_INTERN
@@ -826,15 +833,18 @@ fts_drop_index_split_tables(
        dict_index_t*   index)                  /*!< in: fts instance */
        __attribute__((nonnull, warn_unused_result));
 
-/****************************************************************//**
-Run SYNC on the table, i.e., write out data from the cache to the
-FTS auxiliary INDEX table and clear the cache at the end. */
+/** Run SYNC on the table, i.e., write out data from the cache to the
+FTS auxiliary INDEX table and clear the cache at the end.
+@param[in,out] table           fts table
+@param[in]     unlock_cache    whether unlock cache when write node
+@param[in]     wait            whether wait for existing sync to finish
+@return DB_SUCCESS on success, error code on failure. */
 UNIV_INTERN
 dberr_t
 fts_sync_table(
-/*===========*/
-       dict_table_t*   table)                  /*!< in: table */
-       __attribute__((nonnull));
+       dict_table_t*   table,
+       bool            unlock_cache,
+       bool            wait);
 
 /****************************************************************//**
 Free the query graph but check whether dict_sys->mutex is already
index 64677428331b51f5d992fe82f9fda883d3173e77..e495fe72a606baaf95a1646d2ff6515559e0f956 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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 the Free Software
@@ -122,7 +122,11 @@ struct fts_sync_t {
        doc_id_t        max_doc_id;     /*!< The doc id at which the cache was
                                        noted as being full, we use this to
                                        set the upper_limit field */
-        ib_time_t      start_time;     /*!< SYNC start time */
+       ib_time_t       start_time;     /*!< SYNC start time */
+       bool            in_progress;    /*!< flag whether sync is in progress.*/
+       bool            unlock_cache;   /*!< flag whether unlock cache when
+                                       write fts node */
+       os_event_t      event;          /*!< sync finish event */
 };
 
 /** The cache for the FTS system. It is a memory-based inverted index
@@ -165,7 +169,6 @@ struct fts_cache_t {
                                        objects, they are recreated after
                                        a SYNC is completed */
 
-
        ib_alloc_t*     self_heap;      /*!< This heap is the heap out of
                                        which an instance of the cache itself
                                        was created. Objects created using
@@ -212,6 +215,7 @@ struct fts_node_t {
        ulint           ilist_size_alloc;
                                        /*!< Allocated size of ilist in
                                        bytes */
+       bool            synced;         /*!< flag whether the node is synced */
 };
 
 /** A tokenizer word. Contains information about one word. */
index fa202aa773e6c8940f711eddfd8cd2357abf5099..ee5786d920ba0ea1a5d73604ccce924ed6680543 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2006, 2014, 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 the Free Software
@@ -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 */
@@ -328,6 +345,15 @@ thd_supports_xa(
        THD*    thd);   /*!< in: thread handle, or NULL to query
                        the global innodb_supports_xa */
 
+/** Get status of innodb_tmpdir.
+@param[in]     thd     thread handle, or NULL to query
+                       the global innodb_tmpdir.
+@retval NULL if innodb_tmpdir="" */
+UNIV_INTERN
+const char*
+thd_innodb_tmpdir(
+       THD*    thd);
+
 /******************************************************************//**
 Returns the lock wait timeout for the current connection.
 @return        the lock wait timeout, in seconds */
index 6f9a628df5d49dc54e71126c20b2857b405bad70..9a4077befb1e28b38a6bd51c00195cdf96138c41 100644 (file)
@@ -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
index 21747fdceac523131f72c8b3c8e53c80e60d3023..a5df9f7b6b433b743aacaaeec6b5b812bd44baff 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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 the Free Software
@@ -128,7 +128,8 @@ ibuf_should_try(
               && ibuf->max_size != 0
               && !dict_index_is_clust(index)
               && index->table->quiesce == QUIESCE_NONE
-              && (ignore_sec_unique || !dict_index_is_unique(index)));
+              && (ignore_sec_unique || !dict_index_is_unique(index))
+              && srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE);
 }
 
 /******************************************************************//**
index 6d5ed35d5d89fa3baa87cf7c6068036cc294a7fa..385853bdb685340acd0bebe17da7a34ac90dae84 100644 (file)
@@ -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
index ad9b6a9ac1038b32dd3b8f1ac7cb028baa3248a2..13631732b1a9dd32cc5429facfd821de1a52c346 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
 
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2009, Percona Inc.
 
 Portions of this file contain modifications contributed and copyrighted
@@ -383,10 +383,10 @@ to original un-instrumented file I/O APIs */
 
 enum os_file_type_t {
        OS_FILE_TYPE_UNKNOWN = 0,
-       OS_FILE_TYPE_FILE,                      /* regular file */
+       OS_FILE_TYPE_FILE,                      /* regular file
+                                               (or a character/block device) */
        OS_FILE_TYPE_DIR,                       /* directory */
-       OS_FILE_TYPE_LINK,                      /* symbolic link */
-       OS_FILE_TYPE_BLOCK                      /* block device */
+       OS_FILE_TYPE_LINK                       /* symbolic link */
 };
 
 /* Maximum path string length in bytes when referring to tables with in the
@@ -431,14 +431,19 @@ UNIV_INTERN
 void
 os_io_init_simple(void);
 /*===================*/
-/***********************************************************************//**
-Creates a temporary file.  This function is like tmpfile(3), but
-the temporary file is created in the MySQL temporary directory.
-@return        temporary file handle, or NULL on error */
 
+
+/** Create a temporary file. This function is like tmpfile(3), but
+the temporary file is created in the given parameter path. If the path
+is null then it will create the file in the mysql server configuration
+parameter (--tmpdir).
+@param[in]     path    location for creating temporary file
+@return temporary file handle, or NULL on error */
+UNIV_INTERN
 FILE*
-os_file_create_tmpfile(void);
-/*========================*/
+os_file_create_tmpfile(
+       const char*     path);
+
 #endif /* !UNIV_HOTBACKUP */
 /***********************************************************************//**
 The os_file_opendir() function opens a directory stream corresponding to the
@@ -1244,14 +1249,14 @@ os_file_get_status(
                                        file can be opened in RW mode */
 
 #if !defined(UNIV_HOTBACKUP)
-/*********************************************************************//**
-Creates a temporary file that will be deleted on close.
-This function is defined in ha_innodb.cc.
-@return        temporary file descriptor, or < 0 on error */
+/** Create a temporary file in the location specified by the parameter
+path. If the path is null, then it will be created in tmpdir.
+@param[in]     path    location for creating temporary file
+@return temporary file descriptor, or < 0 on error */
 UNIV_INTERN
 int
-innobase_mysql_tmpfile(void);
-/*========================*/
+innobase_mysql_tmpfile(
+       const char*     path);
 #endif /* !UNIV_HOTBACKUP */
 
 
index 57b29fff663c4b6a3e54847c21f08799d1fd9a9c..367c2a31924377910a3a4c8a5db311a8843fdde7 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -38,6 +38,26 @@ Created 9/6/1995 Heikki Tuuri
 #include "ut0lst.h"
 #include "sync0types.h"
 
+#if defined __i386__ || defined __x86_64__ || defined _M_IX86 \
+    || defined _M_X64 || defined __WIN__
+
+#define IB_STRONG_MEMORY_MODEL
+
+#endif /* __i386__ || __x86_64__ || _M_IX86 || _M_X64 || __WIN__ */
+
+#ifdef HAVE_WINDOWS_ATOMICS
+typedef LONG lock_word_t;      /*!< On Windows, InterlockedExchange operates
+                               on LONG variable */
+#elif defined(HAVE_ATOMIC_BUILTINS) && !defined(HAVE_ATOMIC_BUILTINS_BYTE)
+typedef ulint lock_word_t;
+#else
+
+#define IB_LOCK_WORD_IS_BYTE
+
+typedef byte lock_word_t;
+
+#endif /* HAVE_WINDOWS_ATOMICS */
+
 #ifdef __WIN__
 /** Native event (slow)*/
 typedef HANDLE                 os_native_event_t;
@@ -429,14 +449,61 @@ amount to decrement. */
 # define os_atomic_decrement_uint64(ptr, amount) \
        os_atomic_decrement(ptr, amount)
 
-/**********************************************************//**
-Returns the old value of *ptr, atomically sets *ptr to new_val */
+# if defined(IB_STRONG_MEMORY_MODEL)
+
+/** Do an atomic test and set.
+@param[in,out] ptr             Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+       return(__sync_lock_test_and_set(ptr, 1));
+}
+
+/** Do an atomic release.
+
+In theory __sync_lock_release should be used to release the lock.
+Unfortunately, it does not work properly alone. The workaround is
+that more conservative __sync_lock_test_and_set is used instead.
+
+Performance regression was observed at some conditions for Intel
+architecture. Disable release barrier on Intel architecture for now.
+@param[in,out] ptr             Memory location to write to
+@return the previous value */
+inline
+lock_word_t
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+       return(__sync_lock_test_and_set(ptr, 0));
+}
+
+# elif defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET)
+
+/** Do an atomic test-and-set.
+@param[in,out] ptr             Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+       return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE));
+}
+
+/** Do an atomic clear.
+@param[in,out] ptr             Memory location to set to zero */
+inline
+void
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+       __atomic_clear(ptr, __ATOMIC_RELEASE);
+}
+
+# else
 
-# define os_atomic_test_and_set_byte(ptr, new_val) \
-       __sync_lock_test_and_set(ptr, (byte) new_val)
+#  error "Unsupported platform"
 
-# define os_atomic_test_and_set_ulint(ptr, new_val) \
-       __sync_lock_test_and_set(ptr, new_val)
+# endif /* HAVE_IB_GCC_ATOMIC_TEST_AND_SET */
 
 #elif defined(HAVE_IB_SOLARIS_ATOMICS)
 
@@ -511,14 +578,51 @@ amount to decrement. */
 # define os_atomic_decrement_uint64(ptr, amount) \
        os_atomic_increment_uint64(ptr, -(amount))
 
-/**********************************************************//**
-Returns the old value of *ptr, atomically sets *ptr to new_val */
-
-# define os_atomic_test_and_set_byte(ptr, new_val) \
-       atomic_swap_uchar(ptr, new_val)
-
-# define os_atomic_test_and_set_ulint(ptr, new_val) \
-       atomic_swap_ulong(ptr, new_val)
+# ifdef IB_LOCK_WORD_IS_BYTE
+
+/** Do an atomic xchg and set to non-zero.
+@param[in,out] ptr             Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+       return(atomic_swap_uchar(ptr, 1));
+}
+
+/** Do an atomic xchg and set to zero.
+@param[in,out] ptr             Memory location to set to zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+       return(atomic_swap_uchar(ptr, 0));
+}
+
+# else
+
+/** Do an atomic xchg and set to non-zero.
+@param[in,out] ptr             Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+       return(atomic_swap_ulong(ptr, 1));
+}
+
+/** Do an atomic xchg and set to zero.
+@param[in,out] ptr             Memory location to set to zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+       return(atomic_swap_ulong(ptr, 0));
+}
+
+# endif /* IB_LOCK_WORD_IS_BYTE */
 
 #elif defined(HAVE_WINDOWS_ATOMICS)
 
@@ -633,16 +737,27 @@ amount to decrement. There is no atomic substract function on Windows */
                                (ib_int64_t*) ptr,              \
                                -(ib_int64_t) amount) - amount))
 
-/**********************************************************//**
-Returns the old value of *ptr, atomically sets *ptr to new_val.
-InterlockedExchange() operates on LONG, and the LONG will be
-clobbered */
-
-# define os_atomic_test_and_set_byte(ptr, new_val) \
-       ((byte) InterlockedExchange(ptr, new_val))
-
-# define os_atomic_test_and_set_ulong(ptr, new_val) \
-       InterlockedExchange(ptr, new_val)
+/** Do an atomic test and set.
+InterlockedExchange() operates on LONG, and the LONG will be clobbered
+@param[in,out] ptr             Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+       return(InterlockedExchange(ptr, 1));
+}
+
+/** Do an atomic release.
+InterlockedExchange() operates on LONG, and the LONG will be clobbered
+@param[in,out] ptr             Memory location to set to zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+       return(InterlockedExchange(ptr, 0));
+}
 
 #else
 # define IB_ATOMICS_STARTUP_MSG \
@@ -692,7 +807,7 @@ for synchronization */
        } while (0);
 
 /** barrier definitions for memory ordering */
-#if defined __i386__ || defined __x86_64__ || defined _M_IX86 || defined _M_X64 || defined __WIN__
+#ifdef IB_STRONG_MEMORY_MODEL
 /* Performance regression was observed at some conditions for Intel
 architecture. Disable memory barrier for Intel architecture for now. */
 # define os_rmb
index b572f7abb4940a01c4ebef4034485377515449f3..0bd0a009cae83587af2c0541a845f9f65922f736 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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 the Free Software
@@ -1110,6 +1110,20 @@ page_find_rec_with_heap_no(
 const rec_t*
 page_find_rec_max_not_deleted(
        const page_t*   page);
+
+/** Issue a warning when the checksum that is stored in the page is valid,
+but different than the global setting innodb_checksum_algorithm.
+@param[in]     current_algo    current checksum algorithm
+@param[in]     page_checksum   page valid checksum
+@param[in]     space_id        tablespace id
+@param[in]     page_no         page number */
+void
+page_warn_strict_checksum(
+       srv_checksum_algorithm_t        curr_algo,
+       srv_checksum_algorithm_t        page_checksum,
+       ulint                           space_id,
+       ulint                           page_no);
+
 #ifdef UNIV_MATERIALIZE
 #undef UNIV_INLINE
 #define UNIV_INLINE  UNIV_INLINE_ORIGINAL
index 8e7d5ff2d489369db0bf8e88af29efc54ce51240..5dc49714669acfc3b23c82ea32e64cb969c05b19 100644 (file)
@@ -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
index 62715fe8808de1b21e53bec0b9084cf6a306535d..5eed390acedbc382b8b7f7fb2c4e997b25c07f62 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2011, 2014, 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 the Free Software
@@ -51,8 +51,9 @@ row_log_allocate(
        const dtuple_t* add_cols,
                                /*!< in: default values of
                                added columns, or NULL */
-       const ulint*    col_map)/*!< in: mapping of old column
+       const ulint*    col_map,/*!< in: mapping of old column
                                numbers to new ones, or NULL if !table */
+       const char*     path)   /*!< in: where to create temporary file */
        __attribute__((nonnull(1), warn_unused_result));
 
 /******************************************************//**
index 2b9e9f7711cd0e1020d8ac312323a8416dbdd429..06e9fec544b59459cf4f41ee908b0e9d740ecfd1 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved.
+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 the Free Software
@@ -170,14 +170,14 @@ void
 row_merge_drop_temp_indexes(void);
 /*=============================*/
 
-/*********************************************************************//**
-Creates temporary merge files, and if UNIV_PFS_IO defined, register
-the file descriptor with Performance Schema.
+/** Create temporary merge files in the given paramater path, and if
+UNIV_PFS_IO defined, register the file descriptor with Performance Schema.
+@param[in]     path    location for creating temporary merge files.
 @return File descriptor */
 UNIV_INTERN
 int
-row_merge_file_create_low(void)
-/*===========================*/
+row_merge_file_create_low(
+       const char*     path)
        __attribute__((warn_unused_result));
 /*********************************************************************//**
 Destroy a merge file. And de-register the file from Performance Schema
@@ -348,15 +348,17 @@ row_merge_buf_empty(
 /*================*/
        row_merge_buf_t*        buf)    /*!< in,own: sort buffer */
        __attribute__((warn_unused_result, nonnull));
-/*********************************************************************//**
-Create a merge file.
+
+/** Create a merge file in the given location.
+@param[out]    merge_file      merge file structure
+@param[in]     path            location for creating temporary file
 @return file descriptor, or -1 on failure */
 UNIV_INTERN
 int
 row_merge_file_create(
-/*==================*/
-       merge_file_t*   merge_file)     /*!< out: merge file structure */
-       __attribute__((nonnull));
+       merge_file_t*   merge_file,
+       const char*     path);
+
 /*********************************************************************//**
 Merge disk files.
 @return DB_SUCCESS or error code */
index 93dcf9cf49b45713a817321d462837593da6ab9a..888289a6c79bb8e98fa459aeed1db87b3ed93f9e 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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 the Free Software
@@ -119,6 +119,16 @@ struct purge_node_t{
                                clustered index record */
        ibool           done;   /* Debug flag */
 
+#ifdef UNIV_DEBUG
+       /***********************************************************//**
+       Validate the persisent cursor. The purge node has two references
+       to the clustered index record - one via the ref member, and the
+       other via the persistent cursor.  These two references must match
+       each other if the found_clust flag is set.
+       @return true if the persistent cursor is consistent with
+       the ref member.*/
+       bool    validate_pcur();
+#endif
 };
 
 #ifndef UNIV_NONINL
index 7a6c9f93e3d68dcd5585633bfeac6d7c5d153ff0..e2c0ca686647e771b47c5a3ff35de8677bac374d 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
 Copyright (c) 2008, 2009, Google Inc.
 Copyright (c) 2009, Percona Inc.
 
@@ -187,6 +187,9 @@ extern char*        srv_arch_dir;
 recovery and open all tables in RO mode instead of RW mode. We don't
 sync the max trx id to disk either. */
 extern my_bool srv_read_only_mode;
+/** Set if InnoDB operates in read-only mode or innodb-force-recovery
+is greater than SRV_FORCE_NO_TRX_UNDO. */
+extern my_bool high_level_read_only;
 /** store to its own file each table created by an user; data
 dictionary tables are in the system tablespace 0 */
 extern my_bool srv_file_per_table;
@@ -217,6 +220,7 @@ OS (provided we compiled Innobase with it in), otherwise we will
 use simulated aio we build below with threads.
 Currently we support native aio on windows and linux */
 extern my_bool srv_use_native_aio;
+extern my_bool srv_numa_interleave;
 #ifdef __WIN__
 extern ibool   srv_use_native_conditions;
 #endif /* __WIN__ */
@@ -257,6 +261,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 */
@@ -875,6 +883,7 @@ struct srv_slot_t{
 #else /* !UNIV_HOTBACKUP */
 # define srv_use_adaptive_hash_indexes         FALSE
 # define srv_use_native_aio                    FALSE
+# define srv_numa_interleave                   FALSE
 # define srv_force_recovery                    0UL
 # define srv_set_io_thread_op_info(t,info)     ((void) 0)
 # define srv_reset_io_thread_op_info()         ((void) 0)
@@ -884,5 +893,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
index 82fb353a41bb867e2b9995b784f7e849b6b7e7c4..d6f8d8f5e4ccb81f27be781ce79ce43cf3f1bc77 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 Copyright (c) 2012, Facebook Inc.
 
@@ -46,15 +46,6 @@ Created 9/5/1995 Heikki Tuuri
 extern "C" my_bool     timed_mutexes;
 #endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
 
-#ifdef HAVE_WINDOWS_ATOMICS
-typedef LONG lock_word_t;      /*!< On Windows, InterlockedExchange operates
-                               on LONG variable */
-#elif defined(HAVE_ATOMIC_BUILTINS) && !defined(HAVE_ATOMIC_BUILTINS_BYTE)
-typedef ulint lock_word_t;
-#else
-typedef byte lock_word_t;
-#endif
-
 #if defined UNIV_PFS_MUTEX || defined UNIV_PFS_RWLOCK
 
 /* By default, buffer mutexes and rwlocks will be excluded from
index 616e53d4aacf7b3dff7d63795941da2584387dee..fa7b68b350a3de8aa3c727e4466248f785d05840 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -74,17 +74,13 @@ Performs an atomic test-and-set instruction to the lock_word field of a
 mutex.
 @return        the previous value of lock_word: 0 or 1 */
 UNIV_INLINE
-byte
+lock_word_t
 ib_mutex_test_and_set(
-/*===============*/
+/*==================*/
        ib_mutex_t*     mutex)  /*!< in: mutex */
 {
 #if defined(HAVE_ATOMIC_BUILTINS)
-# if defined(HAVE_ATOMIC_BUILTINS_BYTE)
-       return(os_atomic_test_and_set_byte(&mutex->lock_word, 1));
-# else
-       return(os_atomic_test_and_set_ulint(&mutex->lock_word, 1));
-# endif
+       return(os_atomic_test_and_set(&mutex->lock_word));
 #else
        ibool   ret;
 
@@ -100,7 +96,7 @@ ib_mutex_test_and_set(
        }
 
        return((byte) ret);
-#endif
+#endif /* HAVE_ATOMIC_BUILTINS */
 }
 
 /******************************************************************//**
@@ -113,19 +109,12 @@ mutex_reset_lock_word(
        ib_mutex_t*     mutex)  /*!< in: mutex */
 {
 #if defined(HAVE_ATOMIC_BUILTINS)
-       /* In theory __sync_lock_release should be used to release the lock.
-       Unfortunately, it does not work properly alone. The workaround is
-       that more conservative __sync_lock_test_and_set is used instead. */
-# if defined(HAVE_ATOMIC_BUILTINS_BYTE)
-       os_atomic_test_and_set_byte(&mutex->lock_word, 0);
-# else
-       os_atomic_test_and_set_ulint(&mutex->lock_word, 0);
-# endif
+       os_atomic_clear(&mutex->lock_word);
 #else
        mutex->lock_word = 0;
 
        os_fast_mutex_unlock(&(mutex->os_fast_mutex));
-#endif
+#endif /* HAVE_ATOMIC_BUILTINS */
 }
 
 /******************************************************************//**
@@ -213,8 +202,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. */
 
index 70f214d1ac7af2f8e790ed395152da632769c84e..28ed5bfa105e6b7a1ad34ec2d19a22065b96366e 100644 (file)
@@ -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 */
index e097e29b551b76894ea988b5bc043d6f2f6fac68..7265a97ae2516f6abb706fe1a4f342aa4f7061de 100644 (file)
@@ -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
index 144e1803975c022627af73ca68bda049112d7ba6..6adbe2c98c156c68076917bc378139e2ca52f31a 100644 (file)
@@ -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) */
index bf7ca1607d109d1f69d327a3e10d054b752d9914..5bf096340314837ef1f22ec96b04cdf9612f90a0 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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 the Free Software
@@ -50,6 +50,10 @@ Created 5/7/1996 Heikki Tuuri
 #include "dict0boot.h"
 #include <set>
 
+#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
@@ -378,8 +382,10 @@ because there is no parallel deadlock check. This stack is protected by
 the lock_sys_t::mutex. */
 static lock_stack_t*   lock_stack;
 
+#ifdef UNIV_DEBUG
 /** The count of the types of locks. */
 static const ulint     lock_types = UT_ARR_SIZE(lock_compatibility_matrix);
+#endif /* UNIV_DEBUG */
 
 #ifdef UNIV_PFS_MUTEX
 /* Key to register mutex with performance schema */
@@ -616,7 +622,7 @@ lock_sys_create(
        lock_sys->rec_hash = hash_create(n_cells);
 
        if (!srv_read_only_mode) {
-               lock_latest_err_file = os_file_create_tmpfile();
+               lock_latest_err_file = os_file_create_tmpfile(NULL);
                ut_a(lock_latest_err_file);
        }
 }
@@ -945,6 +951,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 +1024,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 +1104,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 +1577,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 +1630,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 +1710,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 +1810,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 +1861,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 +1899,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 +1929,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 +2004,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 +2095,6 @@ lock_rec_create(
 
        MONITOR_INC(MONITOR_RECLOCK_CREATED);
        MONITOR_INC(MONITOR_NUM_RECLOCK);
-
        return(lock);
 }
 
@@ -1886,6 +2109,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 +2168,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 +2279,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 +2319,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: %llu\n",
+                                               (unsigned long long) trx->id);
+                                       lock_rec_print(stderr, lock);
+                               }
+                 } else
+#endif
                        goto somebody_waits;
                }
        }
@@ -2095,9 +2351,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 +2422,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 +2481,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 +2508,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<enum lock_mode>(mode),
+                       block, heap_no, trx))) {
+#else
        } else if (lock_rec_other_has_conflicting(
                        static_cast<enum lock_mode>(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 +2636,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);
                }
        }
@@ -2632,8 +2919,8 @@ lock_rec_inherit_to_gap(
        /* If srv_locks_unsafe_for_binlog is TRUE or session is using
        READ COMMITTED isolation level, we do not want locks set
        by an UPDATE or a DELETE to be inherited as gap type locks. But we
-       DO want S-locks set by a consistency constraint to be inherited also
-       then. */
+       DO want S-locks/X-locks(taken for replace) set by a consistency
+       constraint to be inherited also then */
 
        for (lock = lock_rec_get_first(block, heap_no);
             lock != NULL;
@@ -2643,7 +2930,8 @@ lock_rec_inherit_to_gap(
                    && !((srv_locks_unsafe_for_binlog
                          || lock->trx->isolation_level
                          <= TRX_ISO_READ_COMMITTED)
-                        && lock_get_mode(lock) == LOCK_X)) {
+                        && lock_get_mode(lock) ==
+                        (lock->trx->duplicates ? LOCK_S : LOCK_X))) {
 
                        lock_rec_add_to_queue(
                                LOCK_REC | LOCK_GAP | lock_get_mode(lock),
@@ -3739,9 +4027,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 +4170,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 +4192,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 +4313,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 +4365,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 +4411,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 +4607,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 +4654,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 +4733,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 +4801,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 +4850,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 +6002,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 +6012,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 +6316,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 +6376,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<enum lock_mode>(
+                           LOCK_X | LOCK_GAP | LOCK_INSERT_INTENTION),
+                   block, next_rec_heap_no, trx))) {
+#else
        if (lock_rec_other_has_conflicting(
                    static_cast<enum lock_mode>(
                            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 +6477,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) {
index a1c35e20ead74070ac787bf269acbc5e666e527a..9b8daf857bb5b0f61b27701b30c5cc4f4e8f887f 100644 (file)
@@ -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,17 @@ lock_wait_suspend_thread(
 
        if (lock_wait_timeout < 100000000
            && wait_time > (double) lock_wait_timeout) {
+#ifdef WITH_WSREP
+                if (!wsrep_on(trx->mysql_thd) ||
+                    (!wsrep_is_BF_lock_timeout(trx) &&
+                     trx->error_state != DB_DEADLOCK)) {
+#endif /* WITH_WSREP */
 
                trx->error_state = DB_LOCK_WAIT_TIMEOUT;
 
+#ifdef WITH_WSREP
+                }
+#endif /* WITH_WSREP */
                MONITOR_INC(MONITOR_TIMEOUT);
        }
 
@@ -461,8 +491,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();
index d0e0453849edbc9d86b0234840d7fc9f5ddbb2e1..3ff4a9d7d1ed4131e8205f124a03b883d8f1dd79 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2009, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -3406,11 +3406,7 @@ loop:
 
        lsn = log_sys->lsn;
 
-       ut_ad(srv_force_recovery != SRV_FORCE_NO_LOG_REDO
-             || lsn == log_sys->last_checkpoint_lsn + LOG_BLOCK_HDR_SIZE);
-
-       if ((srv_force_recovery != SRV_FORCE_NO_LOG_REDO
-            && lsn != log_sys->last_checkpoint_lsn)
+       if (lsn != log_sys->last_checkpoint_lsn
 #ifdef UNIV_LOG_ARCHIVE
            || (srv_log_archive_on
                && lsn != log_sys->archived_lsn + LOG_BLOCK_HDR_SIZE)
index aa6c81483d719222ea7befe6a03a6000e93e05e6..ca07f89890f9d6bd0d49b1bdfd0bdde9b7fac614 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -827,6 +827,10 @@ not_consistent:
 
                fprintf(stderr,
                        "InnoDB: No valid checkpoint found.\n"
+                       "InnoDB: If you are attempting downgrade"
+                       " from MySQL 5.7.9 or later,\n"
+                       "InnoDB: please refer to " REFMAN
+                       "upgrading-downgrading.html\n"
                        "InnoDB: If this error appears when you are"
                        " creating an InnoDB database,\n"
                        "InnoDB: the problem may be that during"
@@ -1862,7 +1866,7 @@ loop:
                goto loop;
        }
 
-       ut_ad(!allow_ibuf == mutex_own(&log_sys->mutex));
+       ut_ad((!allow_ibuf) == mutex_own(&log_sys->mutex));
 
        if (!allow_ibuf) {
                recv_no_ibuf_operations = TRUE;
index fb7e8ca1eb73539b670342e758710bd86c045cee..5212ce3bfbbe51283ec1ddb6810904c348be6540 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
 
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2009, Percona Inc.
 
 Portions of this file contain modifications contributed and copyrighted
@@ -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:
@@ -753,17 +759,20 @@ os_io_init_simple(void)
        }
 }
 
-/***********************************************************************//**
-Creates a temporary file.  This function is like tmpfile(3), but
-the temporary file is created in the MySQL temporary directory.
-@return        temporary file handle, or NULL on error */
+/** Create a temporary file. This function is like tmpfile(3), but
+the temporary file is created in the given parameter path. If the path
+is null then it will create the file in the mysql server configuration
+parameter (--tmpdir).
+@param[in]     path    location for creating temporary file
+@return temporary file handle, or NULL on error */
 UNIV_INTERN
 FILE*
-os_file_create_tmpfile(void)
-/*========================*/
+os_file_create_tmpfile(
+       const char*     path)
 {
        FILE*   file    = NULL;
-       int     fd      = innobase_mysql_tmpfile();
+       WAIT_ALLOW_WRITES();
+       int     fd      = innobase_mysql_tmpfile(path);
 
        ut_ad(!srv_read_only_mode);
 
@@ -1089,6 +1098,7 @@ os_file_create_directory(
        return(TRUE);
 #else
        int     rcode;
+       WAIT_ALLOW_WRITES();
 
        rcode = mkdir(pathname, 0770);
 
@@ -1215,6 +1225,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));
@@ -1380,14 +1392,19 @@ os_file_create_simple_no_error_handling_func(
        *success = (file != INVALID_HANDLE_VALUE);
 #else /* __WIN__ */
        int             create_flag;
+       const char*     mode_str        = NULL;
 
        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));
 
        if (create_mode == OS_FILE_OPEN) {
 
+               mode_str = "OPEN";
+
                if (access_type == OS_FILE_READ_ONLY) {
 
                        create_flag = O_RDONLY;
@@ -1406,10 +1423,14 @@ os_file_create_simple_no_error_handling_func(
 
        } else if (srv_read_only_mode) {
 
+               mode_str = "OPEN";
+
                create_flag = O_RDONLY;
 
        } else if (create_mode == OS_FILE_CREATE) {
 
+               mode_str = "CREATE";
+
                create_flag = O_RDWR | O_CREAT | O_EXCL;
 
        } else {
@@ -1424,6 +1445,17 @@ os_file_create_simple_no_error_handling_func(
 
        *success = file == -1 ? FALSE : TRUE;
 
+       /* This function is always called for data files, we should disable
+       OS caching (O_DIRECT) here as we do in os_file_create_func(), so
+       we open the same file in the same mode, see man page of open(2). */
+       if (!srv_read_only_mode
+           && *success
+           && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT
+               || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) {
+
+               os_file_set_nocache(file, name, mode_str);
+       }
+
 #ifdef USE_FILE_LOCK
        if (!srv_read_only_mode
            && *success
@@ -1673,6 +1705,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 +1886,7 @@ loop:
        goto loop;
 #else
        int     ret;
+       WAIT_ALLOW_WRITES();
 
        ret = unlink(name);
 
@@ -1916,6 +1951,7 @@ loop:
        goto loop;
 #else
        int     ret;
+       WAIT_ALLOW_WRITES();
 
        ret = unlink(name);
 
@@ -1969,6 +2005,7 @@ os_file_rename_func(
        return(FALSE);
 #else
        int     ret;
+       WAIT_ALLOW_WRITES();
 
        ret = rename(oldpath, newpath);
 
@@ -2180,6 +2217,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 +2312,7 @@ os_file_flush_func(
        return(FALSE);
 #else
        int     ret;
+       WAIT_ALLOW_WRITES();
 
 #if defined(HAVE_DARWIN_THREADS)
 # ifndef F_FULLFSYNC
@@ -2969,6 +3008,7 @@ retry:
        return(FALSE);
 #else
        ssize_t ret;
+       WAIT_ALLOW_WRITES();
 
        ret = os_file_pwrite(file, buf, n, offset);
 
@@ -3187,8 +3227,9 @@ os_file_get_status(
                stat_info->type = OS_FILE_TYPE_LINK;
                break;
        case S_IFBLK:
-               stat_info->type = OS_FILE_TYPE_BLOCK;
-               break;
+               /* Handle block device as regular file. */
+       case S_IFCHR:
+               /* Handle character device as regular file. */
        case S_IFREG:
                stat_info->type = OS_FILE_TYPE_FILE;
                break;
@@ -3197,8 +3238,8 @@ os_file_get_status(
        }
 
 
-       if (check_rw_perm && (stat_info->type == OS_FILE_TYPE_FILE
-                             || stat_info->type == OS_FILE_TYPE_BLOCK)) {
+       if (check_rw_perm && stat_info->type == OS_FILE_TYPE_FILE) {
+
                int     fh;
                int     access;
 
@@ -3609,7 +3650,7 @@ os_aio_native_aio_supported(void)
                return(FALSE);
        } else if (!srv_read_only_mode) {
                /* Now check if tmpdir supports native aio ops. */
-               fd = innobase_mysql_tmpfile();
+               fd = innobase_mysql_tmpfile(NULL);
 
                if (fd < 0) {
                        ib_logf(IB_LOG_LEVEL_WARN,
index e42c5900c0c688920c8dafdad2a0bcfcfbac5222..cd57abd0623da27f9b8217dc208f66082d2bb9c1 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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 the Free Software
@@ -233,24 +233,6 @@ os_cond_broadcast(
 #endif
 }
 
-/*********************************************************//**
-Wakes one thread waiting for condition variable */
-UNIV_INLINE
-void
-os_cond_signal(
-/*==========*/
-       os_cond_t*      cond)   /*!< in: condition variable. */
-{
-       ut_a(cond);
-
-#ifdef __WIN__
-       ut_a(wake_condition_variable != NULL);
-       wake_condition_variable(cond);
-#else
-       ut_a(pthread_cond_signal(cond) == 0);
-#endif
-}
-
 /*********************************************************//**
 Destroys condition variable */
 UNIV_INLINE
index bd5fb36af8f89913bcf7d2080435d7e0c5fb92ec..cb2381df48c3a61f17c635ffd2e0566c29117c1c 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -2811,3 +2811,45 @@ page_find_rec_max_not_deleted(
        }
        return(prev_rec);
 }
+
+/** Issue a warning when the checksum that is stored in the page is valid,
+but different than the global setting innodb_checksum_algorithm.
+@param[in]     current_algo    current checksum algorithm
+@param[in]     page_checksum   page valid checksum
+@param[in]     space_id        tablespace id
+@param[in]     page_no         page number */
+void
+page_warn_strict_checksum(
+       srv_checksum_algorithm_t        curr_algo,
+       srv_checksum_algorithm_t        page_checksum,
+       ulint                           space_id,
+       ulint                           page_no)
+{
+       srv_checksum_algorithm_t        curr_algo_nonstrict;
+       switch (curr_algo) {
+       case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
+               curr_algo_nonstrict = SRV_CHECKSUM_ALGORITHM_CRC32;
+               break;
+       case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
+               curr_algo_nonstrict = SRV_CHECKSUM_ALGORITHM_INNODB;
+               break;
+       case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
+               curr_algo_nonstrict = SRV_CHECKSUM_ALGORITHM_NONE;
+               break;
+       default:
+               ut_error;
+       }
+
+       ib_logf(IB_LOG_LEVEL_WARN,
+               "innodb_checksum_algorithm is set to \"%s\""
+               " but the page [page id: space=" ULINTPF ","
+               " page number=" ULINTPF "] contains a valid checksum \"%s\"."
+               " Accepting the page as valid. Change innodb_checksum_algorithm"
+               " to \"%s\" to silently accept such pages or rewrite all pages"
+               " so that they contain \"%s\" checksum.",
+               buf_checksum_algorithm_name(curr_algo),
+               space_id, page_no,
+               buf_checksum_algorithm_name(page_checksum),
+               buf_checksum_algorithm_name(curr_algo_nonstrict),
+               buf_checksum_algorithm_name(curr_algo_nonstrict));
+}
index 4fcf38e9a8cb454293689b0c87ae9784ec9e80dd..e5176148edd7af8054b30e8e6bae8ea73d3787de 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -1572,7 +1572,7 @@ page_zip_fields_free(
 {
        if (index) {
                dict_table_t*   table = index->table;
-               os_fast_mutex_free(&index->zip_pad.mutex);
+               dict_index_zip_pad_mutex_destroy(index);
                mem_heap_free(index->heap);
 
                dict_mem_table_free(table);
@@ -4889,6 +4889,10 @@ page_zip_verify_checksum(
        stored = static_cast<ib_uint32_t>(mach_read_from_4(
                static_cast<const unsigned char*>(data) + FIL_PAGE_SPACE_OR_CHKSUM));
 
+       ulint   page_no = mach_read_from_4(static_cast<const unsigned char*>                                    (data) + FIL_PAGE_OFFSET);
+       ulint   space_id = mach_read_from_4(static_cast<const unsigned char*>
+                               (data) + FIL_PAGE_SPACE_ID);
+
 #if FIL_PAGE_LSN % 8
 #error "FIL_PAGE_LSN must be 64 bit aligned"
 #endif
@@ -4909,40 +4913,113 @@ page_zip_verify_checksum(
                return(TRUE);
        }
 
+       const srv_checksum_algorithm_t  curr_algo =
+               static_cast<srv_checksum_algorithm_t>(srv_checksum_algorithm);
+
+       if (curr_algo == SRV_CHECKSUM_ALGORITHM_NONE) {
+               return(TRUE);
+       }
+
        calc = static_cast<ib_uint32_t>(page_zip_calc_checksum(
-               data, size, static_cast<srv_checksum_algorithm_t>(
-                       srv_checksum_algorithm)));
+               data, size, curr_algo));
 
        if (stored == calc) {
                return(TRUE);
        }
 
-       switch ((srv_checksum_algorithm_t) srv_checksum_algorithm) {
+       switch (curr_algo) {
        case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
-       case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
-       case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
-               return(stored == calc);
        case SRV_CHECKSUM_ALGORITHM_CRC32:
+
                if (stored == BUF_NO_CHECKSUM_MAGIC) {
+                       if (curr_algo
+                           == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
+                               page_warn_strict_checksum(
+                                       curr_algo,
+                                       SRV_CHECKSUM_ALGORITHM_NONE,
+                                       space_id, page_no);
+                       }
+
                        return(TRUE);
                }
-               crc32 = calc;
+
                innodb = static_cast<ib_uint32_t>(page_zip_calc_checksum(
                        data, size, SRV_CHECKSUM_ALGORITHM_INNODB));
+
+               if (stored == innodb) {
+                       if (curr_algo
+                           == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
+                               page_warn_strict_checksum(
+                                       curr_algo,
+                                       SRV_CHECKSUM_ALGORITHM_INNODB,
+                                       space_id, page_no);
+                       }
+
+                       return(TRUE);
+               }
+
                break;
+       case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
        case SRV_CHECKSUM_ALGORITHM_INNODB:
+
                if (stored == BUF_NO_CHECKSUM_MAGIC) {
+                       if (curr_algo
+                           == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
+                               page_warn_strict_checksum(
+                                       curr_algo,
+                                       SRV_CHECKSUM_ALGORITHM_NONE,
+                                       space_id, page_no);
+                       }
+
+                       return(TRUE);
+               }
+
+               crc32 = static_cast<ib_uint32_t>(page_zip_calc_checksum(
+                       data, size, SRV_CHECKSUM_ALGORITHM_CRC32));
+
+               if (stored == crc32) {
+                       if (curr_algo
+                           == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
+                               page_warn_strict_checksum(
+                                       curr_algo,
+                                       SRV_CHECKSUM_ALGORITHM_CRC32,
+                                       space_id, page_no);
+                       }
+
                        return(TRUE);
                }
+
+               break;
+       case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
+
                crc32 = static_cast<ib_uint32_t>(page_zip_calc_checksum(
                        data, size, SRV_CHECKSUM_ALGORITHM_CRC32));
-               innodb = calc;
+
+               if (stored == crc32) {
+                       page_warn_strict_checksum(
+                               curr_algo, SRV_CHECKSUM_ALGORITHM_CRC32,
+                               space_id, page_no);
+
+                       return(TRUE);
+               }
+
+               innodb = static_cast<ib_uint32_t>(page_zip_calc_checksum(
+                       data, size, SRV_CHECKSUM_ALGORITHM_INNODB));
+
+               if (stored == innodb) {
+                       page_warn_strict_checksum(
+                               curr_algo,
+                               SRV_CHECKSUM_ALGORITHM_INNODB,
+                               space_id, page_no);
+                       return(TRUE);
+               }
+
                break;
        case SRV_CHECKSUM_ALGORITHM_NONE:
-               return(TRUE);
+               ut_error;
        /* no default so the compiler will emit a warning if new enum
        is added and not handled here */
        }
 
-       return(stored == crc32 || stored == innodb);
+       return(FALSE);
 }
index fb185959d56c7d4c6065c99e949ac686bb668a2e..957a90e71b372b973348c1cfb2de73f978522212 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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 the Free Software
@@ -380,32 +380,6 @@ que_fork_start_command(
        return(thr);
 }
 
-/****************************************************************//**
-Tests if all the query threads in the same fork have a given state.
-@return TRUE if all the query threads in the same fork were in the
-given state */
-UNIV_INLINE
-ibool
-que_fork_all_thrs_in_state(
-/*=======================*/
-       que_fork_t*     fork,   /*!< in: query fork */
-       ulint           state)  /*!< in: state */
-{
-       que_thr_t*      thr_node;
-
-       for (thr_node = UT_LIST_GET_FIRST(fork->thrs);
-            thr_node != NULL;
-            thr_node = UT_LIST_GET_NEXT(thrs, thr_node)) {
-
-               if (thr_node->state != state) {
-
-                       return(FALSE);
-               }
-       }
-
-       return(TRUE);
-}
-
 /**********************************************************************//**
 Calls que_graph_free_recursive for statements in a statement list. */
 static
index 0d7b7c16785dd79f714aeefdd2cf282a9f896006..9540211629c476d966476dac556d818dcb23b3dc 100644 (file)
@@ -33,6 +33,9 @@ Created 5/30/1994 Heikki Tuuri
 #include "mtr0mtr.h"
 #include "mtr0log.h"
 #include "fts0fts.h"
+#ifdef WITH_WSREP
+#include <ha_prototypes.h>
+#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
index 6da430a03d63f9ff34e02986280cb4dc52e6c594..1fc72bdeade9b173d4929ee72f24c9ed85cdb498 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2010, 2014, 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 the Free Software
@@ -220,6 +220,9 @@ row_fts_psort_info_init(
        common_info->merge_event = os_event_create();
        common_info->opt_doc_id_size = opt_doc_id_size;
 
+       ut_ad(trx->mysql_thd != NULL);
+       const char*     path = thd_innodb_tmpdir(trx->mysql_thd);
+
        /* There will be FTS_NUM_AUX_INDEX number of "sort buckets" for
        each parallel sort thread. Each "sort bucket" holds records for
        a particular "FTS index partition" */
@@ -241,8 +244,8 @@ row_fts_psort_info_init(
                        psort_info[j].merge_buf[i] = row_merge_buf_create(
                                dup->index);
 
-                       if (row_merge_file_create(psort_info[j].merge_file[i])
-                           < 0) {
+                       if (row_merge_file_create(psort_info[j].merge_file[i],
+                                                 path) < 0) {
                                goto func_exit;
                        }
 
@@ -610,6 +613,11 @@ fts_parallel_tokenization(
        ulint                   retried = 0;
        dberr_t                 error = DB_SUCCESS;
 
+       ut_ad(psort_info->psort_common->trx->mysql_thd != NULL);
+
+       const char*             path = thd_innodb_tmpdir(
+               psort_info->psort_common->trx->mysql_thd);
+
        ut_ad(psort_info);
 
        buf = psort_info->merge_buf;
@@ -839,7 +847,7 @@ exit:
                        continue;
                }
 
-               tmpfd[i] = row_merge_file_create_low();
+               tmpfd[i] = row_merge_file_create_low(path);
                if (tmpfd[i] < 0) {
                        error = DB_OUT_OF_MEMORY;
                        goto func_exit;
index b753574158a3aae2e0c065f3f7a32c99e9997f5b..89496b4176b11f2e62c138f5b13ad796476064b6 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2012, 2013, 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 the Free Software
@@ -138,14 +138,6 @@ struct row_import {
        @return ULINT_UNDEFINED if not found. */
        ulint find_col(const char* name) const UNIV_NOTHROW;
 
-       /**
-       Find the index field entry in in the cfg indexes fields.
-       @name - of the index to look for
-       @return instance if found else 0. */
-       const dict_field_t* find_field(
-               const row_index_t*      cfg_index,
-               const char*             name) const UNIV_NOTHROW;
-
        /**
        Get the number of rows for which purge failed during the convert phase.
        @param name - index name
@@ -1140,30 +1132,6 @@ row_import::find_col(
        return(ULINT_UNDEFINED);
 }
 
-/**
-Find the index field entry in in the cfg indexes fields.
-@name - of the index to look for
-@return instance if found else 0. */
-const dict_field_t*
-row_import::find_field(
-       const row_index_t*      cfg_index,
-       const char*             name) const UNIV_NOTHROW
-{
-       const dict_field_t*     field = cfg_index->m_fields;
-
-       for (ulint i = 0; i < cfg_index->m_n_fields; ++i, ++field) {
-               const char*     field_name;
-
-               field_name = reinterpret_cast<const char*>(field->name);
-
-               if (strcmp(field_name, name) == 0) {
-                       return(field);
-               }
-       }
-
-       return(0);
-}
-
 /**
 Check if the index schema that was read from the .cfg file matches the
 in memory index definition.
@@ -1187,51 +1155,60 @@ row_import::match_index_columns(
                return(DB_ERROR);
        }
 
-       cfg_index->m_srv_index = index;
+       if (cfg_index->m_n_fields != index->n_fields) {
 
-       const dict_field_t*     field = index->fields;
+               ib_errf(thd, IB_LOG_LEVEL_ERROR,
+                        ER_TABLE_SCHEMA_MISMATCH,
+                        "Index field count %lu doesn't match"
+                        " tablespace metadata file value %lu",
+                        (ulong) index->n_fields,
+                        (ulong) cfg_index->m_n_fields);
 
-       for (ulint i = 0; i < index->n_fields; ++i, ++field) {
+               return(DB_ERROR);
+       }
 
-               const dict_field_t*     cfg_field;
+       cfg_index->m_srv_index = index;
 
-               cfg_field = find_field(cfg_index, field->name);
+       const dict_field_t*     field = index->fields;
+       const dict_field_t*     cfg_field = cfg_index->m_fields;
+
+       for (ulint i = 0; i < index->n_fields; ++i, ++field, ++cfg_field) {
 
-               if (cfg_field == 0) {
+               if (strcmp(field->name, cfg_field->name) != 0) {
                        ib_errf(thd, IB_LOG_LEVEL_ERROR,
                                 ER_TABLE_SCHEMA_MISMATCH,
-                                "Index %s field %s not found in tablespace "
-                                "meta-data file.",
-                                index->name, field->name);
+                                "Index field name %s doesn't match"
+                                " tablespace metadata field name %s"
+                                " for field position %lu",
+                                field->name, cfg_field->name, (ulong) i);
 
                        err = DB_ERROR;
-               } else {
+               }
 
-                       if (cfg_field->prefix_len != field->prefix_len) {
-                               ib_errf(thd, IB_LOG_LEVEL_ERROR,
-                                        ER_TABLE_SCHEMA_MISMATCH,
-                                        "Index %s field %s prefix len %lu "
-                                        "doesn't match meta-data file value "
-                                        "%lu",
-                                        index->name, field->name,
-                                        (ulong) field->prefix_len,
-                                        (ulong) cfg_field->prefix_len);
+               if (cfg_field->prefix_len != field->prefix_len) {
+                       ib_errf(thd, IB_LOG_LEVEL_ERROR,
+                                ER_TABLE_SCHEMA_MISMATCH,
+                                "Index %s field %s prefix len %lu"
+                                " doesn't match metadata file value"
+                                %lu",
+                                index->name, field->name,
+                                (ulong) field->prefix_len,
+                                (ulong) cfg_field->prefix_len);
 
-                               err = DB_ERROR;
-                       }
+                       err = DB_ERROR;
+               }
 
-                       if (cfg_field->fixed_len != field->fixed_len) {
-                               ib_errf(thd, IB_LOG_LEVEL_ERROR,
-                                        ER_TABLE_SCHEMA_MISMATCH,
-                                        "Index %s field %s fixed len %lu "
-                                        "doesn't match meta-data file value "
-                                        "%lu",
-                                        index->name, field->name,
-                                        (ulong) field->fixed_len,
-                                        (ulong) cfg_field->fixed_len);
+               if (cfg_field->fixed_len != field->fixed_len) {
+                       ib_errf(thd, IB_LOG_LEVEL_ERROR,
+                                ER_TABLE_SCHEMA_MISMATCH,
+                                "Index %s field %s fixed len %lu"
+                                " doesn't match metadata file value"
+                                %lu",
+                                index->name, field->name,
+                                (ulong) field->fixed_len,
+                                (ulong) cfg_field->fixed_len);
 
-                               err = DB_ERROR;
-                       }
+                       err = DB_ERROR;
                }
        }
 
@@ -2091,8 +2068,20 @@ PageConverter::validate(
                return(IMPORT_PAGE_STATUS_CORRUPTED);
 
        } else if (offset > 0 && page_get_page_no(page) == 0) {
-               const byte*     b = page;
-               const byte*     e = b + m_page_size;
+               ulint           checksum;
+
+               checksum = mach_read_from_4(page + FIL_PAGE_SPACE_OR_CHKSUM);
+               if (checksum != 0) {
+                       /* Checksum check passed in buf_page_is_corrupted(). */
+                       ib_logf(IB_LOG_LEVEL_WARN,
+                               "%s: Page %lu checksum %lu should be zero.",
+                               m_filepath, (ulong) (offset / m_page_size),
+                               checksum);
+               }
+
+               const byte*     b = page + FIL_PAGE_OFFSET;
+               const byte*     e = page + m_page_size
+                                   - FIL_PAGE_END_LSN_OLD_CHKSUM;
 
                /* If the page number is zero and offset > 0 then
                the entire page MUST consist of zeroes. If not then
index e31b44747aec410b1ab8ffe9bc8299797f298317..37eac2494f1bcbb7b6323cc60c2e1504e299f6ce 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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 the Free Software
@@ -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
@@ -2709,6 +2736,8 @@ row_ins_sec_index_entry_low(
                        goto func_exit;
                }
 
+               DEBUG_SYNC_C("row_ins_sec_index_entry_dup_locks_created");
+
                /* We did not find a duplicate and we have now
                locked with s-locks the necessary records to
                prevent any insertion of a duplicate by another
index 48b5dd36cb98ab59c435f25ee39ad736ed9902e8..bb473ca92cf3b51edfe1656620fc53588ef2b1eb 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2011, 2014, 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 the Free Software
@@ -194,8 +194,25 @@ struct row_log_t {
                                or by index->lock X-latch only */
        row_log_buf_t   head;   /*!< reader context; protected by MDL only;
                                modifiable by row_log_apply_ops() */
+       const char*     path;   /*!< where to create temporary file during
+                               log operation */
 };
 
+/** Create the file or online log if it does not exist.
+@param[in,out] log     online rebuild log
+@return file descriptor. */
+static __attribute__((warn_unused_result))
+int
+row_log_tmpfile(
+       row_log_t*      log)
+{
+       DBUG_ENTER("row_log_tmpfile");
+       if (log->fd < 0) {
+               log->fd = row_merge_file_create_low(log->path);
+       }
+
+       DBUG_RETURN(log->fd);
+}
 
 /** Allocate the memory for the log buffer.
 @param[in,out] log_buf Buffer used for log operation
@@ -340,6 +357,12 @@ row_log_online_op(
                               log->tail.buf, avail_size);
                }
                UNIV_MEM_ASSERT_RW(log->tail.block, srv_sort_buf_size);
+
+               if (row_log_tmpfile(log) < 0) {
+                       log->error = DB_OUT_OF_MEMORY;
+                       goto err_exit;
+               }
+
                ret = os_file_write(
                        "(modification log)",
                        OS_FILE_FROM_FD(log->fd),
@@ -450,6 +473,12 @@ row_log_table_close_func(
                               log->tail.buf, avail);
                }
                UNIV_MEM_ASSERT_RW(log->tail.block, srv_sort_buf_size);
+
+               if (row_log_tmpfile(log) < 0) {
+                       log->error = DB_OUT_OF_MEMORY;
+                       goto err_exit;
+               }
+
                ret = os_file_write(
                        "(modification log)",
                        OS_FILE_FROM_FD(log->fd),
@@ -469,6 +498,7 @@ write_failed:
 
        log->tail.total += size;
        UNIV_MEM_INVALID(log->tail.buf, sizeof log->tail.buf);
+err_exit:
        mutex_exit(&log->mutex);
 }
 
@@ -1381,6 +1411,27 @@ blob_done:
                        dfield_set_data(dfield, data, len);
                }
 
+               if (len != UNIV_SQL_NULL && col->mtype == DATA_MYSQL
+                   && col->len != len && !dict_table_is_comp(log->table)) {
+
+                       ut_ad(col->len >= len);
+                       if (dict_table_is_comp(index->table)) {
+                               byte*   buf = (byte*) mem_heap_alloc(heap,
+                                                                    col->len);
+                               memcpy(buf, dfield->data, len);
+                               memset(buf + len, 0x20, col->len - len);
+
+                               dfield_set_data(dfield, buf, col->len);
+                       } else {
+                               /* field length mismatch should not happen
+                               when rebuilding the redundant row format
+                               table. */
+                               ut_ad(0);
+                               *error = DB_CORRUPTION;
+                               return(NULL);
+                       }
+               }
+
                /* See if any columns were changed to NULL or NOT NULL. */
                const dict_col_t*       new_col
                        = dict_table_get_nth_col(log->table, col_no);
@@ -1433,6 +1484,7 @@ row_log_table_apply_insert_low(
        dtuple_t*       entry;
        const row_log_t*log     = dup->index->online_log;
        dict_index_t*   index   = dict_table_get_first_index(log->table);
+       ulint           n_index = 0;
 
        ut_ad(dtuple_validate(row));
        ut_ad(trx_id);
@@ -1468,6 +1520,8 @@ row_log_table_apply_insert_low(
        }
 
        do {
+               n_index++;
+
                if (!(index = dict_table_get_next_index(index))) {
                        break;
                }
@@ -1480,6 +1534,12 @@ row_log_table_apply_insert_low(
                error = row_ins_sec_index_entry_low(
                        flags, BTR_MODIFY_TREE,
                        index, offsets_heap, heap, entry, trx_id, thr);
+
+               /* Report correct index name for duplicate key error. */
+               if (error == DB_DUPLICATE_KEY) {
+                       thr_get_trx(thr)->error_key_num = n_index;
+               }
+
        } while (error == DB_SUCCESS);
 
        return(error);
@@ -1787,6 +1847,7 @@ row_log_table_apply_update(
        mtr_t           mtr;
        btr_pcur_t      pcur;
        dberr_t         error;
+       ulint           n_index = 0;
 
        ut_ad(dtuple_get_n_fields_cmp(old_pk)
              == dict_index_get_n_unique(index));
@@ -2062,6 +2123,8 @@ func_exit_committed:
                        break;
                }
 
+               n_index++;
+
                if (index->type & DICT_FTS) {
                        continue;
                }
@@ -2105,6 +2168,11 @@ func_exit_committed:
                        BTR_MODIFY_TREE, index, offsets_heap, heap,
                        entry, trx_id, thr);
 
+               /* Report correct index name for duplicate key error. */
+               if (error == DB_DUPLICATE_KEY) {
+                       thr_get_trx(thr)->error_key_num = n_index;
+               }
+
                mtr_start(&mtr);
        }
 
@@ -2498,7 +2566,8 @@ corruption:
                if (index->online_log->head.blocks) {
 #ifdef HAVE_FTRUNCATE
                        /* Truncate the file in order to save space. */
-                       if (ftruncate(index->online_log->fd, 0) == -1) {
+                       if (index->online_log->fd != -1
+                           && ftruncate(index->online_log->fd, 0) == -1) {
                                perror("ftruncate");
                        }
 #endif /* HAVE_FTRUNCATE */
@@ -2814,8 +2883,9 @@ row_log_allocate(
        const dtuple_t* add_cols,
                                /*!< in: default values of
                                added columns, or NULL */
-       const ulint*    col_map)/*!< in: mapping of old column
+       const ulint*    col_map,/*!< in: mapping of old column
                                numbers to new ones, or NULL if !table */
+       const char*     path)   /*!< in: where to create temporary file */
 {
        row_log_t*      log;
        DBUG_ENTER("row_log_allocate");
@@ -2834,11 +2904,7 @@ row_log_allocate(
                DBUG_RETURN(false);
        }
 
-       log->fd = row_merge_file_create_low();
-       if (log->fd < 0) {
-               ut_free(log);
-               DBUG_RETURN(false);
-       }
+       log->fd = -1;
        mutex_create(index_online_log_key, &log->mutex,
                     SYNC_INDEX_ONLINE_LOG);
        log->blobs = NULL;
@@ -2853,6 +2919,7 @@ row_log_allocate(
        log->tail.block = log->head.block = NULL;
        log->head.blocks = log->head.bytes = 0;
        log->head.total = 0;
+       log->path = path;
        dict_index_set_online_status(index, ONLINE_INDEX_CREATION);
        index->online_log = log;
 
@@ -3330,7 +3397,8 @@ corruption:
                if (index->online_log->head.blocks) {
 #ifdef HAVE_FTRUNCATE
                        /* Truncate the file in order to save space. */
-                       if (ftruncate(index->online_log->fd, 0) == -1) {
+                       if (index->online_log->fd != -1
+                           && ftruncate(index->online_log->fd, 0) == -1) {
                                perror("ftruncate");
                        }
 #endif /* HAVE_FTRUNCATE */
index c4224424fdb057c1f5948c8e9a316ada25856e00..20a73a9ba33d6faf4bb0b811567b64d50873d741 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-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 the Free Software
@@ -235,22 +235,86 @@ row_merge_buf_free(
        mem_heap_free(buf->heap);
 }
 
-/******************************************************//**
-Insert a data tuple into a sort buffer.
-@return        number of rows added, 0 if out of space */
+/** Convert the field data from compact to redundant format.
+@param[in]     row_field       field to copy from
+@param[out]    field           field to copy to
+@param[in]     len             length of the field data
+@param[in]     zip_size        compressed BLOB page size,
+                               zero for uncompressed BLOBs
+@param[in,out] heap            memory heap where to allocate data when
+                               converting to ROW_FORMAT=REDUNDANT, or NULL
+                               when not to invoke
+                               row_merge_buf_redundant_convert(). */
+static
+void
+row_merge_buf_redundant_convert(
+       const dfield_t*         row_field,
+       dfield_t*               field,
+       ulint                   len,
+       ulint                   zip_size,
+       mem_heap_t*             heap)
+{
+       ut_ad(DATA_MBMINLEN(field->type.mbminmaxlen) == 1);
+       ut_ad(DATA_MBMAXLEN(field->type.mbminmaxlen) > 1);
+
+       byte*           buf = (byte*) mem_heap_alloc(heap, len);
+       ulint           field_len = row_field->len;
+       ut_ad(field_len <= len);
+
+       if (row_field->ext) {
+               const byte*     field_data = static_cast<byte*>(
+                       dfield_get_data(row_field));
+               ulint           ext_len;
+
+               ut_a(field_len >= BTR_EXTERN_FIELD_REF_SIZE);
+               ut_a(memcmp(field_data + field_len - BTR_EXTERN_FIELD_REF_SIZE,
+                           field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE));
+
+               byte*   data = btr_copy_externally_stored_field(
+                       &ext_len, field_data, zip_size, field_len, heap);
+
+               ut_ad(ext_len < len);
+
+               memcpy(buf, data, ext_len);
+               field_len = ext_len;
+       } else {
+               memcpy(buf, row_field->data, field_len);
+       }
+
+       memset(buf + field_len, 0x20, len - field_len);
+
+       dfield_set_data(field, buf, len);
+}
+
+/** Insert a data tuple into a sort buffer.
+@param[in,out] buf             sort buffer
+@param[in]     fts_index       fts index to be created
+@param[in]     old_table       original table
+@param[in,out] psort_info      parallel sort info
+@param[in]     row             table row
+@param[in]     ext             cache of externally stored
+                               column prefixes, or NULL
+@param[in,out] doc_id          Doc ID if we are creating
+                               FTS index
+@param[in,out] conv_heap       memory heap where to allocate data when
+                               converting to ROW_FORMAT=REDUNDANT, or NULL
+                               when not to invoke
+                               row_merge_buf_redundant_convert()
+@param[in,out] exceed_page     set if the record size exceeds the page size
+                               when converting to ROW_FORMAT=REDUNDANT
+@return number of rows added, 0 if out of space */
 static
 ulint
 row_merge_buf_add(
-/*==============*/
-       row_merge_buf_t*        buf,    /*!< in/out: sort buffer */
-       dict_index_t*           fts_index,/*!< in: fts index to be created */
-       const dict_table_t*     old_table,/*!< in: original table */
-       fts_psort_t*            psort_info, /*!< in: parallel sort info */
-       const dtuple_t*         row,    /*!< in: table row */
-       const row_ext_t*        ext,    /*!< in: cache of externally stored
-                                       column prefixes, or NULL */
-       doc_id_t*               doc_id) /*!< in/out: Doc ID if we are
-                                       creating FTS index */
+       row_merge_buf_t*        buf,
+       dict_index_t*           fts_index,
+       const dict_table_t*     old_table,
+       fts_psort_t*            psort_info,
+       const dtuple_t*         row,
+       const row_ext_t*        ext,
+       doc_id_t*               doc_id,
+       mem_heap_t*             conv_heap,
+       bool*                   exceed_page)
 {
        ulint                   i;
        const dict_index_t*     index;
@@ -400,6 +464,23 @@ row_merge_buf_add(
                                n_row_added = 1;
                                continue;
                        }
+
+                       if (field->len != UNIV_SQL_NULL
+                           && col->mtype == DATA_MYSQL
+                           && col->len != field->len) {
+
+                               if (conv_heap != NULL) {
+                                       row_merge_buf_redundant_convert(
+                                               row_field, field, col->len,
+                                               dict_table_zip_size(old_table),
+                                               conv_heap);
+                               } else {
+                                       /* Field length mismatch should not
+                                       happen when rebuilding redundant row
+                                       format table. */
+                                       ut_ad(dict_table_is_comp(index->table));
+                               }
+                       }
                }
 
                len = dfield_get_len(field);
@@ -508,6 +589,14 @@ row_merge_buf_add(
        of extra_size. */
        data_size += (extra_size + 1) + ((extra_size + 1) >= 0x80);
 
+       /* Record size can exceed page size while converting to
+       redundant row format. But there is assert
+       ut_ad(size < UNIV_PAGE_SIZE) in rec_offs_data_size().
+       It may hit the assert before attempting to insert the row. */
+       if (conv_heap != NULL && data_size > UNIV_PAGE_SIZE) {
+               *exceed_page = true;
+       }
+
        ut_ad(data_size < srv_sort_buf_size);
 
        /* Reserve one byte for the end marker of row_merge_block_t. */
@@ -527,6 +616,10 @@ row_merge_buf_add(
                dfield_dup(field++, buf->heap);
        } while (--n_fields);
 
+       if (conv_heap != NULL) {
+               mem_heap_empty(conv_heap);
+       }
+
        DBUG_RETURN(n_row_added);
 }
 
@@ -1148,47 +1241,95 @@ row_merge_write_eof(
        return(&block[0]);
 }
 
-/********************************************************************//**
-Reads clustered index of the table and create temporary files
+/** Create a temporary file if it has not been created already.
+@param[in,out] tmpfd   temporary file handle
+@param[in]     path    path to create temporary file
+@return file descriptor, or -1 on failure */
+static __attribute__((warn_unused_result))
+int
+row_merge_tmpfile_if_needed(
+       int*            tmpfd,
+       const char*     path)
+{
+       if (*tmpfd < 0) {
+               *tmpfd = row_merge_file_create_low(path);
+       }
+
+       return(*tmpfd);
+}
+
+/** Create a temporary file for merge sort if it was not created already.
+@param[in,out] file    merge file structure
+@param[in,out] tmpfd   temporary file structure
+@param[in]     nrec    number of records in the file
+@param[in]     path    path to create temporary files
+@return file descriptor, or -1 on failure */
+static __attribute__((warn_unused_result))
+int
+row_merge_file_create_if_needed(
+       merge_file_t*   file,
+       int*            tmpfd,
+       ulint           nrec,
+       const char*     path)
+{
+       ut_ad(file->fd < 0 || *tmpfd >=0);
+       if (file->fd < 0 && row_merge_file_create(file, path) >= 0) {
+               if (row_merge_tmpfile_if_needed(tmpfd, path) < 0) {
+                       return(-1);
+               }
+
+               file->n_rec = nrec;
+       }
+
+       ut_ad(file->fd < 0 || *tmpfd >=0);
+       return(file->fd);
+}
+
+/** Reads clustered index of the table and create temporary files
 containing the index entries for the indexes to be built.
-@return        DB_SUCCESS or error */
+@param[in]     trx             transaction
+@param[in,out] table           MySQL table object, for reporting erroneous
+                               records
+@param[in]     old_table       table where rows are read from
+@param[in]     new_table       table where indexes are created; identical to
+                               old_table unless creating a PRIMARY KEY
+@param[in]     online          true if creating indexes online
+@param[in]     index           indexes to be created
+@param[in]     fts_sort_idx    full-text index to be created, or NULL
+@param[in]     psort_info      parallel sort info for fts_sort_idx creation,
+                               or NULL
+@param[in]     files           temporary files
+@param[in]     key_numbers     MySQL key numbers to create
+@param[in]     n_index         number of indexes to create
+@param[in]     add_cols        default values of added columns, or NULL
+@param[in]     col_map         mapping of old column numbers to new ones, or
+                               NULL if old_table == new_table
+@param[in]     add_autoinc     number of added AUTO_INCREMENT columns, or
+                               ULINT_UNDEFINED if none is added
+@param[in,out] sequence                autoinc sequence
+@param[in,out] block           file buffer
+@param[in,out] tmpfd           temporary file handle
+return DB_SUCCESS or error */
 static __attribute__((nonnull(1,2,3,4,6,9,10,16), warn_unused_result))
 dberr_t
 row_merge_read_clustered_index(
-/*===========================*/
-       trx_t*                  trx,    /*!< in: transaction */
-       struct TABLE*           table,  /*!< in/out: MySQL table object,
-                                       for reporting erroneous records */
-       const dict_table_t*     old_table,/*!< in: table where rows are
-                                       read from */
-       const dict_table_t*     new_table,/*!< in: table where indexes are
-                                       created; identical to old_table
-                                       unless creating a PRIMARY KEY */
-       bool                    online, /*!< in: true if creating indexes
-                                       online */
-       dict_index_t**          index,  /*!< in: indexes to be created */
+       trx_t*                  trx,
+       struct TABLE*           table,
+       const dict_table_t*     old_table,
+       const dict_table_t*     new_table,
+       bool                    online,
+       dict_index_t**          index,
        dict_index_t*           fts_sort_idx,
-                                       /*!< in: full-text index to be created,
-                                       or NULL */
        fts_psort_t*            psort_info,
-                                       /*!< in: parallel sort info for
-                                       fts_sort_idx creation, or NULL */
-       merge_file_t*           files,  /*!< in: temporary files */
+       merge_file_t*           files,
        const ulint*            key_numbers,
-                                       /*!< in: MySQL key numbers to create */
-       ulint                   n_index,/*!< in: number of indexes to create */
+       ulint                   n_index,
        const dtuple_t*         add_cols,
-                                       /*!< in: default values of
-                                       added columns, or NULL */
-       const ulint*            col_map,/*!< in: mapping of old column
-                                       numbers to new ones, or NULL
-                                       if old_table == new_table */
+       const ulint*            col_map,
        ulint                   add_autoinc,
-                                       /*!< in: number of added
-                                       AUTO_INCREMENT column, or
-                                       ULINT_UNDEFINED if none is added */
-       ib_sequence_t&          sequence,/*!< in/out: autoinc sequence */
-       row_merge_block_t*      block)  /*!< in/out: file buffer */
+       ib_sequence_t&          sequence,
+       row_merge_block_t*      block,
+       int*                    tmpfd)
 {
        dict_index_t*           clust_index;    /* Clustered index */
        mem_heap_t*             row_heap;       /* Heap memory to create
@@ -1208,6 +1349,7 @@ row_merge_read_clustered_index(
        os_event_t              fts_parallel_sort_event = NULL;
        ibool                   fts_pll_sort = FALSE;
        ib_int64_t              sig_count = 0;
+       mem_heap_t*             conv_heap = NULL;
        DBUG_ENTER("row_merge_read_clustered_index");
 
        ut_ad((old_table == new_table) == !col_map);
@@ -1219,6 +1361,9 @@ row_merge_read_clustered_index(
        DEBUG_FTS_SORT_PRINT("FTS_SORT: Start Create Index\n");
 #endif
 
+       ut_ad(trx->mysql_thd != NULL);
+       const char*     path = thd_innodb_tmpdir(trx->mysql_thd);
+
        /* Create and initialize memory for record buffers */
 
        merge_buf = static_cast<row_merge_buf_t**>(
@@ -1303,6 +1448,11 @@ row_merge_read_clustered_index(
 
        row_heap = mem_heap_create(sizeof(mrec_buf_t));
 
+       if (dict_table_is_comp(old_table)
+           && !dict_table_is_comp(new_table)) {
+               conv_heap = mem_heap_create(sizeof(mrec_buf_t));
+       }
+
        /* Scan the clustered index. */
        for (;;) {
                const rec_t*    rec;
@@ -1581,16 +1731,24 @@ write_buffers:
                        row_merge_buf_t*        buf     = merge_buf[i];
                        merge_file_t*           file    = &files[i];
                        ulint                   rows_added = 0;
+                       bool                    exceed_page = false;
 
                        if (UNIV_LIKELY
                            (row && (rows_added = row_merge_buf_add(
                                        buf, fts_index, old_table,
-                                       psort_info, row, ext, &doc_id)))) {
+                                       psort_info, row, ext, &doc_id,
+                                       conv_heap, &exceed_page)))) {
 
                                /* If we are creating FTS index,
                                a single row can generate more
                                records for tokenized word */
                                file->n_rec += rows_added;
+
+                               if (exceed_page) {
+                                       err = DB_TOO_BIG_RECORD;
+                                       break;
+                               }
+
                                if (doc_id > max_doc_id) {
                                        max_doc_id = doc_id;
                                }
@@ -1670,13 +1828,25 @@ write_buffers:
                                        dict_index_get_lock(buf->index));
                        }
 
-                       row_merge_buf_write(buf, file, block);
+                       if (buf->n_tuples > 0) {
 
-                       if (!row_merge_write(file->fd, file->offset++,
-                                            block)) {
-                               err = DB_TEMP_FILE_WRITE_FAILURE;
-                               trx->error_key_num = i;
-                               break;
+                               if (row_merge_file_create_if_needed(
+                                       file, tmpfd, buf->n_tuples, path) < 0) {
+                                       err = DB_OUT_OF_MEMORY;
+                                       trx->error_key_num = i;
+                                       break;
+                               }
+
+                               ut_ad(file->n_rec > 0);
+
+                               row_merge_buf_write(buf, file, block);
+
+                               if (!row_merge_write(file->fd, file->offset++,
+                                                    block)) {
+                                       err = DB_TEMP_FILE_WRITE_FAILURE;
+                                       trx->error_key_num = i;
+                                       break;
+                               }
                        }
 
                        UNIV_MEM_INVALID(&block[0], srv_sort_buf_size);
@@ -1691,12 +1861,18 @@ write_buffers:
                                    (!(rows_added = row_merge_buf_add(
                                                buf, fts_index, old_table,
                                                psort_info, row, ext,
-                                               &doc_id)))) {
+                                               &doc_id, conv_heap,
+                                               &exceed_page)))) {
                                        /* An empty buffer should have enough
                                        room for at least one record. */
                                        ut_error;
                                }
 
+                               if (exceed_page) {
+                                       err = DB_TOO_BIG_RECORD;
+                                       break;
+                               }
+
                                file->n_rec += rows_added;
                        }
                }
@@ -1714,6 +1890,7 @@ write_buffers:
 
 func_exit:
        mtr_commit(&mtr);
+
        mem_heap_free(row_heap);
 
        if (nonnull) {
@@ -1721,6 +1898,10 @@ func_exit:
        }
 
 all_done:
+       if (conv_heap != NULL) {
+               mem_heap_free(conv_heap);
+       }
+
 #ifdef FTS_INTERNAL_DIAG_PRINT
        DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Scan Table\n");
 #endif
@@ -1805,7 +1986,8 @@ wait_again:
        if (max_doc_id && err == DB_SUCCESS) {
                /* Sync fts cache for other fts indexes to keep all
                fts indexes consistent in sync_doc_id. */
-               err = fts_sync_table(const_cast<dict_table_t*>(new_table));
+               err = fts_sync_table(const_cast<dict_table_t*>(new_table),
+                                    false, true);
 
                if (err == DB_SUCCESS) {
                        fts_update_next_doc_id(
@@ -2922,14 +3104,15 @@ row_merge_drop_temp_indexes(void)
        trx_free_for_background(trx);
 }
 
-/*********************************************************************//**
-Creates temporary merge files, and if UNIV_PFS_IO defined, register
-the file descriptor with Performance Schema.
-@return file descriptor, or -1 on failure */
+
+/** Create temporary merge files in the given paramater path, and if
+UNIV_PFS_IO defined, register the file descriptor with Performance Schema.
+@param[in]     path    location for creating temporary merge files.
+@return File descriptor */
 UNIV_INTERN
 int
-row_merge_file_create_low(void)
-/*===========================*/
+row_merge_file_create_low(
+       const char*     path)
 {
        int     fd;
 #ifdef UNIV_PFS_IO
@@ -2943,7 +3126,7 @@ row_merge_file_create_low(void)
                                     "Innodb Merge Temp File",
                                     __FILE__, __LINE__);
 #endif
-       fd = innobase_mysql_tmpfile();
+       fd = innobase_mysql_tmpfile(path);
 #ifdef UNIV_PFS_IO
        register_pfs_file_open_end(locker, fd);
 #endif
@@ -2956,16 +3139,18 @@ row_merge_file_create_low(void)
        return(fd);
 }
 
-/*********************************************************************//**
-Create a merge file.
+
+/** Create a merge file in the given location.
+@param[out]    merge_file      merge file structure
+@param[in]     path            location for creating temporary file
 @return file descriptor, or -1 on failure */
 UNIV_INTERN
 int
 row_merge_file_create(
-/*==================*/
-       merge_file_t*   merge_file)     /*!< out: merge file structure */
+       merge_file_t*   merge_file,
+       const char*     path)
 {
-       merge_file->fd = row_merge_file_create_low();
+       merge_file->fd = row_merge_file_create_low(path);
        merge_file->offset = 0;
        merge_file->n_rec = 0;
 
@@ -3481,10 +3666,6 @@ row_merge_build_indexes(
        }
 
        for (i = 0; i < n_indexes; i++) {
-               if (row_merge_file_create(&merge_files[i]) < 0) {
-                       error = DB_OUT_OF_MEMORY;
-                       goto func_exit;
-               }
 
                if (indexes[i]->type & DICT_FTS) {
                        ibool   opt_doc_id_size = FALSE;
@@ -3513,13 +3694,6 @@ row_merge_build_indexes(
                }
        }
 
-       tmpfd = row_merge_file_create_low();
-
-       if (tmpfd < 0) {
-               error = DB_OUT_OF_MEMORY;
-               goto func_exit;
-       }
-
        /* Reset the MySQL row buffer that is used when reporting
        duplicate keys. */
        innobase_rec_reset(table);
@@ -3531,7 +3705,7 @@ row_merge_build_indexes(
                trx, table, old_table, new_table, online, indexes,
                fts_sort_idx, psort_info, merge_files, key_numbers,
                n_indexes, add_cols, col_map,
-               add_autoinc, sequence, block);
+               add_autoinc, sequence, block, &tmpfd);
 
        if (error != DB_SUCCESS) {
 
@@ -3612,7 +3786,7 @@ wait_again:
 #ifdef FTS_INTERNAL_DIAG_PRINT
                        DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n");
 #endif
-               } else {
+               } else if (merge_files[i].fd != -1) {
                        row_merge_dup_t dup = {
                                sort_idx, table, col_map, 0};
 
index bf17673a036261018cb20292289c227517598481..3140e18a0b1a7b56d0af3ca4ed4abaf6bc315096 100644 (file)
@@ -1322,18 +1322,14 @@ row_insert_for_mysql(
                mem_analyze_corruption(prebuilt);
 
                ut_error;
-       } else if (srv_created_new_raw || srv_force_recovery) {
-               fputs("InnoDB: A new raw disk partition was initialized or\n"
-                     "InnoDB: innodb_force_recovery is on: we do not allow\n"
+       } else if (srv_force_recovery) {
+               fputs("InnoDB: innodb_force_recovery is on: we do not allow\n"
                      "InnoDB: database modifications by the user. Shut down\n"
                      "InnoDB: mysqld and edit my.cnf so that"
-                     " newraw is replaced\n"
-                     "InnoDB: with raw, and innodb_force_... is removed.\n",
+                     "InnoDB: innodb_force_... is removed.\n",
                      stderr);
-               if(srv_force_recovery) {
-                       return(DB_READ_ONLY);
-               }
-               return(DB_ERROR);
+
+               return(DB_READ_ONLY);
        }
 
        trx->op_info = "inserting";
@@ -1715,18 +1711,14 @@ row_update_for_mysql(
                ut_error;
        }
 
-       if (UNIV_UNLIKELY(srv_created_new_raw || srv_force_recovery)) {
-               fputs("InnoDB: A new raw disk partition was initialized or\n"
-                     "InnoDB: innodb_force_recovery is on: we do not allow\n"
+       if (UNIV_UNLIKELY(srv_force_recovery)) {
+               fputs("InnoDB: innodb_force_recovery is on: we do not allow\n"
                      "InnoDB: database modifications by the user. Shut down\n"
-                     "InnoDB: mysqld and edit my.cnf so that newraw"
-                     " is replaced\n"
-                     "InnoDB: with raw, and innodb_force_... is removed.\n",
+                     "InnoDB: mysqld and edit my.cnf so that"
+                     "InnoDB: innodb_force_... is removed.\n",
                      stderr);
-               if(srv_force_recovery) {
-                       return(DB_READ_ONLY);
-               }
-               return(DB_ERROR);
+
+               return(DB_READ_ONLY);
        }
 
        DEBUG_SYNC_C("innodb_row_update_for_mysql_begin");
@@ -2204,22 +2196,6 @@ row_create_table_for_mysql(
                goto err_exit;
        );
 
-       if (srv_created_new_raw) {
-               fputs("InnoDB: A new raw disk partition was initialized:\n"
-                     "InnoDB: we do not allow database modifications"
-                     " by the user.\n"
-                     "InnoDB: Shut down mysqld and edit my.cnf so that newraw"
-                     " is replaced with raw.\n", stderr);
-err_exit:
-               dict_mem_table_free(table);
-
-               if (commit) {
-                       trx_commit_for_mysql(trx);
-               }
-
-               return(DB_ERROR);
-       }
-
        trx->op_info = "creating table";
 
        if (row_mysql_is_system_table(table->name)) {
@@ -2230,7 +2206,19 @@ err_exit:
                        "InnoDB: MySQL system tables must be"
                        " of the MyISAM type!\n",
                        table->name);
-               goto err_exit;
+
+#ifndef DBUG_OFF
+err_exit:
+#endif /* !DBUG_OFF */
+               dict_mem_table_free(table);
+
+               if (commit) {
+                       trx_commit_for_mysql(trx);
+               }
+
+               trx->op_info = "";
+
+               return(DB_ERROR);
        }
 
        trx_start_if_not_started_xa(trx);
@@ -3280,16 +3268,6 @@ row_truncate_table_for_mysql(
 
        ut_ad(table);
 
-       if (srv_created_new_raw) {
-               fputs("InnoDB: A new raw disk partition was initialized:\n"
-                     "InnoDB: we do not allow database modifications"
-                     " by the user.\n"
-                     "InnoDB: Shut down mysqld and edit my.cnf so that newraw"
-                     " is replaced with raw.\n", stderr);
-
-               return(DB_ERROR);
-       }
-
        if (dict_table_is_discarded(table)) {
                return(DB_TABLESPACE_DELETED);
        } else if (table->ibd_file_missing) {
@@ -3411,13 +3389,11 @@ row_truncate_table_for_mysql(
                goto funct_exit;
        }
 
-       if (table->space && !table->dir_path_of_temp_table) {
+       if (table->space && !DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY)) {
                /* Discard and create the single-table tablespace. */
                ulint   space   = table->space;
                ulint   flags   = fil_space_get_flags(space);
 
-               ut_a(!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY));
-
                dict_get_and_save_data_dir_path(table, true);
 
                if (flags != ULINT_UNDEFINED
@@ -3771,16 +3747,6 @@ row_drop_table_for_mysql(
 
        ut_a(name != NULL);
 
-       if (srv_created_new_raw) {
-               fputs("InnoDB: A new raw disk partition was initialized:\n"
-                     "InnoDB: we do not allow database modifications"
-                     " by the user.\n"
-                     "InnoDB: Shut down mysqld and edit my.cnf so that newraw"
-                     " is replaced with raw.\n", stderr);
-
-               DBUG_RETURN(DB_ERROR);
-       }
-
        /* The table name is prefixed with the database name and a '/'.
        Certain table names starting with 'innodb_' have their special
        meaning regardless of the database name.  Thus, we need to
@@ -4217,8 +4183,9 @@ row_drop_table_for_mysql(
                is_temp = DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY);
 
                /* If there is a temp path then the temp flag is set.
-               However, during recovery, we might have a temp flag but
-               not know the temp path */
+               However, during recovery or reloading the table object
+               after eviction from data dictionary cache, we might
+               have a temp flag but not know the temp path */
                ut_a(table->dir_path_of_temp_table == NULL || is_temp);
                if (dict_table_is_discarded(table)
                    || table->ibd_file_missing) {
@@ -4786,24 +4753,22 @@ row_rename_table_for_mysql(
        ibool           old_is_tmp, new_is_tmp;
        pars_info_t*    info                    = NULL;
        int             retry;
+       bool            aux_fts_rename          = false;
 
        ut_a(old_name != NULL);
        ut_a(new_name != NULL);
        ut_ad(trx->state == TRX_STATE_ACTIVE);
 
-       if (srv_created_new_raw || srv_force_recovery) {
-               fputs("InnoDB: A new raw disk partition was initialized or\n"
-                     "InnoDB: innodb_force_recovery is on: we do not allow\n"
+       if (srv_force_recovery) {
+               fputs("InnoDB: innodb_force_recovery is on: we do not allow\n"
                      "InnoDB: database modifications by the user. Shut down\n"
-                     "InnoDB: mysqld and edit my.cnf so that newraw"
-                     " is replaced\n"
-                     "InnoDB: with raw, and innodb_force_... is removed.\n",
+                     "InnoDB: mysqld and edit my.cnf so that"
+                     "InnoDB: innodb_force_... is removed.\n",
                      stderr);
-               if(srv_force_recovery) {
-                       err = DB_READ_ONLY;
-               }
 
+               err = DB_READ_ONLY;
                goto funct_exit;
+
        } else if (row_mysql_is_system_table(new_name)) {
 
                fprintf(stderr,
@@ -5072,34 +5037,8 @@ row_rename_table_for_mysql(
        if (dict_table_has_fts_index(table)
            && !dict_tables_have_same_db(old_name, new_name)) {
                err = fts_rename_aux_tables(table, new_name, trx);
-
-               if (err != DB_SUCCESS && (table->space != 0)) {
-                       char*   orig_name = table->name;
-                       trx_t*  trx_bg = trx_allocate_for_background();
-
-                       /* If the first fts_rename fails, the trx would
-                       be rolled back and committed, we can't use it any more,
-                       so we have to start a new background trx here. */
-                       ut_a(trx_state_eq(trx, TRX_STATE_NOT_STARTED));
-                       trx_bg->op_info = "Revert the failing rename "
-                                         "for fts aux tables";
-                       trx_bg->dict_operation_lock_mode = RW_X_LATCH;
-                       trx_start_for_ddl(trx_bg, TRX_DICT_OP_TABLE);
-
-                       /* If rename fails and table has its own tablespace,
-                       we need to call fts_rename_aux_tables again to
-                       revert the ibd file rename, which is not under the
-                       control of trx. Also notice the parent table name
-                       in cache is not changed yet. If the reverting fails,
-                       the ibd data may be left in the new database, which
-                       can be fixed only manually. */
-                       table->name = const_cast<char*>(new_name);
-                       fts_rename_aux_tables(table, old_name, trx_bg);
-                       table->name = orig_name;
-
-                       trx_bg->dict_operation_lock_mode = 0;
-                       trx_commit_for_mysql(trx_bg);
-                       trx_free_for_background(trx_bg);
+               if (err != DB_TABLE_NOT_FOUND) {
+                       aux_fts_rename = true;
                }
        }
 
@@ -5200,6 +5139,37 @@ end:
        }
 
 funct_exit:
+       if (aux_fts_rename && err != DB_SUCCESS
+           && table != NULL && (table->space != 0)) {
+
+               char*   orig_name = table->name;
+               trx_t*  trx_bg = trx_allocate_for_background();
+
+               /* If the first fts_rename fails, the trx would
+               be rolled back and committed, we can't use it any more,
+               so we have to start a new background trx here. */
+               ut_a(trx_state_eq(trx_bg, TRX_STATE_NOT_STARTED));
+               trx_bg->op_info = "Revert the failing rename "
+                                 "for fts aux tables";
+               trx_bg->dict_operation_lock_mode = RW_X_LATCH;
+               trx_start_for_ddl(trx_bg, TRX_DICT_OP_TABLE);
+
+               /* If rename fails and table has its own tablespace,
+               we need to call fts_rename_aux_tables again to
+               revert the ibd file rename, which is not under the
+               control of trx. Also notice the parent table name
+               in cache is not changed yet. If the reverting fails,
+               the ibd data may be left in the new database, which
+               can be fixed only manually. */
+               table->name = const_cast<char*>(new_name);
+               fts_rename_aux_tables(table, old_name, trx_bg);
+               table->name = orig_name;
+
+               trx_bg->dict_operation_lock_mode = 0;
+               trx_commit_for_mysql(trx_bg);
+               trx_free_for_background(trx_bg);
+       }
+
        if (table != NULL) {
                dict_table_close(table, dict_locked, FALSE);
        }
index 8212a7b43e0e4867a8cc6da002b7d5e2971e4695..b26ba971a95383a3af41b20f19aca402235e61d0 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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 the Free Software
@@ -84,7 +84,7 @@ row_purge_node_create(
 
 /***********************************************************//**
 Repositions the pcur in the purge node on the clustered index record,
-if found.
+if found. If the record is not found, close pcur.
 @return        TRUE if the record was found */
 static
 ibool
@@ -95,11 +95,10 @@ row_purge_reposition_pcur(
        mtr_t*          mtr)    /*!< in: mtr */
 {
        if (node->found_clust) {
-               ibool   found;
+               ut_ad(node->validate_pcur());
 
-               found = btr_pcur_restore_position(mode, &node->pcur, mtr);
+               node->found_clust = btr_pcur_restore_position(mode, &node->pcur, mtr);
 
-               return(found);
        } else {
                node->found_clust = row_search_on_row_ref(
                        &node->pcur, mode, node->table, node->ref, mtr);
@@ -109,6 +108,11 @@ row_purge_reposition_pcur(
                }
        }
 
+       /* Close the current cursor if we fail to position it correctly. */
+       if (!node->found_clust) {
+               btr_pcur_close(&node->pcur);
+       }
+
        return(node->found_clust);
 }
 
@@ -182,7 +186,12 @@ func_exit:
                mem_heap_free(heap);
        }
 
-       btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
+       /* Persistent cursor is closed if reposition fails. */
+       if (node->found_clust) {
+               btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
+       } else {
+               mtr_commit(&mtr);
+       }
 
        return(success);
 }
@@ -251,7 +260,12 @@ row_purge_poss_sec(
                                                 btr_pcur_get_rec(&node->pcur),
                                                 &mtr, index, entry);
 
-       btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
+       /* Persistent cursor is closed if reposition fails. */
+       if (node->found_clust) {
+               btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
+       } else {
+               mtr_commit(&mtr);
+       }
 
        return(can_delete);
 }
@@ -831,6 +845,8 @@ row_purge_record_func(
        dict_index_t*   clust_index;
        bool            purged          = true;
 
+       ut_ad(!node->found_clust);
+
        clust_index = dict_table_get_first_index(node->table);
 
        node->index = dict_table_get_next_index(clust_index);
@@ -986,3 +1002,52 @@ row_purge_step(
 
        return(thr);
 }
+
+#ifdef UNIV_DEBUG
+/***********************************************************//**
+Validate the persisent cursor. The purge node has two references
+to the clustered index record - one via the ref member, and the
+other via the persistent cursor.  These two references must match
+each other if the found_clust flag is set.
+@return true if the stored copy of persistent cursor is consistent
+with the ref member.*/
+bool
+purge_node_t::validate_pcur()
+{
+       if (!found_clust) {
+               return(true);
+       }
+
+       if (index == NULL) {
+               return(true);
+       }
+
+       if (index->type == DICT_FTS) {
+               return(true);
+       }
+
+       if (pcur.old_stored != BTR_PCUR_OLD_STORED) {
+               return(true);
+       }
+
+       dict_index_t*   clust_index = pcur.btr_cur.index;
+
+       ulint*  offsets = rec_get_offsets(
+       pcur.old_rec, clust_index, NULL, pcur.old_n_fields, &heap);
+
+       /* Here we are comparing the purge ref record and the stored initial
+       part in persistent cursor. Both cases we store n_uniq fields of the
+       cluster index and so it is fine to do the comparison. We note this
+       dependency here as pcur and ref belong to different modules. */
+       int st = cmp_dtuple_rec(ref, pcur.old_rec, offsets);
+
+       if (st != 0) {
+               fprintf(stderr, "Purge node pcur validation failed\n");
+               dtuple_print(stderr, ref);
+               rec_print(stderr, pcur.old_rec, clust_index);
+               return(false);
+       }
+
+       return(true);
+}
+#endif /* UNIV_DEBUG */
index a27f0ebfb80d6c07c75efbdb939fa8a697960ccf..b7bc3cff64535c9ca69694c0d4e94f199f554089 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
index fcd54332a47ae26eb125bfc064b44628cf2b97f6..5a8987a802972985a57213559929738639c59f32 100644 (file)
@@ -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 <algorithm>
 
 /* 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) {
 
index dc3c0b1dd885642930c5fc12c01c8c448216e9e4..fb7fad3bf4ea0b65af9b5f9964ed58ab6951c849 100644 (file)
@@ -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 */
 
index f4ea8895d2f0a9336522b6c98d520c498b9a7bc9..5e5a4029e14f6a5b6f9981defb9147bfdf7fd333 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, 2009 Google Inc.
 Copyright (c) 2009, Percona Inc.
 
@@ -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;
 
@@ -126,6 +130,9 @@ UNIV_INTERN ulint   srv_file_format = 0;
 UNIV_FORMAT_MAX + 1 means no checking ie. FALSE.  The default is to
 set it to the highest format we support. */
 UNIV_INTERN ulint      srv_max_file_format_at_startup = UNIV_FORMAT_MAX;
+/** Set if InnoDB operates in read-only mode or innodb-force-recovery
+is greater than SRV_FORCE_NO_TRX_UNDO. */
+UNIV_INTERN my_bool    high_level_read_only;
 
 #if UNIV_FORMAT_A
 # error "UNIV_FORMAT_A must be 0!"
@@ -144,6 +151,7 @@ OS (provided we compiled Innobase with it in), otherwise we will
 use simulated aio we build below with threads.
 Currently we support native aio on windows and linux */
 UNIV_INTERN my_bool    srv_use_native_aio = TRUE;
+UNIV_INTERN my_bool    srv_numa_interleave = FALSE;
 
 #ifdef __WIN__
 /* Windows native condition variables. We use runtime loading / function
@@ -207,6 +215,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 +987,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);
 
@@ -1663,6 +1683,8 @@ exit_func:
 /*********************************************************************//**
 A thread which prints warnings about semaphore waits which have lasted
 too long. These can be used to track bugs which cause hangs.
+Note: In order to make sync_arr_wake_threads_if_sema_free work as expected,
+we should avoid waiting any mutexes in this function!
 @return        a dummy parameter */
 extern "C" UNIV_INTERN
 os_thread_ret_t
@@ -1702,22 +1724,22 @@ loop:
        /* Try to track a strange bug reported by Harald Fuchs and others,
        where the lsn seems to decrease at times */
 
-       new_lsn = log_get_lsn();
+       if (log_peek_lsn(&new_lsn)) {
+               if (new_lsn < old_lsn) {
+                       ut_print_timestamp(stderr);
+                       fprintf(stderr,
+                               "  InnoDB: Error: old log sequence number " LSN_PF
+                               " was greater\n"
+                               "InnoDB: than the new log sequence number " LSN_PF "!\n"
+                               "InnoDB: Please submit a bug report"
+                               " to http://bugs.mysql.com\n",
+                               old_lsn, new_lsn);
+                       ut_ad(0);
+               }
 
-       if (new_lsn < old_lsn) {
-               ut_print_timestamp(stderr);
-               fprintf(stderr,
-                       "  InnoDB: Error: old log sequence number " LSN_PF
-                       " was greater\n"
-                       "InnoDB: than the new log sequence number " LSN_PF "!\n"
-                       "InnoDB: Please submit a bug report"
-                       " to http://bugs.mysql.com\n",
-                       old_lsn, new_lsn);
-               ut_ad(0);
+               old_lsn = new_lsn;
        }
 
-       old_lsn = new_lsn;
-
        if (difftime(time(NULL), srv_last_monitor_time) > 60) {
                /* We referesh InnoDB Monitor values so that averages are
                printed from at most 60 last seconds */
@@ -1737,7 +1759,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,
@@ -2581,13 +2616,8 @@ srv_do_purge(
                }
 
                n_pages_purged = trx_purge(
-                       n_use_threads, srv_purge_batch_size, false);
-
-               if (!(count++ % TRX_SYS_N_RSEGS)) {
-                       /* Force a truncate of the history list. */
-                       n_pages_purged += trx_purge(
-                               1, srv_purge_batch_size, true);
-               }
+                       n_use_threads, srv_purge_batch_size,
+                       (++count % TRX_SYS_N_RSEGS) == 0);
 
                *n_total_purged += n_pages_purged;
 
@@ -2780,8 +2810,17 @@ DECLARE_THREAD(srv_purge_coordinator_thread)(
                n_pages_purged = trx_purge(1, srv_purge_batch_size, false);
        }
 
-       /* Force a truncate of the history list. */
-       n_pages_purged = trx_purge(1, srv_purge_batch_size, true);
+       /* This trx_purge is called to remove any undo records (added by
+       background threads) after completion of the above loop. When
+       srv_fast_shutdown != 0, a large batch size can cause significant
+       delay in shutdown ,so reducing the batch size to magic number 20
+       (which was default in 5.5), which we hope will be sufficient to
+       remove all the undo records */
+       const   uint temp_batch_size = 20;
+
+       n_pages_purged = trx_purge(1, srv_purge_batch_size <= temp_batch_size
+                                     ? srv_purge_batch_size : temp_batch_size,
+                                  true);
        ut_a(n_pages_purged == 0 || srv_fast_shutdown != 0);
 
        /* The task queue should always be empty, independent of fast
index fde0d1552be210e4a8c23ffcc02fe64f8e0c76a6..5a9aeb75e85711012d7f3fdc9b0e5b8d6e5456d6 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
 Copyright (c) 2008, Google Inc.
 Copyright (c) 2009, Percona Inc.
 
@@ -147,6 +147,9 @@ static const ulint SRV_UNDO_TABLESPACE_SIZE_IN_PAGES =
 #define SRV_N_PENDING_IOS_PER_THREAD   OS_AIO_N_PENDING_IOS_PER_THREAD
 #define SRV_MAX_N_PENDING_SYNC_IOS     100
 
+/** The round off to MB is similar as done in srv_parse_megabytes() */
+#define CALC_NUMBER_OF_PAGES(size)  ((size) / (1024 * 1024)) * \
+                                 ((1024 * 1024) / (UNIV_PAGE_SIZE))
 #ifdef UNIV_PFS_THREAD
 /* Keys to register InnoDB threads with performance schema */
 UNIV_INTERN mysql_pfs_key_t    io_handler_thread_key;
@@ -222,8 +225,8 @@ srv_file_check_mode(
 
                /* Note: stat.rw_perm is only valid of files */
 
-               if (stat.type == OS_FILE_TYPE_FILE
-                   || stat.type == OS_FILE_TYPE_BLOCK) {
+               if (stat.type == OS_FILE_TYPE_FILE) {
+
                        if (!stat.rw_perm) {
 
                                ib_logf(IB_LOG_LEVEL_ERROR,
@@ -420,14 +423,18 @@ srv_parse_data_file_paths_and_sizes(
                    && *(str + 1) == 'e'
                    && *(str + 2) == 'w') {
                        str += 3;
-                       (srv_data_file_is_raw_partition)[i] = SRV_NEW_RAW;
+                       /* Initialize new raw device only during bootstrap */
+                       (srv_data_file_is_raw_partition)[i] =
+                       opt_bootstrap ? SRV_NEW_RAW : SRV_OLD_RAW;
                }
 
                if (*str == 'r' && *(str + 1) == 'a' && *(str + 2) == 'w') {
                        str += 3;
 
+                       /* Initialize new raw device only during bootstrap */
                        if ((srv_data_file_is_raw_partition)[i] == 0) {
-                               (srv_data_file_is_raw_partition)[i] = SRV_OLD_RAW;
+                               (srv_data_file_is_raw_partition)[i] =
+                               opt_bootstrap ? SRV_NEW_RAW : SRV_OLD_RAW;
                        }
                }
 
@@ -880,6 +887,24 @@ open_or_create_data_files(
 
                                return(DB_ERROR);
                        }
+
+                       const char*     check_msg;
+                       check_msg = fil_read_first_page(
+                               files[i], FALSE, &flags, &space,
+#ifdef UNIV_LOG_ARCHIVE
+                               min_arch_log_no, max_arch_log_no,
+#endif /* UNIV_LOG_ARCHIVE */
+                               min_flushed_lsn, max_flushed_lsn);
+
+                       /* If first page is valid, don't overwrite DB.
+                       It prevents overwriting DB when mysql_install_db
+                       starts mysqld multiple times during bootstrap. */
+                       if (check_msg == NULL) {
+
+                               srv_created_new_raw = FALSE;
+                               ret = FALSE;
+                       }
+
                } else if (srv_data_file_is_raw_partition[i] == SRV_OLD_RAW) {
                        srv_start_raw_disk_in_use = TRUE;
 
@@ -936,10 +961,16 @@ open_or_create_data_files(
 size_check:
                        size = os_file_get_size(files[i]);
                        ut_a(size != (os_offset_t) -1);
-                       /* Round size downward to megabytes */
 
-                       rounded_size_pages = (ulint)
-                               (size >> UNIV_PAGE_SIZE_SHIFT);
+                       /* Under some error conditions like disk full
+                       narios or file size reaching filesystem
+                       limit the data file could contain an incomplete
+                       extent at the end. When we extend a data file
+                       and if some failure happens, then also the data
+                       file could contain an incomplete extent.  So we
+                       need to round the size downward to a megabyte.*/
+
+                       rounded_size_pages = (ulint) CALC_NUMBER_OF_PAGES(size);
 
                        if (i == srv_n_data_files - 1
                            && srv_auto_extend_last_data_file) {
@@ -1523,9 +1554,8 @@ innobase_start_or_create_for_mysql(void)
        char*           logfile0        = NULL;
        size_t          dirnamelen;
 
-       if (srv_force_recovery > SRV_FORCE_NO_TRX_UNDO) {
-               srv_read_only_mode = true;
-       }
+       high_level_read_only = srv_read_only_mode
+               || srv_force_recovery > SRV_FORCE_NO_TRX_UNDO;
 
        if (srv_read_only_mode) {
                ib_logf(IB_LOG_LEVEL_INFO, "Started in read only mode");
@@ -1854,7 +1884,7 @@ innobase_start_or_create_for_mysql(void)
                        }
                } else {
                        srv_monitor_file_name = NULL;
-                       srv_monitor_file = os_file_create_tmpfile();
+                       srv_monitor_file = os_file_create_tmpfile(NULL);
 
                        if (!srv_monitor_file) {
                                return(DB_ERROR);
@@ -1864,7 +1894,7 @@ innobase_start_or_create_for_mysql(void)
                mutex_create(srv_dict_tmpfile_mutex_key,
                             &srv_dict_tmpfile_mutex, SYNC_DICT_OPERATION);
 
-               srv_dict_tmpfile = os_file_create_tmpfile();
+               srv_dict_tmpfile = os_file_create_tmpfile(NULL);
 
                if (!srv_dict_tmpfile) {
                        return(DB_ERROR);
@@ -1873,7 +1903,7 @@ innobase_start_or_create_for_mysql(void)
                mutex_create(srv_misc_tmpfile_mutex_key,
                             &srv_misc_tmpfile_mutex, SYNC_ANY_LATCH);
 
-               srv_misc_tmpfile = os_file_create_tmpfile();
+               srv_misc_tmpfile = os_file_create_tmpfile(NULL);
 
                if (!srv_misc_tmpfile) {
                        return(DB_ERROR);
@@ -3025,9 +3055,9 @@ innobase_shutdown_for_mysql(void)
 
        ibuf_close();
        log_shutdown();
-       lock_sys_close();
        trx_sys_file_format_close();
        trx_sys_close();
+       lock_sys_close();
 
        /* We don't create these mutexes in RO mode because we don't create
        the temp files that the cover. */
index d56d328d8c321e41079ba46305929aad6f90a2a7..4feea36a253366592fbf060b9e229314d136487c 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -1036,8 +1036,8 @@ sync_array_print_info_low(
        ulint           count = 0;
 
        fprintf(file,
-               "OS WAIT ARRAY INFO: reservation count %ld\n",
-               (long) arr->res_count);
+               "OS WAIT ARRAY INFO: reservation count " ULINTPF "\n",
+               arr->res_count);
 
        for (i = 0; count < arr->n_reserved; ++i) {
                sync_cell_t*    cell;
@@ -1132,7 +1132,7 @@ sync_array_print(
        }
 
        fprintf(file,
-               "OS WAIT ARRAY INFO: signal count %ld\n", (long) sg_count);
+               "OS WAIT ARRAY INFO: signal count " ULINTPF "\n", sg_count);
 
 }
 
index 60b1798fb0d6402b399e7f993b6f9819c0966ef9..3ca495aaa8c72da4d5fabe0a3208808c5d8fd5b3 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2008, Google Inc.
 
 Portions of this file contain modifications contributed and copyrighted by
@@ -298,9 +298,9 @@ mutex_create_func(
 
        /* NOTE! The very first mutexes are not put to the mutex list */
 
-       if ((mutex == &mutex_list_mutex)
+       if (mutex == &mutex_list_mutex
 #ifdef UNIV_SYNC_DEBUG
-           || (mutex == &sync_thread_mutex)
+           || mutex == &sync_thread_mutex
 #endif /* UNIV_SYNC_DEBUG */
            ) {
 
index bc11f1d76bd45fdfbc0d419f68fb2c159bef0c39..ae9095d1ddc24011d75d98f023e53bf4be50f75b 100644 (file)
@@ -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 */
 }
 
 /***********************************************************************//**
index 52830a77b127e4d9e9e3823c9da55228d13e772e..96b906803d7951e150ce25d0957c4b73f6984872 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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 the Free Software
@@ -29,7 +29,10 @@ Created 3/26/1996 Heikki Tuuri
 #include "trx0sys.ic"
 #endif
 
-#ifndef UNIV_HOTBACKUP
+#ifdef UNIV_HOTBACKUP
+#include "fsp0types.h"
+
+#else  /* !UNIV_HOTBACKUP */
 #include "fsp0fsp.h"
 #include "mtr0log.h"
 #include "mtr0log.h"
@@ -44,6 +47,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 +181,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 +214,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 +229,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 +318,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. */
@@ -1115,18 +1252,15 @@ trx_sys_read_pertable_file_format_id(
        /* get the file format from the page */
        ptr = page + 54;
        flags = mach_read_from_4(ptr);
-       if (flags == 0) {
-               /* file format is Antelope */
-               *format_id = 0;
-               return(TRUE);
-       } else if (flags & 1) {
-               /* tablespace flags are ok */
-               *format_id = (flags / 32) % 128;
-               return(TRUE);
-       } else {
+
+       if (!fsp_flags_is_valid(flags) {
                /* bad tablespace flags */
                return(FALSE);
        }
+
+       *format_id = FSP_FLAGS_GET_POST_ANTELOPE(flags);
+
+       return(TRUE);
 }
 
 
@@ -1187,8 +1321,6 @@ trx_sys_close(void)
        /* Free the double write data structures. */
        buf_dblwr_free();
 
-       mutex_enter(&trx_sys->mutex);
-
        ut_a(UT_LIST_GET_LEN(trx_sys->ro_trx_list) == 0);
 
        /* Only prepared transactions may be left in the system. Free them. */
@@ -1228,8 +1360,6 @@ trx_sys_close(void)
        ut_a(UT_LIST_GET_LEN(trx_sys->rw_trx_list) == 0);
        ut_a(UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0);
 
-       mutex_exit(&trx_sys->mutex);
-
        mutex_free(&trx_sys->mutex);
 
        mem_free(trx_sys);
index c2d5c1f7c7f43ca389be786a27e77062129474c4..5390f6dcf9114aa5cc4068bbd379da4c86db4df2 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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 the Free Software
@@ -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);
 }
 
 /********************************************************************//**
@@ -303,11 +306,10 @@ trx_free_prepared(
 /*==============*/
        trx_t*  trx)    /*!< in, own: trx object */
 {
-       ut_ad(mutex_own(&trx_sys->mutex));
-
        ut_a(trx_state_eq(trx, TRX_STATE_PREPARED));
        ut_a(trx->magic_n == TRX_MAGIC_N);
 
+       lock_trx_release_locks(trx);
        trx_undo_free_prepared(trx);
 
        assert_trx_in_rw_list(trx);
@@ -853,6 +855,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 +974,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 +1023,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 +1042,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 +1341,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 +1530,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 +2261,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 +2287,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 +2324,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;
index 6a82c8df39be448f3a30da64de70368c087ec142..bf30ec379aa8cbb4aad3e4aa3f8b450ea1095834 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2001, 2013, 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
@@ -199,7 +199,8 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
       ftbw= (FTB_WORD *)alloc_root(&ftb_param->ftb->mem_root,
                                    sizeof(FTB_WORD) +
                                    (info->trunc ? MI_MAX_KEY_BUFF :
-                                    word_len * ftb_param->ftb->charset->mbmaxlen +
+                                    (word_len + 1) *
+                                    ftb_param->ftb->charset->mbmaxlen +
                                     HA_FT_WLEN +
                                     ftb_param->ftb->info->s->rec_reflength));
       ftbw->len= word_len + 1;
@@ -362,6 +363,8 @@ static int _ft2_search_no_lock(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
   MI_INFO *info=ftb->info;
   uint UNINIT_VAR(off), extra= HA_FT_WLEN + info->s->rec_reflength;
   uchar *lastkey_buf=ftbw->word+ftbw->off;
+  uint max_word_length= (ftbw->flags & FTB_FLAG_TRUNC) ? MI_MAX_KEY_BUFF :
+                        ((ftbw->len) * ftb->charset->mbmaxlen) + extra;
 
   if (ftbw->flags & FTB_FLAG_TRUNC)
     lastkey_buf+=ftbw->len;
@@ -421,7 +424,7 @@ static int _ft2_search_no_lock(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
              (my_bool) (ftbw->flags & FTB_FLAG_TRUNC),0);
   }
 
-  if (r) /* not found */
+  if (r || info->lastkey_length > max_word_length) /* not found */
   {
     if (!ftbw->off || !(ftbw->flags & FTB_FLAG_TRUNC))
     {
index baa15b6fbcc87f7e5e053a6d0047555cb88fca19..2ef63c8af2e99e0d1d7f1a41c6f8edc1be0c22b5 100644 (file)
@@ -1,4 +1,5 @@
-/* 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
@@ -16,6 +17,7 @@
 /* Written by Sergei A. Golubchik, who has a shared copyright to this code */
 
 #include "ftdefs.h"
+#include "ctype.h"
 
 typedef struct st_ft_docstat {
   FT_WORD *list;
@@ -89,7 +91,7 @@ my_bool ft_boolean_check_syntax_string(const uchar *str)
   for (i=0; i<sizeof(DEFAULT_FTB_SYNTAX); i++)
   {
     /* limiting to 7-bit ascii only */
-    if ((unsigned char)(str[i]) > 127 || my_isalnum(default_charset_info, str[i]))
+    if ((unsigned char)(str[i]) > 127 || isalnum(str[i]))
       return 1;
     for (j=0; j<i; j++)
       if (str[i] == str[j] && (i != 11 || j != 10))
index 68d1af7026019224057cb84d1e1e3fc6a3e1b748..c1dcfb0c9d8284f4097b4c5367bb6ff3b1155556 100644 (file)
@@ -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
@@ -96,7 +96,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
 uint _mi_ft_parse(TREE *parsed, MI_INFO *info, uint keynr, const uchar *record,
                   MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root)
 {
-  FT_SEG_ITERATOR ftsi;
+  FT_SEG_ITERATOR ftsi= { 0, 0, NULL, NULL, NULL };
   struct st_mysql_ftparser *parser;
   DBUG_ENTER("_mi_ft_parse");
 
@@ -169,7 +169,8 @@ static int _mi_ft_erase(MI_INFO *info, uint keynr, uchar *keybuf,
 
 int _mi_ft_cmp(MI_INFO *info, uint keynr, const uchar *rec1, const uchar *rec2)
 {
-  FT_SEG_ITERATOR ftsi1, ftsi2;
+  FT_SEG_ITERATOR ftsi1= { 0, 0, NULL, NULL, NULL };
+  FT_SEG_ITERATOR ftsi2= { 0, 0, NULL, NULL, NULL };
   const CHARSET_INFO *cs= info->s->keyinfo[keynr].seg->charset;
   DBUG_ENTER("_mi_ft_cmp");
   _mi_ft_segiterator_init(info, keynr, rec1, &ftsi1);
index e3f172c95299c339bbf2f91349a3e013dd6f9f86..5b40a120c4bf7b612ed6b3984a32e6427eb9950f 100644 (file)
@@ -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
@@ -138,7 +138,7 @@ int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag)
 {
   reg2 ha_rows i;
   uint delete_link_length;
-  my_off_t empty,next_link,UNINIT_VAR(old_link);
+  my_off_t empty, next_link, old_link= 0;
   char buff[22],buff2[22];
   DBUG_ENTER("chk_del");
 
index 48f9b82a0b5f052f3b5d9eb989dbbce3229e06eb..c05184236ce7558e5a41bc5ff83dffff8a78cc36 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
@@ -68,6 +68,10 @@ static double mbr_join_square(const double *a, const double *b, int n_dim)
     b += 2;
   }while (a != end);
 
+  /* Check for infinity or NaN */
+  if (my_isinf(square) || my_isnan(square))
+    square = DBL_MAX;
+
   return square;
 }
 
@@ -102,6 +106,9 @@ static void pick_seeds(SplitStruct *node, int n_entries,
   double max_d = -DBL_MAX;
   double d;
 
+  *seed_a = node;
+  *seed_b = node + 1;
+
   for (cur1 = node; cur1 < lim1; ++cur1)
   {
     for (cur2=cur1 + 1; cur2 < lim2; ++cur2)
index 0772eda37c3ab300b6b05fb9ceeb1b842c35831e..e4397035bf86afdad4e2302e43eb132bdafd3bd2 100644 (file)
-/*
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
-*/
-
-package regression;
-
-import java.util.Properties;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import junit.framework.TestCase;
-
-import testsuite.clusterj.model.Employee;
-
-import com.mysql.clusterj.ClusterJHelper;
-import com.mysql.clusterj.Session;
-import com.mysql.clusterj.SessionFactory;
-
-public class Bug54619 extends TestCase {
-
-    public void test() {
-        main(null);
-    }
-
-    public static void main(String[] args) {
-
-        /* http://bugs.mysql.com/bug.php?id=54619
-         * 
-         * MySQL Cluster generic Linux and Windows 7.1.3
-         * 
-         * Session factory in a different thread than sessions crashes JVM.
-         * 
-         * If SessionFactory is initialized in a different thread than where
-         * sessions are created, session.newInstance call will crash JVM. This
-         * happens on Windows and Linux. In Windows the crash seems to be coming
-         * from DomainFieldHandlerImpl and from line table.getColumn(columnName);.
-         * 
-         * Workaround is to insert a dummy row (most likely any db access works)
-         * from same thread where the SessionFactory is created. After this the
-         * session seem to be working from other thread.
-         */
-        ExecutorService pool = Executors.newFixedThreadPool(4);
-        // 1. Manager initializes session factory
-        Manager.createClusterJSession();
-        // 2. Remove the comment to get this to work.
-        //insert(1); 
-
-        // 3. Insert rows from different threads.
-        for (int i = 0; i < 4; ++i) {
-            final int id = i;
-            pool.submit(new Runnable() {
-                
-                public void run() {
-                    Session session = Manager.getSessionFactory().getSession();
-                    Employee entity = session.newInstance(Employee.class); // crash here?
-                    entity.setId(id);
-                    entity.setAge(id);
-                    entity.setMagic(id);
-                    entity.setName("Employee " + id);
-                    session.currentTransaction().begin();
-                    session.persist(entity);
-                    session.currentTransaction().commit();
-                    return;
-                }
-            });
-        }
-        // wait for all threads to complete
-        pool.shutdown();
-        try {
-            pool.awaitTermination(5, TimeUnit.SECONDS);
-        } catch (InterruptedException e) {
-            fail("Interrupted pool.awaitTermination");
-        }
-        pool.shutdownNow();
-    }
-
-    private static void insert(int number) {
-        Session session = Manager.getSessionFactory().getSession();
-        Employee entity = session.newInstance(Employee.class);
-        entity.setId(number);
-        session.currentTransaction().begin();
-        session.persist(entity);
-        session.currentTransaction().commit();
-
-        return;
-    }
-
-}
-
-class Manager {
-
-    static SessionFactory sessionfactory;
-
-    Manager() {
-        createClusterJSession();
-        return;
-    }
-
-    static void createClusterJSession() {
-        Properties properties = new Properties();
-        properties.put("com.mysql.clusterj.connectstring", "localhost:9311");
-        properties.put("com.mysql.clusterj.database", "test");
-        sessionfactory = ClusterJHelper.getSessionFactory(properties);
-
-        return;
-    }
-
-    public static SessionFactory getSessionFactory() {
-        return sessionfactory;
-    }
-}
+/*\r
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.\r
+\r
+ This program is free software; you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License as published by\r
+ the Free Software Foundation; version 2 of the License.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA\r
+*/\r
+\r
+package regression;\r
+\r
+import java.util.Properties;\r
+import java.util.concurrent.ExecutorService;\r
+import java.util.concurrent.Executors;\r
+import java.util.concurrent.TimeUnit;\r
+\r
+import junit.framework.TestCase;\r
+\r
+import testsuite.clusterj.model.Employee;\r
+\r
+import com.mysql.clusterj.ClusterJHelper;\r
+import com.mysql.clusterj.Session;\r
+import com.mysql.clusterj.SessionFactory;\r
+\r
+public class Bug54619 extends TestCase {\r
+\r
+    public void test() {\r
+        main(null);\r
+    }\r
+\r
+    public static void main(String[] args) {\r
+\r
+        /* http://bugs.mysql.com/bug.php?id=54619\r
+         * \r
+         * MySQL Cluster generic Linux and Windows 7.1.3\r
+         * \r
+         * Session factory in a different thread than sessions crashes JVM.\r
+         * \r
+         * If SessionFactory is initialized in a different thread than where\r
+         * sessions are created, session.newInstance call will crash JVM. This\r
+         * happens on Windows and Linux. In Windows the crash seems to be coming\r
+         * from DomainFieldHandlerImpl and from line table.getColumn(columnName);.\r
+         * \r
+         * Workaround is to insert a dummy row (most likely any db access works)\r
+         * from same thread where the SessionFactory is created. After this the\r
+         * session seem to be working from other thread.\r
+         */\r
+        ExecutorService pool = Executors.newFixedThreadPool(4);\r
+        // 1. Manager initializes session factory\r
+        Manager.createClusterJSession();\r
+        // 2. Remove the comment to get this to work.\r
+        //insert(1); \r
+\r
+        // 3. Insert rows from different threads.\r
+        for (int i = 0; i < 4; ++i) {\r
+            final int id = i;\r
+            pool.submit(new Runnable() {\r
+                \r
+                public void run() {\r
+                    Session session = Manager.getSessionFactory().getSession();\r
+                    Employee entity = session.newInstance(Employee.class); // crash here?\r
+                    entity.setId(id);\r
+                    entity.setAge(id);\r
+                    entity.setMagic(id);\r
+                    entity.setName("Employee " + id);\r
+                    session.currentTransaction().begin();\r
+                    session.persist(entity);\r
+                    session.currentTransaction().commit();\r
+                    return;\r
+                }\r
+            });\r
+        }\r
+        // wait for all threads to complete\r
+        pool.shutdown();\r
+        try {\r
+            pool.awaitTermination(5, TimeUnit.SECONDS);\r
+        } catch (InterruptedException e) {\r
+            fail("Interrupted pool.awaitTermination");\r
+        }\r
+        pool.shutdownNow();\r
+    }\r
+\r
+    private static void insert(int number) {\r
+        Session session = Manager.getSessionFactory().getSession();\r
+        Employee entity = session.newInstance(Employee.class);\r
+        entity.setId(number);\r
+        session.currentTransaction().begin();\r
+        session.persist(entity);\r
+        session.currentTransaction().commit();\r
+\r
+        return;\r
+    }\r
+\r
+}\r
+\r
+class Manager {\r
+\r
+    static SessionFactory sessionfactory;\r
+\r
+    Manager() {\r
+        createClusterJSession();\r
+        return;\r
+    }\r
+\r
+    static void createClusterJSession() {\r
+        Properties properties = new Properties();\r
+        properties.put("com.mysql.clusterj.connectstring", "localhost:9311");\r
+        properties.put("com.mysql.clusterj.database", "test");\r
+        sessionfactory = ClusterJHelper.getSessionFactory(properties);\r
+\r
+        return;\r
+    }\r
+\r
+    public static SessionFactory getSessionFactory() {\r
+        return sessionfactory;\r
+    }\r
+}\r
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/Makefile
new file mode 100644 (file)
index 0000000..5935560
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright (C) 2003, 2008 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+BIN_DIRS :=    ndbapi_simple \
+               ndbapi_async \
+               ndbapi_async1 \
+               ndbapi_retries \
+               ndbapi_simple_index \
+               ndbapi_s_i_ndbrecord \
+               ndbapi_event \
+               ndbapi_scan \
+               ndbapi_blob \
+               ndbapi_blob_ndbrecord \
+               mgmapi_logevent \
+               ndbapi_simple_dual \
+               mgmapi_logevent2 \
+               ndbapi_recattr_vs_record
+
+bins: $(patsubst %, _bins_%, $(BIN_DIRS))
+
+$(patsubst %, _bins_%, $(BIN_DIRS)) :
+       $(MAKE) -C $(patsubst _bins_%, %, $@) $(OPTS)
+
+libs:
+
+clean:
+       for f in ${BIN_DIRS}; do \
+               $(MAKE) -C $$f $@;\
+       done
+
+clean_dep: clean
+cleanall: clean
+tidy: clean
+distclean: clean
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/mgmapi_logevent/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/mgmapi_logevent/Makefile
new file mode 100644 (file)
index 0000000..d9db39a
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2005, 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = mgmapi_logevent
+SRCS = main.cpp
+OBJS = main.o
+CXX = g++
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = 
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)/storage/ndb/include
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(OBJS): $(SRCS)
+       $(CXX) $(CFLAGS) -I$(TOP_SRCDIR)/include -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/mgmapi  -I$(INCLUDE_DIR)/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile
new file mode 100644 (file)
index 0000000..349c0f5
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2006, 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = mgmapi_logevent2
+SRCS = main.cpp
+OBJS = main.o
+CXX = g++
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = 
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)/storage/ndb/include
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(OBJS): $(SRCS)
+       $(CXX) $(CFLAGS) -I$(TOP_SRCDIR)/include -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/mgmapi  -I$(INCLUDE_DIR)/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_async/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_async/Makefile
new file mode 100644 (file)
index 0000000..3cd1e9f
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2005, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_async
+SRCS = $(TARGET).cpp
+OBJS = $(TARGET).o
+CXX = g++
+CFLAGS = -g -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = -g
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(TARGET).o: $(SRCS)
+       $(CXX) $(CFLAGS) -I$(INCLUDE_DIR)/include -I$(INCLUDE_DIR)/storage/ndb/include -I$(INCLUDE_DIR)/storage/ndb/include/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_async1/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_async1/Makefile
new file mode 100644 (file)
index 0000000..f742915
--- /dev/null
@@ -0,0 +1,37 @@
+# Copyright (C) 2005, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_async1
+SRCS = ndbapi_async1.cpp
+OBJS = ndbapi_async1.o
+CXX = g++
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)/storage/ndb/include
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(TARGET).o: $(SRCS)
+       $(CXX) $(CFLAGS) -I$(TOP_SRCDIR)/include -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_blob/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_blob/Makefile
new file mode 100644 (file)
index 0000000..9ada0b8
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_blob
+SRCS = $(TARGET).cpp
+OBJS = $(TARGET).o
+CXX = g++
+CFLAGS = -g -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = -g
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(TARGET).o: $(SRCS)
+       $(CXX) $(CFLAGS) -I$(INCLUDE_DIR)/include -I$(INCLUDE_DIR)/storage/ndb/include -I$(INCLUDE_DIR)/storage/ndb/include/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_blob_ndbrecord/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_blob_ndbrecord/Makefile
new file mode 100644 (file)
index 0000000..ff2aed6
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_blob_ndbrecord
+SRCS = main.cpp
+OBJS = main.o
+CXX = g++
+CFLAGS = -g -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = -g
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(OBJS): $(SRCS)
+       $(CXX) $(CFLAGS) -I$(INCLUDE_DIR)/include -I$(INCLUDE_DIR)/storage/ndb/include -I$(INCLUDE_DIR)/storage/ndb/include/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_event/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_event/Makefile
new file mode 100644 (file)
index 0000000..8ec9664
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2005, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_event
+SRCS = ndbapi_event.cpp
+OBJS = ndbapi_event.o
+CXX = g++ -g
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = 
+DEBUG =# -DVM_TRACE
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)/storage/ndb/include
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(TARGET).o: $(SRCS) Makefile
+       $(CXX) $(CFLAGS) $(DEBUG) -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/ndbapi -I$(TOP_SRCDIR)/include $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_recattr_vs_record/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_recattr_vs_record/Makefile
new file mode 100644 (file)
index 0000000..70e7320
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2008 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_recattr_vs_record
+SRCS = main.cpp
+OBJS = main.o
+CXX = g++
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = 
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(OBJS): $(SRCS)
+       $(CXX) $(CFLAGS) -I$(INCLUDE_DIR)/include -I$(INCLUDE_DIR)/storage/ndb/include -I$(INCLUDE_DIR)/storage/ndb/include/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_retries/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_retries/Makefile
new file mode 100644 (file)
index 0000000..1ddf3e7
--- /dev/null
@@ -0,0 +1,37 @@
+# Copyright (C) 2005, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_retries
+SRCS = ndbapi_retries.cpp
+OBJS = ndbapi_retries.o
+CXX = g++
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)/storage/ndb/include
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(TARGET).o: $(SRCS)
+       $(CXX) $(CFLAGS)  -I$(TOP_SRCDIR)/include -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_s_i_ndbrecord/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_s_i_ndbrecord/Makefile
new file mode 100644 (file)
index 0000000..8576937
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_simple_index_ndbrecord
+SRCS = main.cpp
+OBJS = main.o
+CXX = g++
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = 
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(OBJS): $(SRCS)
+       $(CXX) $(CFLAGS) -I$(INCLUDE_DIR)/include -I$(INCLUDE_DIR)/storage/ndb/include -I$(INCLUDE_DIR)/storage/ndb/include/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_scan/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_scan/Makefile
new file mode 100644 (file)
index 0000000..dd34fe3
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2005, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_scan
+SRCS = $(TARGET).cpp
+OBJS = $(TARGET).o
+CXX = g++
+CFLAGS = -g -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = -g
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(TARGET).o: $(SRCS)
+       $(CXX) $(CFLAGS) -I$(INCLUDE_DIR)/include -I$(INCLUDE_DIR)/storage/ndb/include -I$(INCLUDE_DIR)/storage/ndb/include/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_simple/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_simple/Makefile
new file mode 100644 (file)
index 0000000..2c24b20
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2005, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_simple
+SRCS = $(TARGET).cpp
+OBJS = $(TARGET).o
+CXX = g++
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = 
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)/storage/ndb/include
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(TARGET).o: $(SRCS)
+       $(CXX) $(CFLAGS) -I$(TOP_SRCDIR)/include -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile
new file mode 100644 (file)
index 0000000..509867b
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2006, 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_simple_dual
+SRCS = main.cpp
+OBJS = main.o
+CXX = g++
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = 
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)/storage/ndb/include
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(OBJS): $(SRCS)
+       $(CXX) $(CFLAGS) -I$(TOP_SRCDIR)/include -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
diff --git a/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile b/mysql-wsrep-5.6/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile
new file mode 100644 (file)
index 0000000..1a03016
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2005, 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+TARGET = ndbapi_simple_index
+SRCS = main.cpp
+OBJS = main.o
+CXX = g++
+CFLAGS = -c -Wall -fno-rtti -fno-exceptions
+CXXFLAGS = 
+DEBUG = 
+LFLAGS = -Wall
+TOP_SRCDIR = ../../../..
+INCLUDE_DIR = $(TOP_SRCDIR)
+LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \
+          -L$(TOP_SRCDIR)/libmysql_r/.libs
+SYS_LIB = 
+
+$(TARGET): $(OBJS)
+       $(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r $(SYS_LIB) -o $(TARGET)
+
+$(OBJS): $(SRCS)
+       $(CXX) $(CFLAGS) -I$(INCLUDE_DIR)/include -I$(INCLUDE_DIR)/storage/ndb/include -I$(INCLUDE_DIR)/storage/ndb/include/ndbapi $(SRCS)
+
+clean:
+       rm -f *.o $(TARGET)
index f3096d3ecd4db756290e4913945e5cebee2458db..e1cb5272e5651908b505b783bf66d60c4d03e3be 100644 (file)
@@ -1,73 +1,73 @@
-/*
-   Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
-*/
-
-/*
-  To change or add messages ndbd or ndb_mgmd writes to the Windows
-  error log, run
-   mc.exe message.mc
-  and checkin generated messages.h, messages.rc and msg000001.bin under the 
-  source control.
-  mc.exe can be installed with Windows SDK, some Visual Studio distributions 
-  do not include it.
-*/
-//
-//  Values are 32 bit values laid out as follows:
-//
-//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
-//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
-//  +---+-+-+-----------------------+-------------------------------+
-//  |Sev|C|R|     Facility          |               Code            |
-//  +---+-+-+-----------------------+-------------------------------+
-//
-//  where
-//
-//      Sev - is the severity code
-//
-//          00 - Success
-//          01 - Informational
-//          10 - Warning
-//          11 - Error
-//
-//      C - is the Customer code flag
-//
-//      R - is a reserved bit
-//
-//      Facility - is the facility code
-//
-//      Code - is the facility's status code
-//
-//
-// Define the facility codes
-//
-
-
-//
-// Define the severity codes
-//
-
-
-//
-// MessageId: MSG_EVENTLOG
-//
-// MessageText:
-//
-// %1.
+/*\r
+   Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.\r
+\r
+   This program is free software; you can redistribute it and/or modify\r
+   it under the terms of the GNU General Public License as published by\r
+   the Free Software Foundation; version 2 of the License.\r
+\r
+   This program is distributed in the hope that it will be useful,\r
+   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+   GNU General Public License for more details.\r
+\r
+   You should have received a copy of the GNU General Public License\r
+   along with this program; if not, write to the Free Software\r
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA\r
+*/\r
+\r
+/*\r
+  To change or add messages ndbd or ndb_mgmd writes to the Windows\r
+  error log, run\r
+   mc.exe message.mc\r
+  and checkin generated messages.h, messages.rc and msg000001.bin under the \r
+  source control.\r
+  mc.exe can be installed with Windows SDK, some Visual Studio distributions \r
+  do not include it.\r
+*/\r
+//\r
+//  Values are 32 bit values laid out as follows:\r
+//\r
+//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1\r
+//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0\r
+//  +---+-+-+-----------------------+-------------------------------+\r
+//  |Sev|C|R|     Facility          |               Code            |\r
+//  +---+-+-+-----------------------+-------------------------------+\r
+//\r
+//  where\r
+//\r
+//      Sev - is the severity code\r
+//\r
+//          00 - Success\r
+//          01 - Informational\r
+//          10 - Warning\r
+//          11 - Error\r
+//\r
+//      C - is the Customer code flag\r
+//\r
+//      R - is a reserved bit\r
+//\r
+//      Facility - is the facility code\r
+//\r
+//      Code - is the facility's status code\r
+//\r
+//\r
+// Define the facility codes\r
+//\r
+\r
+\r
+//\r
+// Define the severity codes\r
+//\r
+\r
+\r
+//\r
+// MessageId: MSG_EVENTLOG\r
+//\r
+// MessageText:\r
+//\r
+// %1.\r
 // 
 // 
-//
-#define MSG_EVENTLOG                     0xC0000064L
-
+//\r
+#define MSG_EVENTLOG                     0xC0000064L\r
+\r
index 0abcb0fa2c5715345b85e7bdbe1d79a9f2410b23..a928b138ef4ce86a2b16ec9b43603462c47a7a40 100644 (file)
@@ -1,2 +1,2 @@
-LANGUAGE 0x9,0x1
-1 11 "MSG00001.bin"
+LANGUAGE 0x9,0x1\r
+1 11 "MSG00001.bin"\r
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/mgmcommon/printConfig/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/mgmcommon/printConfig/Makefile
new file mode 100644 (file)
index 0000000..79bc75e
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi mgmapiclient
+
+BIN_TARGET := printConfig
+BIN_TARGET_ARCHIVES := general portlib
+
+CCFLAGS_LOC += -I.. 
+
+SOURCES := printConfig.cpp ../ConfigRetriever.cpp
+
+SOURCES.c := ../NdbConfig.c ../LocalConfig.c
+
+CFLAGS_printConfig.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/transporter/basictest/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/transporter/basictest/Makefile
new file mode 100644 (file)
index 0000000..4d45cd2
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi
+
+BIN_TARGET := basicTransporterTest
+BIN_TARGET_ARCHIVES := transporter portlib general
+
+SOURCES   = basicTransporterTest.cpp
+
+include $(NDB_TOP)/Epilogue.mk
+
+
+
+
+
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/transporter/failoverSCI/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/transporter/failoverSCI/Makefile
new file mode 100644 (file)
index 0000000..79f2982
--- /dev/null
@@ -0,0 +1,34 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi
+
+BIN_TARGET := failoverSCI
+BIN_TARGET_LIBS := sisci
+BIN_TARGET_ARCHIVES := portlib
+
+CCFLAGS_LOC += -I.. 
+
+SOURCES = failoverSCI.cpp
+
+include $(NDB_TOP)/Epilogue.mk
+
+
+
+
+
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/transporter/perftest/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/transporter/perftest/Makefile
new file mode 100644 (file)
index 0000000..821b76f
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi
+
+BIN_TARGET := perfTransporterTest
+BIN_TARGET_ARCHIVES := transporter portlib general
+
+SOURCES   = perfTransporterTest.cpp
+
+include $(NDB_TOP)/Epilogue.mk
+
+
+
+
+
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/Makefile
new file mode 100644 (file)
index 0000000..6672872
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi
+
+SOURCES   = prioTransporterTest.cpp
+ARCHIVE_TARGET := libpriotransportertest.a
+
+DIRS := prioTCP prioSHM prioSCI
+
+include $(NDB_TOP)/Epilogue.mk
+
+
+
+
+
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/prioSCI/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/prioSCI/Makefile
new file mode 100644 (file)
index 0000000..d05b53b
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi
+BIN_TARGET := prioSCI
+BIN_TARGET_LIBS := sisci
+BIN_TARGET_ARCHIVES := priotransportertest transporter portlib general
+
+CCFLAGS_LOC += -I.. 
+
+SOURCES = prioSCI.cpp
+
+include $(NDB_TOP)/Epilogue.mk
+
+
+
+
+
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/prioSHM/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/prioSHM/Makefile
new file mode 100644 (file)
index 0000000..d7975a7
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi
+
+BIN_TARGET := prioSHM
+BIN_TARGET_ARCHIVES := priotransportertest transporter portlib general
+
+CCFLAGS_LOC += -I.. 
+
+SOURCES = prioSHM.cpp
+
+include $(NDB_TOP)/Epilogue.mk
+
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/prioTCP/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/transporter/priotest/prioTCP/Makefile
new file mode 100644 (file)
index 0000000..06613e2
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi
+
+BIN_TARGET := prioTCP
+BIN_TARGET_ARCHIVES := priotransportertest transporter portlib general
+
+CCFLAGS_LOC += -I.. 
+
+SOURCES = prioTCP.cpp
+
+include $(NDB_TOP)/Epilogue.mk
+
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/util/testConfigValues/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/util/testConfigValues/Makefile
new file mode 100644 (file)
index 0000000..6877afc
--- /dev/null
@@ -0,0 +1,28 @@
+# Copyright (C) 2004, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := util
+
+BIN_TARGET := testConfigValues
+BIN_TARGET_ARCHIVES := portlib general
+
+SOURCES := testConfigValues.cpp
+
+CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util)
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/util/testProperties/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/util/testProperties/Makefile
new file mode 100644 (file)
index 0000000..6c0a741
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := util
+
+BIN_TARGET := keso
+
+SOURCES := testProperties.cpp
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/mysql-wsrep-5.6/storage/ndb/src/common/util/testSimpleProperties/Makefile b/mysql-wsrep-5.6/storage/ndb/src/common/util/testSimpleProperties/Makefile
new file mode 100644 (file)
index 0000000..8ea954b
--- /dev/null
@@ -0,0 +1,28 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := util
+
+BIN_TARGET := sp_test
+BIN_TARGET_ARCHIVES := portlib general
+
+SOURCES := sp_test.cpp
+
+CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util)
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/mysql-wsrep-5.6/storage/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/Makefile b/mysql-wsrep-5.6/storage/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/Makefile
new file mode 100644 (file)
index 0000000..880c0c7
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := kernel
+
+BIN_TARGET := aftest
+BIN_TARGET_ARCHIVES := ndbfs portlib trace signaldataprint
+
+SOURCES = AsyncFileTest.cpp
+
+CFLAGS_AsyncFileTest.cpp = -I../
+
+include $(NDB_TOP)/Epilogue.mk
+
+
+# run basic tests
+run_test :
+       $(NDB_TOP)/bin/$(BIN_TARGET)
+       $(NDB_TOP)/bin/$(BIN_TARGET) -n 8 -r 8 -l 10 -remove
+       $(NDB_TOP)/bin/$(BIN_TARGET) -n 8 -r 8 -l 10 -reverse -remove
+       $(NDB_TOP)/bin/$(BIN_TARGET) -n 8 -r 8 -l 10 -s 512 -remove
+       $(NDB_TOP)/bin/$(BIN_TARGET) -n 8 -r 4 -l 1000
+
+
+
+
+
+
diff --git a/mysql-wsrep-5.6/storage/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/Makefile b/mysql-wsrep-5.6/storage/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/Makefile
new file mode 100644 (file)
index 0000000..4071d5b
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := kernel
+
+BIN_TARGET  := mctest
+BIN_TARGET_ARCHIVES := portlib
+
+SOURCES = MemoryChannelTest.cpp
+
+CFLAGS_MemoryChannelTest.cpp = -I../
+
+include $(NDB_TOP)/Epilogue.mk
+
diff --git a/mysql-wsrep-5.6/storage/ndb/src/kernel/vm/al_test/Makefile b/mysql-wsrep-5.6/storage/ndb/src/kernel/vm/al_test/Makefile
new file mode 100644 (file)
index 0000000..f28389c
--- /dev/null
@@ -0,0 +1,28 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk       
+
+TYPE := kernel
+
+BIN_TARGET := al_test
+BIN_TARGET_ARCHIVES := portlib
+
+SOURCES = main.cpp
+
+CFLAGS_main.cpp = -DDEBUG
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/mysql-wsrep-5.6/storage/ndb/src/kernel/vm/testCopy/Makefile b/mysql-wsrep-5.6/storage/ndb/src/kernel/vm/testCopy/Makefile
new file mode 100644 (file)
index 0000000..6850485
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk       
+
+TYPE := util
+
+BIN_TARGET := testCopy
+
+SOURCES = testCopy.cpp 
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/mysql-wsrep-5.6/storage/ndb/src/kernel/vm/testDataBuffer/Makefile b/mysql-wsrep-5.6/storage/ndb/src/kernel/vm/testDataBuffer/Makefile
new file mode 100644 (file)
index 0000000..5ef8d90
--- /dev/null
@@ -0,0 +1,26 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk       
+
+TYPE := kernel
+
+BIN_TARGET := testKernelDataBuffer 
+BIN_TARGET_ARCHIVES := general portlib
+
+SOURCES = testDataBuffer.cpp
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/mysql-wsrep-5.6/storage/ndb/src/kernel/vm/testSimplePropertiesSection/Makefile b/mysql-wsrep-5.6/storage/ndb/src/kernel/vm/testSimplePropertiesSection/Makefile
new file mode 100644 (file)
index 0000000..d15887e
--- /dev/null
@@ -0,0 +1,26 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk       
+
+TYPE := kernel
+
+BIN_TARGET := testSimplePropertiesSection
+BIN_TARGET_ARCHIVES := general portlib 
+
+SOURCES = test.cpp ../SimplePropertiesSection.cpp
+
+include $(NDB_TOP)/Epilogue.mk
index 42cd7c0cf8a4c402b7ef14302d8ef8851f10f546..2298b4a8fbe18967099bf5f1786a1578e276c760 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   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
@@ -3335,7 +3335,11 @@ ndb_mgm_set_configuration(NdbMgmHandle h, ndb_mgm_configuration *c)
   }
 
   BaseString encoded;
-  encoded.assfmt("%*s", base64_needed_encoded_length(buf.length()), "Z");
+  /*
+    The base64 encoded data of BaseString can be of max length (1024*1024)/3*4
+    hence using int to store the length.
+  */
+  encoded.assfmt("%*s", (int)base64_needed_encoded_length(buf.length()), "Z");
   (void) base64_encode(buf.get_data(), buf.length(), (char*)encoded.c_str());
 
   Properties args;
diff --git a/mysql-wsrep-5.6/storage/ndb/src/mgmapi/test/Makefile b/mysql-wsrep-5.6/storage/ndb/src/mgmapi/test/Makefile
new file mode 100644 (file)
index 0000000..c6d3efa
--- /dev/null
@@ -0,0 +1,13 @@
+include .defs.mk
+
+TYPE := mgmapiclient util
+
+BIN_TARGET  := testMgmapi 
+
+CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) 
+#-I$(NDB_TOP)/include/util -I$(NDB_TOP)/include/portlib
+
+# Source files of non-templated classes (.C files)
+SOURCES = keso.cpp
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/mysql-wsrep-5.6/storage/ndb/src/mgmclient/test_cpcd/Makefile b/mysql-wsrep-5.6/storage/ndb/src/mgmclient/test_cpcd/Makefile
new file mode 100644 (file)
index 0000000..ba83ac2
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi 
+
+BIN_TARGET := test_cpcd
+BIN_TARGET_LIBS := general
+
+
+# Source files of non-templated classes (.cpp files)
+SOURCES = test_cpcd.cpp ../CpcClient.cpp
+
+CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \
+               -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) 
+
+include $(NDB_TOP)/Epilogue.mk
+
+
index 279cb41ccb16226ac355c53091013eabd15f2f52..df630a4952b4c0c843804a915eb6560bbad5fe7b 100644 (file)
@@ -1,6 +1,5 @@
 /*
-   Copyright (C) 2003-2006, 2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
-    All rights reserved. Use is subject to license terms.
+   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
@@ -241,9 +240,13 @@ Config::pack64(BaseString& encoded) const
   if (m_configValues->m_config.pack(buf) == 0)
     return false;
 
-  // Expand the string to correct length by filling with Z
+  /*
+    Expand the string to correct length by filling with Z.
+    The base64 encoded data of UtilBuffer can be of max length (1024*1024)/3*4
+    hence using int to store the length.
+  */
   encoded.assfmt("%*s",
-                 base64_needed_encoded_length(buf.length()),
+                 (int)base64_needed_encoded_length(buf.length()),
                  "Z");
 
   if (base64_encode(buf.get_data(),
diff --git a/mysql-wsrep-5.6/storage/ndb/src/mgmsrv/mkconfig/Makefile b/mysql-wsrep-5.6/storage/ndb/src/mgmsrv/mkconfig/Makefile
new file mode 100644 (file)
index 0000000..a08d316
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (C) 2003, 2005 MySQL AB
+#  All rights reserved. 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 St, Fifth Floor, Boston, MA 02110-1301  USA
+
+include .defs.mk
+
+TYPE := ndbapi
+
+BIN_TARGET := mkconfig
+BIN_TARGET_ARCHIVES := logger trace mgmsrvcommon portlib general 
+
+SOURCES := mkconfig.cpp
+
+CCFLAGS_LOC += -I.. -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) 
+CFLAGS_mkconfig.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/mysql-wsrep-5.6/storage/ndb/test/crund/Makefile b/mysql-wsrep-5.6/storage/ndb/test/crund/Makefile
new file mode 100755 (executable)
index 0000000..b21ced0
--- /dev/null
@@ -0,0 +1,44 @@
+#------------------------------------------------------------------------------
+
+  SRC          = ./src
+
+.PHONY:        all help dep dbg opt prf clean mostlclean clobber distclean check
+all:   dbg
+
+help:
+       @echo "dep              -- build dependencies"
+       @echo "all              -- build all targets with default flags"
+       @echo "dbg              -- build all targets with debug flags"
+       @echo "opt              -- build all targets with optimizing flags"
+       @echo "prf              -- build all targets with profiling flags"
+       @echo "clean            -- delete temporary files"
+       @echo "mostlyclean      -- also delete all generated files"
+       @echo "distclean        -- delete also database and server log files"
+       @echo "check            -- perform self-tests (if any)"
+
+dep dbg opt prf clean mostlyclean clobber check:
+       ant $@
+       @cd $(SRC)/crundndb && $(MAKE) $(MFLAGS) $@
+
+distclean:
+       rm -rf scripts/ndblog
+       rm -f *~
+       ant $@
+       rm -f ./.ant-targets-build.xml
+       @cd $(SRC)/crundndb && $(MAKE) $(MFLAGS) $@
+
+#------------------------------------------------------------------------------
+
+# read the generic settings
+include        env.properties
+
+# not sure if needed:
+#      LD_LIBRARY_PATH=${NDB_LIBDIR}:$(SRC)/crundndb/Driver 
+run.driver:    $(SRC)/crundndb/NdbApiDriver
+       $(SRC)/crundndb/NdbApiDriver \
+       -p crundRun.properties -p crundNdbapi.properties
+#
+#run.driver:
+#      @cd $(SRC)/crundndb && $(MAKE) $(MFLAGS) $@
+
+#------------------------------------------------------------------------------
diff --git a/mysql-wsrep-5.6/storage/ndb/test/crund/martins_little_helpers/Makefile b/mysql-wsrep-5.6/storage/ndb/test/crund/martins_little_helpers/Makefile
new file mode 100644 (file)
index 0000000..3f8afdf
--- /dev/null
@@ -0,0 +1,22 @@
+#------------------------------------------------------------------------------
+
+  SRC          = ./src
+
+.PHONY:        all help dep dbg opt prf clean mostlyclean distclean check
+all:   dbg
+
+help:
+       @echo "dep              -- build dependencies"
+       @echo "all              -- build all targets with default flags"
+       @echo "dbg              -- build all targets with debug flags"
+       @echo "opt              -- build all targets with optimizing flags"
+       @echo "prf              -- build all targets with profiling flags"
+       @echo "clean            -- delete temporary files"
+       @echo "clobber          -- delete also log files"
+       @echo "distclean        -- delete also database and backup files"
+       @echo "check            -- perform self-tests (if any)"
+
+dep dbg opt prf clean mostlyclean distclean check:
+       @cd $(SRC)/utils && $(MAKE) $(MFLAGS) $@
+
+#------------------------------------------------------------------------------
diff --git a/mysql-wsrep-5.6/storage/ndb/test/crund/martins_little_helpers/src/utils/Makefile b/mysql-wsrep-5.6/storage/ndb/test/crund/martins_little_helpers/src/utils/Makefile
new file mode 100644 (file)
index 0000000..1e633ac
--- /dev/null
@@ -0,0 +1,209 @@
+#------------------------------------------------------------------------------
+
+# read the generic settings
+include        ../../../Makefile.defaults
+include        ../../../env.properties
+
+#------------------------------------------------------------------------------
+
+  API_PKG_PATH = .
+#  API_PKG_PATH        = utils
+
+# Linux:
+#               -DHRT_REALTIME_METHOD=HRT_USE_CLOCK_GETTIME \
+#               -DHRT_CPUTIME_METHOD=HRT_USE_CLOCK_GETTIME \
+# MacOS X:
+#               -DHRT_REALTIME_METHOD=HRT_USE_GETTIMEOFDAY \
+#               -DHRT_CPUTIME_METHOD=HRT_USE_GETRUSAGE \
+
+  DDEFINES     = \
+                -DHRT_REALTIME_METHOD=HRT_USE_GETTIMEOFDAY \
+                -DHRT_CPUTIME_METHOD=HRT_USE_GETRUSAGE \
+                #-DHRT_REALTIME_METHOD=HRT_USE_CLOCK_GETTIME \
+                #-DHRT_CPUTIME_METHOD=HRT_USE_CLOCK_GETTIME \
+                #-DHRT_REALTIME_METHOD=HRT_USE_GETTIMEOFDAY \
+                #-DHRT_CPUTIME_METHOD=HRT_USE_GETRUSAGE \
+                #-DHRT_REALTIME_METHOD=HRT_USE_TIMES \
+                #-DHRT_CPUTIME_METHOD=HRT_USE_TIMES \
+                #-DHRT_REALTIME_METHOD=HRT_USE_ANSI_TIME \
+                #-DHRT_CPUTIME_METHOD=HRT_USE_ANSI_CLOCK \
+                #-D_POSIX_C_SOURCE=199309 \
+                #-D_POSIX_C_SOURCE=200112 \
+                #-DHAVE_UNISTD_H \
+                #-DHAVE_BOOL \
+
+# check source-level flags:
+# _GNU_SOURCE
+# _POSIX_SOURCE
+# _XOPEN_SOURCE
+# _POSIX_C_SOURCE
+# _UNIX_STD
+
+  DELIVERABLES = libutils.a libutils.$(DLL_SUFFIX) utils.jar \
+               $(TESTS) $(TESTS1)
+
+  TESTS                = hrt_utils_test hrt_stopwatch_test Properties_test \
+               $(API_PKG_PATH)/HrtStopwatch.class \
+               $(API_PKG_PATH)/HrtProfiler.class \
+               $(API_PKG_PATH)/HrtStopwatchTest.class
+
+  TESTS1       = $(API_PKG_PATH)/JniInstrumentationTest.class \
+               libjnitest.$(DLL_SUFFIX)
+
+  GENERATED_H  = utils_HrtStopwatch.h utils_JniInstrumentationTest.h
+
+  CLEAN                = core *.o $(API_PKG_PATH)/*.class $(GENERATED_H)
+
+  MOSTLYCLEAN  = $(DELIVERABLES) *.dSYM
+
+  DISTCLEAN    = *~ *% */*~
+
+  INCLUDES     = $(JAVA_INCLUDEOPTS) -I.
+
+  CLASSPATH    = ".."
+
+# for library dependencies, LOADLIBES and LDLIBS have been used historically
+# this convention is used sometimes: use
+#   LDLIBS for project-wide libs (like -lc or -lm)
+#   LOADLIBES for libs for the individual case
+# check with non-gnu makes: use of LOADLIBES, LDLIBS
+# CLOCK_GETTIME requires -lrt
+  LDLIBS       =
+#  LDLIBS      = -lrt
+
+#------------------------------------------------------------------------------
+
+.PHONY:        all depend dep
+
+all:   $(DELIVERABLES)
+
+dep depend:    $(GENERATED_H)
+
+#------------------------------------------------------------------------------
+
+utils.jar:     $(API_PKG_PATH)/HrtStopwatch.class \
+               $(API_PKG_PATH)/HrtProfiler.class
+       $(JAR) cvf $@ $?
+
+utils_HrtStopwatch.h:  $(API_PKG_PATH)/HrtStopwatch.class
+       $(COMPILE.javah) utils.HrtStopwatch
+
+libutils.a:    libutils.a(hrt_utils.o hrt_stopwatch.o hrt_gstopwatch.o) \
+       libutils.a(utils_HrtStopwatch.o)
+
+libutils.so:   libutils.a
+       $(LINK.cpp) \
+       -fPIC -shared \
+       $(LDLIBS) \
+       -o libutils.so \
+       utils_HrtStopwatch.o \
+       libutils.a
+
+libutils.dylib:        libutils.a
+       $(LINK.cpp) \
+       -fPIC -shared -dynamiclib \
+       $(LDLIBS) \
+       -o libutils.dylib \
+       utils_HrtStopwatch.o \
+       libutils.a
+
+# hrt_gstopwatch.o hrt_stopwatch.o hrt_utils.o
+
+#------------------------------------------------------------------------------
+
+hrt_utils_test:                libutils.a
+
+.PHONY: run.hrt_utils_test
+run.hrt_utils_test:    hrt_utils_test
+       ./hrt_utils_test
+
+hrt_stopwatch_test:    libutils.a
+
+.PHONY: run.hrt_stopwatch_test
+run.hrt_stopwatch_test:        hrt_stopwatch_test
+       ./hrt_stopwatch_test
+
+Properties_test:       libutils.a
+
+.PHONY: run.Properties_test
+run.Properties_test:   Properties_test
+       ./Properties_test -p Properties_test.properties
+
+#------------------------------------------------------------------------------
+
+$(API_PKG_PATH)/HrtStopwatchTest.class:        $(API_PKG_PATH)/HrtStopwatchTest.java
+       $(COMPILE.java) $<
+
+.PHONY: run.HrtStopwatchTest
+run.HrtStopwatchTest:  $(API_PKG_PATH)/HrtStopwatchTest.class
+       $(JAVA) $(JAVAFLAGS) -classpath .. -Djava.library.path="." utils.HrtStopwatchTest
+
+#------------------------------------------------------------------------------
+
+$(API_PKG_PATH)/JniInstrumentationTest.class:  \
+               $(API_PKG_PATH)/JniInstrumentationTest.java
+       $(COMPILE.java) $<
+
+#utils_JniInstrumentationTest.c:       utils_JniInstrumentationTest.h
+
+utils_JniInstrumentationTest.h:        $(API_PKG_PATH)/JniInstrumentationTest.class
+       $(COMPILE.javah) utils.JniInstrumentationTest
+
+libjnitest.so: utils_JniInstrumentationTest.o libutils.a
+       $(LINK.cpp) \
+       -fPIC -shared \
+       $(LDLIBS) \
+       -o libjnitest.so \
+       utils_JniInstrumentationTest.o \
+       -Wl,-rpath -Wl,. libutils.so
+
+libjnitest.dylib:      utils_JniInstrumentationTest.o libutils.a
+       $(LINK.cpp) \
+       -fPIC -shared -dynamiclib \
+       $(LDLIBS) \
+       -o libjnitest.dylib \
+       utils_JniInstrumentationTest.o \
+       -Wl,-rpath -Wl,. libutils.dylib
+
+# undefined references to be resolved by LD_LIBRARY_PATH:
+#      libutils.so
+# or
+#      -L. \
+#      -lutils \
+# ldd libjnitest.so
+#       libutils.so => not found
+
+# symbolical references with default library path:
+#
+#      -Wl,-rpath -Wl,/home/md/martins_little_helpers/src/utils \
+# ldd libjnitest.so
+#        libutils.so => /home/md/martins_little_helpers/src/utils/libutils.so (0xb7f8d000)
+#
+#      -Wl,-rpath -Wl,. \
+# ldd libjnitest.so
+#        libutils.so => ./libutils.so (0xb7edd000)
+
+# statically linked references:
+#      libutils.a
+# ldd libjnitest.so
+#       ...
+
+.PHONY: run.jitest
+run.jitest:    $(API_PKG_PATH)/JniInstrumentationTest.class
+       $(JAVA) $(JAVAFLAGS) -classpath .. -Djava.library.path="." utils.JniInstrumentationTest
+
+#------------------------------------------------------------------------------
+
+check: run.Properties_test \
+       run.hrt_utils_test run.hrt_stopwatch_test run.HrtStopwatchTest \
+       run.jitest
+
+#------------------------------------------------------------------------------
+
+.depend:
+       touch $@
+
+# read local dependencies
+-include       .depend
+
+#------------------------------------------------------------------------------
diff --git a/mysql-wsrep-5.6/storage/ndb/test/crund/src/crundndb/Makefile b/mysql-wsrep-5.6/storage/ndb/test/crund/src/crundndb/Makefile
new file mode 100644 (file)
index 0000000..9532a4e
--- /dev/null
@@ -0,0 +1,123 @@
+#------------------------------------------------------------------------------
+
+# read the generic settings
+include        ../../Makefile.defaults
+include        ../../env.properties
+
+#------------------------------------------------------------------------------
+
+#  API_PKG_PATH        = com/mysql/cluster
+
+  DDEFINES     =
+
+  DELIVERABLES = libcrundndb.a libcrundndb.$(DLL_SUFFIX) NdbApiDriver 
+
+  GENERATED_H  = com_mysql_cluster_crund_NdbApiLoad.h
+
+  CLEAN                = core *.o $(GENERATED_H)
+
+  MOSTLYCLEAN  = $(DELIVERABLES) *.dSYM *% log_*
+
+  DISTCLEAN    = *~ *% */*~
+
+  INCLUDES     = $(JAVA_INCLUDEOPTS) -I. -I"$(MARTINS_LITTLE_HELPERS)" \
+                 $(NDB_INCLUDEOPT0) $(NDB_INCLUDEOPT1)
+
+# for library dependencies, LOADLIBES and LDLIBS have been used historically
+# this convention is used sometimes: use
+#   LDLIBS for project-wide libs (like -lc or -lm)
+#   LOADLIBES for libs for the individual case
+# check with non-gnu makes: use of LOADLIBES, LDLIBS
+  LDLIBS       = -L${NDB_LIBDIR} -lndbclient
+# XXX undefined symbols when linking with 
+#  LOADLIBES   = -L$(MARTINS_LITTLE_HELPERS) -lutils
+# XXX which seems to be the same as
+#  LOADLIBES   = $(MARTINS_LITTLE_HELPERS)/libutils.dylib
+# XXX but linking statically is fine:
+  LOADLIBES    = $(MARTINS_LITTLE_HELPERS)/libutils.a
+
+#------------------------------------------------------------------------------
+
+.PHONY:        all depend dep run.driver valgrind.driver
+
+all:   $(DELIVERABLES)
+
+dep depend:    $(GENERATED_H)
+
+com_mysql_cluster_crund_NdbApiLoad.h:
+       cd ../.. && ant dep
+
+#com_mysql_cluster_NdbApiLoad.h:       $(API_PKG_PATH)/NdbApiLoad.class
+#      $(COMPILE.javah) com.mysql.cluster.NdbApiLoad
+#
+#$(API_PKG_PATH)/NdbApiLoad.class:     \
+#              $(API_PKG_PATH)/NdbApiLoad.java
+#      $(COMPILE.java) $<
+
+# not sure if needed:
+#      LD_LIBRARY_PATH=${NDB_LIBDIR}:./Driver
+run.driver:    NdbApiDriver
+       ./NdbApiDriver \
+       -p ../../crundRun.properties -p ../../crundNdbapi.properties
+
+# for JVM processes, try running valgrind with
+# --smc-check=all --trace-children=yes --leak-check=full --show-reachable=yes
+# not sure if needed:
+#      LD_LIBRARY_PATH=${NDB_LIBDIR}:./Driver
+valgrind.driver:       NdbApiDriver
+       valgrind \
+       --leak-check=full --show-reachable=yes --trace-children=yes \
+       ./NdbApiDriver \
+       -p ../../crundRun.properties -p ../../crundNdbapi.properties
+
+NdbApiDriver:  Driver.o CrundDriver.o libcrundndb.a
+
+# can list multiple archive members: lib.a(a.o b.o ...) lib.a(c.o)...
+libcrundndb.a: libcrundndb.a(CrundNdbApiOperations.o)  \
+               libcrundndb.a(com_mysql_cluster_crund_NdbApiLoad.o)
+
+# XXX cleanup & refactorize this rule!
+# LINK.o
+#libcrundndb.so:       CrundNdbApiOperations.o com_mysql_cluster_crund_NdbApiLoad.o
+#libcrundndb.so:       libcrundndb.a
+libcrundndb.so:        CrundNdbApiOperations.cpp
+       $(LINK.cpp) \
+       -fPIC -shared \
+       -L${NDB_LIBDIR} \
+       -lndbclient \
+       -o libcrundndb.so \
+       CrundNdbApiOperations.cpp com_mysql_cluster_crund_NdbApiLoad.cpp
+
+libcrundndb.dylib:     CrundNdbApiOperations.cpp
+       $(LINK.cpp) \
+       -fPIC -shared -dynamiclib \
+       -L${NDB_LIBDIR} \
+       -lndbclient \
+       -o libcrundndb.dylib \
+       CrundNdbApiOperations.cpp com_mysql_cluster_crund_NdbApiLoad.cpp
+
+# Solaris cc?
+# -#          <!-- verbose mode -->
+# -G          <!-- create shared object -->
+# cc \
+#      -# \
+#      -I. \
+#      -I${JAVA_HOME}/include \
+#      -I${JAVA_HOME}/include/solaris \
+#      -I${NDB_INCLUDE} \
+#      -I${NDB_INCLUDE}/ndbapi \
+#      -L${NDB_LIB} \
+#      -lndbclient \
+#      -G \
+#      -o libcrundndb.so \
+#      ../src/crundndb/*.cpp
+
+#------------------------------------------------------------------------------
+
+.depend:
+       touch $@
+
+# read local dependencies
+-include       .depend
+
+#------------------------------------------------------------------------------
index c15fb389937810c64f875c3740b2addf8342a98a..7a22d9d050b42a70c6df8c6260de7066cb8b5350 100755 (executable)
@@ -1,54 +1,54 @@
--- Copyright 2010 Sun Microsystems, Inc.
---  All rights reserved. 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 St, Fifth Floor, Boston, MA  02110-1301  USA
-
-DROP TABLE B1;
-DROP TABLE B0;
-DROP TABLE A;
-
-CREATE TABLE A (
-        id          INT                 NOT NULL,
-        cint        INT                 NULL,
-        clong       DECIMAL(20)         NULL,
-        cfloat      FLOAT               NULL,
-        cdouble     DOUBLE PRECISION    NULL,
-        cstring     VARCHAR(30)         NULL,
-        CONSTRAINT PK_A_0 PRIMARY KEY (id)
-);
-
-CREATE TABLE B0 (
-        id          INT                 NOT NULL,
-        cint        INT                 NULL,
-        clong       DECIMAL(20)         NULL,
-        cfloat      FLOAT               NULL,
-        cdouble     DOUBLE PRECISION    NULL,
-        cstring     VARCHAR(30)         NULL,
-        a_id        INT                 NULL,
-        CONSTRAINT PK_B0_0 PRIMARY KEY (id),
-        CONSTRAINT FK_B0_1 FOREIGN KEY (a_id) REFERENCES A (id)
-);
-
-CREATE TABLE B1 (
-        id int NOT NULL,
-        CONSTRAINT PK_B1_0 PRIMARY KEY (id)
-);
-
-CREATE INDEX I_B0_FK ON B0 (
-       a_id
-);
-
-COMMIT WORK;
-
-EXIT;
+-- Copyright 2010 Sun Microsystems, Inc.\r
+--  All rights reserved. Use is subject to license terms.\r
+--\r
+-- This program is free software; you can redistribute it and/or modify\r
+-- it under the terms of the GNU General Public License as published by\r
+-- the Free Software Foundation; version 2 of the License.\r
+--\r
+-- This program is distributed in the hope that it will be useful,\r
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+-- GNU General Public License for more details.\r
+--\r
+-- You should have received a copy of the GNU General Public License\r
+-- along with this program; if not, write to the Free Software\r
+-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+\r
+DROP TABLE B1;\r
+DROP TABLE B0;\r
+DROP TABLE A;\r
+\r
+CREATE TABLE A (\r
+        id          INT                 NOT NULL,\r
+        cint        INT                 NULL,\r
+        clong       DECIMAL(20)         NULL,\r
+        cfloat      FLOAT               NULL,\r
+        cdouble     DOUBLE PRECISION    NULL,\r
+        cstring     VARCHAR(30)         NULL,\r
+        CONSTRAINT PK_A_0 PRIMARY KEY (id)\r
+);\r
+\r
+CREATE TABLE B0 (\r
+        id          INT                 NOT NULL,\r
+        cint        INT                 NULL,\r
+        clong       DECIMAL(20)         NULL,\r
+        cfloat      FLOAT               NULL,\r
+        cdouble     DOUBLE PRECISION    NULL,\r
+        cstring     VARCHAR(30)         NULL,\r
+        a_id        INT                 NULL,\r
+        CONSTRAINT PK_B0_0 PRIMARY KEY (id),\r
+        CONSTRAINT FK_B0_1 FOREIGN KEY (a_id) REFERENCES A (id)\r
+);\r
+\r
+CREATE TABLE B1 (\r
+        id int NOT NULL,\r
+        CONSTRAINT PK_B1_0 PRIMARY KEY (id)\r
+);\r
+\r
+CREATE INDEX I_B0_FK ON B0 (\r
+       a_id\r
+);\r
+\r
+COMMIT WORK;\r
+\r
+EXIT;\r
diff --git a/mysql-wsrep-5.6/storage/ndb/test/crund/tws/tws_cpp/Makefile b/mysql-wsrep-5.6/storage/ndb/test/crund/tws/tws_cpp/Makefile
new file mode 100644 (file)
index 0000000..a34de63
--- /dev/null
@@ -0,0 +1,85 @@
+#------------------------------------------------------------------------------
+
+# read the generic settings
+include        ../../Makefile.defaults
+include        ../../env.properties
+
+#------------------------------------------------------------------------------
+
+  DDEFINES     =
+
+  DELIVERABLES = TwsDriver 
+
+  GENERATED_H  =
+
+  CLEAN                = core *.o $(GENERATED_H)
+
+  MOSTLYCLEAN  = $(DELIVERABLES) *.dSYM *% log_*
+
+  DISTCLEAN    = *~ *% */*~
+
+  INCLUDES     = -I. -I"$(MARTINS_LITTLE_HELPERS)"     \
+                 $(NDB_INCLUDEOPT0) $(NDB_INCLUDEOPT1)
+
+# for library dependencies, LOADLIBES and LDLIBS have been used historically
+# this convention is used sometimes: use
+#   LDLIBS for project-wide libs (like -lc or -lm)
+#   LOADLIBES for libs for the individual case
+# check with non-gnu makes: use of LOADLIBES, LDLIBS
+  LDLIBS       = -L${NDB_LIBDIR} -lndbclient
+# XXX undefined symbols when linking with 
+#  LOADLIBES   = -L$(MARTINS_LITTLE_HELPERS) -lutils
+# XXX which seems to be the same as
+#  LOADLIBES   = $(MARTINS_LITTLE_HELPERS)/libutils.dylib
+# XXX but linking statically is fine:
+#  LOADLIBES   = $(MARTINS_LITTLE_HELPERS)/libutils.a
+
+#------------------------------------------------------------------------------
+
+.PHONY:        all help depend dep dbg opt prf clean mostlyclean distclean \
+       run.driver valgrind.driver
+
+all:   $(DELIVERABLES)
+
+help:
+       @echo "build targets:"
+       @echo "  dep            -- build the include dependencies"
+       @echo "  dbg            -- build all targets with debug flags"
+       @echo "  opt            -- build all targets with optimizing flags"
+       @echo "  prf            -- build all targets with profiling flags"
+       @echo ""
+       @echo "clean targets:"
+       @echo "  clean          -- delete temporary files"
+       @echo "  mostlyclean    -- also delete all generated files"
+       @echo "  distclean      -- delete also database and server log files"
+       @echo ""
+       @echo "run targets:"
+       @echo "  run.driver     -- run the benchmark's driver program"
+       @echo "  grind.driver   -- run the driver with valgrind memchecker"
+       @echo ""
+
+dep depend:    $(GENERATED_H)
+
+run.driver:    TwsDriver
+       ./TwsDriver \
+       -p ../run.properties
+
+# for JVM processes, try running valgrind with
+# --smc-check=all --trace-children=yes --leak-check=full --show-reachable=yes
+grind.driver:  TwsDriver
+       valgrind \
+       --leak-check=full --show-reachable=yes --trace-children=yes \
+       ./TwsDriver \
+       -p ../run.properties
+
+TwsDriver:     Driver.o NdbApiTwsDriver.o
+
+#------------------------------------------------------------------------------
+
+.depend:
+       touch $@
+
+# read local dependencies
+-include       .depend
+
+#------------------------------------------------------------------------------
diff --git a/mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/Makefile b/mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/Makefile
new file mode 100644 (file)
index 0000000..d7eaf98
--- /dev/null
@@ -0,0 +1,25 @@
+include .defs.mk
+
+TYPE := util
+
+PIC_ARCHIVE := Y
+ARCHIVE_TARGET := newtonbasictestcommon
+
+A_LIB       := Y
+SO_LIB      := Y
+PIC_LIB     := Y
+
+LIB_TARGET  := NEWTON_BASICTEST_COMMON
+LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) NEWTON_API
+
+
+SOURCES = common.cpp
+
+DIRS := basic \
+        ptr_binding \
+        bulk_read
+
+CCFLAGS_LOC := -I$(call fixpath,$(NDB_TOP)/include/util) -I$(call fixpath,$(NDB_TOP)/include/newtonapi)
+
+include $(NDB_TOP)/Epilogue.mk
+
diff --git a/mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/basic/Makefile b/mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/basic/Makefile
new file mode 100644 (file)
index 0000000..7e2945d
--- /dev/null
@@ -0,0 +1,14 @@
+include .defs.mk
+
+TYPE := ndbapitest
+
+BIN_TARGET := newton_basic
+BIN_TARGET_LIBS :=
+BIN_TARGET_ARCHIVES := NEWTON_BASICTEST_COMMON NEWTON_API
+SOURCES    := basic.cpp
+
+CCFLAGS_LOC := -I.. -I$(call fixpath,$(NDB_TOP)/include/util) -I$(call fixpath,$(NDB_TOP)/include/newtonapi) -I$(call fixpath,$(NDB_TOP)/include/portlib)
+
+include $(NDB_TOP)/Epilogue.mk
+
+
diff --git a/mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/bulk_read/Makefile b/mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/bulk_read/Makefile
new file mode 100644 (file)
index 0000000..c45bbad
--- /dev/null
@@ -0,0 +1,14 @@
+include .defs.mk
+
+TYPE := ndbapitest
+
+BIN_TARGET := newton_br
+BIN_TARGET_LIBS :=
+BIN_TARGET_ARCHIVES := NEWTON_BASICTEST_COMMON NEWTON_API
+SOURCES    := br_test.cpp
+
+CCFLAGS_LOC := -I.. -I$(call fixpath,$(NDB_TOP)/include/util) -I$(call fixpath,$(NDB_TOP)/include/newtonapi) -I$(call fixpath,$(NDB_TOP)/include/portlib)
+
+include $(NDB_TOP)/Epilogue.mk
+
+
diff --git a/mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/ptr_binding/Makefile b/mysql-wsrep-5.6/storage/ndb/test/newtonapi/basic_test/ptr_binding/Makefile
new file mode 100644 (file)
index 0000000..95e87d4
--- /dev/null
@@ -0,0 +1,14 @@
+include .defs.mk
+
+TYPE := ndbapitest
+
+BIN_TARGET := newton_pb
+BIN_TARGET_LIBS :=
+BIN_TARGET_ARCHIVES := NEWTON_BASICTEST_COMMON NEWTON_API
+SOURCES    := ptr_binding_test.cpp
+
+CCFLAGS_LOC := -I.. -I$(call fixpath,$(NDB_TOP)/include/util) -I$(call fixpath,$(NDB_TOP)/include/newtonapi) -I$(call fixpath,$(NDB_TOP)/include/portlib)
+
+include $(NDB_TOP)/Epilogue.mk
+
+
diff --git a/mysql-wsrep-5.6/storage/ndb/test/newtonapi/perf_test/Makefile b/mysql-wsrep-5.6/storage/ndb/test/newtonapi/perf_test/Makefile
new file mode 100644 (file)
index 0000000..2be004d
--- /dev/null
@@ -0,0 +1,14 @@
+include .defs.mk
+
+TYPE := ndbapitest
+
+BIN_TARGET := newton_perf
+BIN_TARGET_LIBS :=
+BIN_TARGET_ARCHIVES := NEWTON_API
+SOURCES    := perf.cpp
+
+CCFLAGS_LOC := -I$(call fixpath,$(NDB_TOP)/include/util) -I$(call fixpath,$(NDB_TOP)/include/newtonapi) -I$(call fixpath,$(NDB_TOP)/include/portlib)
+
+include $(NDB_TOP)/Epilogue.mk
+
+
index b8f910a9539acf7c025d75b8d2777f1c337d99bf..8071476e1f683a681c28d1cc46df0dc86a2056cb 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2011, 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
@@ -21,29 +21,11 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}
 
 ADD_DEFINITIONS(-DMYSQL_SERVER)
 
-# Gen_pfs_lex_token
-ADD_EXECUTABLE(gen_pfs_lex_token gen_pfs_lex_token.cc)
-# gen_pfs_lex_token itself depends on ${CMAKE_CURRENT_BINARY_DIR}/sql/sql_yacc.h
-ADD_DEPENDENCIES(gen_pfs_lex_token GenServerSource)
-
-ADD_CUSTOM_COMMAND(
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pfs_lex_token.h
-  COMMAND gen_pfs_lex_token > pfs_lex_token.h
-  DEPENDS gen_pfs_lex_token
-)
-
-SET(PFS_GEN_SOURCES
-  ${CMAKE_CURRENT_BINARY_DIR}/pfs_lex_token.h
-)
-
-SET_SOURCE_FILES_PROPERTIES(${PFS_GEN_SOURCES} PROPERTIES GENERATED 1)
-
 #
 # Maintainer: keep this list sorted, to avoid merge collisions.
 # Tip: ls -1 *.h, ls -1 *.cc
 #
 SET(PERFSCHEMA_SOURCES
-${PFS_GEN_SOURCES}
 ha_perfschema.h
 cursor_by_account.h
 cursor_by_host.h
index 876baa47fa63ae05a077c31ad2a5eb236033280b..cf0fa82ba3f86b87d31d63f531ca009a2cf37f7f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2014, 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
@@ -4388,6 +4388,8 @@ get_thread_statement_locker_v1(PSI_statement_locker_state *state,
                                const void *charset)
 {
   DBUG_ASSERT(state != NULL);
+  DBUG_ASSERT(charset != NULL);
+
   if (! flag_global_instrumentation)
     return NULL;
   PFS_statement_class *klass= find_statement_class(key);
@@ -4432,6 +4434,8 @@ get_thread_statement_locker_v1(PSI_statement_locker_state *state,
       pfs->m_lock_time= 0;
       pfs->m_current_schema_name_length= 0;
       pfs->m_sqltext_length= 0;
+      pfs->m_sqltext_truncated= false;
+      pfs->m_sqltext_cs_number= system_charset_info->number; /* default */
 
       pfs->m_message_text[0]= '\0';
       pfs->m_sql_errno= 0;
@@ -4455,7 +4459,7 @@ get_thread_statement_locker_v1(PSI_statement_locker_state *state,
       pfs->m_sort_scan= 0;
       pfs->m_no_index_used= 0;
       pfs->m_no_good_index_used= 0;
-      digest_reset(& pfs->m_digest_storage);
+      pfs->m_digest_storage.reset();
 
       /* New stages will have this statement as parent */
       PFS_events_stages *child_stage= & pfs_thread->m_stage_current;
@@ -4484,11 +4488,7 @@ get_thread_statement_locker_v1(PSI_statement_locker_state *state,
 
   if (flag_statements_digest)
   {
-    const CHARSET_INFO *cs= static_cast <const CHARSET_INFO*> (charset);
     flags|= STATE_FLAG_DIGEST;
-    state->m_digest_state.m_last_id_index= 0;
-    digest_reset(& state->m_digest_state.m_digest_storage);
-    state->m_digest_state.m_digest_storage.m_charset_number= cs->number;
   }
 
   state->m_discarded= false;
@@ -4512,7 +4512,10 @@ get_thread_statement_locker_v1(PSI_statement_locker_state *state,
   state->m_no_index_used= 0;
   state->m_no_good_index_used= 0;
 
+  state->m_digest= NULL;
+
   state->m_schema_name_length= 0;
+  state->m_cs_number= ((CHARSET_INFO *)charset)->number;
 
   return reinterpret_cast<PSI_statement_locker*> (state);
 }
@@ -4618,10 +4621,14 @@ static void set_statement_text_v1(PSI_statement_locker *locker,
     PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement);
     DBUG_ASSERT(pfs != NULL);
     if (text_len > sizeof (pfs->m_sqltext))
+    {
       text_len= sizeof(pfs->m_sqltext);
+      pfs->m_sqltext_truncated= true;
+    }
     if (text_len)
       memcpy(pfs->m_sqltext, text, text_len);
     pfs->m_sqltext_length= text_len;
+    pfs->m_sqltext_cs_number= state->m_cs_number;
   }
 
   return;
@@ -4781,11 +4788,11 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
   PFS_statement_stat *event_name_array;
   uint index= klass->m_event_name_index;
   PFS_statement_stat *stat;
-  
+
   /*
    Capture statement stats by digest.
   */
-  PSI_digest_storage *digest_storage= NULL;
+  const sql_digest_storage *digest_storage= NULL;
   PFS_statement_stat *digest_stat= NULL;
 
   if (flags & STATE_FLAG_THREAD)
@@ -4798,11 +4805,15 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
 
     if (flags & STATE_FLAG_DIGEST)
     {
-      digest_storage= &state->m_digest_state.m_digest_storage;
-      /* Populate PFS_statements_digest_stat with computed digest information.*/
-      digest_stat= find_or_create_digest(thread, digest_storage,
-                                         state->m_schema_name,
-                                         state->m_schema_name_length);
+      digest_storage= state->m_digest;
+
+      if (digest_storage != NULL)
+      {
+        /* Populate PFS_statements_digest_stat with computed digest information.*/
+        digest_stat= find_or_create_digest(thread, digest_storage,
+                                           state->m_schema_name,
+                                           state->m_schema_name_length);
+      }
     }
 
     if (flags & STATE_FLAG_EVENT)
@@ -4830,6 +4841,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
           memcpy(pfs->m_message_text, da->message(), MYSQL_ERRMSG_SIZE);
           pfs->m_message_text[MYSQL_ERRMSG_SIZE]= 0;
           pfs->m_sql_errno= da->sql_errno();
+          pfs->m_error_count++;
           memcpy(pfs->m_sqlstate, da->get_sqlstate(), SQLSTATE_LENGTH);
           break;
         case Diagnostics_area::DA_DISABLED:
@@ -4839,7 +4851,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
       pfs->m_timer_end= timer_end;
       pfs->m_end_event_id= thread->m_event_id;
 
-      if (flags & STATE_FLAG_DIGEST)
+      if (digest_storage != NULL)
       {
         /*
           The following columns in events_statement_current:
@@ -4847,7 +4859,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
           - DIGEST_TEXT
           are computed from the digest storage.
         */
-        digest_copy(& pfs->m_digest_storage, digest_storage);
+        pfs->m_digest_storage.copy(digest_storage);
       }
 
       if (flag_events_statements_history)
@@ -4870,11 +4882,15 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
       if (thread != NULL)
       {
         /* Set digest stat. */
-        digest_storage= &state->m_digest_state.m_digest_storage;
-        /* Populate statements_digest_stat with computed digest information. */
-        digest_stat= find_or_create_digest(thread, digest_storage,
-                                           state->m_schema_name,
-                                           state->m_schema_name_length);
+        digest_storage= state->m_digest;
+
+        if (digest_storage != NULL)
+        {
+          /* Populate statements_digest_stat with computed digest information. */
+          digest_stat= find_or_create_digest(thread, digest_storage,
+                                             state->m_schema_name,
+                                             state->m_schema_name_length);
+        }
       }
     }
 
@@ -4921,7 +4937,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
     {
       digest_stat->aggregate_counted();
     }
-  
+
     digest_stat->m_lock_time+= state->m_lock_time;
     digest_stat->m_rows_sent+= state->m_rows_sent;
     digest_stat->m_rows_examined+= state->m_rows_examined;
@@ -5106,6 +5122,39 @@ static void set_socket_thread_owner_v1(PSI_socket *socket)
   pfs_socket->m_thread_owner= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
 }
 
+struct PSI_digest_locker*
+pfs_digest_start_v1(PSI_statement_locker *locker)
+{
+  PSI_statement_locker_state *statement_state;
+  statement_state= reinterpret_cast<PSI_statement_locker_state*> (locker);
+  DBUG_ASSERT(statement_state != NULL);
+
+  if (statement_state->m_discarded)
+    return NULL;
+
+  if (statement_state->m_flags & STATE_FLAG_DIGEST)
+  {
+    return reinterpret_cast<PSI_digest_locker*> (locker);
+  }
+
+  return NULL;
+}
+
+void pfs_digest_end_v1(PSI_digest_locker *locker, const sql_digest_storage *digest)
+{
+  PSI_statement_locker_state *statement_state;
+  statement_state= reinterpret_cast<PSI_statement_locker_state*> (locker);
+  DBUG_ASSERT(statement_state != NULL);
+  DBUG_ASSERT(digest != NULL);
+
+  if (statement_state->m_discarded)
+    return;
+
+  if (statement_state->m_flags & STATE_FLAG_DIGEST)
+  {
+    statement_state->m_digest= digest;
+  }
+}
 
 /**
   Implementation of the thread attribute connection interface
@@ -5243,7 +5292,7 @@ PSI_v1 PFS_v1=
   set_socket_info_v1,
   set_socket_thread_owner_v1,
   pfs_digest_start_v1,
-  pfs_digest_add_token_v1,
+  pfs_digest_end_v1,
   set_thread_connect_attrs_v1,
 };
 
index 405364a23d306f6619d1320d31444460a972adcc..8650a9340b1c63c4524cc9d24d24ac5a4d3e7848 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, 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
@@ -69,8 +69,8 @@ int init_account(const PFS_global_param *param)
 
   if (account_max > 0)
   {
-    account_array= PFS_MALLOC_ARRAY(account_max, PFS_account,
-                                      MYF(MY_ZEROFILL));
+    account_array= PFS_MALLOC_ARRAY(account_max, sizeof(PFS_account), PFS_account,
+                                    MYF(MY_ZEROFILL));
     if (unlikely(account_array == NULL))
       return 1;
   }
@@ -527,9 +527,7 @@ void purge_account(PFS_thread *thread, PFS_account *account,
                     account->m_key.m_key_length));
   if (entry && (entry != MY_ERRPTR))
   {
-    PFS_account *pfs;
-    pfs= *entry;
-    DBUG_ASSERT(pfs == account);
+    DBUG_ASSERT(*entry == account);
     if (account->get_refcount() == 0)
     {
       lf_hash_delete(&account_hash, pins,
index 23ef946ee82d6b9c14f571300a7727b1940b051c..c70ca220d847040f8fbab178ba7a5c2e45690b9f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, 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
index 263f25c1c08fe0e593fe5e48d48f8ccb700acfef..bd449df0a4b86c6b0a2916810f21635bee90a8fd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, 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
@@ -39,7 +39,8 @@ PFS_connection_slice::alloc_waits_slice(uint sizing)
 
   if (sizing > 0)
   {
-    slice= PFS_MALLOC_ARRAY(sizing, PFS_single_stat, MYF(MY_ZEROFILL));
+    slice= PFS_MALLOC_ARRAY(sizing, sizeof(PFS_single_stat), PFS_single_stat,
+                            MYF(MY_ZEROFILL));
     if (unlikely(slice == NULL))
       return NULL;
 
@@ -58,7 +59,8 @@ PFS_connection_slice::alloc_stages_slice(uint sizing)
 
   if (sizing > 0)
   {
-    slice= PFS_MALLOC_ARRAY(sizing, PFS_stage_stat, MYF(MY_ZEROFILL));
+    slice= PFS_MALLOC_ARRAY(sizing, sizeof(PFS_stage_stat), PFS_stage_stat,
+                            MYF(MY_ZEROFILL));
     if (unlikely(slice == NULL))
       return NULL;
 
@@ -77,7 +79,8 @@ PFS_connection_slice::alloc_statements_slice(uint sizing)
 
   if (sizing > 0)
   {
-    slice= PFS_MALLOC_ARRAY(sizing, PFS_statement_stat, MYF(MY_ZEROFILL));
+    slice= PFS_MALLOC_ARRAY(sizing, sizeof(PFS_statement_stat), PFS_statement_stat,
+                            MYF(MY_ZEROFILL));
     if (unlikely(slice == NULL))
       return NULL;
 
index 8fbd5741565d431143472e4c21ba643a950a8300..1053bd59571c2053e06b2f6d8cc62c84a9c07517 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2014, 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
 #include "pfs_digest.h"
 #include "pfs_global.h"
 #include "table_helper.h"
-#include "my_md5.h"
 #include "sql_lex.h"
 #include "sql_get_diagnostics.h"
 #include "sql_string.h"
 #include <string.h>
 
-/* Generated code */
-#include "../sql/sql_yacc.h"
-#include "../storage/perfschema/pfs_lex_token.h"
-
-/* Name pollution from sql/sql_lex.h */
-#ifdef LEX_YYSTYPE
-#undef LEX_YYSTYPE
-#endif
-
-#define LEX_YYSTYPE YYSTYPE
-
-/**
-  Token array :
-  Token array is an array of bytes to store tokens recieved during parsing.
-  Following is the way token array is formed.
-
-      ...<non-id-token><non-id-token><id-token><id_len><id_text>...
-
-  For Ex:
-  SELECT * FROM T1;
-  <SELECT_TOKEN><*><FROM_TOKEN><ID_TOKEN><2><T1>
-*/
-
-ulong digest_max= 0;
+size_t digest_max= 0;
 ulong digest_lost= 0;
 
 /** EVENTS_STATEMENTS_HISTORY_LONG circular buffer. */
 PFS_statements_digest_stat *statements_digest_stat_array= NULL;
+static unsigned char *statements_digest_token_array= NULL;
 /** Consumer flag for table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST. */
 bool flag_statements_digest= true;
 /**
   Current index in Stat array where new record is to be inserted.
   index 0 is reserved for "all else" case when entire array is full.
 */
-volatile uint32 digest_index= 1;
+volatile uint32 digest_index;
+bool digest_full= false;
 
 LF_HASH digest_hash;
 static bool digest_hash_inited= false;
 
 /**
   Initialize table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST.
-  @param digest_sizing
+  @param param performance schema sizing
 */
 int init_digest(const PFS_global_param *param)
 {
-  unsigned int index;
-
   /*
     Allocate memory for statements_digest_stat_array based on
     performance_schema_digests_size values
   */
   digest_max= param->m_digest_sizing;
   digest_lost= 0;
+  digest_index= 1;
+  digest_full= false;
 
   if (digest_max == 0)
     return 0;
 
   statements_digest_stat_array=
-    PFS_MALLOC_ARRAY(digest_max, PFS_statements_digest_stat,
+    PFS_MALLOC_ARRAY(digest_max,
+                     sizeof(PFS_statements_digest_stat),
+                     PFS_statements_digest_stat,
                      MYF(MY_ZEROFILL));
+
   if (unlikely(statements_digest_stat_array == NULL))
+  {
+    cleanup_digest();
     return 1;
+  }
+
+  if (pfs_max_digest_length > 0)
+  {
+    /* Size of each digest array. */
+    size_t digest_memory_size= pfs_max_digest_length * sizeof(unsigned char);
+
+    statements_digest_token_array=
+      PFS_MALLOC_ARRAY(digest_max,
+                       digest_memory_size,
+                       unsigned char,
+                       MYF(MY_ZEROFILL));
 
-  for (index= 0; index < digest_max; index++)
+    if (unlikely(statements_digest_token_array == NULL))
+    {
+      cleanup_digest();
+      return 1;
+    }
+  }
+
+  for (size_t index= 0; index < digest_max; index++)
   {
-    statements_digest_stat_array[index].reset_data();
+    statements_digest_stat_array[index].reset_data(statements_digest_token_array
+                                                   + index * pfs_max_digest_length, pfs_max_digest_length);
   }
 
   return 0;
@@ -110,7 +113,9 @@ void cleanup_digest(void)
 {
   /*  Free memory allocated to statements_digest_stat_array. */
   pfs_free(statements_digest_stat_array);
+  pfs_free(statements_digest_token_array);
   statements_digest_stat_array= NULL;
+  statements_digest_token_array= NULL;
 }
 
 C_MODE_START
@@ -142,7 +147,7 @@ int init_digest_hash(void)
     lf_hash_init(&digest_hash, sizeof(PFS_statements_digest_stat*),
                  LF_HASH_UNIQUE, 0, 0, digest_hash_get_key,
                  &my_charset_bin);
-    digest_hash.size= digest_max;
+    digest_hash.size= (int32)digest_max;
     digest_hash_inited= true;
   }
   return 0;
@@ -170,10 +175,12 @@ static LF_PINS* get_digest_hash_pins(PFS_thread *thread)
 
 PFS_statement_stat*
 find_or_create_digest(PFS_thread *thread,
-                      PSI_digest_storage *digest_storage,
+                      const sql_digest_storage *digest_storage,
                       const char *schema_name,
                       uint schema_name_length)
 {
+  DBUG_ASSERT(digest_storage != NULL);
+
   if (statements_digest_stat_array == NULL)
     return NULL;
 
@@ -192,9 +199,8 @@ find_or_create_digest(PFS_thread *thread,
   PFS_digest_key hash_key;
   memset(& hash_key, 0, sizeof(hash_key));
   /* Compute MD5 Hash of the tokens received. */
-  compute_md5_hash((char *) hash_key.m_md5,
-                   (char *) digest_storage->m_token_array,
-                   digest_storage->m_byte_count);
+  compute_digest_md5(digest_storage, hash_key.m_md5);
+  memcpy((void*)& digest_storage->m_md5, &hash_key.m_md5, MD5_HASH_SIZE);
   /* Add the current schema to the key */
   hash_key.m_schema_name_length= schema_name_length;
   if (schema_name_length > 0)
@@ -227,8 +233,7 @@ search:
 
   lf_hash_search_unpin(pins);
 
-  /* Dirty read of digest_index */
-  if (digest_index == 0)
+  if (digest_full)
   {
     /*  digest_stat array is full. Add stat at index 0 and return. */
     pfs= &statements_digest_stat_array[0];
@@ -244,7 +249,7 @@ search:
   if (safe_index >= digest_max)
   {
     /* The digest array is now full. */
-    digest_index= 0;
+    digest_full= true;
     pfs= &statements_digest_stat_array[0];
 
     if (pfs->m_first_seen == 0)
@@ -263,7 +268,7 @@ search:
     Copy digest storage to statement_digest_stat_array so that it could be
     used later to generate digest text.
   */
-  digest_copy(& pfs->m_digest_storage, digest_storage);
+  pfs->m_digest_storage.copy(digest_storage);
 
   pfs->m_first_seen= now;
   pfs->m_last_seen= now;
@@ -313,9 +318,9 @@ void purge_digest(PFS_thread* thread, PFS_digest_key *hash_key)
   return;
 }
 
-void PFS_statements_digest_stat::reset_data()
+void PFS_statements_digest_stat::reset_data(unsigned char *token_array, uint length)
 {
-  digest_reset(& m_digest_storage);
+  m_digest_storage.reset(token_array, length);
   m_stat.reset();
   m_first_seen= 0;
   m_last_seen= 0;
@@ -332,8 +337,6 @@ void PFS_statements_digest_stat::reset_index(PFS_thread *thread)
 
 void reset_esms_by_digest()
 {
-  uint index;
-
   if (statements_digest_stat_array == NULL)
     return;
 
@@ -342,10 +345,10 @@ void reset_esms_by_digest()
     return;
 
   /* Reset statements_digest_stat_array. */
-  for (index= 0; index < digest_max; index++)
+  for (size_t index= 0; index < digest_max; index++)
   {
     statements_digest_stat_array[index].reset_index(thread);
-    statements_digest_stat_array[index].reset_data();
+    statements_digest_stat_array[index].reset_data(statements_digest_token_array + index * pfs_max_digest_length, pfs_max_digest_length);
   }
 
   /*
@@ -353,448 +356,6 @@ void reset_esms_by_digest()
     to be inserted in statements_digest_stat_array.
   */
   digest_index= 1;
+  digest_full= false;
 }
 
-/*
-  Iterate token array and updates digest_text.
-*/
-void get_digest_text(char* digest_text, PSI_digest_storage* digest_storage)
-{
-  DBUG_ASSERT(digest_storage != NULL);
-  bool truncated= false;
-  int byte_count= digest_storage->m_byte_count;
-  char *digest_output= digest_text;
-  int bytes_needed= 0;
-  uint tok= 0;
-  int current_byte= 0;
-  lex_token_string *tok_data;
-  /* -4 is to make sure extra space for '...' and a '\0' at the end. */
-  int bytes_available= COL_DIGEST_TEXT_SIZE - 4;
-
-  if (byte_count <= 0 || byte_count > PSI_MAX_DIGEST_STORAGE_SIZE)
-  {
-    *digest_text= '\0';
-    return;
-  }
-
-  /* Convert text to utf8 */
-  const CHARSET_INFO *from_cs= get_charset(digest_storage->m_charset_number, MYF(0));
-  const CHARSET_INFO *to_cs= &my_charset_utf8_bin;
-
-  if (from_cs == NULL)
-  {
-    /*
-      Can happen, as we do dirty reads on digest_storage,
-      which can be written to in another thread.
-    */
-    *digest_text= '\0';
-    return;
-  }
-
-  /*
-     Max converted size is number of characters * max multibyte length of the
-     target charset, which is 4 for UTF8.
-   */
-  const uint max_converted_size= PSI_MAX_DIGEST_STORAGE_SIZE * 4;
-  char id_buffer[max_converted_size];
-  char *id_string;
-  int  id_length;
-  bool convert_text= !my_charset_same(from_cs, to_cs);
-
-  DBUG_ASSERT(byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE);
-
-  while ((current_byte < byte_count) &&
-         (bytes_available > 0) &&
-         !truncated)
-  {
-    current_byte= read_token(digest_storage, current_byte, &tok);
-
-    if (tok <= 0 || tok >= array_elements(lex_token_array))
-    {
-      *digest_text='\0';
-      return;
-    }
-
-    tok_data= &lex_token_array[tok];
-
-    switch (tok)
-    {
-    /* All identifiers are printed with their name. */
-    case IDENT:
-    case IDENT_QUOTED:
-      {
-        char *id_ptr;
-        int id_len;
-        uint err_cs= 0;
-
-        /* Get the next identifier from the storage buffer. */
-        current_byte= read_identifier(digest_storage, current_byte,
-                                      &id_ptr, &id_len);
-        if (convert_text)
-        {
-          /* Verify that the converted text will fit. */
-          if (to_cs->mbmaxlen*id_len > max_converted_size)
-          {
-            truncated= true;
-            break;
-          }
-          /* Convert identifier string into the storage character set. */
-          id_length= my_convert(id_buffer, max_converted_size, to_cs,
-                                id_ptr, id_len, from_cs, &err_cs);
-          id_string= id_buffer;
-        }
-        else
-        {
-          id_string= id_ptr;
-          id_length= id_len;
-        }
-
-        if (id_length == 0 || err_cs != 0)
-        {
-          truncated= true;
-          break;
-        }
-        /* Copy the converted identifier into the digest string. */
-        bytes_needed= id_length + (tok == IDENT ? 1 : 3);
-        if (bytes_needed <= bytes_available)
-        {
-          if (tok == IDENT_QUOTED)
-            *digest_output++= '`';
-          if (id_length > 0)
-          {
-            memcpy(digest_output, id_string, id_length);
-            digest_output+= id_length;
-          }
-          if (tok == IDENT_QUOTED)
-            *digest_output++= '`';
-          *digest_output++= ' ';
-          bytes_available-= bytes_needed;
-        }
-        else
-        {
-          truncated= true;
-        }
-      }
-      break;
-
-    /* Everything else is printed as is. */
-    default:
-      /*
-        Make sure not to overflow digest_text buffer.
-        +1 is to make sure extra space for ' '.
-      */
-      int tok_length= tok_data->m_token_length;
-      bytes_needed= tok_length + 1;
-
-      if (bytes_needed <= bytes_available)
-      {
-        strncpy(digest_output, tok_data->m_token_string, tok_length);
-        digest_output+= tok_length;
-        *digest_output++= ' ';
-        bytes_available-= bytes_needed;
-      }
-      else
-      {
-        truncated= true;
-      }
-      break;
-    }
-  }
-
-  /* Truncate digest text in case of long queries. */
-  if (digest_storage->m_full || truncated)
-  {
-    strcpy(digest_output, "...");
-    digest_output+= 3;
-  }
-
-  *digest_output= '\0';
-}
-
-static inline uint peek_token(const PSI_digest_storage *digest, int index)
-{
-  uint token;
-  DBUG_ASSERT(index >= 0);
-  DBUG_ASSERT(index + PFS_SIZE_OF_A_TOKEN <= digest->m_byte_count);
-  DBUG_ASSERT(digest->m_byte_count <=  PSI_MAX_DIGEST_STORAGE_SIZE);
-
-  token= ((digest->m_token_array[index + 1])<<8) | digest->m_token_array[index];
-  return token;
-}
-
-/**
-  Function to read last two tokens from token array. If an identifier
-  is found, do not look for token before that.
-*/
-static inline void peek_last_two_tokens(const PSI_digest_storage* digest_storage,
-                                        int last_id_index, uint *t1, uint *t2)
-{
-  int byte_count= digest_storage->m_byte_count;
-  int peek_index= byte_count - PFS_SIZE_OF_A_TOKEN;
-
-  if (last_id_index <= peek_index)
-  {
-    /* Take last token. */
-    *t1= peek_token(digest_storage, peek_index);
-
-    peek_index-= PFS_SIZE_OF_A_TOKEN;
-    if (last_id_index <= peek_index)
-    {
-      /* Take 2nd token from last. */
-      *t2= peek_token(digest_storage, peek_index);
-    }
-    else
-    {
-      *t2= TOK_PFS_UNUSED;
-    }
-  }
-  else
-  {
-    *t1= TOK_PFS_UNUSED;
-    *t2= TOK_PFS_UNUSED;
-  }
-}
-
-struct PSI_digest_locker* pfs_digest_start_v1(PSI_statement_locker *locker)
-{
-  PSI_statement_locker_state *statement_state;
-  statement_state= reinterpret_cast<PSI_statement_locker_state*> (locker);
-  DBUG_ASSERT(statement_state != NULL);
-
-  if (statement_state->m_discarded)
-    return NULL;
-
-  if (statement_state->m_flags & STATE_FLAG_DIGEST)
-  {
-    PSI_digest_locker_state *digest_state;
-    digest_state= &statement_state->m_digest_state;
-    return reinterpret_cast<PSI_digest_locker*> (digest_state);
-  }
-
-  return NULL;
-}
-
-PSI_digest_locker* pfs_digest_add_token_v1(PSI_digest_locker *locker,
-                                           uint token,
-                                           OPAQUE_LEX_YYSTYPE *yylval)
-{
-  PSI_digest_locker_state *state= NULL;
-  PSI_digest_storage      *digest_storage= NULL;
-
-  state= reinterpret_cast<PSI_digest_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
-
-  digest_storage= &state->m_digest_storage;
-
-  /*
-    Stop collecting further tokens if digest storage is full or
-    if END token is received.
-  */
-  if (digest_storage->m_full || token == END_OF_INPUT)
-    return NULL;
-
-  /*
-    Take last_token 2 tokens collected till now. These tokens will be used
-    in reduce for normalisation. Make sure not to consider ID tokens in reduce.
-  */
-  uint last_token;
-  uint last_token2;
-
-  switch (token)
-  {
-    case NUM:
-    case LONG_NUM:
-    case ULONGLONG_NUM:
-    case DECIMAL_NUM:
-    case FLOAT_NUM:
-    case BIN_NUM:
-    case HEX_NUM:
-    {
-      bool found_unary;
-      do
-      {
-        found_unary= false;
-        peek_last_two_tokens(digest_storage, state->m_last_id_index,
-                             &last_token, &last_token2);
-
-        if ((last_token == '-') || (last_token == '+'))
-        {
-          /*
-            We need to differentiate:
-            - a <unary minus> operator
-            - a <unary plus> operator
-            from
-            - a <binary minus> operator
-            - a <binary plus> operator
-            to only reduce "a = -1" to "a = ?", and not change "b - 1" to "b ?"
-
-            Binary operators are found inside an expression,
-            while unary operators are found at the beginning of an expression, or after operators.
-
-            To achieve this, every token that is followed by an <expr> expression
-            in the SQL grammar is flagged.
-            See sql/sql_yacc.yy
-            See sql/gen_lex_token.cc
-
-            For example,
-            "(-1)" is parsed as "(", "-", NUM, ")", and lex_token_array["("].m_start_expr is true,
-            so reduction of the "-" NUM is done, the result is "(?)".
-            "(a-1)" is parsed as "(", ID, "-", NUM, ")", and lex_token_array[ID].m_start_expr is false,
-            so the operator is binary, no reduction is done, and the result is "(a-?)".
-          */
-          if (lex_token_array[last_token2].m_start_expr)
-          {
-            /*
-              REDUCE:
-              TOK_PFS_GENERIC_VALUE := (UNARY_PLUS | UNARY_MINUS) (NUM | LOG_NUM | ... | FLOAT_NUM)
-
-              REDUCE:
-              TOK_PFS_GENERIC_VALUE := (UNARY_PLUS | UNARY_MINUS) TOK_PFS_GENERIC_VALUE
-            */
-            token= TOK_PFS_GENERIC_VALUE;
-            digest_storage->m_byte_count-= PFS_SIZE_OF_A_TOKEN;
-            found_unary= true;
-          }
-        }
-      } while (found_unary);
-    }
-    /* fall through, for case NULL_SYM below */
-    case LEX_HOSTNAME:
-    case TEXT_STRING:
-    case NCHAR_STRING:
-    case PARAM_MARKER:
-    {
-      /*
-        REDUCE:
-        TOK_PFS_GENERIC_VALUE := BIN_NUM | DECIMAL_NUM | ... | ULONGLONG_NUM
-      */
-      token= TOK_PFS_GENERIC_VALUE;
-    }
-    /* fall through */
-    case NULL_SYM:
-    {
-      peek_last_two_tokens(digest_storage, state->m_last_id_index,
-                           &last_token, &last_token2);
-
-      if ((last_token2 == TOK_PFS_GENERIC_VALUE ||
-           last_token2 == TOK_PFS_GENERIC_VALUE_LIST ||
-           last_token2 == NULL_SYM) &&
-          (last_token == ','))
-      {
-        /*
-          REDUCE:
-          TOK_PFS_GENERIC_VALUE_LIST :=
-            (TOK_PFS_GENERIC_VALUE|NULL_SYM) ',' (TOK_PFS_GENERIC_VALUE|NULL_SYM)
-
-          REDUCE:
-          TOK_PFS_GENERIC_VALUE_LIST :=
-            TOK_PFS_GENERIC_VALUE_LIST ',' (TOK_PFS_GENERIC_VALUE|NULL_SYM)
-        */
-        digest_storage->m_byte_count-= 2*PFS_SIZE_OF_A_TOKEN;
-        token= TOK_PFS_GENERIC_VALUE_LIST;
-      }
-      /*
-        Add this token or the resulting reduce to digest storage.
-      */
-      store_token(digest_storage, token);
-      break;
-    }
-    case ')':
-    {
-      peek_last_two_tokens(digest_storage, state->m_last_id_index,
-                           &last_token, &last_token2);
-
-      if (last_token == TOK_PFS_GENERIC_VALUE &&
-          last_token2 == '(')
-      {
-        /*
-          REDUCE:
-          TOK_PFS_ROW_SINGLE_VALUE :=
-            '(' TOK_PFS_GENERIC_VALUE ')'
-        */
-        digest_storage->m_byte_count-= 2*PFS_SIZE_OF_A_TOKEN;
-        token= TOK_PFS_ROW_SINGLE_VALUE;
-
-        /* Read last two tokens again */
-        peek_last_two_tokens(digest_storage, state->m_last_id_index,
-                             &last_token, &last_token2);
-
-        if ((last_token2 == TOK_PFS_ROW_SINGLE_VALUE ||
-             last_token2 == TOK_PFS_ROW_SINGLE_VALUE_LIST) &&
-            (last_token == ','))
-        {
-          /*
-            REDUCE:
-            TOK_PFS_ROW_SINGLE_VALUE_LIST :=
-              TOK_PFS_ROW_SINGLE_VALUE ',' TOK_PFS_ROW_SINGLE_VALUE
-
-            REDUCE:
-            TOK_PFS_ROW_SINGLE_VALUE_LIST :=
-              TOK_PFS_ROW_SINGLE_VALUE_LIST ',' TOK_PFS_ROW_SINGLE_VALUE
-          */
-          digest_storage->m_byte_count-= 2*PFS_SIZE_OF_A_TOKEN;
-          token= TOK_PFS_ROW_SINGLE_VALUE_LIST;
-        }
-      }
-      else if (last_token == TOK_PFS_GENERIC_VALUE_LIST &&
-               last_token2 == '(')
-      {
-        /*
-          REDUCE:
-          TOK_PFS_ROW_MULTIPLE_VALUE :=
-            '(' TOK_PFS_GENERIC_VALUE_LIST ')'
-        */
-        digest_storage->m_byte_count-= 2*PFS_SIZE_OF_A_TOKEN;
-        token= TOK_PFS_ROW_MULTIPLE_VALUE;
-
-        /* Read last two tokens again */
-        peek_last_two_tokens(digest_storage, state->m_last_id_index,
-                             &last_token, &last_token2);
-
-        if ((last_token2 == TOK_PFS_ROW_MULTIPLE_VALUE ||
-             last_token2 == TOK_PFS_ROW_MULTIPLE_VALUE_LIST) &&
-            (last_token == ','))
-        {
-          /*
-            REDUCE:
-            TOK_PFS_ROW_MULTIPLE_VALUE_LIST :=
-              TOK_PFS_ROW_MULTIPLE_VALUE ',' TOK_PFS_ROW_MULTIPLE_VALUE
-
-            REDUCE:
-            TOK_PFS_ROW_MULTIPLE_VALUE_LIST :=
-              TOK_PFS_ROW_MULTIPLE_VALUE_LIST ',' TOK_PFS_ROW_MULTIPLE_VALUE
-          */
-          digest_storage->m_byte_count-= 2*PFS_SIZE_OF_A_TOKEN;
-          token= TOK_PFS_ROW_MULTIPLE_VALUE_LIST;
-        }
-      }
-      /*
-        Add this token or the resulting reduce to digest storage.
-      */
-      store_token(digest_storage, token);
-      break;
-    }
-    case IDENT:
-    case IDENT_QUOTED:
-    {
-      LEX_YYSTYPE *lex_token= (LEX_YYSTYPE*) yylval;
-      char *yytext= lex_token->lex_str.str;
-      int yylen= lex_token->lex_str.length;
-
-      /* Add this token and identifier string to digest storage. */
-      store_token_identifier(digest_storage, token, yylen, yytext);
-
-      /* Update the index of last identifier found. */
-      state->m_last_id_index= digest_storage->m_byte_count;
-      break;
-    }
-    default:
-    {
-      /* Add this token to digest storage. */
-      store_token(digest_storage, token);
-      break;
-    }
-  }
-
-  return locker;
-}
index 03f534b3d7e1e897868102a8ba240be85cac535e..76d6c33d984fbbbbba816f518198835389ceffa0 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
 #include "pfs_column_types.h"
 #include "lf.h"
 #include "pfs_stat.h"
-
-#define PFS_SIZE_OF_A_TOKEN 2
+#include "sql_digest.h"
 
 extern bool flag_statements_digest;
-extern ulong digest_max;
+extern size_t digest_max;
 extern ulong digest_lost;
 struct PFS_thread;
 
-/* Fixed, per MD5 hash. */
-#define PFS_MD5_SIZE 16
-
 /**
   Structure to store a MD5 hash value (digest) for a statement.
 */
 struct PFS_digest_key
 {
-  unsigned char m_md5[PFS_MD5_SIZE];
+  unsigned char m_md5[MD5_HASH_SIZE];
   char m_schema_name[NAME_LEN];
   uint m_schema_name_length;
 };
@@ -52,7 +48,7 @@ struct PFS_ALIGNED PFS_statements_digest_stat
   PFS_digest_key m_digest_key;
 
   /** Digest Storage. */
-  PSI_digest_storage m_digest_storage;
+  sql_digest_storage m_digest_storage;
 
   /** Statement stat. */
   PFS_statement_stat m_stat;
@@ -62,7 +58,7 @@ struct PFS_ALIGNED PFS_statements_digest_stat
   ulonglong m_last_seen;
 
   /** Reset data for this record. */
-  void reset_data();
+  void reset_data(unsigned char* token_array, uint length);
   /** Reset data and remove index for this record. */
   void reset_index(PFS_thread *thread);
 };
@@ -73,147 +69,15 @@ void cleanup_digest();
 int init_digest_hash(void);
 void cleanup_digest_hash(void);
 PFS_statement_stat* find_or_create_digest(PFS_thread *thread,
-                                          PSI_digest_storage *digest_storage,
+                                          const sql_digest_storage *digest_storage,
                                           const char *schema_name,
                                           uint schema_name_length);
 
-void get_digest_text(char *digest_text, PSI_digest_storage *digest_storage);
-
 void reset_esms_by_digest();
 
 /* Exposing the data directly, for iterators. */
 extern PFS_statements_digest_stat *statements_digest_stat_array;
 
-/* Instrumentation callbacks for pfs.cc */
-
-struct PSI_digest_locker *pfs_digest_start_v1(PSI_statement_locker *locker);
-PSI_digest_locker *pfs_digest_add_token_v1(PSI_digest_locker *locker,
-                                           uint token,
-                                           OPAQUE_LEX_YYSTYPE *yylval);
-
-static inline void digest_reset(PSI_digest_storage *digest)
-{
-  digest->m_full= false;
-  digest->m_byte_count= 0;
-  digest->m_charset_number= 0;
-}
-
-static inline void digest_copy(PSI_digest_storage *to, const PSI_digest_storage *from)
-{
-  if (from->m_byte_count > 0)
-  {
-    to->m_full= from->m_full;
-    to->m_byte_count= from->m_byte_count;
-    to->m_charset_number= from->m_charset_number;
-    DBUG_ASSERT(to->m_byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE);
-    memcpy(to->m_token_array, from->m_token_array, to->m_byte_count);
-  }
-  else
-  {
-    DBUG_ASSERT(from->m_byte_count == 0);
-    to->m_full= false;
-    to->m_byte_count= 0;
-    to->m_charset_number= 0;
-  }
-}
-
-/** 
-  Read a single token from token array.
-*/
-inline int read_token(PSI_digest_storage *digest_storage,
-                      int index, uint *tok)
-{
-  int safe_byte_count= digest_storage->m_byte_count;
-
-  if (index + PFS_SIZE_OF_A_TOKEN <= safe_byte_count &&
-      safe_byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE)
-  {
-    unsigned char *src= & digest_storage->m_token_array[index];
-    *tok= src[0] | (src[1] << 8);
-    return index + PFS_SIZE_OF_A_TOKEN;
-  }
-
-  /* The input byte stream is exhausted. */
-  *tok= 0;
-  return PSI_MAX_DIGEST_STORAGE_SIZE + 1;
-}
-
-/**
-  Store a single token in token array.
-*/
-inline void store_token(PSI_digest_storage* digest_storage, uint token)
-{
-  DBUG_ASSERT(digest_storage->m_byte_count >= 0);
-  DBUG_ASSERT(digest_storage->m_byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE);
-
-  if (digest_storage->m_byte_count + PFS_SIZE_OF_A_TOKEN <= PSI_MAX_DIGEST_STORAGE_SIZE)
-  {
-    unsigned char* dest= & digest_storage->m_token_array[digest_storage->m_byte_count];
-    dest[0]= token & 0xff;
-    dest[1]= (token >> 8) & 0xff;
-    digest_storage->m_byte_count+= PFS_SIZE_OF_A_TOKEN; 
-  }
-  else
-  {
-    digest_storage->m_full= true;
-  }
-}
-
-/**
-  Read an identifier from token array.
-*/
-inline int read_identifier(PSI_digest_storage* digest_storage,
-                           int index, char ** id_string, int *id_length)
-{
-  int new_index;
-  DBUG_ASSERT(index <= digest_storage->m_byte_count);
-  DBUG_ASSERT(digest_storage->m_byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE);
-
-  /*
-    token + length + string are written in an atomic way,
-    so we do always expect a length + string here
-  */
-  unsigned char *src= & digest_storage->m_token_array[index];
-  uint length= src[0] | (src[1] << 8);
-  *id_string= (char *) (src + 2);
-  *id_length= length;
-
-  new_index= index + PFS_SIZE_OF_A_TOKEN + length;
-  DBUG_ASSERT(new_index <= digest_storage->m_byte_count);
-  return new_index;
-}
-
-/**
-  Store an identifier in token array.
-*/
-inline void store_token_identifier(PSI_digest_storage* digest_storage,
-                                   uint token,
-                                   uint id_length, const char *id_name)
-{
-  DBUG_ASSERT(digest_storage->m_byte_count >= 0);
-  DBUG_ASSERT(digest_storage->m_byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE);
-
-  uint bytes_needed= 2 * PFS_SIZE_OF_A_TOKEN + id_length;
-  if (digest_storage->m_byte_count + bytes_needed <= PSI_MAX_DIGEST_STORAGE_SIZE)
-  {
-    unsigned char* dest= & digest_storage->m_token_array[digest_storage->m_byte_count];
-    /* Write the token */
-    dest[0]= token & 0xff;
-    dest[1]= (token >> 8) & 0xff;
-    /* Write the string length */
-    dest[2]= id_length & 0xff;
-    dest[3]= (id_length >> 8) & 0xff;
-    /* Write the string data */
-    if (id_length > 0)
-      memcpy((char *)(dest + 4), id_name, id_length);
-    digest_storage->m_byte_count+= bytes_needed; 
-  }
-  else
-  {
-    digest_storage->m_full= true;
-  }
-}
-
 extern LF_HASH digest_hash;
 
 #endif
index df4418b4bae1f91396952dbb79b216934d4de896..d114c2286d401b05dfc36fc9f953d31a257195d6 100644 (file)
@@ -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
@@ -1415,12 +1415,64 @@ bool pfs_show_status(handlerton *hton, THD *thd,
       name= "host_cache.size";
       size= sizeof(Host_entry);
       break;
+    case 154:
+      name= "(history_long_statements_digest_token_array).row_count";
+      size= events_statements_history_long_size;
+      break;
+    case 155:
+      name= "(history_long_statements_digest_token_array).row_size";
+      size= pfs_max_digest_length;
+      break;
+    case 156:
+      name= "(history_long_statements_digest_token_array).memory";
+      size= events_statements_history_long_size * pfs_max_digest_length;
+      total_memory+= size;
+      break;
+    case 157:
+      name= "(history_statements_digest_token_array).row_count";
+      size= thread_max * events_statements_history_per_thread;
+      break;
+    case 158:
+      name= "(history_statements_digest_token_array).row_size";
+      size= pfs_max_digest_length;
+      break;
+    case 159:
+      name= "(history_statements_digest_token_array).memory";
+      size= thread_max * events_statements_history_per_thread * pfs_max_digest_length;
+      total_memory+= size;
+      break;
+    case 160:
+      name= "(current_statements_digest_token_array).row_count";
+      size= thread_max * statement_stack_max;
+      break;
+    case 161:
+      name= "(current_statements_digest_token_array).row_size";
+      size= pfs_max_digest_length;
+      break;
+    case 162:
+      name= "(current_statements_digest_token_array).memory";
+      size= thread_max * statement_stack_max * pfs_max_digest_length;
+      total_memory+= size;
+      break;
+    case 163:
+      name= "(statements_digest_token_array).row_count";
+      size= digest_max;
+      break;
+    case 164:
+      name= "(statements_digest_token_array).row_size";
+      size= pfs_max_digest_length;
+      break;
+    case 165:
+      name= "(statements_digest_token_array).memory";
+      size= digest_max * pfs_max_digest_length;
+      total_memory+= size;
+      break;
 
     /*
       This case must be last,
       for aggregation in total_memory.
     */
-    case 154:
+    case 166:
       name= "performance_schema.memory";
       size= total_memory;
       /* This will fail if something is not advertised here */
index 282071f830e30c858931efde5139392fc12f3627..7351c95c9cbd5ce08779369a43ace1d8b59c0749 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, 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
@@ -59,8 +59,8 @@ int init_events_stages_history_long(uint events_stages_history_long_sizing)
     return 0;
 
   events_stages_history_long_array=
-    PFS_MALLOC_ARRAY(events_stages_history_long_size, PFS_events_stages,
-                     MYF(MY_ZEROFILL));
+    PFS_MALLOC_ARRAY(events_stages_history_long_size, sizeof(PFS_events_stages),
+                     PFS_events_stages,  MYF(MY_ZEROFILL));
 
   return (events_stages_history_long_array ? 0 : 1);
 }
index 07810d26dc4003838b7008f30b8d74cefa7c51f7..cecd0167c38aff721c366109cb09630967306ba9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, 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
@@ -30,7 +30,7 @@
 #include "pfs_atomic.h"
 #include "m_string.h"
 
-ulong events_statements_history_long_size= 0;
+size_t events_statements_history_long_size= 0;
 /** Consumer flag for table EVENTS_STATEMENTS_CURRENT. */
 bool flag_events_statements_current= false;
 /** Consumer flag for table EVENTS_STATEMENTS_HISTORY. */
@@ -44,12 +44,13 @@ bool events_statements_history_long_full= false;
 volatile uint32 events_statements_history_long_index= 0;
 /** EVENTS_STATEMENTS_HISTORY_LONG circular buffer. */
 PFS_events_statements *events_statements_history_long_array= NULL;
+static unsigned char *h_long_stmts_digest_token_array= NULL;
 
 /**
   Initialize table EVENTS_STATEMENTS_HISTORY_LONG.
   @param events_statements_history_long_sizing       table sizing
 */
-int init_events_statements_history_long(uint events_statements_history_long_sizing)
+int init_events_statements_history_long(size_t events_statements_history_long_sizing)
 {
   events_statements_history_long_size= events_statements_history_long_sizing;
   events_statements_history_long_full= false;
@@ -59,23 +60,56 @@ int init_events_statements_history_long(uint events_statements_history_long_sizi
     return 0;
 
   events_statements_history_long_array=
-    PFS_MALLOC_ARRAY(events_statements_history_long_size, PFS_events_statements,
-                     MYF(MY_ZEROFILL));
+    PFS_MALLOC_ARRAY(events_statements_history_long_size, sizeof(PFS_events_statements),
+                     PFS_events_statements, MYF(MY_ZEROFILL));
 
-  return (events_statements_history_long_array ? 0 : 1);
+  if (events_statements_history_long_array == NULL)
+  {
+    cleanup_events_statements_history_long();
+    return 1;
+  }
+
+  if (pfs_max_digest_length > 0)
+  {
+    /* Size of each digest token array. */
+    size_t digest_text_size= pfs_max_digest_length * sizeof(unsigned char);
+
+    h_long_stmts_digest_token_array=
+      PFS_MALLOC_ARRAY(events_statements_history_long_size, digest_text_size, 
+                       unsigned char, MYF(MY_ZEROFILL));
+    if (h_long_stmts_digest_token_array == NULL)
+    {
+      cleanup_events_statements_history_long();
+      return 1;
+    }
+  }
+
+  for (size_t index= 0; index < events_statements_history_long_size; index++)
+  {
+    events_statements_history_long_array[index].m_digest_storage.reset(h_long_stmts_digest_token_array
+                                                                       + index * pfs_max_digest_length, pfs_max_digest_length);
+  }
+
+  return 0;
 }
 
 /** Cleanup table EVENTS_STATEMENTS_HISTORY_LONG. */
 void cleanup_events_statements_history_long(void)
 {
   pfs_free(events_statements_history_long_array);
+  pfs_free(h_long_stmts_digest_token_array);
   events_statements_history_long_array= NULL;
+  h_long_stmts_digest_token_array= NULL;
 }
 
 static inline void copy_events_statements(PFS_events_statements *dest,
                                       const PFS_events_statements *source)
 {
-  memcpy(dest, source, sizeof(PFS_events_statements));
+  /* Copy all attributes except DIGEST */
+  memcpy(dest, source, my_offsetof(PFS_events_statements, m_digest_storage));
+
+  /* Copy DIGEST */
+  dest->m_digest_storage.copy(& source->m_digest_storage);
 }
 
 /**
index 5d90250c6183f833808483f95bcf01f576e0ef6f..d3fd79ea1950ffb33a41e8d8c3c59d37bb20b2cf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, 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
@@ -88,8 +88,18 @@ struct PFS_events_statements : public PFS_events
   ulonglong m_no_index_used;
   /** Optimizer metric, number of 'no good index used'. */
   ulonglong m_no_good_index_used;
-  /** Statement digest. */
-  PSI_digest_storage m_digest_storage;
+
+  /** True if sqltext was truncated. */
+  bool m_sqltext_truncated;
+  /** Statement character set number. */
+  uint m_sqltext_cs_number;
+
+  /**
+    Statement digest.
+    This underlying token array storage pointer is immutable,
+    and always point to pre allocated memory.
+  */
+  sql_digest_storage m_digest_storage;
 };
 
 void insert_events_statements_history(PFS_thread *thread, PFS_events_statements *statement);
@@ -102,9 +112,9 @@ extern bool flag_events_statements_history_long;
 extern bool events_statements_history_long_full;
 extern volatile uint32 events_statements_history_long_index;
 extern PFS_events_statements *events_statements_history_long_array;
-extern ulong events_statements_history_long_size;
+extern size_t events_statements_history_long_size;
 
-int init_events_statements_history_long(uint events_statements_history_long_sizing);
+int init_events_statements_history_long(size_t events_statements_history_long_sizing);
 void cleanup_events_statements_history_long();
 
 void reset_events_statements_current();
index 2799550c81ddd2de81a9ab2088e3d10fc37e848b..1120ac2a445b1d2a2375cac2ffe016ec8c642cc7 100644 (file)
@@ -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
@@ -63,8 +63,8 @@ int init_events_waits_history_long(uint events_waits_history_long_sizing)
     return 0;
 
   events_waits_history_long_array=
-    PFS_MALLOC_ARRAY(events_waits_history_long_size, PFS_events_waits,
-                     MYF(MY_ZEROFILL));
+    PFS_MALLOC_ARRAY(events_waits_history_long_size, sizeof(PFS_events_waits),
+                     PFS_events_waits, MYF(MY_ZEROFILL));
 
   return (events_waits_history_long_array ? 0 : 1);
 }
index a82ffe58cea7cfaacf945397627c4d9e72a72281..1e2070129e006b59486aa82e601190820c7fdc21 100644 (file)
@@ -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
@@ -49,7 +49,7 @@ void *pfs_malloc(size_t size, myf flags)
   DBUG_ASSERT(! pfs_initialized);
   DBUG_ASSERT(size > 0);
 
-  void *ptr;
+  void *ptr= NULL;
 
 #ifdef PFS_ALIGNEMENT
 #ifdef HAVE_POSIX_MEMALIGN
@@ -125,6 +125,40 @@ void pfs_print_error(const char *format, ...)
   fflush(stderr);
 }
 
+/**
+  Array allocation for the performance schema.
+  Checks for overflow of n * size before allocating.
+  @param n  number of array elements
+  @param size  element size
+  @param flags malloc flags
+  @return pointer to memory on success, else NULL
+*/
+void *pfs_malloc_array(size_t n, size_t size, myf flags)
+{
+  DBUG_ASSERT(n > 0);
+  DBUG_ASSERT(size > 0);
+  size_t array_size= n * size;
+  /* Check for overflow before allocating. */
+  if (is_overflow(array_size, n, size))
+    return NULL;
+  return pfs_malloc(array_size, flags);
+}
+
+/**
+  Detect multiplication overflow.
+  @param product  multiplication product
+  @param n1  operand
+  @param n2  operand
+  @return true if multiplication caused an overflow.
+*/
+bool is_overflow(size_t product, size_t n1, size_t n2)
+{
+  if (n1 != 0 && (product / n1 != n2))
+    return true;
+  else
+    return false;
+}
+
 /** Convert raw ip address into readable format. Do not do a reverse DNS lookup. */
 
 uint pfs_get_socket_address(char *host,
index 2ec76df6f91f441948f70f3de33952f13b620a9f..e69b304f4c48e0b28e50c562fd2da278aec5043d 100644 (file)
@@ -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,24 @@ extern size_t pfs_allocated_memory;
 
 void *pfs_malloc(size_t size, myf flags);
 
+/** Allocate an array of structures with overflow check. */
+void *pfs_malloc_array(size_t n, size_t size, myf flags);
+
 /**
   Helper, to allocate an array of structures.
-  @param n number of elements in the array.
-  @param T type of an element.
+  @param n number of elements in the array
+  @param s size of array element
+  @param T type of an element
   @param f flags to use when allocating memory
 */
-#define PFS_MALLOC_ARRAY(n, T, f) \
-  reinterpret_cast<T*> (pfs_malloc((n) * sizeof(T), (f)))
+#define PFS_MALLOC_ARRAY(n, s, T, f) \
+  reinterpret_cast<T*>(pfs_malloc_array((n), (s), (f)))
 
 /** Free memory allocated with @sa pfs_malloc. */
 void pfs_free(void *ptr);
 
+/** Detect multiplication overflow. */
+bool is_overflow(size_t product, size_t n1, size_t n2);
 
 uint pfs_get_socket_address(char *host,
                             uint host_len,
@@ -106,7 +112,7 @@ inline uint randomized_index(const void *ptr, uint max_size)
   value= (reinterpret_cast<intptr> (ptr)) >> 3;
   value*= 1789;
   value+= seed2 + seed1 + 1;
-  
+
   result= (static_cast<uint> (value)) % max_size;
 
   seed2= seed1*seed1;
index 0c6f5cf362741165ae99b8e8ced6b3d2efa68a7d..99e6820cdff03417c8505c1fb7130a708c4152e7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, 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
@@ -66,7 +66,7 @@ int init_host(const PFS_global_param *param)
 
   if (host_max > 0)
   {
-    host_array= PFS_MALLOC_ARRAY(host_max, PFS_host,
+    host_array= PFS_MALLOC_ARRAY(host_max, sizeof(PFS_host), PFS_host,
                                  MYF(MY_ZEROFILL));
     if (unlikely(host_array == NULL))
       return 1;
@@ -353,9 +353,7 @@ void purge_host(PFS_thread *thread, PFS_host *host)
                     host->m_key.m_hash_key, host->m_key.m_key_length));
   if (entry && (entry != MY_ERRPTR))
   {
-    PFS_host *pfs;
-    pfs= *entry;
-    DBUG_ASSERT(pfs == host);
+    DBUG_ASSERT(*entry == host);
     if (host->get_refcount() == 0)
     {
       lf_hash_delete(&host_hash, pins,
index cf0e6fd56f8537e31aceef2a5b16e9e344207984..e842aa7fa6e787057e9cc0b78ae80d87ab7d96bb 100644 (file)
@@ -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
@@ -94,6 +94,7 @@ ulong events_stages_history_per_thread;
 /** Number of EVENTS_STATEMENTS_HISTORY records per thread. */
 ulong events_statements_history_per_thread;
 uint statement_stack_max;
+size_t pfs_max_digest_length= 0;
 /** Number of locker lost. @sa LOCKER_STACK_SIZE. */
 ulong locker_lost= 0;
 /** Number of statement lost. @sa STATEMENT_STACK_SIZE. */
@@ -176,6 +177,8 @@ static PFS_events_waits *thread_waits_history_array= NULL;
 static PFS_events_stages *thread_stages_history_array= NULL;
 static PFS_events_statements *thread_statements_history_array= NULL;
 static PFS_events_statements *thread_statements_stack_array= NULL;
+static unsigned char *current_stmts_digest_token_array= NULL;
+static unsigned char *history_stmts_digest_token_array= NULL;
 static char *thread_session_connect_attrs_array= NULL;
 
 /** Hash table for instrumented files. */
@@ -190,6 +193,9 @@ static bool filename_hash_inited= false;
 */
 int init_instruments(const PFS_global_param *param)
 {
+  PFS_events_statements *pfs_stmt;
+  unsigned char *pfs_tokens;
+
   uint thread_waits_history_sizing;
   uint thread_stages_history_sizing;
   uint thread_statements_history_sizing;
@@ -215,6 +221,9 @@ int init_instruments(const PFS_global_param *param)
   file_handle_max= param->m_file_handle_sizing;
   file_handle_full= false;
   file_handle_lost= 0;
+
+  pfs_max_digest_length= param->m_max_digest_length;
+
   table_max= param->m_table_sizing;
   table_full= false;
   table_lost= 0;
@@ -254,6 +263,9 @@ int init_instruments(const PFS_global_param *param)
     * session_connect_attrs_size_per_thread;
   session_connect_attrs_lost= 0;
 
+  size_t current_digest_tokens_sizing= param->m_thread_sizing * pfs_max_digest_length * statement_stack_max;
+  size_t history_digest_tokens_sizing= param->m_thread_sizing * pfs_max_digest_length * events_statements_history_per_thread;
+
   mutex_array= NULL;
   rwlock_array= NULL;
   cond_array= NULL;
@@ -266,6 +278,8 @@ int init_instruments(const PFS_global_param *param)
   thread_stages_history_array= NULL;
   thread_statements_history_array= NULL;
   thread_statements_stack_array= NULL;
+  current_stmts_digest_token_array= NULL;
+  history_stmts_digest_token_array= NULL;
   thread_instr_class_waits_array= NULL;
   thread_instr_class_stages_array= NULL;
   thread_instr_class_statements_array= NULL;
@@ -273,56 +287,56 @@ int init_instruments(const PFS_global_param *param)
 
   if (mutex_max > 0)
   {
-    mutex_array= PFS_MALLOC_ARRAY(mutex_max, PFS_mutex, MYF(MY_ZEROFILL));
+    mutex_array= PFS_MALLOC_ARRAY(mutex_max, sizeof(PFS_mutex), PFS_mutex, MYF(MY_ZEROFILL));
     if (unlikely(mutex_array == NULL))
       return 1;
   }
 
   if (rwlock_max > 0)
   {
-    rwlock_array= PFS_MALLOC_ARRAY(rwlock_max, PFS_rwlock, MYF(MY_ZEROFILL));
+    rwlock_array= PFS_MALLOC_ARRAY(rwlock_max, sizeof(PFS_rwlock), PFS_rwlock, MYF(MY_ZEROFILL));
     if (unlikely(rwlock_array == NULL))
       return 1;
   }
 
   if (cond_max > 0)
   {
-    cond_array= PFS_MALLOC_ARRAY(cond_max, PFS_cond, MYF(MY_ZEROFILL));
+    cond_array= PFS_MALLOC_ARRAY(cond_max, sizeof(PFS_cond), PFS_cond, MYF(MY_ZEROFILL));
     if (unlikely(cond_array == NULL))
       return 1;
   }
 
   if (file_max > 0)
   {
-    file_array= PFS_MALLOC_ARRAY(file_max, PFS_file, MYF(MY_ZEROFILL));
+    file_array= PFS_MALLOC_ARRAY(file_max, sizeof(PFS_file), PFS_file, MYF(MY_ZEROFILL));
     if (unlikely(file_array == NULL))
       return 1;
   }
 
   if (file_handle_max > 0)
   {
-    file_handle_array= PFS_MALLOC_ARRAY(file_handle_max, PFS_file*, MYF(MY_ZEROFILL));
+    file_handle_array= PFS_MALLOC_ARRAY(file_handle_max, sizeof(PFS_file*), PFS_file*, MYF(MY_ZEROFILL));
     if (unlikely(file_handle_array == NULL))
       return 1;
   }
 
   if (table_max > 0)
   {
-    table_array= PFS_MALLOC_ARRAY(table_max, PFS_table, MYF(MY_ZEROFILL));
+    table_array= PFS_MALLOC_ARRAY(table_max, sizeof(PFS_table), PFS_table, MYF(MY_ZEROFILL));
     if (unlikely(table_array == NULL))
       return 1;
   }
 
   if (socket_max > 0)
   {
-    socket_array= PFS_MALLOC_ARRAY(socket_max, PFS_socket, MYF(MY_ZEROFILL));
+    socket_array= PFS_MALLOC_ARRAY(socket_max, sizeof(PFS_socket), PFS_socket, MYF(MY_ZEROFILL));
     if (unlikely(socket_array == NULL))
       return 1;
   }
 
   if (thread_max > 0)
   {
-    thread_array= PFS_MALLOC_ARRAY(thread_max, PFS_thread, MYF(MY_ZEROFILL));
+    thread_array= PFS_MALLOC_ARRAY(thread_max, sizeof(PFS_thread), PFS_thread, MYF(MY_ZEROFILL));
     if (unlikely(thread_array == NULL))
       return 1;
   }
@@ -330,7 +344,7 @@ int init_instruments(const PFS_global_param *param)
   if (thread_waits_history_sizing > 0)
   {
     thread_waits_history_array=
-      PFS_MALLOC_ARRAY(thread_waits_history_sizing, PFS_events_waits,
+      PFS_MALLOC_ARRAY(thread_waits_history_sizing, sizeof(PFS_events_waits), PFS_events_waits,
                        MYF(MY_ZEROFILL));
     if (unlikely(thread_waits_history_array == NULL))
       return 1;
@@ -340,7 +354,7 @@ int init_instruments(const PFS_global_param *param)
   {
     thread_instr_class_waits_array=
       PFS_MALLOC_ARRAY(thread_instr_class_waits_sizing,
-                       PFS_single_stat, MYF(MY_ZEROFILL));
+                       sizeof(PFS_single_stat), PFS_single_stat, MYF(MY_ZEROFILL));
     if (unlikely(thread_instr_class_waits_array == NULL))
       return 1;
 
@@ -351,7 +365,7 @@ int init_instruments(const PFS_global_param *param)
   if (thread_stages_history_sizing > 0)
   {
     thread_stages_history_array=
-      PFS_MALLOC_ARRAY(thread_stages_history_sizing, PFS_events_stages,
+      PFS_MALLOC_ARRAY(thread_stages_history_sizing, sizeof(PFS_events_stages), PFS_events_stages,
                        MYF(MY_ZEROFILL));
     if (unlikely(thread_stages_history_array == NULL))
       return 1;
@@ -361,7 +375,7 @@ int init_instruments(const PFS_global_param *param)
   {
     thread_instr_class_stages_array=
       PFS_MALLOC_ARRAY(thread_instr_class_stages_sizing,
-                       PFS_stage_stat, MYF(MY_ZEROFILL));
+                       sizeof(PFS_stage_stat), PFS_stage_stat, MYF(MY_ZEROFILL));
     if (unlikely(thread_instr_class_stages_array == NULL))
       return 1;
 
@@ -372,8 +386,8 @@ int init_instruments(const PFS_global_param *param)
   if (thread_statements_history_sizing > 0)
   {
     thread_statements_history_array=
-      PFS_MALLOC_ARRAY(thread_statements_history_sizing, PFS_events_statements,
-                       MYF(MY_ZEROFILL));
+      PFS_MALLOC_ARRAY(thread_statements_history_sizing, sizeof(PFS_events_statements),
+                       PFS_events_statements, MYF(MY_ZEROFILL));
     if (unlikely(thread_statements_history_array == NULL))
       return 1;
   }
@@ -381,8 +395,8 @@ int init_instruments(const PFS_global_param *param)
   if (thread_statements_stack_sizing > 0)
   {
     thread_statements_stack_array=
-      PFS_MALLOC_ARRAY(thread_statements_stack_sizing, PFS_events_statements,
-                       MYF(MY_ZEROFILL));
+      PFS_MALLOC_ARRAY(thread_statements_stack_sizing, sizeof(PFS_events_statements),
+                       PFS_events_statements, MYF(MY_ZEROFILL));
     if (unlikely(thread_statements_stack_array == NULL))
       return 1;
   }
@@ -391,7 +405,7 @@ int init_instruments(const PFS_global_param *param)
   {
     thread_instr_class_statements_array=
       PFS_MALLOC_ARRAY(thread_instr_class_statements_sizing,
-                       PFS_statement_stat, MYF(MY_ZEROFILL));
+                       sizeof(PFS_statement_stat), PFS_statement_stat, MYF(MY_ZEROFILL));
     if (unlikely(thread_instr_class_statements_array == NULL))
       return 1;
 
@@ -407,6 +421,22 @@ int init_instruments(const PFS_global_param *param)
       return 1;
   }
 
+  if (current_digest_tokens_sizing > 0)
+  {
+    current_stmts_digest_token_array=
+      (unsigned char *)pfs_malloc(current_digest_tokens_sizing, MYF(MY_ZEROFILL));
+    if (unlikely(current_stmts_digest_token_array == NULL))
+      return 1;
+  }
+
+  if (history_digest_tokens_sizing > 0)
+  {
+    history_stmts_digest_token_array=
+      (unsigned char *)pfs_malloc(history_digest_tokens_sizing, MYF(MY_ZEROFILL));
+    if (unlikely(history_stmts_digest_token_array == NULL))
+      return 1;
+  }
+
   for (index= 0; index < thread_max; index++)
   {
     thread_array[index].m_waits_history=
@@ -427,11 +457,27 @@ int init_instruments(const PFS_global_param *param)
       &thread_session_connect_attrs_array[index * session_connect_attrs_size_per_thread];
   }
 
+  for (index= 0; index < thread_statements_stack_sizing; index++)
+  {
+    pfs_stmt= & thread_statements_stack_array[index];
+
+    pfs_tokens= & current_stmts_digest_token_array[index * pfs_max_digest_length];
+    pfs_stmt->m_digest_storage.reset(pfs_tokens, pfs_max_digest_length);
+  }
+
+  for (index= 0; index < thread_statements_history_sizing; index++)
+  {
+    pfs_stmt= & thread_statements_history_array[index];
+
+    pfs_tokens= & history_stmts_digest_token_array[index * pfs_max_digest_length];
+    pfs_stmt->m_digest_storage.reset(pfs_tokens, pfs_max_digest_length);
+  }
+
   if (stage_class_max > 0)
   {
     global_instr_class_stages_array=
       PFS_MALLOC_ARRAY(stage_class_max,
-                       PFS_stage_stat, MYF(MY_ZEROFILL));
+                       sizeof(PFS_stage_stat), PFS_stage_stat, MYF(MY_ZEROFILL));
     if (unlikely(global_instr_class_stages_array == NULL))
       return 1;
 
@@ -443,7 +489,7 @@ int init_instruments(const PFS_global_param *param)
   {
     global_instr_class_statements_array=
       PFS_MALLOC_ARRAY(statement_class_max,
-                       PFS_statement_stat, MYF(MY_ZEROFILL));
+                       sizeof(PFS_statement_stat), PFS_statement_stat, MYF(MY_ZEROFILL));
     if (unlikely(global_instr_class_statements_array == NULL))
       return 1;
 
@@ -497,6 +543,10 @@ void cleanup_instruments(void)
   global_instr_class_statements_array= NULL;
   pfs_free(thread_session_connect_attrs_array);
   thread_session_connect_attrs_array=NULL;
+  pfs_free(current_stmts_digest_token_array);
+  current_stmts_digest_token_array= NULL;
+  pfs_free(history_stmts_digest_token_array);
+  history_stmts_digest_token_array= NULL;
 }
 
 C_MODE_START
index bd2fe0e4afd4de997be94963f0991f871afacdfe..b25f5769b697a9fee16c91c6de0929ce13005b35 100644 (file)
@@ -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
@@ -298,6 +298,8 @@ struct PFS_ALIGNED PFS_socket : public PFS_instr
 
 /** Max size of the statements stack. */
 extern uint statement_stack_max;
+/** Max size of the digests token array. */
+extern size_t pfs_max_digest_length;
 
 /**
   @def PFS_MAX_ALLOC_RETRY
index 4d73396fc9b101089a3688659a4454c697220c6c..61d9b4d14840f01d1f2331e871cbb194eaba868a 100644 (file)
@@ -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
@@ -255,24 +255,24 @@ int init_sync_class(uint mutex_class_sizing,
 
   if (mutex_class_max > 0)
   {
-    mutex_class_array= PFS_MALLOC_ARRAY(mutex_class_max, PFS_mutex_class,
-                                        MYF(MY_ZEROFILL));
+    mutex_class_array= PFS_MALLOC_ARRAY(mutex_class_max, sizeof(PFS_mutex_class),
+                                        PFS_mutex_class, MYF(MY_ZEROFILL));
     if (unlikely(mutex_class_array == NULL))
       return 1;
   }
 
   if (rwlock_class_max > 0)
   {
-    rwlock_class_array= PFS_MALLOC_ARRAY(rwlock_class_max, PFS_rwlock_class,
-                                         MYF(MY_ZEROFILL));
+    rwlock_class_array= PFS_MALLOC_ARRAY(rwlock_class_max, sizeof(PFS_rwlock_class),
+                                         PFS_rwlock_class, MYF(MY_ZEROFILL));
     if (unlikely(rwlock_class_array == NULL))
       return 1;
   }
 
   if (cond_class_max > 0)
   {
-    cond_class_array= PFS_MALLOC_ARRAY(cond_class_max, PFS_cond_class,
-                                       MYF(MY_ZEROFILL));
+    cond_class_array= PFS_MALLOC_ARRAY(cond_class_max, sizeof(PFS_cond_class),
+                                       PFS_cond_class, MYF(MY_ZEROFILL));
     if (unlikely(cond_class_array == NULL))
       return 1;
   }
@@ -308,8 +308,8 @@ int init_thread_class(uint thread_class_sizing)
 
   if (thread_class_max > 0)
   {
-    thread_class_array= PFS_MALLOC_ARRAY(thread_class_max, PFS_thread_class,
-                                         MYF(MY_ZEROFILL));
+    thread_class_array= PFS_MALLOC_ARRAY(thread_class_max, sizeof(PFS_thread_class),
+                                         PFS_thread_class, MYF(MY_ZEROFILL));
     if (unlikely(thread_class_array == NULL))
       result= 1;
   }
@@ -341,8 +341,8 @@ int init_table_share(uint table_share_sizing)
 
   if (table_share_max > 0)
   {
-    table_share_array= PFS_MALLOC_ARRAY(table_share_max, PFS_table_share,
-                                        MYF(MY_ZEROFILL));
+    table_share_array= PFS_MALLOC_ARRAY(table_share_max, sizeof(PFS_table_share),
+                                        PFS_table_share, MYF(MY_ZEROFILL));
     if (unlikely(table_share_array == NULL))
       result= 1;
   }
@@ -481,8 +481,8 @@ int init_file_class(uint file_class_sizing)
 
   if (file_class_max > 0)
   {
-    file_class_array= PFS_MALLOC_ARRAY(file_class_max, PFS_file_class,
-                                       MYF(MY_ZEROFILL));
+    file_class_array= PFS_MALLOC_ARRAY(file_class_max, sizeof(PFS_file_class),
+                                       PFS_file_class, MYF(MY_ZEROFILL));
     if (unlikely(file_class_array == NULL))
       return 1;
   }
@@ -515,8 +515,8 @@ int init_stage_class(uint stage_class_sizing)
 
   if (stage_class_max > 0)
   {
-    stage_class_array= PFS_MALLOC_ARRAY(stage_class_max, PFS_stage_class,
-                                        MYF(MY_ZEROFILL));
+    stage_class_array= PFS_MALLOC_ARRAY(stage_class_max, sizeof(PFS_stage_class),
+                                        PFS_stage_class, MYF(MY_ZEROFILL));
     if (unlikely(stage_class_array == NULL))
       return 1;
   }
@@ -549,8 +549,8 @@ int init_statement_class(uint statement_class_sizing)
 
   if (statement_class_max > 0)
   {
-    statement_class_array= PFS_MALLOC_ARRAY(statement_class_max, PFS_statement_class,
-                                            MYF(MY_ZEROFILL));
+    statement_class_array= PFS_MALLOC_ARRAY(statement_class_max, sizeof(PFS_statement_class),
+                                            PFS_statement_class, MYF(MY_ZEROFILL));
     if (unlikely(statement_class_array == NULL))
       return 1;
   }
@@ -583,8 +583,8 @@ int init_socket_class(uint socket_class_sizing)
 
   if (socket_class_max > 0)
   {
-    socket_class_array= PFS_MALLOC_ARRAY(socket_class_max, PFS_socket_class,
-                                         MYF(MY_ZEROFILL));
+    socket_class_array= PFS_MALLOC_ARRAY(socket_class_max, sizeof(PFS_socket_class),
+                                         PFS_socket_class, MYF(MY_ZEROFILL));
     if (unlikely(socket_class_array == NULL))
       return 1;
   }
index 093f772915a6d817056f82f085c3f60dc80326d5..cc5e52f379d4ae35e9ac4343be41cfe629d50aae 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2012, 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
index aa5dd6862fac95f98b49ba10551c051d1215d9b9..c816628a5f0d47334dfdc223c353e446a9cb5fd6 100644 (file)
@@ -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
@@ -197,6 +197,8 @@ struct PFS_global_param
   /** Maximum number of session attribute strings per thread */
   long m_session_connect_attrs_sizing;
 
+  long m_max_digest_length;
+
   /** Sizing hints, for auto tuning. */
   PFS_sizing_hints m_hints;
 };
index 943654ce1c9d9a66de6ec2b3dbd5ca6e5dcea70e..c18ab72e453474bbf2ae2051a09d4dac60adbc71 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, 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
@@ -60,8 +60,8 @@ int init_setup_actor(const PFS_global_param *param)
 
   if (setup_actor_max > 0)
   {
-    setup_actor_array= PFS_MALLOC_ARRAY(setup_actor_max, PFS_setup_actor,
-                                         MYF(MY_ZEROFILL));
+    setup_actor_array= PFS_MALLOC_ARRAY(setup_actor_max, sizeof(PFS_setup_actor),
+                                        PFS_setup_actor, MYF(MY_ZEROFILL));
     if (unlikely(setup_actor_array == NULL))
       return 1;
   }
index b84456d874c3ae52ef95e1a74f610fc1ac3ad1d3..3ad1186a8a1b9fef15cf22da8bc760c973e3c388 100644 (file)
@@ -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
@@ -55,8 +55,8 @@ int init_setup_object(const PFS_global_param *param)
 
   if (setup_object_max > 0)
   {
-    setup_object_array= PFS_MALLOC_ARRAY(setup_object_max, PFS_setup_object,
-                                         MYF(MY_ZEROFILL));
+    setup_object_array= PFS_MALLOC_ARRAY(setup_object_max, sizeof(PFS_setup_object),
+                                         PFS_setup_object, MYF(MY_ZEROFILL));
     if (unlikely(setup_object_array == NULL))
       return 1;
   }
index 8c3553db2b2cafd1837d9ea66b033146b8738d7e..8348f165e5cf72922282b687dfdd10700683f348 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2012, 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
@@ -124,6 +124,42 @@ void init_timers(void)
     Pick best replacements.
   */
 
+  /*
+    For WAIT, the cycle timer is used by default. However, it is not available
+    on all architectures. Fall back to the nanosecond timer in this case. It is
+    unlikely that neither cycle nor nanosecond are available, but we continue
+    probing less resolution timers anyway for consistency with other events.
+  */
+
+  if (cycle_to_pico != 0)
+  {
+    /* Normal case. */
+    wait_timer= TIMER_NAME_CYCLE;
+  }
+  else if (nanosec_to_pico != 0)
+  {
+    /* Robustness, no known cases. */
+    wait_timer= TIMER_NAME_NANOSEC;
+  }
+  else if (microsec_to_pico != 0)
+  {
+    /* Robustness, no known cases. */
+    wait_timer= TIMER_NAME_MICROSEC;
+  }
+  else if (millisec_to_pico != 0)
+  {
+    /* Robustness, no known cases. */
+    wait_timer= TIMER_NAME_MILLISEC;
+  }
+  else
+  {
+    /*
+       Will never be reached on any architecture, but must provide a default if
+       no other timers are available.
+    */
+    wait_timer= TIMER_NAME_TICK;
+  }
+
   /*
     For STAGE and STATEMENT, a timer with a fixed frequency is better.
     The prefered timer is nanosecond, or lower resolutions.
@@ -174,7 +210,7 @@ void init_timers(void)
   else if (millisec_to_pico != 0)
   {
     /* Robustness, no known cases. */
-    idle_timer= TIMER_NAME_MILLISEC;
+    wait_timer= TIMER_NAME_MILLISEC;
   }
   else if (tick_to_pico != 0)
   {
index 9f53702dd863305d303edfd38fb6fd15cc9965fe..671afab0d16e1914b9e4126c9fbdcf0e9a4d6244 100644 (file)
@@ -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
@@ -66,7 +66,7 @@ int init_user(const PFS_global_param *param)
 
   if (user_max > 0)
   {
-    user_array= PFS_MALLOC_ARRAY(user_max, PFS_user,
+    user_array= PFS_MALLOC_ARRAY(user_max, sizeof(PFS_user), PFS_user,
                                  MYF(MY_ZEROFILL));
     if (unlikely(user_array == NULL))
       return 1;
@@ -346,9 +346,7 @@ void purge_user(PFS_thread *thread, PFS_user *user)
                     user->m_key.m_hash_key, user->m_key.m_key_length));
   if (entry && (entry != MY_ERRPTR))
   {
-    PFS_user *pfs;
-    pfs= *entry;
-    DBUG_ASSERT(pfs == user);
+    DBUG_ASSERT(*entry == user);
     if (user->get_refcount() == 0)
     {
       lf_hash_delete(&user_hash, pins,
index 854e1be15cdc83ee449b9cc4cc4d21a3fb2168cc..ad0c7eb6d91ce12edc8d3a9816eb32479e23018e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, 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
@@ -152,6 +152,7 @@ void table_events_stages_common::make_row(PFS_events_stages *stage)
 {
   const char *base;
   const char *safe_source_file;
+  ulonglong timer_end;
 
   m_row_exists= false;
 
@@ -166,7 +167,16 @@ void table_events_stages_common::make_row(PFS_events_stages *stage)
   m_row.m_nesting_event_id= stage->m_nesting_event_id;
   m_row.m_nesting_event_type= stage->m_nesting_event_type;
 
-  m_normalizer->to_pico(stage->m_timer_start, stage->m_timer_end,
+  if (m_row.m_end_event_id == 0)
+  {
+    timer_end= get_timer_raw_value(stage_timer);
+  }
+  else
+  {
+    timer_end= stage->m_timer_end;
+  }
+
+  m_normalizer->to_pico(stage->m_timer_start, timer_end,
                       & m_row.m_timer_start, & m_row.m_timer_end, & m_row.m_timer_wait);
 
   m_row.m_name= klass->m_name;
index 6d95cdd77bbb854ec21712a0d3378c7b24767765..6931584895fb034d4587e145649884d00303614d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, 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
@@ -302,10 +302,11 @@ table_events_statements_common::table_events_statements_common
   @param statement                      the statement the cursor is reading
 */
 void table_events_statements_common::make_row_part_1(PFS_events_statements *statement,
-                                                     PSI_digest_storage *digest)
+                                                     sql_digest_storage *digest)
 {
   const char *base;
   const char *safe_source_file;
+  ulonglong timer_end;
 
   m_row_exists= false;
 
@@ -320,16 +321,48 @@ void table_events_statements_common::make_row_part_1(PFS_events_statements *stat
   m_row.m_nesting_event_id= statement->m_nesting_event_id;
   m_row.m_nesting_event_type= statement->m_nesting_event_type;
 
-  m_normalizer->to_pico(statement->m_timer_start, statement->m_timer_end,
+  if (m_row.m_end_event_id == 0)
+  {
+    timer_end= get_timer_raw_value(statement_timer);
+  }
+  else
+  {
+    timer_end= statement->m_timer_end;
+  }
+
+  m_normalizer->to_pico(statement->m_timer_start, timer_end,
                       & m_row.m_timer_start, & m_row.m_timer_end, & m_row.m_timer_wait);
   m_row.m_lock_time= statement->m_lock_time * MICROSEC_TO_PICOSEC;
 
   m_row.m_name= klass->m_name;
   m_row.m_name_length= klass->m_name_length;
 
-  m_row.m_sqltext_length= statement->m_sqltext_length;
-  if (m_row.m_sqltext_length > 0)
-    memcpy(m_row.m_sqltext, statement->m_sqltext, m_row.m_sqltext_length);
+  CHARSET_INFO *cs= get_charset(statement->m_sqltext_cs_number, MYF(0));
+  size_t valid_length= statement->m_sqltext_length;
+
+  if (cs->mbmaxlen > 1)
+  {
+    int well_formed_error;
+    valid_length= cs->cset->well_formed_len(cs, statement->m_sqltext, statement->m_sqltext + valid_length,
+                                            valid_length, &well_formed_error);
+  }
+
+  m_row.m_sqltext.set_charset(cs);
+  m_row.m_sqltext.length(0);
+  m_row.m_sqltext.append(statement->m_sqltext, (uint32)valid_length, cs);
+
+  /* Indicate that sqltext is truncated or not well-formed. */
+  if (statement->m_sqltext_truncated || valid_length < statement->m_sqltext_length)
+  {
+    size_t chars= m_row.m_sqltext.numchars();
+    if (chars > 3)
+    {
+      chars-= 3;
+      size_t bytes_offset= m_row.m_sqltext.charpos(chars, 0);
+      m_row.m_sqltext.length(bytes_offset);
+      m_row.m_sqltext.append("...", 3);
+    }
+  }
 
   m_row.m_current_schema_name_length= statement->m_current_schema_name_length;
   if (m_row.m_current_schema_name_length > 0)
@@ -340,8 +373,8 @@ void table_events_statements_common::make_row_part_1(PFS_events_statements *stat
     return;
 
   base= base_name(safe_source_file);
-  m_row.m_source_length= my_snprintf(m_row.m_source, sizeof(m_row.m_source),
-                                     "%s:%d", base, statement->m_source_line);
+  m_row.m_source_length= (uint)my_snprintf(m_row.m_source, sizeof(m_row.m_source),
+                                           "%s:%d", base, statement->m_source_line);
   if (m_row.m_source_length > sizeof(m_row.m_source))
     m_row.m_source_length= sizeof(m_row.m_source);
 
@@ -367,46 +400,40 @@ void table_events_statements_common::make_row_part_1(PFS_events_statements *stat
   m_row.m_sort_scan= statement->m_sort_scan;
   m_row.m_no_index_used= statement->m_no_index_used;
   m_row.m_no_good_index_used= statement->m_no_good_index_used;
-  /* 
+  /*
     Making a copy of digest storage.
   */
-  digest_copy(digest, & statement->m_digest_storage);
+  digest->copy(& statement->m_digest_storage);
 
   m_row_exists= true;
   return;
 }
 
 
-void table_events_statements_common::make_row_part_2(PSI_digest_storage *digest)
+void table_events_statements_common::make_row_part_2(const sql_digest_storage *digest)
 {
   /*
     Filling up statement digest information.
   */
-  int safe_byte_count= digest->m_byte_count;
+  size_t safe_byte_count= digest->m_byte_count;
   if (safe_byte_count > 0 &&
-      safe_byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE)
+      safe_byte_count <= pfs_max_digest_length)
   {
-    PFS_digest_key md5;
-    compute_md5_hash((char *) md5.m_md5,
-                     (char *) digest->m_token_array,
-                     safe_byte_count);
-
     /* Generate the DIGEST string from the MD5 digest  */
-    MD5_HASH_TO_STRING(md5.m_md5,
+    MD5_HASH_TO_STRING(digest->m_md5,
                        m_row.m_digest.m_digest);
     m_row.m_digest.m_digest_length= MD5_HASH_TO_STRING_LENGTH;
 
     /* Generate the DIGEST_TEXT string from the token array */
-    get_digest_text(m_row.m_digest.m_digest_text, digest);
-    m_row.m_digest.m_digest_text_length= strlen(m_row.m_digest.m_digest_text);
+    compute_digest_text(digest, &m_row.m_digest.m_digest_text);
 
-    if (m_row.m_digest.m_digest_text_length == 0)
+    if (m_row.m_digest.m_digest_text.length() == 0)
       m_row.m_digest.m_digest_length= 0;
   }
   else
   {
     m_row.m_digest.m_digest_length= 0;
-    m_row.m_digest.m_digest_text_length= 0;
+    m_row.m_digest.m_digest_text.length(0);
   }
 
   return;
@@ -478,8 +505,8 @@ int table_events_statements_common::read_row_values(TABLE *table,
           f->set_null();
         break;
       case 9: /* SQL_TEXT */
-        if (m_row.m_sqltext_length)
-          set_field_longtext_utf8(f, m_row.m_sqltext, m_row.m_sqltext_length);
+        if (m_row.m_sqltext.length())
+          set_field_longtext_utf8(f, m_row.m_sqltext.ptr(), m_row.m_sqltext.length());
         else
           f->set_null();
         break;
@@ -491,9 +518,9 @@ int table_events_statements_common::read_row_values(TABLE *table,
           f->set_null();
         break;
       case 11: /* DIGEST_TEXT */
-        if (m_row.m_digest.m_digest_text_length > 0)
-           set_field_longtext_utf8(f, m_row.m_digest.m_digest_text,
-                                   m_row.m_digest.m_digest_text_length);
+        if (m_row.m_digest.m_digest_text.length() > 0)
+           set_field_longtext_utf8(f, m_row.m_digest.m_digest_text.ptr(),
+                                   m_row.m_digest.m_digest_text.length());
         else
           f->set_null();
         break;
@@ -525,7 +552,7 @@ int table_events_statements_common::read_row_values(TABLE *table,
           f->set_null();
         break;
       case 19: /* MESSAGE_TEXT */
-        len= strlen(m_row.m_message_text);
+        len= (uint)strlen(m_row.m_message_text);
         if (len)
           set_field_varchar_utf8(f, m_row.m_message_text, len);
         else
@@ -710,11 +737,11 @@ int table_events_statements_current::rnd_pos(const void *pos)
 void table_events_statements_current::make_row(PFS_thread *pfs_thread,
                                                PFS_events_statements *statement)
 {
-  PSI_digest_storage digest;
+  sql_digest_storage digest;
   pfs_lock lock;
   pfs_lock stmt_lock;
 
-  digest_reset(&digest);
+  digest.reset(m_token_array, MAX_DIGEST_STORAGE_SIZE);
   /* Protect this reader against thread termination. */
   pfs_thread->m_lock.begin_optimistic_lock(&lock);
   /* Protect this reader against writing on statement information. */
@@ -838,10 +865,10 @@ int table_events_statements_history::rnd_pos(const void *pos)
 void table_events_statements_history::make_row(PFS_thread *pfs_thread,
                                                PFS_events_statements *statement)
 {
-  PSI_digest_storage digest;
+  sql_digest_storage digest;
   pfs_lock lock;
 
-  digest_reset(&digest);
+  digest.reset(m_token_array, MAX_DIGEST_STORAGE_SIZE);
   /* Protect this reader against thread termination. */
   pfs_thread->m_lock.begin_optimistic_lock(&lock);
 
@@ -887,7 +914,7 @@ int table_events_statements_history_long::rnd_init(bool scan)
 int table_events_statements_history_long::rnd_next(void)
 {
   PFS_events_statements *statement;
-  uint limit;
+  size_t limit;
 
   if (events_statements_history_long_size == 0)
     return HA_ERR_END_OF_FILE;
@@ -916,7 +943,7 @@ int table_events_statements_history_long::rnd_next(void)
 int table_events_statements_history_long::rnd_pos(const void *pos)
 {
   PFS_events_statements *statement;
-  uint limit;
+  size_t limit;
 
   if (events_statements_history_long_size == 0)
     return HA_ERR_RECORD_DELETED;
@@ -942,9 +969,9 @@ int table_events_statements_history_long::rnd_pos(const void *pos)
 
 void table_events_statements_history_long::make_row(PFS_events_statements *statement)
 {
-  PSI_digest_storage digest;
+  sql_digest_storage digest;
 
-  digest_reset(&digest);
+  digest.reset(m_token_array, MAX_DIGEST_STORAGE_SIZE);
   table_events_statements_common::make_row_part_1(statement, &digest);
 
   table_events_statements_common::make_row_part_2(&digest);
index e33c6b505bde2b8a862a987d72c6470bdda4e41c..6c8899e14c3d9669adfeb3be7d6340aa303097be 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, 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
@@ -63,11 +63,9 @@ struct row_events_statements
   /** Length in bytes of @c m_source. */
   uint m_source_length;
   /** Column SQL_TEXT. */
-  char m_sqltext[COL_INFO_SIZE];
+  String m_sqltext;
   /** Column DIGEST and DIGEST_TEXT. */
   PFS_digest_row m_digest;
-  /** Length in bytes of @c m_info. */
-  uint m_sqltext_length;
   /** Column CURRENT_SCHEMA. */
   char m_current_schema_name[NAME_LEN];
   /** Length in bytes of @c m_current_schema_name. */
@@ -175,14 +173,15 @@ protected:
   {}
 
   void make_row_part_1(PFS_events_statements *statement,
-                       PSI_digest_storage *digest);
+                       sql_digest_storage *digest);
 
-  void make_row_part_2(PSI_digest_storage *digest);
+  void make_row_part_2(const sql_digest_storage *digest);
 
   /** Current row. */
   row_events_statements m_row;
   /** True if the current row exists. */
   bool m_row_exists;
+  unsigned char m_token_array[MAX_DIGEST_STORAGE_SIZE];
 };
 
 /** Table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_CURRENT. */
index 82d8ba2a0cc8c64558242fe0159ce3cf81b413fc..0966c9ee9aede8034da2b0fc764c11dfbd24fa63 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, 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
@@ -363,6 +363,8 @@ void table_events_waits_common::make_row(bool thread_own_wait,
   PFS_instr_class *safe_class;
   const char *base;
   const char *safe_source_file;
+  enum_timer_name timer_name= wait_timer;
+  ulonglong timer_end;
 
   m_row_exists= false;
   safe_thread= sanitize_thread(pfs_thread);
@@ -401,6 +403,7 @@ void table_events_waits_common::make_row(bool thread_own_wait,
   case WAIT_CLASS_IDLE:
     clear_object_columns();
     safe_class= sanitize_idle_class(wait->m_class);
+    timer_name= idle_timer;
     break;
   case WAIT_CLASS_MUTEX:
     clear_object_columns();
@@ -444,7 +447,17 @@ void table_events_waits_common::make_row(bool thread_own_wait,
   m_row.m_nesting_event_type= wait->m_nesting_event_type;
 
   get_normalizer(safe_class);
-  m_normalizer->to_pico(wait->m_timer_start, wait->m_timer_end,
+
+  if (m_row.m_end_event_id == 0)
+  {
+    timer_end= get_timer_raw_value(timer_name);
+  }
+  else
+  {
+    timer_end= wait->m_timer_end;
+  }
+
+  m_normalizer->to_pico(wait->m_timer_start, timer_end,
                       & m_row.m_timer_start, & m_row.m_timer_end, & m_row.m_timer_wait);
 
   m_row.m_name= safe_class->m_name;
index 9c10a3ecc887a9f0485b38df8e66f6f8befe892f..d064333dc7e62e7e9bb835085774e3e46a78d4dd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, 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
@@ -25,6 +25,7 @@
 #include "pfs_host.h"
 #include "pfs_user.h"
 #include "pfs_account.h"
+#include "pfs_instr.h"
 
 int PFS_host_row::make_row(PFS_host *pfs)
 {
@@ -109,8 +110,8 @@ int PFS_digest_row::make_row(PFS_statements_digest_stat* pfs)
   if (m_schema_name_length > 0)
     memcpy(m_schema_name, pfs->m_digest_key.m_schema_name, m_schema_name_length);
 
-  int safe_byte_count= pfs->m_digest_storage.m_byte_count;
-  if (safe_byte_count > PSI_MAX_DIGEST_STORAGE_SIZE)
+  size_t safe_byte_count= pfs->m_digest_storage.m_byte_count;
+  if (safe_byte_count > pfs_max_digest_length)
     safe_byte_count= 0;
 
   /*
@@ -124,23 +125,22 @@ int PFS_digest_row::make_row(PFS_statements_digest_stat* pfs)
       Calculate digest from MD5 HASH collected to be shown as
       DIGEST in this row.
     */
-    MD5_HASH_TO_STRING(pfs->m_digest_key.m_md5, m_digest);
+    MD5_HASH_TO_STRING(pfs->m_digest_storage.m_md5, m_digest);
     m_digest_length= MD5_HASH_TO_STRING_LENGTH;
 
     /*
       Calculate digest_text information from the token array collected
       to be shown as DIGEST_TEXT column.
     */
-    get_digest_text(m_digest_text, &pfs->m_digest_storage);
-    m_digest_text_length= strlen(m_digest_text);
+    compute_digest_text(&pfs->m_digest_storage, &m_digest_text);
 
-    if (m_digest_text_length == 0)
+    if (m_digest_text.length() == 0)
       m_digest_length= 0;
   }
   else
   {
     m_digest_length= 0;
-    m_digest_text_length= 0;
+    m_digest_text.length(0);
   }
 
   return 0;
@@ -165,9 +165,9 @@ void PFS_digest_row::set_field(uint index, Field *f)
         f->set_null();
       break;
     case 2: /* DIGEST_TEXT */
-      if (m_digest_text_length > 0)
-        PFS_engine_table::set_field_longtext_utf8(f, m_digest_text,
-                                                  m_digest_text_length);
+      if (m_digest_text.length() > 0)
+        PFS_engine_table::set_field_longtext_utf8(f, m_digest_text.ptr(),
+                                                  m_digest_text.length());
       else
         f->set_null();
       break;
index 76bb289c73b9feaadedb7e4cf9d0d319eb596fce..b1377eb9748f535fed551f025ca86dcd5ac473d3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2014, 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
@@ -136,9 +136,7 @@ struct PFS_digest_row
   /** Length in bytes of @c m_digest. */
   uint m_digest_length;
   /** Column DIGEST_TEXT. */
-  char m_digest_text[COL_DIGEST_TEXT_SIZE];
-  /** Length in bytes of @c m_digest_text. */
-  uint m_digest_text_length;
+  String m_digest_text;
 
   /** Build a row from a memory buffer. */
   int make_row(PFS_statements_digest_stat*);
index bea9b7c94dbdac964a937ca7317a3d42d792c92f..70e89c0b195409e251d2fe2e333fd0d3c50b7118 100644 (file)
@@ -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
@@ -251,7 +251,8 @@ void table_session_connect::make_row(PFS_thread *pfs, uint ordinal)
                     &m_row.m_attr_value_length))
   {
     /* we don't expect internal threads to have connection attributes */
-    DBUG_ASSERT(pfs->m_processlist_id != 0);
+    if (pfs->m_processlist_id == 0)
+       return;
 
     m_row.m_ordinal_position= ordinal;
     m_row.m_process_id= pfs->m_processlist_id;
index b237d6b4ee03321170425df20e7007f01c4e1f3f..22e4aad3f363c363b2f3ed1c657f736f08f7244c 100644 (file)
@@ -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
@@ -23,9 +23,13 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
 
 ADD_DEFINITIONS(-DMYSQL_SERVER ${SSL_DEFINES})
 
+ADD_CONVENIENCE_LIBRARY(pfs_server_stubs pfs_server_stubs.cc)
+
+ADD_DEPENDENCIES(pfs_server_stubs GenError)
+
 MACRO (PFS_ADD_TEST name)
   ADD_EXECUTABLE(${name}-t ${name}-t.cc)
-  TARGET_LINK_LIBRARIES(${name}-t mytap perfschema mysys)
+  TARGET_LINK_LIBRARIES(${name}-t mytap perfschema mysys pfs_server_stubs)
   ADD_TEST(${name} ${name}-t)
 ENDMACRO()
 
@@ -38,6 +42,7 @@ SET(tests
  pfs_host-oom
  pfs_user-oom
  pfs
+ pfs_misc
 )
 FOREACH(testname ${tests})
   PFS_ADD_TEST(${testname})
index 6e63a18f174cda988e598ad786317694015be6d2..8b24cee9eaf6167082ac87b95662e46f38ccf4f7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, 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
@@ -26,7 +26,6 @@
 
 #include "stub_print_error.h"
 #include "stub_pfs_defaults.h"
-#include "stub_server_misc.h"
 
 /* test helpers, to simulate the setup */
 
@@ -112,6 +111,7 @@ void test_bootstrap()
   param.m_events_statements_history_long_sizing= 0;
   param.m_digest_sizing= 0;
   param.m_session_connect_attrs_sizing= 0;
+  param.m_max_digest_length= 0;
 
   boot= initialize_performance_schema(& param);
   ok(boot != NULL, "boot");
@@ -170,6 +170,7 @@ PSI * load_perfschema()
   param.m_events_statements_history_long_sizing= 0;
   param.m_digest_sizing= 0;
   param.m_session_connect_attrs_sizing= 0;
+  param.m_max_digest_length= 0;
 
   /* test_bootstrap() covered this, assuming it just works */
   boot= initialize_performance_schema(& param);
@@ -1514,6 +1515,7 @@ void test_event_name_index()
   param.m_events_statements_history_long_sizing= 0;
   param.m_digest_sizing= 0;
   param.m_session_connect_attrs_sizing= 0;
+  param.m_max_digest_length= 0;
 
   param.m_mutex_sizing= 0;
   param.m_rwlock_sizing= 0;
index 7574de542f8f8cbfbaa5cf927b9f6945edffc8a4..ef8a7c195e0b7f95d2f80e7813b7b8660fcf117b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2012, 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
@@ -22,7 +22,6 @@
 #include <tap.h>
 
 #include "stub_pfs_global.h"
-#include "stub_server_misc.h"
 
 #include <string.h> /* memset */
 
index 32d9c23cbde8655f7df11b5ac3ebaa579251bec5..6627dd48df2b18f191b954624910babb68f987f9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2012, 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
@@ -22,7 +22,6 @@
 #include <tap.h>
 
 #include "stub_pfs_global.h"
-#include "stub_server_misc.h"
 
 #include <string.h> /* memset */
 
index 1ec198511c934850ffbf92c8a6625d2c43ba55e6..161060aa6bf1097e899fac7632f94ff73ed9392f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, 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
@@ -22,7 +22,6 @@
 #include <tap.h>
 
 #include "stub_pfs_global.h"
-#include "stub_server_misc.h"
 
 #include <string.h> /* memset */
 
index 43c143fe30faf74c5dee5a63182716b0ad51ddb9..3cc4c48388d63ba0c7274de37a53e3e9de352828 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, 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
@@ -23,8 +23,6 @@
 
 #include <memory.h>
 
-#include "stub_server_misc.h"
-
 void test_no_instruments()
 {
   int rc;
@@ -62,6 +60,7 @@ void test_no_instruments()
   param.m_events_statements_history_long_sizing= 0;
   param.m_digest_sizing= 0;
   param.m_session_connect_attrs_sizing= 0;
+  param.m_max_digest_length= 0;
 
   init_event_name_sizing(& param);
   rc= init_instruments(& param);
@@ -121,6 +120,7 @@ void test_no_instances()
   param.m_events_statements_history_long_sizing= 0;
   param.m_digest_sizing= 0;
   param.m_session_connect_attrs_sizing= 0;
+  param.m_max_digest_length= 0;
 
   init_event_name_sizing(& param);
   rc= init_instruments(& param);
@@ -261,6 +261,7 @@ void test_with_instances()
   param.m_events_statements_history_long_sizing= 0;
   param.m_digest_sizing= 0;
   param.m_session_connect_attrs_sizing= 0;
+  param.m_max_digest_length= 0;
 
   init_event_name_sizing(& param);
   rc= init_instruments(& param);
index f83d017f231ab23f72c87f8c58d5ebe872678dc7..e98250d8567a839a1d7f976f3e10d544982b73d8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, 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
@@ -20,7 +20,6 @@
 #include <tap.h>
 
 #include "stub_pfs_global.h"
-#include "stub_server_misc.h"
 
 void test_oom()
 {
index 85dec2dccc4887d7b06fe57739604a3605509a46..ee483312e3cad75ff7bd57f8c0521b0e77f585ec 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, 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
@@ -21,8 +21,6 @@
 #include <pfs_global.h>
 #include <tap.h>
 
-#include "stub_server_misc.h"
-
 void test_no_registration()
 {
   int rc;
diff --git a/mysql-wsrep-5.6/storage/perfschema/unittest/pfs_misc-t.cc b/mysql-wsrep-5.6/storage/perfschema/unittest/pfs_misc-t.cc
new file mode 100644 (file)
index 0000000..a0fff2f
--- /dev/null
@@ -0,0 +1,71 @@
+/* Copyright (c) 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
+  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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#include <my_global.h>
+#include <pfs_instr.h>
+#include <pfs_stat.h>
+#include <pfs_global.h>
+#include <pfs_instr_class.h>
+#include <tap.h>
+
+#include <memory.h>
+
+void test_digest_length_overflow()
+{
+  if (sizeof(size_t) != 4)
+  {
+    skip(2, "digest length overflow requires a 32-bit environment");
+    return;
+  }
+  
+  PFS_global_param param;
+  memset(&param, 0, sizeof(param));
+  param.m_enabled= true;
+  /*
+     Force 32-bit arithmetic overflow using the digest memory allocation
+     parameters. The Performance Schema should detect the overflow, free
+     allocated memory and abort initialization with a warning.
+  */
+  
+  /* Max digest length, events_statements_history_long. */
+  param.m_events_statements_history_long_sizing= 10000;
+  param.m_digest_sizing= 1000;
+  param.m_max_digest_length= (1024 * 1024);
+  pfs_max_digest_length= param.m_max_digest_length;
+
+  int rc = init_events_statements_history_long(param.m_events_statements_history_long_sizing);
+  ok(rc == 1, "digest length overflow (init_events_statements_history_long");
+
+  /* Max digest length, events_statements_summary_by_digest. */
+  param.m_max_digest_length= (1024 * 1024);
+  param.m_digest_sizing= 10000;
+
+  rc = init_digest(&param);
+  ok(rc == 1, "digest length overflow (init_digest)");
+}
+
+void do_all_tests()
+{
+  test_digest_length_overflow();
+}
+
+int main(int, char **)
+{
+  plan(2);
+  MY_INIT("pfs_misc-t");
+  do_all_tests();
+  return exit_status();
+}
+
similarity index 74%
rename from mysql-wsrep-5.6/storage/perfschema/unittest/stub_server_misc.h
rename to mysql-wsrep-5.6/storage/perfschema/unittest/pfs_server_stubs.cc
index 946da5337272cec55ec0b78cd156a0fc2e8b632b..ec916865a7d0f53ef05c71975efcbafd06c5fb9f 100644 (file)
@@ -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
   Minimal code to be able to link a unit test.
 */
 
+#include "my_global.h"
+#include "m_ctype.h"
+#include "sql_class.h"
+#include "sql_show.h"
+
+struct sql_digest_storage;
+
 volatile bool ready_to_exit= false;
 
 uint lower_case_table_names= 0;
 CHARSET_INFO *files_charset_info= NULL;
+CHARSET_INFO *system_charset_info= NULL;
 
-extern "C" void compute_md5_hash(char *, const char *, int)
+void compute_digest_md5(const sql_digest_storage *, unsigned char *)
 {
 }
 
index 1faf29b753ad5e568f7cde648af0a4d3497cf5e0..0e4c5eb341100b36ef997f2fb9bd5b6ccc23e914 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 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
@@ -22,7 +22,6 @@
 #include <tap.h>
 
 #include "stub_pfs_global.h"
-#include "stub_server_misc.h"
 
 #include <string.h> /* memset */
 
index 34c52e18b5a91494119a9f160b36ff711f4abf65..8f204006f48908ad8545c014fcd71cafd020f096 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, 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
@@ -25,6 +25,11 @@ int stub_alloc_fails_after_count= 0;
 
 void *pfs_malloc(size_t size, myf)
 {
+  /*
+    Catch non initialized sizing parameter in the unit tests.
+  */
+  DBUG_ASSERT(size <= 100*1024*1024);
+
   if (stub_alloc_always_fails)
     return NULL;
 
@@ -43,6 +48,23 @@ void pfs_free(void *ptr)
     free(ptr);
 }
 
+void *pfs_malloc_array(size_t n, size_t size, myf flags)
+{
+  size_t array_size= n * size;
+  /* Check for overflow before allocating. */
+  if (is_overflow(array_size, n, size))
+    return NULL;
+  return pfs_malloc(array_size, flags);
+}
+
+bool is_overflow(size_t product, size_t n1, size_t n2)
+{
+  if (n1 != 0 && (product / n1 != n2))
+    return true;
+  else
+    return false;
+}
+
 void pfs_print_error(const char *format, ...)
 {
 }
index caad24e52578be78329a126689af4088149cf8ae..e9b8bc255484a5d6be44e2be6655fedcb2d58022 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, 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
@@ -33,6 +33,23 @@ void pfs_free(void *ptr)
     free(ptr);
 }
 
+void *pfs_malloc_array(size_t n, size_t size, myf flags)
+{
+  size_t array_size= n * size;
+  /* Check for overflow before allocating. */
+  if (is_overflow(array_size, n, size))
+    return NULL;
+  return pfs_malloc(array_size, flags);
+}
+
+bool is_overflow(size_t product, size_t n1, size_t n2)
+{
+  if (n1 != 0 && (product / n1 != n2))
+    return true;
+  else
+    return false;
+}
+
 void pfs_print_error(const char *format, ...)
 {
   /* Do not pollute the unit test output with annoying messages. */
index 52ac50eee76b0b92924c8926d73931249e46a7e5..48709100357f0b837aa0969a0ab83f1caef2b0c3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
    
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
@@ -2545,14 +2545,17 @@ void my_fill_utf32(const CHARSET_INFO *cs,
                    char *s, size_t slen, int fill)
 {
   char buf[10];
-  uint buflen;
   char *e= s + slen;
   
   DBUG_ASSERT((slen % 4) == 0);
-
-  buflen= cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf,
-                          (uchar*) buf + sizeof(buf));
-  DBUG_ASSERT(buflen == 4);
+  {
+#ifndef DBUG_OFF
+    uint buflen=
+#endif
+      cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf,
+                      (uchar*) buf + sizeof(buf));
+    DBUG_ASSERT(buflen == 4);
+  }
   while (s < e)
   {
     memcpy(s, buf, 4);
index 770a0c9cde469bef064420722072a6dddff203a6..563109eec7bbe111379b2fdabb989a44f0c19087 100644 (file)
@@ -1,4 +1,4 @@
-/* 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 library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
@@ -5572,15 +5572,6 @@ my_toupper_utf8mb3(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
 }
 
 
-static inline void
-my_tosort_utf8mb3(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
-  MY_UNICASE_CHARACTER *page;
-  if ((page= uni_plane->page[(*wc >> 8) & 0xFF]))
-    *wc= page[*wc & 0xFF].sort;
-}
-
-
 static size_t
 my_caseup_utf8(const CHARSET_INFO *cs, char *src, size_t srclen,
                char *dst, size_t dstlen)
@@ -8298,7 +8289,8 @@ my_strnncoll_utf8mb4(const CHARSET_INFO *cs,
                      const uchar *t, size_t tlen,
                      my_bool t_is_prefix)
 {
-  my_wc_t s_wc,t_wc;
+  my_wc_t s_wc= 0;
+  my_wc_t t_wc= 0;
   const uchar *se= s + slen;
   const uchar *te= t + tlen;
   MY_UNICASE_INFO *uni_plane= cs->caseinfo;
@@ -8366,7 +8358,8 @@ my_strnncollsp_utf8mb4(const CHARSET_INFO *cs,
                        my_bool diff_if_only_endspace_difference)
 {
   int res;
-  my_wc_t s_wc, t_wc;
+  my_wc_t s_wc= 0;
+  my_wc_t t_wc= 0;
   const uchar *se= s + slen, *te= t + tlen;
   MY_UNICASE_INFO *uni_plane= cs->caseinfo;
   LINT_INIT(s_wc);
index 39892fd8b3224d099f3d0f0e68f7845727e46174..0dfea2b9f09fae41d23d6640ce8ed2b9befb4e60 100644 (file)
@@ -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
@@ -425,7 +425,7 @@ scan_one_character(const char *s, const char *e, my_wc_t *wc)
     wc[0]= 0;
     return len;
   }
-  else if (s[0] > 0) /* 7-bit character */
+  else if ((s[0] & 0x80) == 0) /* 7-bit character */
   {
     wc[0]= 0;
     return 1;
@@ -752,7 +752,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len)
 
   /* Rules: Context */
   case _CS_CONTEXT:
-    if (len < sizeof(i->context) + 1)
+    if (len < sizeof(i->context))
     {
       memcpy(i->context, attr, len);
       i->context[len]= '\0';
index 39b765c060f25c22871eadf2585aba6a5d716fa0..ccb4a6b9f3c13750805d1ca0f2471497b69618a8 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -211,6 +211,74 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
           (to)=a;                                                       \
         } while(0)
 
+
+/*
+  This is a direct loop unrolling of code that used to look like this:
+  for (; *buf_beg < powers10[i--]; start++) ;
+
+  @param   i    start index
+  @param   val  value to compare against list of powers of 10
+
+  @retval  Number of leading zeroes that can be removed from fraction.
+
+  @note Why unroll? To get rid of lots of compiler warnings [-Warray-bounds]
+        Nice bonus: unrolled code is significantly faster.
+ */
+static inline int count_leading_zeroes(int i, dec1 val)
+{
+  int ret= 0;
+  switch (i)
+  {
+  /* @note Intentional fallthrough in all case labels */
+  case 9: if (val >= 1000000000) break; ++ret;
+  case 8: if (val >= 100000000) break; ++ret;
+  case 7: if (val >= 10000000) break; ++ret;
+  case 6: if (val >= 1000000) break; ++ret;
+  case 5: if (val >= 100000) break; ++ret;
+  case 4: if (val >= 10000) break; ++ret;
+  case 3: if (val >= 1000) break; ++ret;
+  case 2: if (val >= 100) break; ++ret;
+  case 1: if (val >= 10) break; ++ret;
+  case 0: if (val >= 1) break; ++ret;
+  default: { DBUG_ASSERT(FALSE); }
+  }
+  return ret;
+}
+
+/*
+  This is a direct loop unrolling of code that used to look like this:
+  for (; *buf_end % powers10[i++] == 0; stop--) ;
+
+  @param   i    start index
+  @param   val  value to compare against list of powers of 10
+
+  @retval  Number of trailing zeroes that can be removed from fraction.
+
+  @note Why unroll? To get rid of lots of compiler warnings [-Warray-bounds]
+        Nice bonus: unrolled code is significantly faster.
+ */
+static inline int count_trailing_zeroes(int i, dec1 val)
+{
+  int ret= 0;
+  switch(i)
+  {
+  /* @note Intentional fallthrough in all case labels */
+  case 0: if ((val % 1) != 0) break; ++ret;
+  case 1: if ((val % 10) != 0) break; ++ret;
+  case 2: if ((val % 100) != 0) break; ++ret;
+  case 3: if ((val % 1000) != 0) break; ++ret;
+  case 4: if ((val % 10000) != 0) break; ++ret;
+  case 5: if ((val % 100000) != 0) break; ++ret;
+  case 6: if ((val % 1000000) != 0) break; ++ret;
+  case 7: if ((val % 10000000) != 0) break; ++ret;
+  case 8: if ((val % 100000000) != 0) break; ++ret;
+  case 9: if ((val % 1000000000) != 0) break; ++ret;
+  default: { DBUG_ASSERT(FALSE); }
+  }
+  return ret;
+}
+
+
 /*
   Get maximum value for given precision and scale
 
@@ -261,7 +329,7 @@ static dec1 *remove_leading_zeroes(const decimal_t *from, int *intg_result)
   }
   if (intg > 0)
   {
-    for (i= (intg - 1) % DIG_PER_DEC1; *buf0 < powers10[i--]; intg--) ;
+    intg-= count_leading_zeroes((intg - 1) % DIG_PER_DEC1, *buf0);
     DBUG_ASSERT(intg > 0);
   }
   else
@@ -296,9 +364,8 @@ int decimal_actual_fraction(decimal_t *from)
   }
   if (frac > 0)
   {
-    for (i= DIG_PER_DEC1 - ((frac - 1) % DIG_PER_DEC1);
-         *buf0 % powers10[i++] == 0;
-         frac--) ;
+    frac-=
+      count_trailing_zeroes(DIG_PER_DEC1 - ((frac - 1) % DIG_PER_DEC1), *buf0);
   }
   return frac;
 }
@@ -484,7 +551,8 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result)
     start= (int) ((buf_beg - from->buf) * DIG_PER_DEC1);
   }
   if (buf_beg < end)
-    for (; *buf_beg < powers10[i--]; start++) ;
+    start+= count_leading_zeroes(i, *buf_beg);
+
   *start_result= start; /* index of first decimal digit (from 0) */
 
   /* find non-zero digit at the end */
@@ -502,7 +570,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result)
     stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1);
     i= 1;
   }
-  for (; *buf_end % powers10[i++] == 0; stop--) ;
+  stop-= count_trailing_zeroes(i, *buf_end);
   *end_result= stop; /* index of position after last decimal digit (from 0) */
 }
 
@@ -996,26 +1064,34 @@ int double2decimal(double from, decimal_t *to)
 
 static int ull2dec(ulonglong from, decimal_t *to)
 {
-  int intg1, error=E_DEC_OK;
-  ulonglong x=from;
+  int intg1;
+  int error= E_DEC_OK;
+  ulonglong x= from;
   dec1 *buf;
 
   sanity(to);
 
-  for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) ;
+  if (from == 0)
+    intg1= 1;
+  else
+  {
+    /* Count the number of decimal_digit_t's we need. */
+    for (intg1= 0; from != 0; intg1++, from/= DIG_BASE)
+      ;
+  }
   if (unlikely(intg1 > to->len))
   {
-    intg1=to->len;
-    error=E_DEC_OVERFLOW;
+    intg1= to->len;
+    error= E_DEC_OVERFLOW;
   }
-  to->frac=0;
-  to->intg=intg1*DIG_PER_DEC1;
+  to->frac= 0;
+  to->intg= intg1 * DIG_PER_DEC1;
 
-  for (buf=to->buf+intg1; intg1; intg1--)
+  for (buf= to->buf + intg1; intg1; intg1--)
   {
-    ulonglong y=x/DIG_BASE;
-    *--buf=(dec1)(x-y*DIG_BASE);
-    x=y;
+    ulonglong y= x / DIG_BASE;
+    *--buf=(dec1)(x - y * DIG_BASE);
+    x= y;
   }
   return error;
 }
@@ -2233,7 +2309,7 @@ static int do_div_mod(const decimal_t *from1, const decimal_t *from2,
   }
   if (prec2 <= 0) /* short-circuit everything: from2 == 0 */
     return E_DEC_DIV_ZERO;
-  for (i= (prec2 - 1) % DIG_PER_DEC1; *buf2 < powers10[i--]; prec2--) ;
+  prec2-= count_leading_zeroes((prec2 - 1) % DIG_PER_DEC1, *buf2);
   DBUG_ASSERT(prec2 > 0);
 
   i=((prec1-1) % DIG_PER_DEC1)+1;
@@ -2248,7 +2324,7 @@ static int do_div_mod(const decimal_t *from1, const decimal_t *from2,
     decimal_make_zero(to);
     return E_DEC_OK;
   }
-  for (i=(prec1-1) % DIG_PER_DEC1; *buf1 < powers10[i--]; prec1--) ;
+  prec1-= count_leading_zeroes((prec1-1) % DIG_PER_DEC1, *buf1);
   DBUG_ASSERT(prec1 > 0);
 
   /* let's fix scale_incr, taking into account frac1,frac2 increase */
index 5afe26132957b6a2336f0097e2f7a6cc1ede1de4..74b1075cf251846f2076a4a2c01ee14bd536472d 100644 (file)
@@ -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()
index 3e4f4446a80ad131130fd860742749774ecb8f25..246e4d953cc7ee28a8c883a485155030112868f2 100644 (file)
@@ -1,400 +1,7 @@
-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
-   .
+You can find information about how to install on Mac OS X at
 
-   MySQL for OS X is available in a number of different forms:
+  http://dev.mysql.com/doc/refman/5.1/en/mac-os-x-installation.html
 
-     * 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:
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-  <dict>
-    <key>KeepAlive</key>
-    <true/>
-    <key>Label</key>
-    <string>com.mysql.mysqld</string>
-    <key>ProgramArguments</key>
-    <array>
-    <string>/usr/local/mysql/bin/mysqld_safe</string>
-    <string>--user=mysql</string>
-    </array>
-  </dict>
-</plist>
-
-
-   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.
+The MySQL Reference Manual is also available in various formats on
+http://dev.mysql.com/doc.
index c37485e32f9a18511a38a6cbe6878d9bde4c7126..635940afd4b1de150072ac2b1e7895b58d04768e 100755 (executable)
@@ -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/mysql-wsrep-5.6/support-files/cmake-no-wix.patch b/mysql-wsrep-5.6/support-files/cmake-no-wix.patch
new file mode 100644 (file)
index 0000000..325d97e
--- /dev/null
@@ -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/mysql-wsrep-5.6/support-files/mysql-rpmlintrc b/mysql-wsrep-5.6/support-files/mysql-rpmlintrc
new file mode 100644 (file)
index 0000000..72dd6e3
--- /dev/null
@@ -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/mysql-wsrep-5.6/support-files/mysql.5.6.16.spec b/mysql-wsrep-5.6/support-files/mysql.5.6.16.spec
deleted file mode 100644 (file)
index 9b3669b..0000000
+++ /dev/null
@@ -1,2080 +0,0 @@
-# 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
-# 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.
-
-##############################################################################
-# Some common macro definitions
-##############################################################################
-
-# NOTE: "vendor" is used in upgrade/downgrade check, so you can't
-# change these, has to be exactly as is.
-%global mysql_old_vendor        MySQL AB
-%global mysql_vendor_2          Sun Microsystems, Inc.
-%global mysql_vendor            Oracle and/or its affiliates
-
-%global mysql_version   5.6.16
-
-%global mysqld_user     mysql
-%global mysqld_group    mysql
-%global mysqldatadir    /var/lib/mysql
-
-%global release         1  
-
-
-#
-# Macros we use which are not available in all supported versions of RPM
-#
-# - defined/undefined are missing on RHEL4
-#
-%if %{expand:%{?defined:0}%{!?defined:1}}
-%define defined()       %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
-%endif
-%if %{expand:%{?undefined:0}%{!?undefined:1}}
-%define undefined()     %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
-%endif
-
-# ----------------------------------------------------------------------------
-# RPM build tools now automatically detect Perl module dependencies.  This
-# detection causes problems as it is broken in some versions, and it also
-# provides unwanted dependencies from mandatory scripts in our package.
-# It might not be possible to disable this in all versions of RPM, but here we
-# try anyway.  We keep the "AutoReqProv: no" for the "test" sub package, as
-# disabling here might fail, and that package has the most problems.
-# See:
-#  http://fedoraproject.org/wiki/Packaging/Perl#Filtering_Requires:_and_Provides
-#  http://www.wideopen.com/archives/rpm-list/2002-October/msg00343.html
-# ----------------------------------------------------------------------------
-%undefine __perl_provides
-%undefine __perl_requires
-
-##############################################################################
-# Command line handling
-##############################################################################
-#
-# To set options:
-#
-#   $ rpmbuild --define="option <x>" ...
-#
-
-# ----------------------------------------------------------------------------
-# Commercial builds
-# ----------------------------------------------------------------------------
-%if %{undefined commercial}
-%define commercial 0
-%endif
-
-# ----------------------------------------------------------------------------
-# Source name
-# ----------------------------------------------------------------------------
-%if %{undefined src_base}
-%define src_base mysql
-%endif
-%define src_dir %{src_base}-%{mysql_version}
-
-# ----------------------------------------------------------------------------
-# Feature set (storage engines, options).  Default to community (everything)
-# ----------------------------------------------------------------------------
-%if %{undefined feature_set}
-%define feature_set community
-%endif
-
-# ----------------------------------------------------------------------------
-# Server comment strings
-# ----------------------------------------------------------------------------
-%if %{undefined compilation_comment_debug}
-%define compilation_comment_debug       MySQL Community Server - Debug (GPL)
-%endif
-%if %{undefined compilation_comment_release}
-%define compilation_comment_release     MySQL Community Server (GPL)
-%endif
-
-# ----------------------------------------------------------------------------
-# Product and server suffixes
-# ----------------------------------------------------------------------------
-%if %{undefined product_suffix}
-  %if %{defined short_product_tag}
-    %define product_suffix      -%{short_product_tag}
-  %else
-    %define product_suffix      %{nil}
-  %endif
-%endif
-
-%if %{undefined server_suffix}
-%define server_suffix   %{nil}
-%endif
-
-# ----------------------------------------------------------------------------
-# Distribution support
-# ----------------------------------------------------------------------------
-%if %{undefined distro_specific}
-%define distro_specific 0
-%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"
-        %define distro_description      Oracle Linux 6
-        %define distro_releasetag       el6
-        %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
-  %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}
-
-# Hack to work around bug in RHEL5 __os_install_post macro, wrong inverted
-# test for __debug_package
-%define __strip         /bin/true
-
-# ----------------------------------------------------------------------------
-# Support optional "tcmalloc" library (experimental)
-# ----------------------------------------------------------------------------
-%if %{defined malloc_lib_target}
-%define WITH_TCMALLOC 1
-%else
-%define WITH_TCMALLOC 0
-%endif
-
-##############################################################################
-# Configuration based upon above user input, not to be set directly
-##############################################################################
-
-%if 0%{?commercial}
-%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_type            GPL
-%endif
-
-##############################################################################
-# Main spec file section
-##############################################################################
-
-Name:           MySQL%{product_suffix}
-Summary:        MySQL: a very fast and reliable SQL database server
-Group:          Applications/Databases
-Version:        5.6.16
-Release:        %{release}%{?distro_releasetag:.%{distro_releasetag}}
-Distribution:   %{distro_description}
-License:        Copyright (c) 2000, 2014, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field.
-Source:         http://www.mysql.com/Downloads/MySQL-5.6/%{src_dir}.tar.gz
-URL:            http://www.mysql.com/
-Packager:       MySQL Release Engineering <mysql-build@oss.oracle.com> 
-Vendor:         %{mysql_vendor}
-BuildRequires:  %{distro_buildreq}
-
-# Regression tests may take a long time, override the default to skip them 
-%{!?runselftest:%global runselftest 1}
-
-# Think about what you use here since the first step is to
-# run a rm -rf
-BuildRoot:    %{_tmppath}/%{name}-%{version}-build
-
-# From the manual
-%description
-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
-as for embedding into mass-deployed software. MySQL is a trademark of
-%{mysql_vendor}
-
-The MySQL software has Dual Licensing, which means you can use the MySQL
-software free of charge under the GNU General Public License
-(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
-licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
-the GPL. See the chapter "Licensing and Support" in the manual for
-further info.
-
-The MySQL web site (http://www.mysql.com/) provides the latest
-news and information about the MySQL software. Also please see the
-documentation and the manual for more information.
-
-##############################################################################
-# Sub package definition
-##############################################################################
-
-%package -n MySQL-server%{product_suffix}
-Summary:        MySQL: a very fast and reliable SQL database server
-Group:          Applications/Databases
-Requires:       %{distro_requires}
-%if 0%{?commercial}
-Obsoletes:      MySQL-server
-%else
-Obsoletes:      MySQL-server-advanced
-%endif
-Obsoletes:      mysql-server < %{version}-%{release}
-Obsoletes:      mysql-server-advanced
-Obsoletes:      MySQL-server-classic MySQL-server-community MySQL-server-enterprise
-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}
-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
-as for embedding into mass-deployed software. MySQL is a trademark of
-%{mysql_vendor}
-
-The MySQL software has Dual Licensing, which means you can use the MySQL
-software free of charge under the GNU General Public License
-(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
-licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
-the GPL. See the chapter "Licensing and Support" in the manual for
-further info.
-
-The MySQL web site (http://www.mysql.com/) provides the latest news and
-information about the MySQL software.  Also please see the documentation
-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.
-
-If you want to access and work with the database, you have to install
-package "MySQL-client%{product_suffix}" as well!
-
-# ----------------------------------------------------------------------------
-%package -n MySQL-client%{product_suffix}
-Summary:        MySQL - Client
-Group:          Applications/Databases
-%if 0%{?commercial}
-Obsoletes:      MySQL-client
-%else
-Obsoletes:      MySQL-client-advanced
-%endif
-Obsoletes:      mysql < %{version}-%{release}
-Obsoletes:      mysql-advanced < %{version}-%{release}
-Obsoletes:      MySQL-client-classic MySQL-client-community MySQL-client-enterprise
-Obsoletes:      MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
-Provides:       mysql = %{version}-%{release} 
-Provides:       mysql%{?_isa} = %{version}-%{release}
-
-%description -n MySQL-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}
-Summary:        MySQL - Test suite
-Group:          Applications/Databases
-%if 0%{?commercial}
-Requires:       MySQL-client-advanced perl
-Obsoletes:      MySQL-test
-%else
-Requires:       MySQL-client perl
-Obsoletes:      MySQL-test-advanced
-%endif
-Obsoletes:      mysql-test < %{version}-%{release}
-Obsoletes:      mysql-test-advanced
-Obsoletes:      MySQL-test-classic MySQL-test-community MySQL-test-enterprise
-Obsoletes:      MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
-Provides:       mysql-test = %{version}-%{release}
-Provides:       mysql-test%{?_isa} = %{version}-%{release}
-AutoReqProv:    no
-
-%description -n MySQL-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}
-Summary:        MySQL - Development header files and libraries
-Group:          Applications/Databases
-%if 0%{?commercial}
-Obsoletes:      MySQL-devel
-%else
-Obsoletes:      MySQL-devel-advanced
-%endif
-Obsoletes:      mysql-devel < %{version}-%{release}
-Obsoletes:      mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
-Obsoletes:      MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
-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}
-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}
-Summary:        MySQL - Shared libraries
-Group:          Applications/Databases
-%if 0%{?commercial}
-Obsoletes:      MySQL-shared
-%else
-Obsoletes:      MySQL-shared-advanced
-%endif
-Obsoletes:      MySQL-shared-standard MySQL-shared-pro
-Obsoletes:      MySQL-shared-pro-cert MySQL-shared-pro-gpl
-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}
-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}
-
-##############################################################################
-%build
-
-# Fail quickly and obviously if user tries to build as root
-%if %runselftest
-    if [ x"`id -u`" = x0 ]; then
-        echo "The MySQL regression tests may fail if run as root."
-        echo "If you really need to build the RPM as root, use"
-        echo "--define='runselftest 0' to skip the regression tests."
-        exit 1
-    fi
-%endif
-
-# Be strict about variables, bail at earliest opportunity, etc.
-set -eu
-
-# Optional package files
-touch optional-files-devel
-
-#
-# Set environment in order of preference, MYSQL_BUILD_* first, then variable
-# name, finally a default.  RPM_OPT_FLAGS is assumed to be a part of the
-# default RPM build environment.
-#
-
-# This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break
-# the compile in cmd-line-utils/libedit - needs investigation, but for now
-# we simply unset it and use those specified directly in cmake.
-%if "%{_arch}" == "ia64"
-RPM_OPT_FLAGS=
-%endif
-
-export PATH=${MYSQL_BUILD_PATH:-$PATH}
-export CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
-export CXX=${MYSQL_BUILD_CXX:-${CXX:-g++}}
-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:-}
-
-# By default, a build will include the bundeled "yaSSL" library for SSL.
-# However, there may be a need to override.
-# Protect against undefined variables if there is no override option.
-%if %{undefined with_ssl}
-%define ssl_option   %{nil}
-%else
-%define ssl_option   -DWITH_SSL=%{with_ssl}
-%endif
-
-# Build debug mysqld and libmysqld.a
-mkdir debug
-(
-  cd debug
-  # Attempt to remove any optimisation flags from the debug build
-  CFLAGS=`echo " ${CFLAGS} " | \
-            sed -e 's/ -O[0-9]* / /' \
-                -e 's/ -unroll2 / /' \
-                -e 's/ -ip / /' \
-                -e 's/^ //' \
-                -e 's/ $//'`
-  CXXFLAGS=`echo " ${CXXFLAGS} " | \
-              sed -e 's/ -O[0-9]* / /' \
-                  -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 \
-           -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}"
-  echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG
-  make ${MAKE_JFLAG} VERBOSE=1
-)
-# Build full release
-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 \
-           -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}"
-  echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
-  make ${MAKE_JFLAG} VERBOSE=1
-)
-
-%if %runselftest
-  MTR_BUILD_THREAD=auto
-  export MTR_BUILD_THREAD
-
-  (cd release && make test-bt-fast || true)
-%endif
-
-##############################################################################
-%install
-
-RBR=$RPM_BUILD_ROOT
-MBD=$RPM_BUILD_DIR/%{src_dir}
-
-# Ensure that needed directories exists
-install -d $RBR%{_sysconfdir}/{logrotate.d,init.d}
-install -d $RBR%{mysqldatadir}/mysql
-install -d $RBR%{_datadir}/mysql-test
-install -d $RBR%{_datadir}/mysql/SELinux/RHEL4
-install -d $RBR%{_includedir}
-install -d $RBR%{_libdir}
-install -d $RBR%{_mandir}
-install -d $RBR%{_sbindir}
-
-# Install all binaries
-(
-  cd $MBD/release
-  make DESTDIR=$RBR install
-)
-
-# FIXME: at some point we should stop doing this and just install everything
-# FIXME: directly into %{_libdir}/mysql - perhaps at the same time as renaming
-# FIXME: the shared libraries to use libmysql*-$major.$minor.so syntax
-mv -v $RBR/%{_libdir}/*.a $RBR/%{_libdir}/mysql/
-
-# Install logrotate and autostart
-install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
-install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
-
-# 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
-
-# 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
-
-# Install SELinux files in datadir
-install -m 600 $MBD/%{src_dir}/support-files/RHEL4-SElinux/mysql.{fc,te} \
-  $RBR%{_datadir}/mysql/SELinux/RHEL4
-
-%if %{WITH_TCMALLOC}
-# Even though this is a shared library, put it under /usr/lib*/mysql, so it
-# doesn't conflict with possible shared lib by the same name in /usr/lib*.  See
-# `mysql_config --variable=pkglibdir` and mysqld_safe for how this is used.
-install -m 644 "%{malloc_lib_source}" \
-  "$RBR%{_libdir}/mysql/%{malloc_lib_target}"
-%endif
-
-# Remove man pages we explicitly do not want to package, avoids 'unpackaged
-# files' warning.
-# This has become obsolete:  rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
-
-##############################################################################
-#  Post processing actions, i.e. when installed
-##############################################################################
-
-%pre -n MySQL-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.
-
-# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
-
-# There are users who deviate from the default file system layout.
-# Check local settings to support them.
-if [ -x %{_bindir}/my_print_defaults ]
-then
-  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
-  PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`
-fi
-if [ -z "$mysql_datadir" ]
-then
-  mysql_datadir=%{mysqldatadir}
-fi
-if [ -z "$PID_FILE_PATT" ]
-then
-  PID_FILE_PATT="$mysql_datadir/*.pid"
-fi
-
-# Check if we can safely upgrade.  An upgrade is only safe if it's from one
-# of our RPMs in the same version family.
-
-# Handle both ways of spelling the capability.
-installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
-if [ $? -ne 0 -o -z "$installed" ]; then
-  installed=`rpm -q --whatprovides MySQL-server 2> /dev/null`
-fi
-if [ $? -eq 0 -a -n "$installed" ]; then
-  installed=`echo $installed | sed 's/\([^ ]*\) .*/\1/'` # Tests have shown duplicated package names
-  vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
-  version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
-  myoldvendor='%{mysql_old_vendor}'
-  myvendor_2='%{mysql_vendor_2}'
-  myvendor='%{mysql_vendor}'
-  myversion='%{mysql_version}'
-
-  old_family=`echo $version \
-    | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
-  new_family=`echo $myversion \
-    | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
-
-  [ -z "$vendor" ] && vendor='<unknown>'
-  [ -z "$old_family" ] && old_family="<unrecognized version $version>"
-  [ -z "$new_family" ] && new_family="<bad package specification: version $myversion>"
-
-  error_text=
-  if [ "$vendor" != "$myoldvendor" \
-    -a "$vendor" != "$myvendor_2" \
-    -a "$vendor" != "$myvendor" ]; then
-    error_text="$error_text
-The current MySQL server package is provided by a different
-vendor ($vendor) than $myoldvendor, $myvendor_2, or $myvendor.
-Some files may be installed to different locations, including log
-files and the service startup script in %{_sysconfdir}/init.d/.
-"
-  fi
-
-  if [ "$old_family" != "$new_family" ]; then
-    error_text="$error_text
-Upgrading directly from MySQL $old_family to MySQL $new_family may not
-be safe in all cases.  A manual dump and restore using mysqldump is
-recommended.  It is important to review the MySQL manual's Upgrading
-section for version-specific incompatibilities.
-"
-  fi
-
-  if [ -n "$error_text" ]; then
-    cat <<HERE >&2
-
-******************************************************************
-A MySQL server package ($installed) is installed.
-$error_text
-A manual upgrade is required.
-
-- Ensure that you have a complete, working backup of your data and my.cnf
-  files
-- Shut down the MySQL server cleanly
-- Remove the existing MySQL packages.  Usually this command will
-  list the packages you should remove:
-  rpm -qa | grep -i '^mysql-'
-
-  You may choose to use 'rpm --nodeps -ev <package-name>' to remove
-  the package which contains the mysqlclient shared library.  The
-  library will be reinstalled by the MySQL-shared-compat package.
-- Install the new MySQL packages supplied by $myvendor
-- Ensure that the MySQL server is started
-- Run the 'mysql_upgrade' program
-
-This is a brief description of the upgrade process.  Important details
-can be found in the MySQL manual, in the Upgrading section.
-******************************************************************
-HERE
-    exit 1
-  fi
-fi
-
-# We assume that if there is exactly one ".pid" file,
-# it contains the valid PID of a running MySQL server.
-NR_PID_FILES=`ls -1 $PID_FILE_PATT 2>/dev/null | wc -l`
-case $NR_PID_FILES in
-       0 ) SERVER_TO_START=''  ;;  # No "*.pid" file == no running server
-       1 ) SERVER_TO_START='true' ;;
-       * ) SERVER_TO_START=''      # Situation not clear
-           SEVERAL_PID_FILES=true ;;
-esac
-# That logic may be debated: We might check whether it is non-empty,
-# contains exactly one number (possibly a PID), and whether "ps" finds it.
-# OTOH, if there is no such process, it means a crash without a cleanup -
-# is that a reason not to start a new server after upgrade?
-
-STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
-
-if [ -f $STATUS_FILE ]; then
-       echo "Some previous upgrade was not finished:"
-       ls -ld $STATUS_FILE
-       echo "Please check its status, then do"
-       echo "    rm $STATUS_FILE"
-       echo "before repeating the MySQL upgrade."
-       exit 1
-elif [ -n "$SEVERAL_PID_FILES" ] ; then
-       echo "You have more than one PID file:"
-       ls -ld $PID_FILE_PATT
-       echo "Please check which one (if any) corresponds to a running server"
-       echo "and delete all others before repeating the MySQL upgrade."
-       exit 1
-fi
-
-NEW_VERSION=%{mysql_version}-%{release}
-
-# The "pre" section code is also run on a first installation,
-# when there  is no data directory yet. Protect against error messages.
-# Check for the existence of subdirectory "mysql/", the database of system
-# tables like "mysql.user".
-if [ -d $mysql_datadir/mysql ] ; then
-        echo "MySQL RPM upgrade to version $NEW_VERSION"  > $STATUS_FILE
-        echo "'pre' step running at `date`"          >> $STATUS_FILE
-        echo                                         >> $STATUS_FILE
-        fcount=`ls -ltr $mysql_datadir/*.err 2>/dev/null | wc -l`
-        if [ $fcount -gt 0 ] ; then
-             echo "ERR file(s):"                          >> $STATUS_FILE
-             ls -ltr $mysql_datadir/*.err                 >> $STATUS_FILE
-             echo                                         >> $STATUS_FILE
-             echo "Latest 'Version' line in latest file:" >> $STATUS_FILE
-             grep '^Version' `ls -tr $mysql_datadir/*.err | tail -1` | \
-                tail -1                              >> $STATUS_FILE
-             echo                                         >> $STATUS_FILE
-        fi
-
-       if [ -n "$SERVER_TO_START" ] ; then
-               # There is only one PID file, race possibility ignored
-               echo "PID file:"                           >> $STATUS_FILE
-               ls -l   $PID_FILE_PATT                     >> $STATUS_FILE
-               cat     $PID_FILE_PATT                     >> $STATUS_FILE
-               echo                                       >> $STATUS_FILE
-               echo "Server process:"                     >> $STATUS_FILE
-               ps -fp `cat $PID_FILE_PATT`                >> $STATUS_FILE
-               echo                                       >> $STATUS_FILE
-               echo "SERVER_TO_START=$SERVER_TO_START"    >> $STATUS_FILE
-       else
-               # Take a note we checked it ...
-               echo "PID file:"                           >> $STATUS_FILE
-               ls -l   $PID_FILE_PATT                     >> $STATUS_FILE 2>&1
-       fi
-fi
-
-# Shut down a previously installed server first
-# Note we *could* make that depend on $SERVER_TO_START, but we rather don't,
-# so a "stop" is attempted even if there is no PID file.
-# (Maybe the "stop" doesn't work then, but we might fix that in itself.)
-if [ -x %{_sysconfdir}/init.d/mysql ] ; then
-        %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1
-        echo "Giving mysqld 5 seconds to exit nicely"
-        sleep 5
-fi
-
-%post -n MySQL-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.
-
-# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
-
-# There are users who deviate from the default file system layout.
-# Check local settings to support them.
-if [ -x %{_bindir}/my_print_defaults ]
-then
-  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
-fi
-if [ -z "$mysql_datadir" ]
-then
-  mysql_datadir=%{mysqldatadir}
-fi
-
-NEW_VERSION=%{mysql_version}-%{release}
-STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
-
-# ----------------------------------------------------------------------
-# Create data directory if needed, check whether upgrade or install
-# ----------------------------------------------------------------------
-if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi
-if [ -f $STATUS_FILE ] ; then
-       SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
-else
-       SERVER_TO_START=''
-fi
-# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
-if [ ! -d $mysql_datadir/mysql ] ; then
-       mkdir $mysql_datadir/mysql $mysql_datadir/test
-       echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE
-else
-       # If the directory exists, we may assume it is an upgrade.
-       echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
-fi
-
-# ----------------------------------------------------------------------
-# Make MySQL start/shutdown automatically when the machine does it.
-# ----------------------------------------------------------------------
-# NOTE: This still needs to be debated. Should we check whether these links
-# for the other run levels exist(ed) before the upgrade?
-# use chkconfig on Enterprise Linux and newer SuSE releases
-if [ -x /sbin/chkconfig ] ; then
-        /sbin/chkconfig --add mysql
-# use insserv for older SuSE Linux versions
-elif [ -x /sbin/insserv ] ; then
-        /sbin/insserv %{_sysconfdir}/init.d/mysql
-fi
-
-# ----------------------------------------------------------------------
-# Create a MySQL user and group. Do not report any problems if it already
-# exists.
-# ----------------------------------------------------------------------
-groupadd -r %{mysqld_group} 2> /dev/null || true
-useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" \
-  -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
-# The user may already exist, make sure it has the proper group nevertheless
-# (BUG#12823)
-usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
-
-# ----------------------------------------------------------------------
-# Change permissions so that the user that will run the MySQL daemon
-# owns all database files.
-# ----------------------------------------------------------------------
-chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
-
-# ----------------------------------------------------------------------
-# Initiate databases if needed
-# ----------------------------------------------------------------------
-if ! grep '^MySQL RPM upgrade' $STATUS_FILE >/dev/null 2>&1 ; then
-       # Fix bug#45415: no "mysql_install_db" on an upgrade
-       # Do this as a negative to err towards more "install" runs
-       # rather than to miss one.
-       %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} --random-passwords
-
-       # Attention: Now 'root' is the only database user,
-       # its password is a random value found in ~/.mysql_secret,
-       # and the "password expired" flag is set:
-       # Any client needs that password, and the first command
-       # executed must be a new "set password"!
-fi
-
-# ----------------------------------------------------------------------
-# Upgrade databases if needed would go here - but it cannot be automated yet
-# ----------------------------------------------------------------------
-
-# ----------------------------------------------------------------------
-# Change permissions again to fix any new files.
-# ----------------------------------------------------------------------
-chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
-
-# ----------------------------------------------------------------------
-# Fix permissions for the permission database so that only the user
-# can read them.
-# ----------------------------------------------------------------------
-chmod -R og-rw $mysql_datadir/mysql
-
-# ----------------------------------------------------------------------
-# install SELinux files - but don't override existing ones
-# ----------------------------------------------------------------------
-SETARGETDIR=/etc/selinux/targeted/src/policy
-SEDOMPROG=$SETARGETDIR/domains/program
-SECONPROG=$SETARGETDIR/file_contexts/program
-if [ -f /etc/redhat-release ] \
- && (grep -q "Red Hat Enterprise Linux .. release 4" /etc/redhat-release \
- || grep -q "CentOS release 4" /etc/redhat-release) ; then
-  echo
-  echo
-  echo 'Notes regarding SELinux on this platform:'
-  echo '========================================='
-  echo
-  echo 'The default policy might cause server startup to fail because it is'
-  echo 'not allowed to access critical files.  In this case, please update'
-  echo 'your installation.'
-  echo
-  echo 'The default policy might also cause inavailability of SSL related'
-  echo 'features because the server is not allowed to access /dev/random'
-  echo 'and /dev/urandom. If this is a problem, please do the following:'
-  echo
-  echo '  1) install selinux-policy-targeted-sources from your OS vendor'
-  echo '  2) add the following two lines to '$SEDOMPROG/mysqld.te':'
-  echo '       allow mysqld_t random_device_t:chr_file read;'
-  echo '       allow mysqld_t urandom_device_t:chr_file read;'
-  echo '  3) cd to '$SETARGETDIR' and issue the following command:'
-  echo '       make load'
-  echo
-  echo
-fi
-
-if [ -x sbin/restorecon ] ; then
-  sbin/restorecon -R var/lib/mysql
-fi
-
-# Was the server running before the upgrade? If so, restart the new one.
-if [ "$SERVER_TO_START" = "true" ] ; then
-       # Restart in the same way that mysqld will be started normally.
-       if [ -x %{_sysconfdir}/init.d/mysql ] ; then
-               %{_sysconfdir}/init.d/mysql start
-               echo "Giving mysqld 5 seconds to start"
-               sleep 5
-       fi
-fi
-
-# Collect an upgrade history ...
-echo "Upgrade/install finished at `date`"        >> $STATUS_FILE
-echo                                             >> $STATUS_FILE
-echo "====="                                     >> $STATUS_FILE
-STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
-cat $STATUS_FILE >> $STATUS_HISTORY
-mv -f  $STATUS_FILE ${STATUS_FILE}-LAST  # for "triggerpostun"
-
-
-#echo "Thank you for installing the MySQL Community Server! For Production
-#systems, we recommend MySQL Enterprise, which contains enterprise-ready
-#software, intelligent advisory services, and full production support with
-#scheduled service packs and more.  Visit www.mysql.com/enterprise for more
-#information."
-
-%preun -n MySQL-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.
-#   Action                           Count
-#   Install the first time           1
-#   Upgrade                          2 or higher (depending on the number of versions installed)
-#   Remove last version of package   0 "
-#
-#  http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html
-if [ $1 = 0 ] ; then
-        # Stop MySQL before uninstalling it
-        if [ -x %{_sysconfdir}/init.d/mysql ] ; then
-                %{_sysconfdir}/init.d/mysql stop > /dev/null
-                # Remove autostart of MySQL
-                # use chkconfig on Enterprise Linux and newer SuSE releases
-                if [ -x /sbin/chkconfig ] ; then
-                        /sbin/chkconfig --del mysql
-                # For older SuSE Linux versions
-                elif [ -x /sbin/insserv ] ; then
-                        /sbin/insserv -r %{_sysconfdir}/init.d/mysql
-                fi
-        fi
-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
-
-# Setup: We renamed this package, so any existing "server-community"
-#   package will be removed when this "server" is installed.
-# Problem: RPM will first run the "pre" and "post" sections of this script,
-#   and only then the "preun" of that old community server.
-#   But this "preun" includes stopping the server and uninstalling the service,
-#   "chkconfig --del mysql" which removes the symlinks to the start script.
-# Solution: *After* the community server got removed, restart this server
-#   and re-install the service.
-#
-# For information about triggers in spec files, see the Fedora docs:
-#   http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html
-# For all details of this code, see the "pre" and "post" sections.
-
-# There are users who deviate from the default file system layout.
-# Check local settings to support them.
-if [ -x %{_bindir}/my_print_defaults ]
-then
-  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
-fi
-if [ -z "$mysql_datadir" ]
-then
-  mysql_datadir=%{mysqldatadir}
-fi
-
-NEW_VERSION=%{mysql_version}-%{release}
-STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST  # Note the difference!
-STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
-
-if [ -f $STATUS_FILE ] ; then
-       SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
-else
-       # This should never happen, but let's be prepared
-       SERVER_TO_START=''
-fi
-echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
-
-if [ -x /sbin/chkconfig ] ; then
-        /sbin/chkconfig --add mysql
-# use insserv for older SuSE Linux versions
-elif [ -x /sbin/insserv ] ; then
-        /sbin/insserv %{_sysconfdir}/init.d/mysql
-fi
-
-# Was the server running before the upgrade? If so, restart the new one.
-if [ "$SERVER_TO_START" = "true" ] ; then
-       # Restart in the same way that mysqld will be started normally.
-       if [ -x %{_sysconfdir}/init.d/mysql ] ; then
-               %{_sysconfdir}/init.d/mysql start
-               echo "Giving mysqld 5 seconds to start"
-               sleep 5
-       fi
-fi
-
-echo "Trigger 'postun --community' finished at `date`"        >> $STATUS_HISTORY
-echo                                             >> $STATUS_HISTORY
-echo "====="                                     >> $STATUS_HISTORY
-
-
-# ----------------------------------------------------------------------
-# Clean up the BuildRoot after build is done
-# ----------------------------------------------------------------------
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] \
-  && rm -rf $RPM_BUILD_ROOT;
-
-##############################################################################
-#  Files section
-##############################################################################
-
-%files -n MySQL-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 release/Docs/INFO_BIN*
-%doc release/support-files/my-default.cnf
-
-%if 0%{?commercial}
-%doc %attr(644, root, root) %{_infodir}/mysql.info*
-%endif
-
-%doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1*
-%doc %attr(644, root, man) %{_mandir}/man1/my_print_defaults.1*
-%doc %attr(644, root, man) %{_mandir}/man1/myisam_ftdump.1*
-%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1*
-%doc %attr(644, root, man) %{_mandir}/man1/myisamlog.1*
-%doc %attr(644, root, man) %{_mandir}/man1/myisampack.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_convert_table_format.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_extensions.1*
-%doc %attr(644, root, man) %{_mandir}/man8/mysqld.8*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqldumpslow.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_secure_installation.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_setpermission.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqltest.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1*
-%doc %attr(644, root, man) %{_mandir}/man1/perror.1*
-%doc %attr(644, root, man) %{_mandir}/man1/replace.1*
-%doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1*
-%doc %attr(644, root, man) %{_mandir}/man1/resolveip.1*
-
-%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
-
-%attr(755, root, root) %{_bindir}/innochecksum
-%attr(755, root, root) %{_bindir}/my_print_defaults
-%attr(755, root, root) %{_bindir}/myisam_ftdump
-%attr(755, root, root) %{_bindir}/myisamchk
-%attr(755, root, root) %{_bindir}/myisamlog
-%attr(755, root, root) %{_bindir}/myisampack
-%attr(755, root, root) %{_bindir}/mysql_convert_table_format
-%attr(755, root, root) %{_bindir}/mysql_fix_extensions
-%attr(755, root, root) %{_bindir}/mysql_install_db
-%attr(755, root, root) %{_bindir}/mysql_plugin
-%attr(755, root, root) %{_bindir}/mysql_secure_installation
-%attr(755, root, root) %{_bindir}/mysql_setpermission
-%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql
-%attr(755, root, root) %{_bindir}/mysql_upgrade
-%attr(755, root, root) %{_bindir}/mysql_zap
-%attr(755, root, root) %{_bindir}/mysqlbug
-%attr(755, root, root) %{_bindir}/mysqld_multi
-%attr(755, root, root) %{_bindir}/mysqld_safe
-%attr(755, root, root) %{_bindir}/mysqldumpslow
-%attr(755, root, root) %{_bindir}/mysqlhotcopy
-%attr(755, root, root) %{_bindir}/mysqltest
-%attr(755, root, root) %{_bindir}/perror
-%attr(755, root, root) %{_bindir}/replace
-%attr(755, root, root) %{_bindir}/resolve_stack_dump
-%attr(755, root, root) %{_bindir}/resolveip
-
-%attr(755, root, root) %{_sbindir}/mysqld
-%attr(755, root, root) %{_sbindir}/mysqld-debug
-%attr(755, root, root) %{_sbindir}/rcmysql
-%attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
-
-%if %{WITH_TCMALLOC}
-%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target}
-%endif
-
-%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
-%attr(755, root, root) %{_sysconfdir}/init.d/mysql
-
-%attr(755, root, root) %{_datadir}/mysql/
-
-# ----------------------------------------------------------------------------
-%files -n MySQL-client%{product_suffix}
-
-%defattr(-, root, root, 0755)
-%attr(755, root, root) %{_bindir}/msql2mysql
-%attr(755, root, root) %{_bindir}/mysql
-%attr(755, root, root) %{_bindir}/mysql_find_rows
-%attr(755, root, root) %{_bindir}/mysql_waitpid
-%attr(755, root, root) %{_bindir}/mysqlaccess
-# XXX: This should be moved to %{_sysconfdir}
-%attr(644, root, root) %{_bindir}/mysqlaccess.conf
-%attr(755, root, root) %{_bindir}/mysqladmin
-%attr(755, root, root) %{_bindir}/mysqlbinlog
-%attr(755, root, root) %{_bindir}/mysqlcheck
-%attr(755, root, root) %{_bindir}/mysqldump
-%attr(755, root, root) %{_bindir}/mysqlimport
-%attr(755, root, root) %{_bindir}/mysqlshow
-%attr(755, root, root) %{_bindir}/mysqlslap
-%attr(755, root, root) %{_bindir}/mysql_config_editor
-
-%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_find_rows.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_waitpid.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqlcheck.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqlimport.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysqlslap.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_config_editor.1*
-
-# ----------------------------------------------------------------------------
-%files -n MySQL-devel%{product_suffix} -f optional-files-devel
-%defattr(-, root, root, 0755)
-%doc %attr(644, root, man) %{_mandir}/man1/comp_err.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1*
-%attr(755, root, root) %{_bindir}/mysql_config
-%dir %attr(755, root, root) %{_includedir}/mysql
-%dir %attr(755, root, root) %{_libdir}/mysql
-%{_includedir}/mysql/*
-%{_datadir}/aclocal/mysql.m4
-%{_libdir}/mysql/libmysqlclient.a
-%{_libdir}/mysql/libmysqlclient_r.a
-%{_libdir}/mysql/libmysqlservices.a
-
-# ----------------------------------------------------------------------------
-%files -n MySQL-shared%{product_suffix}
-%defattr(-, root, root, 0755)
-# Shared libraries (omit for architectures that don't support them)
-%{_libdir}/libmysql*.so*
-
-%post -n MySQL-shared%{product_suffix}
-/sbin/ldconfig
-
-%postun -n MySQL-shared%{product_suffix}
-/sbin/ldconfig
-
-# ----------------------------------------------------------------------------
-%files -n MySQL-test%{product_suffix}
-%defattr(-, root, root, 0755)
-%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)
-%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
-* Wed Oct 30 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
-- Removed non gpl file docs/mysql.info from community packages
-
-* Mon Sep 09 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
-- Updated logic to get the correct count of PID files
-
-* Fri Aug 16 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
-- Added provides lowercase mysql tags  
-
-* Wed Jun 26 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
-- Cleaned up spec file to resolve rpm dependencies.
-
-* Mon Nov 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Allow to override the default to use the bundled yaSSL by an option like
-      --define="with_ssl /path/to/ssl"
-
-* Wed Oct 10 2012 Bjorn Munch <bjorn.munch@oracle.com>
-
-- Replace old my-*.cnf config file examples with template my-default.cnf
-
-* Fri Oct 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Let the installation use the new option "--random-passwords" of "mysql_install_db".
-  (Bug# 12794345 Ensure root password)
-- Fix an inconsistency: "new install" vs "upgrade" are told from the (non)existence
-  of "$mysql_datadir/mysql" (holding table "mysql.user" and other system stuff).
-
-* Tue Jul 24 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Add a macro "runselftest":
-  if set to 1 (default), the test suite will be run during the RPM build;
-  this can be oveeridden via the command line by adding
-      --define "runselftest 0"
-  Failures of the test suite will NOT make the RPM build fail!
-
-* Mon Jul 16 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Add the man page for the "mysql_config_editor".
-
-* Mon Jun 11 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging.
-
-* Wed Feb 29 2012 Brajmohan Saxena <brajmohan.saxena@oracle.com>
-
-- Removal all traces of the readline library from mysql (BUG 13738013)
-
-* Wed Sep 28 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Fix duplicate mentioning of "mysql_plugin" and its manual page,
-  it is better to keep alphabetic order in the files list (merging!).
-  
-* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace
-  the RPMs of any configuration (of the current or the preceding release series)
-  by the new ones. This is done by not using the implicitly generated capabilities
-  (which include the configuration name) and relying on more generic ones which
-  just list the function ("server", "client", ...).
-  The implicit generation cannot be prevented, so all these capabilities must be
-  explicitly listed in "Obsoletes:"
-
-* Tue Sep 13 2011 Jonathan Perkin <jonathan.perkin@oracle.com>
-
-- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6.  Due to
-  changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install)
-  this necessitated a move of the libmygcc.a installation to the install
-  phase, which is probably where it belonged in the first place.
-
-* Tue Sep 13 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- "make_win_bin_dist" and its manual are dropped, cmake does it different.
-
-* Thu Sep 08 2011 Daniel Fischer <daniel.fischer@oracle.com>
-
-- Add mysql_plugin man page.
-
-* Tue Aug 30 2011 Tor Didriksen <tor.didriksen@oracle.com>
-
-- Set CXX=g++ by default to add a dependency on libgcc/libstdc++.
-  Also, remove the use of the -fno-exceptions and -fno-rtti flags.
-  TODO: update distro_buildreq/distro_requires
-
-* Tue Aug 30 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Add the manual page for "mysql_plugin" to the server package.
-
-* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Null-upmerge the fix of bug#37165: This spec file is not affected.
-- Replace "/var/lib/mysql" by the spec file variable "%{mysqldatadir}".
-
-* Fri Aug 12 2011 Daniel Fischer <daniel.fischer@oracle.com>
-
-- Source plugin library files list from cmake-generated file.
-
-* Mon Jul 25 2011 Chuck Bell <chuck.bell@oracle.com>
-
-- Added the mysql_plugin client - enables or disables plugins.
-
-* Thu Jul 21 2011 Sunanda Menon <sunanda.menon@oracle.com>
-
-- Fix bug#12561297: Added the MySQL embedded binary
-
-* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Fix bug#45415: "rpm upgrade recreates test database"
-  Let the creation of the "test" database happen only during a new installation,
-  not in an RPM upgrade.
-  This affects both the "mkdir" and the call of "mysql_install_db".
-
-* Thu Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- 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)
-  should still work, and use these locations.
-  The problem was that the fix for bug#27072 did not check for local settings.
-  
-* Mon Jan 31 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- Install the new "manifest" files: "INFO_SRC" and "INFO_BIN".
-
-* Tue Nov 23 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
-
-- EXCEPTIONS-CLIENT has been deleted, remove it from here too
-- Support MYSQL_BUILD_MAKE_JFLAG environment variable for passing
-  a '-j' argument to make.
-
-* Mon Nov 1 2010 Georgi Kodinov <georgi.godinov@oracle.com>
-
-- Added test authentication (WL#1054) plugin binaries
-
-* Wed Oct 6 2010 Georgi Kodinov <georgi.godinov@oracle.com>
-
-- Added example external authentication (WL#1054) plugin binaries
-
-* Wed Aug 11 2010 Joerg Bruehe <joerg.bruehe@oracle.com>
-
-- With a recent spec file cleanup, names have changed: A "-community" part was dropped.
-  Reflect that in the "Obsoletes" specifications.
-- Add a "triggerpostun" to handle the uninstall of the "-community" server RPM.
-- This fixes bug#55015 "MySQL server is not restarted properly after RPM upgrade".
-
-* Tue Jun 15 2010 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- Change the behaviour on installation and upgrade:
-  On installation, do not autostart the server.
-  *Iff* the server was stopped before the upgrade is started, this is taken as a
-  sign the administrator is handling that manually, and so the new server will
-  not be started automatically at the end of the upgrade.
-  The start/stop scripts will still be installed, so the server will be started
-  on the next machine boot.
-  This is the 5.5 version of fixing bug#27072 (RPM autostarting the server).
-
-* Tue Jun 1 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
-
-- Implement SELinux checks from distribution-specific spec file.
-
-* Wed May 12 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
-
-- Large number of changes to build using CMake
-- Introduce distribution-specific RPMs
-- Drop debuginfo, build all binaries with debug/symbols
-- Remove __os_install_post, use native macro
-- Remove _unpackaged_files_terminate_build, make it an error to have
-  unpackaged files
-- Remove cluster RPMs
-
-* Wed Mar 24 2010 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- Add "--with-perfschema" to the configure options.
-
-* Mon Mar 22 2010 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- User "usr/lib*" to allow for both "usr/lib" and "usr/lib64",
-  mask "rmdir" return code 1.
-- Remove "ha_example.*" files from the list, they aren't built.
-
-* Wed Mar 17 2010 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- Fix a wrong path name in handling the debug plugins.
-
-* Wed Mar 10 2010 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- Take the result of the debug plugin build and put it into the optimized tree,
-  so that it becomes part of the final installation;
-  include the files in the packlist. Part of the fixes for bug#49022.
-
-* Mon Mar 01 2010 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- Set "Oracle and/or its affiliates" as the vendor and copyright owner,
-  accept upgrading from packages showing MySQL or Sun as vendor.
-
-* Fri Feb 12 2010 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- Formatting changes:
-  Have a consistent structure of separator lines and of indentation
-  (8 leading blanks => tab).
-- Introduce the variable "src_dir".
-- Give the environment variables "MYSQL_BUILD_CC(CXX)" precedence
-  over "CC" ("CXX").
-- Drop the old "with_static" argument analysis, this is not supported
-  in 5.1 since ages.
-- Introduce variables to control the handlers individually, as well
-  as other options.
-- Use the new "--with-plugin" notation for the table handlers.
-- Drop handling "/etc/rc.d/init.d/mysql", the switch to "/etc/init.d/mysql"
-  was done back in 2002 already.
-- Make "--with-zlib-dir=bundled" the default, add an option to disable it.
-- Add missing manual pages to the file list.
-- Improve the runtime check for "libgcc.a", protect it against being tried
-  with the Intel compiler "icc".
-
-* Mon Jan 11 2010 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- Change RPM file naming:
-  - Suffix like "-m2", "-rc" becomes part of version as "_m2", "_rc".
-  - Release counts from 1, not 0.
-
-* Wed Dec 23 2009 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- The "semisync" plugin file name has lost its introductory "lib",
-  adapt the file lists for the subpackages.
-  This is a part missing from the fix for bug#48351.
-- Remove the "fix_privilege_tables" manual, it does not exist in 5.5
-  (and likely, the whole script will go, too).
-
-* Mon Nov 16 2009 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- Fix some problems with the directives around "tcmalloc" (experimental),
-  remove erroneous traces of the InnoDB plugin (that is 5.1 only).
-
-* Fri Oct 06 2009 Magnus Blaudd <mvensson@mysql.com>
-
-- Removed mysql_fix_privilege_tables
-
-* Fri Oct 02 2009 Alexander Nozdrin <alexander.nozdrin@sun.com>
-
-- "mysqlmanager" got removed from version 5.4, all references deleted.
-
-* Fri Aug 28 2009 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- Merge up from 5.1 to 5.4: Remove handling for the InnoDB plugin.
-
-* Thu Aug 27 2009 Joerg Bruehe <joerg.bruehe@sun.com>
-
-- This version does not contain the "Instance manager", "mysqlmanager":
-  Remove it from the spec file so that packaging succeeds.
-
-* Mon Aug 24 2009 Jonathan Perkin <jperkin@sun.com>
-
-- Add conditionals for bundled zlib and innodb plugin
-
-* Fri Aug 21 2009 Jonathan Perkin <jperkin@sun.com>
-
-- Install plugin libraries in appropriate packages.
-- Disable libdaemon_example and ftexample plugins.
-
-* Thu Aug 20 2009 Jonathan Perkin <jperkin@sun.com>
-
-- Update variable used for mysql-test suite location to match source.
-
-* Fri Nov 07 2008 Joerg Bruehe <joerg@mysql.com>
-
-- Correct yesterday's fix, so that it also works for the last flag,
-  and fix a wrong quoting: un-quoted quote marks must not be escaped.
-
-* Thu Nov 06 2008 Kent Boortz <kent.boortz@sun.com>
-
-- Removed "mysql_upgrade_shell"
-- Removed some copy/paste between debug and normal build
-
-* Thu Nov 06 2008 Joerg Bruehe <joerg@mysql.com>
-
-- Modify CFLAGS and CXXFLAGS such that a debug build is not optimized.
-  This should cover both gcc and icc flags.  Fixes bug#40546.
-
-* Fri Aug 29 2008 Kent Boortz <kent@mysql.com>
-
-- Removed the "Federated" storage engine option, and enabled in all
-
-* Tue Aug 26 2008 Joerg Bruehe <joerg@mysql.com>
-
-- Get rid of the "warning: Installed (but unpackaged) file(s) found:"
-  Some generated files aren't needed in RPMs:
-  - the "sql-bench/" subdirectory
-  Some files were missing:
-  - /usr/share/aclocal/mysql.m4  ("devel" subpackage)
-  - Manual "mysqlbug" ("server" subpackage)
-  - Program "innochecksum" and its manual ("server" subpackage)
-  - Manual "mysql_find_rows" ("client" subpackage)
-  - Script "mysql_upgrade_shell" ("client" subpackage)
-  - Program "ndb_cpcd" and its manual ("ndb-extra" subpackage)
-  - Manuals "ndb_mgm" + "ndb_restore" ("ndb-tools" subpackage)
-
-* Mon Mar 31 2008 Kent Boortz <kent@mysql.com>
-
-- Made the "Federated" storage engine an option
-- Made the "Cluster" storage engine and sub packages an option
-
-* Wed Mar 19 2008 Joerg Bruehe <joerg@mysql.com>
-
-- Add the man pages for "ndbd" and "ndb_mgmd".
-
-* Mon Feb 18 2008 Timothy Smith <tim@mysql.com>
-
-- Require a manual upgrade if the alread-installed mysql-server is
-  from another vendor, or is of a different major version.
-
-* Wed May 02 2007 Joerg Bruehe <joerg@mysql.com>
-
-- "ndb_size.tmpl" is not needed any more,
-  "man1/mysql_install_db.1" lacked the trailing '*'.
-
-* Sat Apr 07 2007 Kent Boortz <kent@mysql.com>
-
-- Removed man page for "mysql_create_system_tables"
-
-* Wed Mar 21 2007 Daniel Fischer <df@mysql.com>
-
-- Add debug server.
-
-* Mon Mar 19 2007 Daniel Fischer <df@mysql.com>
-
-- Remove Max RPMs; the server RPMs contain a mysqld compiled with all
-  features that previously only were built into Max.
-
-* Fri Mar 02 2007 Joerg Bruehe <joerg@mysql.com>
-
-- Add several man pages for NDB which are now created.
-
-* Fri Jan 05 2007 Kent Boortz <kent@mysql.com>
-
-- Put back "libmygcc.a", found no real reason it was removed.
-
-- Add CFLAGS to gcc call with --print-libgcc-file, to make sure the
-  correct "libgcc.a" path is returned for the 32/64 bit architecture.
-
-* Mon Dec 18 2006 Joerg Bruehe <joerg@mysql.com>
-
-- Fix the move of "mysqlmanager" to section 8: Directory name was wrong.
-
-* Thu Dec 14 2006 Joerg Bruehe <joerg@mysql.com>
-
-- Include the new man pages for "my_print_defaults" and "mysql_tzinfo_to_sql"
-  in the server RPM.
-- The "mysqlmanager" man page got moved from section 1 to 8.
-
-* Thu Nov 30 2006 Joerg Bruehe <joerg@mysql.com>
-
-- Call "make install" using "benchdir_root=%{_datadir}",
-  because that is affecting the regression test suite as well.
-
-* Thu Nov 16 2006 Joerg Bruehe <joerg@mysql.com>
-
-- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB)
-  replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading
-  (bug#22081).
-
-* Mon Nov 13 2006 Joerg Bruehe <joerg@mysql.com>
-
-- Add "--with-partition" to all server builds.
-
-- Use "--report-features" in one test run per server build.
-
-* Tue Aug 15 2006 Joerg Bruehe <joerg@mysql.com>
-
-- The "max" server is removed from packages, effective from 5.1.12-beta.
-  Delete all steps to build, package, or install it.
-
-* Mon Jul 10 2006 Joerg Bruehe <joerg@mysql.com>
-
-- Fix a typing error in the "make" target for the Perl script to run the tests.
-
-* Tue Jul 04 2006 Joerg Bruehe <joerg@mysql.com>
-
-- Use the Perl script to run the tests, because it will automatically check
-  whether the server is configured with SSL.
-
-* Tue Jun 27 2006 Joerg Bruehe <joerg@mysql.com>
-
-- move "mysqldumpslow" from the client RPM to the server RPM (bug#20216)
-
-- Revert all previous attempts to call "mysql_upgrade" during RPM upgrade,
-  there are some more aspects which need to be solved before this is possible.
-  For now, just ensure the binary "mysql_upgrade" is delivered and installed.
-
-* Thu Jun 22 2006 Joerg Bruehe <joerg@mysql.com>
-
-- Close a gap of the previous version by explicitly using
-  a newly created temporary directory for the socket to be used
-  in the "mysql_upgrade" operation, overriding any local setting.
-
-* Tue Jun 20 2006 Joerg Bruehe <joerg@mysql.com>
-
-- To run "mysql_upgrade", we need a running server;
-  start it in isolation and skip password checks.
-
-* Sat May 20 2006 Kent Boortz <kent@mysql.com>
-
-- Always compile for PIC, position independent code.
-
-* Wed May 10 2006 Kent Boortz <kent@mysql.com>
-
-- Use character set "all" when compiling with Cluster, to make Cluster
-  nodes independent on the character set directory, and the problem
-  that two RPM sub packages both wants to install this directory.
-
-* Mon May 01 2006 Kent Boortz <kent@mysql.com>
-
-- Use "./libtool --mode=execute" instead of searching for the
-  executable in current directory and ".libs".
-
-* Fri Apr 28 2006 Kent Boortz <kent@mysql.com>
-
-- Install and run "mysql_upgrade"
-
-* Wed Apr 12 2006 Jim Winstead <jimw@mysql.com>
-
-- Remove sql-bench, and MySQL-bench RPM (will be built as an independent
-  project from the mysql-bench repository)
-
-* Tue Apr 11 2006 Jim Winstead <jimw@mysql.com>
-
-- Remove old mysqltestmanager and related programs
-* Sat Apr 01 2006 Kent Boortz <kent@mysql.com>
-
-- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS
-
-* Wed Mar 07 2006 Kent Boortz <kent@mysql.com>
-
-- Changed product name from "Community Edition" to "Community Server"
-
-* Mon Mar 06 2006 Kent Boortz <kent@mysql.com>
-
-- Fast mutexes is now disabled by default, but should be
-  used in Linux builds.
-
-* Mon Feb 20 2006 Kent Boortz <kent@mysql.com>
-
-- Reintroduced a max build
-- Limited testing of 'debug' and 'max' servers
-- Berkeley DB only in 'max'
-
-* Mon Feb 13 2006 Joerg Bruehe <joerg@mysql.com>
-
-- Use "-i" on "make test-force";
-  this is essential for later evaluation of this log file.
-
-* Thu Feb 09 2006 Kent Boortz <kent@mysql.com>
-
-- Pass '-static' to libtool, link static with our own libraries, dynamic
-  with system libraries.  Link with the bundled zlib.
-
-* Wed Feb 08 2006 Kristian Nielsen <knielsen@mysql.com>
-
-- Modified RPM spec to match new 5.1 debug+max combined community packaging.
-
-* Sun Dec 18 2005 Kent Boortz <kent@mysql.com>
-
-- Added "client/mysqlslap"
-
-* Mon Dec 12 2005 Rodrigo Novo <rodrigo@mysql.com>
-
-- Added zlib to the list of (static) libraries installed
-- Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld)
-- Compile MySQL with bundled zlib
-- Fixed %packager name to "MySQL Production Engineering Team"
-
-* Mon Dec 05 2005 Joerg Bruehe <joerg@mysql.com>
-
-- Avoid using the "bundled" zlib on "shared" builds:
-  As it is not installed (on the build system), this gives dependency
-  problems with "libtool" causing the build to fail.
-  (Change was done on Nov 11, but left uncommented.)
-
-* Tue Nov 22 2005 Joerg Bruehe <joerg@mysql.com>
-
-- Extend the file existence check for "init.d/mysql" on un-install
-  to also guard the call to "insserv"/"chkconfig".
-
-* Thu Oct 27 2005 Lenz Grimmer <lenz@grimmer.com>
-
-- added more man pages
-
-* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
-
-- Made yaSSL support an option (off by default)
-
-* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
-
-- Enabled yaSSL support
-
-* Sat Oct 15 2005 Kent Boortz <kent@mysql.com>
-
-- Give mode arguments the same way in all places
-- Moved copy of mysqld.a to "standard" build, but
-  disabled it as we don't do embedded yet in 5.0
-
-* Fri Oct 14 2005 Kent Boortz <kent@mysql.com>
-
-- For 5.x, always compile with --with-big-tables
-- Copy the config.log file to location outside
-  the build tree
-
-* Fri Oct 14 2005 Kent Boortz <kent@mysql.com>
-
-- Removed unneeded/obsolete configure options
-- Added archive engine to standard server
-- Removed the embedded server from experimental server
-- Changed suffix "-Max" => "-max"
-- Changed comment string "Max" => "Experimental"
-
-* Thu Oct 13 2005 Lenz Grimmer <lenz@mysql.com>
-
-- added a usermod call to assign a potential existing mysql user to the
-  correct user group (BUG#12823)
-- Save the perror binary built during Max build so it supports the NDB
-  error codes (BUG#13740)
-- added a separate macro "mysqld_group" to be able to define the
-  user group of the mysql user seperately, if desired.
-
-* Thu Sep 29 2005 Lenz Grimmer <lenz@mysql.com>
-
-- 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 <lenz@mysql.com>
-
-- Fixed the creation of the mysql user group account in the postinstall
-  section (BUG 12348)
-- Fixed enabling the Archive storage engine in the Max binary
-
-* Tue Aug 02 2005 Lenz Grimmer <lenz@mysql.com>
-
-- Fixed the Requires: tag for the server RPM (BUG 12233)
-
-* Fri Jul 15 2005 Lenz Grimmer <lenz@mysql.com>
-
-- create a "mysql" user group and assign the mysql user account to that group
-  in the server postinstall section. (BUG 10984)
-
-* Tue Jun 14 2005 Lenz Grimmer <lenz@mysql.com>
-
-- Do not build statically on i386 by default, only when adding either "--with
-  static" or "--define '_with_static 1'" to the RPM build options. Static
-  linking really only makes sense when linking against the specially patched
-  glibc 2.2.5.
-
-* Mon Jun 06 2005 Lenz Grimmer <lenz@mysql.com>
-
-- added mysql_client_test to the "bench" subpackage (BUG 10676)
-- added the libndbclient static and shared libraries (BUG 10676)
-
-* Wed Jun 01 2005 Lenz Grimmer <lenz@mysql.com>
-
-- use "mysqldatadir" variable instead of hard-coding the path multiple times
-- use the "mysqld_user" variable on all occasions a user name is referenced
-- removed (incomplete) Brazilian translations
-- removed redundant release tags from the subpackage descriptions
-
-* Wed May 25 2005 Joerg Bruehe <joerg@mysql.com>
-
-- Added a "make clean" between separate calls to "BuildMySQL".
-
-* Thu May 12 2005 Guilhem Bichot <guilhem@mysql.com>
-
-- Removed the mysql_tableinfo script made obsolete by the information schema
-
-* Wed Apr 20 2005 Lenz Grimmer <lenz@mysql.com>
-
-- Enabled the "blackhole" storage engine for the Max RPM
-
-* Wed Apr 13 2005 Lenz Grimmer <lenz@mysql.com>
-
-- removed the MySQL manual files (html/ps/texi) - they have been removed
-  from the MySQL sources and are now available seperately.
-
-* Mon Apr 4 2005 Petr Chardin <petr@mysql.com>
-
-- old mysqlmanager, mysqlmanagerc and mysqlmanager-pwger renamed into
-  mysqltestmanager, mysqltestmanager and mysqltestmanager-pwgen respectively
-
-* Fri Mar 18 2005 Lenz Grimmer <lenz@mysql.com>
-
-- Disabled RAID in the Max binaries once and for all (it has finally been
-  removed from the source tree)
-
-* Sun Feb 20 2005 Petr Chardin <petr@mysql.com>
-
-- Install MySQL Instance Manager together with mysqld, touch mysqlmanager
-  password file
-
-* Mon Feb 14 2005 Lenz Grimmer <lenz@mysql.com>
-
-- Fixed the compilation comments and moved them into the separate build sections
-  for Max and Standard
-
-* Mon Feb 7 2005 Tomas Ulin <tomas@mysql.com>
-
-- enabled the "Ndbcluster" storage engine for the max binary
-- added extra make install in ndb subdir after Max build to get ndb binaries
-- added packages for ndbcluster storage engine
-
-* Fri Jan 14 2005 Lenz Grimmer <lenz@mysql.com>
-
-- replaced obsoleted "BuildPrereq" with "BuildRequires" instead
-
-* Thu Jan 13 2005 Lenz Grimmer <lenz@mysql.com>
-
-- enabled the "Federated" storage engine for the max binary
-
-* Tue Jan 04 2005 Petr Chardin <petr@mysql.com>
-
-- ISAM and merge storage engines were purged. As well as appropriate
-  tools and manpages (isamchk and isamlog)
-
-* Thu Dec 31 2004 Lenz Grimmer <lenz@mysql.com>
-
-- enabled the "Archive" storage engine for the max binary
-- enabled the "CSV" storage engine for the max binary
-- enabled the "Example" storage engine for the max binary
-
-* Thu Aug 26 2004 Lenz Grimmer <lenz@mysql.com>
-
-- MySQL-Max now requires MySQL-server instead of MySQL (BUG 3860)
-
-* Fri Aug 20 2004 Lenz Grimmer <lenz@mysql.com>
-
-- do not link statically on IA64/AMD64 as these systems do not have
-  a patched glibc installed
-
-* Tue Aug 10 2004 Lenz Grimmer <lenz@mysql.com>
-
-- Added libmygcc.a to the devel subpackage (required to link applications
-  against the the embedded server libmysqld.a) (BUG 4921)
-
-* Mon Aug 09 2004 Lenz Grimmer <lenz@mysql.com>
-
-- Added EXCEPTIONS-CLIENT to the "devel" package
-
-* Thu Jul 29 2004 Lenz Grimmer <lenz@mysql.com>
-
-- disabled OpenSSL in the Max binaries again (the RPM packages were the
-  only exception to this anyway) (BUG 1043)
-
-* Wed Jun 30 2004 Lenz Grimmer <lenz@mysql.com>
-
-- fixed server postinstall (mysql_install_db was called with the wrong
-  parameter)
-
-* Thu Jun 24 2004 Lenz Grimmer <lenz@mysql.com>
-
-- added mysql_tzinfo_to_sql to the server subpackage
-- run "make clean" instead of "make distclean"
-
-* Mon Apr 05 2004 Lenz Grimmer <lenz@mysql.com>
-
-- added ncurses-devel to the build prerequisites (BUG 3377)
-
-* Thu Feb 12 2004 Lenz Grimmer <lenz@mysql.com>
-
-- when using gcc, _always_ use CXX=gcc
-- replaced Copyright with License field (Copyright is obsolete)
-
-* Tue Feb 03 2004 Lenz Grimmer <lenz@mysql.com>
-
-- added myisam_ftdump to the Server package
-
-* Tue Jan 13 2004 Lenz Grimmer <lenz@mysql.com>
-
-- link the mysql client against libreadline instead of libedit (BUG 2289)
-
-* Mon Dec 22 2003 Lenz Grimmer <lenz@mysql.com>
-
-- marked /etc/logrotate.d/mysql as a config file (BUG 2156)
-
-* Fri Dec 13 2003 Lenz Grimmer <lenz@mysql.com>
-
-- fixed file permissions (BUG 1672)
-
-* Thu Dec 11 2003 Lenz Grimmer <lenz@mysql.com>
-
-- made testing for gcc3 a bit more robust
-
-* Fri Dec 05 2003 Lenz Grimmer <lenz@mysql.com>
-
-- added missing file mysql_create_system_tables to the server subpackage
-
-* Fri Nov 21 2003 Lenz Grimmer <lenz@mysql.com>
-
-- removed dependency on MySQL-client from the MySQL-devel subpackage
-  as it is not really required. (BUG 1610)
-
-* Fri Aug 29 2003 Lenz Grimmer <lenz@mysql.com>
-
-- Fixed BUG 1162 (removed macro names from the changelog)
-- Really fixed BUG 998 (disable the checking for installed but
-  unpackaged files)
-
-* Tue Aug 05 2003 Lenz Grimmer <lenz@mysql.com>
-
-- Fixed BUG 959 (libmysqld not being compiled properly)
-- Fixed BUG 998 (RPM build errors): added missing files to the
-  distribution (mysql_fix_extensions, mysql_tableinfo, mysqldumpslow,
-  mysql_fix_privilege_tables.1), removed "-n" from install section.
-
-* Wed Jul 09 2003 Lenz Grimmer <lenz@mysql.com>
-
-- removed the GIF Icon (file was not included in the sources anyway)
-- removed unused variable shared_lib_version
-- do not run automake before building the standard binary
-  (should not be necessary)
-- add server suffix '-standard' to standard binary (to be in line
-  with the binary tarball distributions)
-- Use more RPM macros (_exec_prefix, _sbindir, _libdir, _sysconfdir,
-  _datadir, _includedir) throughout the spec file.
-- allow overriding CC and CXX (required when building with other compilers)
-
-* Fri May 16 2003 Lenz Grimmer <lenz@mysql.com>
-
-- re-enabled RAID again
-
-* Wed Apr 30 2003 Lenz Grimmer <lenz@mysql.com>
-
-- disabled MyISAM RAID (--with-raid) - it throws an assertion which
-  needs to be investigated first.
-
-* Mon Mar 10 2003 Lenz Grimmer <lenz@mysql.com>
-
-- added missing file mysql_secure_installation to server subpackage
-  (BUG 141)
-
-* Tue Feb 11 2003 Lenz Grimmer <lenz@mysql.com>
-
-- re-added missing pre- and post(un)install scripts to server subpackage
-- added config file /etc/my.cnf to the file list (just for completeness)
-- make sure to create the datadir with 755 permissions
-
-* Mon Jan 27 2003 Lenz Grimmer <lenz@mysql.com>
-
-- removed unused CC and CXX variables
-- CFLAGS and CXXFLAGS should honor RPM_OPT_FLAGS
-
-* Fri Jan 24 2003 Lenz Grimmer <lenz@mysql.com>
-
-- renamed package "MySQL" to "MySQL-server"
-- fixed Copyright tag
-- added mysql_waitpid to client subpackage (required for mysql-test-run)
-
-* Wed Nov 27 2002 Lenz Grimmer <lenz@mysql.com>
-
-- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of
-  Linux distributions now support this scheme as proposed by the LSB either
-  directly or via a compatibility symlink)
-- Use new "restart" init script action instead of starting and stopping
-  separately
-- Be more flexible in activating the automatic bootup - use insserv (on
-  older SuSE versions) or chkconfig (Red Hat, newer SuSE versions and
-  others) to create the respective symlinks
-
-* Wed Sep 25 2002 Lenz Grimmer <lenz@mysql.com>
-
-- MySQL-Max now requires MySQL >= 4.0 to avoid version mismatches
-  (mixing 3.23 and 4.0 packages)
-
-* Fri Aug 09 2002 Lenz Grimmer <lenz@mysql.com>
-
-- Turn off OpenSSL in MySQL-Max for now until it works properly again
-- enable RAID for the Max binary instead
-- added compatibility link: safe_mysqld -> mysqld_safe to ease the
-  transition from 3.23
-
-* Thu Jul 18 2002 Lenz Grimmer <lenz@mysql.com>
-
-- Reworked the build steps a little bit: the Max binary is supposed
-  to include OpenSSL, which cannot be linked statically, thus trying
-  to statically link against a special glibc is futile anyway
-- because of this, it is not required to make yet another build run
-  just to compile the shared libs (saves a lot of time)
-- updated package description of the Max subpackage
-- clean up the BuildRoot directory afterwards
-
-* Mon Jul 15 2002 Lenz Grimmer <lenz@mysql.com>
-
-- Updated Packager information
-- Fixed the build options: the regular package is supposed to
-  include InnoDB and linked statically, while the Max package
-  should include BDB and SSL support
-
-* Fri May 03 2002 Lenz Grimmer <lenz@mysql.com>
-
-- Use more RPM macros (e.g. infodir, mandir) to make the spec
-  file more portable
-- reorganized the installation of documentation files: let RPM
-  take care of this
-- reorganized the file list: actually install man pages along
-  with the binaries of the respective subpackage
-- do not include libmysqld.a in the devel subpackage as well, if we
-  have a special "embedded" subpackage
-- reworked the package descriptions
-
-* Mon Oct  8 2001 Monty
-
-- Added embedded server as a separate RPM
-
-* Fri Apr 13 2001 Monty
-
-- Added mysqld-max to the distribution
-
-* Tue Jan 2  2001  Monty
-
-- Added mysql-test to the bench package
-
-* Fri Aug 18 2000 Tim Smith <tim@mysql.com>
-
-- Added separate libmysql_r directory; now both a threaded
-  and non-threaded library is shipped.
-
-* Wed Sep 28 1999 David Axmark <davida@mysql.com>
-
-- Added the support-files/my-example.cnf to the docs directory.
-
-- Removed devel dependency on base since it is about client
-  development.
-
-* Wed Sep 8 1999 David Axmark <davida@mysql.com>
-
-- Cleaned up some for 3.23.
-
-* Thu Jul 1 1999 David Axmark <davida@mysql.com>
-
-- Added support for shared libraries in a separate sub
-  package. Original fix by David Fox (dsfox@cogsci.ucsd.edu)
-
-- The --enable-assembler switch is now automatically disables on
-  platforms there assembler code is unavailable. This should allow
-  building this RPM on non i386 systems.
-
-* Mon Feb 22 1999 David Axmark <david@detron.se>
-
-- Removed unportable cc switches from the spec file. The defaults can
-  now be overridden with environment variables. This feature is used
-  to compile the official RPM with optimal (but compiler version
-  specific) switches.
-
-- Removed the repetitive description parts for the sub rpms. Maybe add
-  again if RPM gets a multiline macro capability.
-
-- Added support for a pt_BR translation. Translation contributed by
-  Jorge Godoy <jorge@bestway.com.br>.
-
-* Wed Nov 4 1998 David Axmark <david@detron.se>
-
-- A lot of changes in all the rpm and install scripts. This may even
-  be a working RPM :-)
-
-* Sun Aug 16 1998 David Axmark <david@detron.se>
-
-- A developers changelog for MySQL is available in the source RPM. And
-  there is a history of major user visible changed in the Reference
-  Manual.  Only RPM specific changes will be documented here.
index 7487d5acc0f9d32e55c6c23cb3d0900be1a92e55..41013fe28ed90337d35967bb335d84b81f01f31d 100644 (file)
 # 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
+
+# Prevent Debian's init scripts from calling systemctl
+
+_SYSTEMCTL_SKIP_REDIRECT=true
  
 # 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 +338,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 +391,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"`
index c72ca3926d8101db247cf3b9459af9f85c97536c..ccc8cacab93034415d9a44786077291cd9c1f85b 100644 (file)
@@ -1,4 +1,4 @@
-# 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
 %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
+%global previous_tag      5.5
 
 #
 # Macros we use which are not available in all supported versions of RPM
@@ -79,9 +82,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)
 %if %{undefined product_suffix}
   %if %{defined short_product_tag}
     %define product_suffix      -%{short_product_tag}
+    %define previous_suffix     -%{previous_tag}
   %else
     %define product_suffix      %{nil}
   %endif
 # ----------------------------------------------------------------------------
 # 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 openssl-devel
 %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
-  %endif
+%if 0%{?rhel} == 7
+BuildRequires: perl(Time::HiRes) perl(Env)
+%endif
+
+%if 0%{?suse_version}
+%if 0%{?suse_version} == 1110
+BuildRequires: gdbm-devel gperf openldap2-client procps pwdutils libopenssl-devel
 %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
+BuildRequires: libopenssl-devel
+%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
+# In case of problems, check "/etc/rpm/macros.dist"
+%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
+%endif
+# CentOS 7 would force ".el7.centos", we want to avoid that.
+%if 0%{?rhel} == 7
+  %define dist .el7
 %endif
 
 # Avoid debuginfo RPMs, leaves binaries unstripped
 %define debug_package   %{nil}
 
-# Hack to work around bug in RHEL5 __os_install_post macro, wrong inverted
-# test for __debug_package
-%define __strip         /bin/true
-
 # ----------------------------------------------------------------------------
 # Support optional "tcmalloc" library (experimental)
 # ----------------------------------------------------------------------------
 %define WITH_TCMALLOC 0
 %endif
 
+##############################################################################
+# Settings for the "compatibility libs", the version depends on the target platform
+##############################################################################
+
+# To differ between current main version and libs-compat:
+%global currentlib            18
+
+%if 0%{?rhel} == 6
+%global compatver             5.1.73
+%global compatlib             16
+%global compatsrc             https://cdn.mysql.com/Downloads/MySQL-5.1/mysql-%{compatver}.tar.gz
+%global compatch              mysql-5173-charset-dir.patch
+%endif
+
+# mysql-wsrep-5.5 has libmysqlclient.so.18, as have 5.6 and 5.7; 
+# same as preinstalled mariadb-libs, so we currently need no libs-compat on RHEL 7.
+# This becomes relevant with a MySQL 5.8 (or higher) that has a libmysqlclient.so.19 or higher.
+#
+# %%if 0%%{?rhel} == 7
+# %%global compatver             5.5.45
+# %%global compatlib             18
+# %%global compatsrc             https://cdn.mysql.com/Downloads/MySQL-5.5/mysql-%%{compatver}.tar.gz
+# %%global compatch              mysql-5545-charset-dir.patch
+# # By default, a build will include the bundeled "yaSSL" library for SSL.
+# %%{?with_ssl:                  %%global ssl_option -DWITH_SSL=%%{with_ssl}}
+# %%endif
+
+%if 0%{?compatlib}
+# Attention: "compat_src_dir" is the old version (e.g. 5.1.73), depends on platform
+%global compat_src_dir               mysql-%{compatver}
+%endif
+
 ##############################################################################
 # Configuration based upon above user input, not to be set directly
 ##############################################################################
 %else
 %define license_files_server    %{src_dir}/COPYING %{src_dir}/README
 %define license_type            GPL
+%define compat_license_files_server   %{compat_src_dir}/COPYING %{compat_src_dir}/README
 %endif
 
 ##############################################################################
 # Main spec file section
 ##############################################################################
 
-Name:           MySQL%{product_suffix}
+Name:           mysql-wsrep%{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
+%if 0%{?compatlib}
+Source7:        %{compatsrc}
+%endif
+Source99:       mysql-rpmlintrc
+Patch0:          cmake-no-wix.patch
+%if 0%{?compatlib}
+Patch7:         %{compatch}
+%if 0%{?compatlib} == 18
+Patch8:         mysql-5.5-libmysqlclient-symbols.patch
+%endif
+%endif
 URL:            http://www.mysql.com/
-Packager:       MySQL Release Engineering <mysql-build@oss.oracle.com> 
+Packager:       Codership Oy <info@galeracluster.com>
 Vendor:         %{mysql_vendor}
-BuildRequires:  %{distro_buildreq}
+# BuildRequires:  %{distro_buildreq}
+#wsrep_patch_tag
+
+Requires:       mysql-wsrep-server%{product_suffix}
+Requires:       mysql-wsrep-client%{product_suffix}
+
+%if %{defined previous_suffix}
+Obsoletes:      mysql-wsrep%{previous_suffix}
+%endif
 
 # 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
@@ -278,14 +292,38 @@ The MySQL web site (http://www.mysql.com/) provides the latest
 news and information about the MySQL software. Also please see the
 documentation and the manual for more information.
 
+This is a meta package of the MySQL software combined with the "wsrep plugin"
+aka "Galera Cluster", all governed by the GPL.
+It causes the installation of both the server and the client subpackages
+so that the machine can be used both as a local database server and as a node
+in a MySQL Galera Cluster.
+
 ##############################################################################
 # Sub package definition
 ##############################################################################
 
-%package -n MySQL-server%{product_suffix}
+%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 %{defined previous_suffix}
+Obsoletes:      mysql-wsrep-server%{previous_suffix}
+%endif
 %if 0%{?commercial}
 Obsoletes:      MySQL-server
 %else
@@ -295,10 +333,14 @@ Obsoletes:      mysql-server < %{version}-%{release}
 Obsoletes:      mysql-server-advanced
 Obsoletes:      MySQL-server-classic MySQL-server-community MySQL-server-enterprise
 Obsoletes:      MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
+%if 0%{?rhel}
+# RedHat has /usr/share/mysql/* in a separate package
+Obsoletes:      mysql-common
+%endif
 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,13 +361,19 @@ 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.
 
-If you want to access and work with the database, you have to install
-package "MySQL-client%{product_suffix}" as well!
+Built with wsrep patch %{wsrep_version}, to be a node in a Galera cluster.
+
+If you want to access and work with the database locally, you have to install
+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 %{defined previous_suffix}
+Obsoletes:      mysql-wsrep-client%{previous_suffix}
+%endif
 %if 0%{?commercial}
 Obsoletes:      MySQL-client
 %else
@@ -337,16 +385,22 @@ Obsoletes:      MySQL-client-classic MySQL-client-community MySQL-client-enterpr
 Obsoletes:      MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
 Provides:       mysql = %{version}-%{release} 
 Provides:       mysql%{?_isa} = %{version}-%{release}
+Provides:       mysql-client = %{version}
+Provides:       MySQL-client = %{version}
 
-%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 %{defined previous_suffix}
+Obsoletes:      mysql-wsrep-test%{previous_suffix}
+%endif
 %if 0%{?commercial}
 Requires:       MySQL-client-advanced perl
 Obsoletes:      MySQL-test
@@ -358,19 +412,25 @@ Obsoletes:      mysql-test < %{version}-%{release}
 Obsoletes:      mysql-test-advanced
 Obsoletes:      MySQL-test-classic MySQL-test-community MySQL-test-enterprise
 Obsoletes:      MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
+Obsoletes:      mysql-bench
+Obsoletes:      MySQL-bench
 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 %{defined previous_suffix}
+Obsoletes:      mysql-wsrep-devel%{previous_suffix}
+%endif
 %if 0%{?commercial}
 Obsoletes:      MySQL-devel
 %else
@@ -383,16 +443,20 @@ 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 %{defined previous_suffix}
+Obsoletes:      mysql-wsrep-shared%{previous_suffix}
+%endif
 %if 0%{?commercial}
 Obsoletes:      MySQL-shared
 %else
@@ -403,11 +467,56 @@ Obsoletes:      MySQL-shared-pro-cert MySQL-shared-pro-gpl
 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
+# RHEL uses other names:
+Obsoletes:      mysql-libs
+# Necessary on RHEL 7, no harm on other platforms:
+Obsoletes:      mariadb-libs
 
-%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.
 
+# ----------------------------------------------------------------------------
+%if 0%{?compatlib}
+%package -n mysql-wsrep-libs-compat%{product_suffix}
+Summary:        Shared libraries for MySQL %{compatver} database client applications
+Group:          Applications/Databases
+
+%if %{defined previous_suffix}
+Obsoletes:      mysql-wsrep-libs-compat%{previous_suffix}
+%endif
+Provides:       mysql-libs-compat = %{version}
+Provides:       mysql-libs-compat%{?_isa} = %{version}
+Obsoletes:      mysql-libs-compat < %{version}
+Provides:       MySQL-shared-compat%{?_isa} = %{version}
+Obsoletes:      MySQL-shared-compat < %{version}
+
+# Dealing with RHEL 6 and upwards (and compatible ...)
+# Directly, we replace "libs" only; but RedHat "client" and "server" need files from "libs"
+Provides:       mysql-libs = %{compatver}
+Obsoletes:      mysql-libs < %{version}
+
+%if 0%{?rhel} > 6
+# Dealing with RHEL 7 and upwards (and compatible ...)
+# Above general section for RHEL also applies, it deals with "mysql" packages.
+# But with RHEL 7, we also get "mariadb" ...
+Obsoletes:      mariadb-libs
+%endif
+
+%description -n mysql-wsrep-libs-compat%{product_suffix}
+The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+and robust SQL (Structured Query Language) database server.
+See the MySQL web site (http://www.mysql.com/) for further information,
+including its dual licensing (GNU GPL or commercial licenses).
+
+This package contains the shared libraries for (old) MySQL %{compatver} client
+applications.
+It is intended for RHEL %{?rhel} and compatible distributions,
+to satisfy the dependencies of several applications shipping with that distro
+while the MySQL software on the machine is updated to a newer release series.
+
+%endif
+
 # ----------------------------------------------------------------------------
 %package -n MySQL-embedded%{product_suffix}
 Summary:        MySQL - Embedded library
@@ -425,7 +534,7 @@ 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}
+Provides:       mysql-embedded%{?_isa} = %{version}-%{release}
 
 %description -n MySQL-embedded%{product_suffix}
 This package contains the MySQL server as an embedded library.
@@ -441,10 +550,93 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
 
 ##############################################################################
 %prep
-%setup -T -a 0 -c -n %{src_dir}
+%if 0%{?compatlib}
+%setup -q -T -a 0 -a 7 -c -n %{name}
+# -q = quiet,  -T = no default unpack,  -n = source dir name,  -c = create,  -a = unpack after cd
+# https://docs.fedoraproject.org/ro/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04.html
+# http://rpm.org/max-rpm-snapshot/s1-rpm-inside-macros.html
+pushd %{compat_src_dir}
+%patch7 -p 1
+%if 0%{?compatlib} == 18
+%patch8 -p 1
+%endif
+popd
+%else
+%setup -q -T -a 0      -c -n %{name}
+%endif # 0%{?compatlib}
+
+# 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.
+pushd %{src_dir}
+%patch0 -p1
+#wsrep_apply_patch_tag
+popd
+
 ##############################################################################
 %build
 
+# Build compat libs
+%if 0%{?compatlib}
+(
+%if 0%{?compatlib} == 16
+# RHEL 6: MySQL 5.1, using traditional "configure ; make"
+export CC="gcc" CXX="g++"
+export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv"
+export CXXFLAGS="$CFLAGS %{?el6:-felide-constructors} -fno-rtti -fno-exceptions"
+pushd %{compat_src_dir}
+%configure \
+    --with-readline \
+    --without-debug \
+    --enable-shared \
+    --localstatedir=/var/lib/mysql \
+    --with-unix-socket-path=/var/lib/mysql/mysql.sock \
+    --with-mysqld-user="mysql" \
+    --with-extra-charsets=all \
+    --enable-local-infile \
+    --enable-largefile \
+    --enable-thread-safe-client \
+    --with-ssl=%{_prefix} \
+    --with-embedded-server \
+    --with-big-tables \
+    --with-pic \
+    --with-plugin-innobase \
+    --with-plugin-innodb_plugin \
+    --with-plugin-partition \
+    --disable-dependency-tracking
+make %{?_smp_mflags}
+popd
+%endif
+#####
+%if 0%{?compatlib} == 18
+# RHEL 7: MySQL 5.5, using "cmake ; make"
+mkdir release
+cd release
+cmake ../%{compat_src_dir} \
+         -DBUILD_CONFIG=mysql_release \
+         -DINSTALL_LAYOUT=RPM \
+         -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+         -DENABLE_DTRACE=OFF \
+         -DCMAKE_C_FLAGS="%{optflags}" \
+         -DCMAKE_CXX_FLAGS="%{optflags}" \
+         -DINSTALL_LIBDIR="%{_lib}/mysql" \
+         -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
+         -DINSTALL_SQLBENCHDIR=share \
+         -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
+         -DFEATURE_SET="%{feature_set}" \
+         -DWITH_EMBEDDED_SERVER=1 \
+         -DWITH_EMBEDDED_SHARED_LIBRARY=1 \
+         %{?ssl_option} \
+         -DCOMPILATION_COMMENT="%{compilation_comment_release}" \
+         -DMYSQL_SERVER_SUFFIX="%{?server_suffix}"
+echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
+make %{?_smp_mflags} VERBOSE=1
+cd ..
+%endif
+)
+%endif
+
+pushd %{src_dir}
+
 # Fail quickly and obviously if user tries to build as root
 %if %runselftest
     if [ x"`id -u`" = x0 ]; then
@@ -481,13 +673,13 @@ 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.
+# By default, a build will use the system library for SSL.
 # However, there may be a need to override.
 # Protect against undefined variables if there is no override option.
 %if %{undefined with_ssl}
-%define ssl_option   %{nil}
+%define ssl_option   -DWITH_SSL=system
 %else
 %define ssl_option   -DWITH_SSL=%{with_ssl}
 %endif
@@ -500,6 +692,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 +700,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 +726,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
 )
@@ -546,12 +746,40 @@ mkdir release
 
   (cd release && make test-bt-fast || true)
 %endif
+popd
 
 ##############################################################################
 %install
+%if 0%{?compatlib}
+(
+cd $RPM_BUILD_DIR/%{name}
+
+# Install compat libs
+# This must be done *before* the current libs are installed, for the "rm *.{a,la,so}"
+%if 0%{?compatlib} == 16
+for dir in mysql-%{compatver}/libmysql mysql-%{compatver}/libmysql_r ; do
+%else
+for dir in            release/libmysql            ; do
+%endif
+    pushd $dir
+    make DESTDIR=%{buildroot} install
+    popd
+done
+rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient{,_r}.{a,la,so}
+
+# "charsets/"
+install -d -m 0755 %{buildroot}/usr/share/mysql/charsets-%{compatver}/
+install -m 644 mysql-%{compatver}/sql/share/charsets/* %{buildroot}/usr/share/mysql/charsets-%{compatver}/
+
+# Add libdir to linker
+install -d -m 0755 %{buildroot}%{_sysconfdir}/ld.so.conf.d
+echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf
+)
+%endif
 
 RBR=$RPM_BUILD_ROOT
-MBD=$RPM_BUILD_DIR/%{src_dir}
+MBD=$RPM_BUILD_DIR/%{name}/%{src_dir}
+cd $MBD
 
 # Ensure that needed directories exists
 install -d $RBR%{_sysconfdir}/{logrotate.d,init.d}
@@ -572,7 +800,7 @@ mkdir -p $RBR%{_sysconfdir}/my.cnf.d
 )
 
 # FIXME: at some point we should stop doing this and just install everything
-# FIXME: directly into %{_libdir}/mysql - perhaps at the same time as renaming
+# FIXME: directly into %%{_libdir}/mysql - perhaps at the same time as renaming
 # FIXME: the shared libraries to use libmysql*-$major.$minor.so syntax
 mv -v $RBR/%{_libdir}/*.a $RBR/%{_libdir}/mysql/
 
@@ -582,16 +810,26 @@ 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
 
+# Get the list of "_datadir" files, remove those that go into "libs-compat"
+find $RBR%{_datadir}/mysql -type f -print | sed -e "s=$RBR==" \
+  | fgrep -v "charsets-%{compatver}" | sort >> $MBD/release/support-files/plugins.files
+
 %if %{WITH_TCMALLOC}
 # Even though this is a shared library, put it under /usr/lib*/mysql, so it
 # doesn't conflict with possible shared lib by the same name in /usr/lib*.  See
@@ -602,13 +840,15 @@ install -m 644 "%{malloc_lib_source}" \
 
 # Remove man pages we explicitly do not want to package, avoids 'unpackaged
 # files' warning.
-# This has become obsolete:  rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
+# This has become obsolete:  rm -f $RBR%%{_mandir}/man1/make_win_bin_dist.1*
+
+%check
 
 ##############################################################################
 #  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.
 
@@ -618,7 +858,7 @@ install -m 644 "%{malloc_lib_source}" \
 # Check local settings to support them.
 if [ -x %{_bindir}/my_print_defaults ]
 then
-  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
   PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`
 fi
 if [ -z "$mysql_datadir" ]
@@ -723,7 +963,7 @@ esac
 
 STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
 
-if [ -f $STATUS_FILE ]; then
+if [ -f "$STATUS_FILE" ]; then
        echo "Some previous upgrade was not finished:"
        ls -ld $STATUS_FILE
        echo "Please check its status, then do"
@@ -786,7 +1026,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.
 
@@ -796,7 +1036,7 @@ fi
 # Check local settings to support them.
 if [ -x %{_bindir}/my_print_defaults ]
 then
-  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
 fi
 if [ -z "$mysql_datadir" ]
 then
@@ -809,8 +1049,8 @@ STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
 # ----------------------------------------------------------------------
 # Create data directory if needed, check whether upgrade or install
 # ----------------------------------------------------------------------
-if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi
-if [ -f $STATUS_FILE ] ; then
+if [ ! -d "$mysql_datadir" ] ; then mkdir -m 755 "$mysql_datadir" ; fi
+if [ -f "$STATUS_FILE" ] ; then
        SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
 else
        SERVER_TO_START=''
@@ -946,7 +1186,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 +1215,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.
@@ -994,7 +1234,7 @@ fi
 # Check local settings to support them.
 if [ -x %{_bindir}/my_print_defaults ]
 then
-  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
 fi
 if [ -z "$mysql_datadir" ]
 then
@@ -1005,7 +1245,7 @@ NEW_VERSION=%{mysql_version}-%{release}
 STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST  # Note the difference!
 STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
 
-if [ -f $STATUS_FILE ] ; then
+if [ -f "$STATUS_FILE" ] ; then
        SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
 else
        # This should never happen, but let's be prepared
@@ -1046,15 +1286,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 %{src_dir}/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 release/Docs/INFO_BIN*
-%doc release/support-files/my-default.cnf
+%doc %{src_dir}/release/Docs/INFO_SRC*
+%doc %{src_dir}/release/Docs/INFO_BIN*
+%doc %{src_dir}/release/support-files/my-default.cnf
+%doc %{src_dir}/Docs/README-wsrep
+%doc %{src_dir}/release/support-files/wsrep.cnf
+%doc %{src_dir}/release/support-files/wsrep_notify
 
 %if 0%{?commercial}
 %doc %attr(644, root, root) %{_infodir}/mysql.info*
@@ -1090,6 +1337,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 +1365,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}
@@ -1129,11 +1385,12 @@ echo "====="                                     >> $STATUS_HISTORY
 
 %attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
 %attr(755, root, root) %{_sysconfdir}/init.d/mysql
-%attr(755, root, root) %{_datadir}/mysql/
+# %%attr(755, root, root) %%{_datadir}/mysql/  ## Contained in "plugins.files", see "%%install" code
 %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}
@@ -1143,7 +1400,7 @@ echo "====="                                     >> $STATUS_HISTORY
 %attr(755, root, root) %{_bindir}/mysql_find_rows
 %attr(755, root, root) %{_bindir}/mysql_waitpid
 %attr(755, root, root) %{_bindir}/mysqlaccess
-# XXX: This should be moved to %{_sysconfdir}
+# XXX: This should be moved to %%{_sysconfdir}
 %attr(644, root, root) %{_bindir}/mysqlaccess.conf
 %attr(755, root, root) %{_bindir}/mysqladmin
 %attr(755, root, root) %{_bindir}/mysqlbinlog
@@ -1169,7 +1426,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 %{src_dir}/optional-files-devel
 %defattr(-, root, root, 0755)
 %if %{defined license_files_server}
 %doc %{license_files_server}
@@ -1186,52 +1443,91 @@ 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}
 %endif
 # Shared libraries (omit for architectures that don't support them)
-%{_libdir}/libmysql*.so*
+%{_libdir}/libmysql*.so
+%{_libdir}/libmysql*.so.%{currentlib}*
 
-%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}
+%if 0%{?compatlib}
+%files -n mysql-wsrep-libs-compat%{product_suffix}
+%defattr(-, root, root, -)
+%doc %{?compat_license_files_server}
+%dir %attr(755, root, root) %{_libdir}/mysql
+%attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf
+%{_libdir}/mysql/libmysqlclient.so.%{compatlib}
+%{_libdir}/mysql/libmysqlclient.so.%{compatlib}.0.0
+%{_libdir}/mysql/libmysqlclient_r.so.%{compatlib}
+%{_libdir}/mysql/libmysqlclient_r.so.%{compatlib}.0.0
+%dir %attr(755, root, root) %{_datadir}/mysql/
+%dir %attr(755, root, root) %{_datadir}/mysql/charsets-%{compatver}/
+%attr(644, root, root) %{_datadir}/mysql/charsets-%{compatver}/*
+
+%post -n mysql-wsrep-libs-compat%{product_suffix}
+/sbin/ldconfig
+
+%postun -n mysql-wsrep-libs-compat%{product_suffix}
+/sbin/ldconfig
+%endif
+
+# ----------------------------------------------------------------------------
+%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
+* Fri Oct 30 2015 Joerg Bruehe <joerg.bruehe@fromdual.com>
+- Combine "plugins.files" and "datadir.files" into one, it seems rpmbuild 4.4
+  (used on SLES 11) cannot handle two "-f" directives for one "%%files" section.
+  This solves issue Github-223.
+- Introduce a macro "previous_suffix" and set it to "-5.5", so that installing a
+  "mysql-wsrep-*-5.6" package will "obsolete" the corresponding "mysql-wsrep-*-5.5"
+  package. This solves issue Github-224.
+- Fix dependency: There is no "libopenssl1-devel", just "libopenssl-devel".
+
+* Tue Oct 27 2015 Joerg Bruehe <joerg.bruehe@fromdual.com>
+- Add the spec file changes coded in mysql-wsrep 5.5 to create "libs-compat",
+  visible and documented (Sep 11 - 17) in the 5.5 spec file.
+
+* Thu Jan 29 2015 Joerg Bruehe <joerg.bruehe@fromdual.com>
+- 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 <joerg.bruehe@fromdual.com>
+- 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 <teemu.ollakka@galeracluster.com>
+
+- Reworked to build wsrep patched packages exclusively
+- OBS compatible
+
 * Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
 - Add license info in each subpackage
 
@@ -1350,7 +1646,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 <joerg.bruehe@oracle.com>
+* Thu Feb 10 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
 
 - 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 +1767,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 <mvensson@mysql.com>
+* Fri Oct 09 2009 Magnus Blaudd <mvensson@mysql.com>
 
 - Removed mysql_fix_privilege_tables
 
@@ -1668,7 +1964,7 @@ echo "====="                                     >> $STATUS_HISTORY
 
 - Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS
 
-* Tue Mar 07 2006 Kent Boortz <kent@mysql.com>
+* Wed Mar 08 2006 Kent Boortz <kent@mysql.com>
 
 - Changed product name from "Community Edition" to "Community Server"
 
@@ -1763,7 +2059,7 @@ echo "====="                                     >> $STATUS_HISTORY
 
 * Thu Sep 29 2005 Lenz Grimmer <lenz@mysql.com>
 
-- 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 <lenz@mysql.com>
@@ -1916,7 +2212,7 @@ echo "====="                                     >> $STATUS_HISTORY
 
 - marked /etc/logrotate.d/mysql as a config file (BUG 2156)
 
-* Sat Dec 13 2003 Lenz Grimmer <lenz@mysql.com>
+* Fri Dec 12 2003 Lenz Grimmer <lenz@mysql.com>
 
 - fixed file permissions (BUG 1672)
 
@@ -2058,7 +2354,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 <davida@mysql.com>
+* Wed Sep 29 1999 David Axmark <davida@mysql.com>
 
 - Added the support-files/my-example.cnf to the docs directory.
 
diff --git a/mysql-wsrep-5.6/support-files/wsrep.cnf b/mysql-wsrep-5.6/support-files/wsrep.cnf
new file mode 100644 (file)
index 0000000..756d4f6
--- /dev/null
@@ -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 <address|hostname>[: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:<root password>
+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/mysql-wsrep-5.6/support-files/wsrep.cnf.sh b/mysql-wsrep-5.6/support-files/wsrep.cnf.sh
new file mode 100644 (file)
index 0000000..756d4f6
--- /dev/null
@@ -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 <address|hostname>[: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:<root password>
+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/mysql-wsrep-5.6/support-files/wsrep_notify.sh b/mysql-wsrep-5.6/support-files/wsrep_notify.sh
new file mode 100644 (file)
index 0000000..bdbe3d1
--- /dev/null
@@ -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
+#
index cce5efb8ba9e72a83b05352f57a26916bcc38825..88fa8b1b97947bdd62b25a163f5fe8f08e8701fe 100644 (file)
@@ -33,21 +33,21 @@ package main;
 
 $opt_skip_create=$opt_skip_in=$opt_verbose=$opt_fast_insert=
 $opt_lock_tables=$opt_debug=$opt_skip_drop=$opt_fast=$opt_force=0;
-$opt_thread_factor=1;
-$opt_insert=1;
-$opt_select=6;$opt_join=4;
-$opt_select_count=$opt_join_count=0;
-$opt_update=1;$opt_delete=0;
-$opt_flush=$opt_check=$opt_repair=$opt_alter=0;
-$opt_join_range=100;
+$opt_thread_factor=1;\r
+$opt_insert=1;\r
+$opt_select=6;$opt_join=4;\r
+$opt_select_count=$opt_join_count=0;\r
+$opt_update=1;$opt_delete=0;\r
+$opt_flush=$opt_check=$opt_repair=$opt_alter=0;\r
+$opt_join_range=100;\r
 $opt_resize_interval=0;
 $opt_time=0;
 $opt_host=$opt_user=$opt_password=""; $opt_db="test";
 $opt_verbose=$opt_debug=$opt_lock_tables=$opt_fast_insert=$opt_fast=$opt_skip_in=$opt_force=undef;  # Ignore warnings from these
 
-GetOptions("host=s","db=s","user=s","password=s","loop-count=i","skip-create","skip-in","skip-drop",
-           "verbose","fast-insert","lock-tables","debug","fast","force","thread-factor=i",
-                  "insert=i", "select=i", "join=i", "select-count=i", "join-count=i", "update=i", "delete=i",
+GetOptions("host=s","db=s","user=s","password=s","loop-count=i","skip-create","skip-in","skip-drop",\r
+           "verbose","fast-insert","lock-tables","debug","fast","force","thread-factor=i",\r
+                  "insert=i", "select=i", "join=i", "select-count=i", "join-count=i", "update=i", "delete=i",\r
                   "flush=i", "check=i", "repair=i", "alter=i", "resize-interval=i", "max-join_range=i", "time=i") || die "Aborted";
 
 print "Test of multiple connections that test the following things:\n";
@@ -65,20 +65,20 @@ srand 100;                  # Make random numbers repeatable
 
 ####
 ####  Start timeing and start test
-####
-
+####\r
+\r
 $opt_insert*=$opt_thread_factor;
-$opt_select*=$opt_thread_factor;
-$opt_join*=$opt_thread_factor;
-$opt_select_count*=$opt_thread_factor;
-$opt_join_count*=$opt_thread_factor;
-$opt_update*=$opt_thread_factor;
-$opt_delete*=$opt_thread_factor;
-
-if ($opt_time == 0 && $opt_insert == 0)
-{
-  $opt_insert=1;
-}
+$opt_select*=$opt_thread_factor;\r
+$opt_join*=$opt_thread_factor;\r
+$opt_select_count*=$opt_thread_factor;\r
+$opt_join_count*=$opt_thread_factor;\r
+$opt_update*=$opt_thread_factor;\r
+$opt_delete*=$opt_thread_factor;\r
+\r
+if ($opt_time == 0 && $opt_insert == 0)\r
+{\r
+  $opt_insert=1;\r
+}\r
 
 $start_time=new Benchmark;
 $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
@@ -117,71 +117,71 @@ $|= 1;                            # Autoflush
 ####
 #### Start the tests
 ####
-if ($opt_time != 0)
-{
-       test_abort() if (($pid=fork()) == 0); $work{$pid}="abort";
+if ($opt_time != 0)\r
+{\r
+       test_abort() if (($pid=fork()) == 0); $work{$pid}="abort";\r
 }
 for ($i=0 ; $i < $opt_insert ; $i ++)
 {
   test_insert() if (($pid=fork()) == 0); $work{$pid}="insert";
-}
+}\r
 $threads=$i;
-for ($i=0 ; $i < $opt_select ; $i ++)
-{
-  test_select() if (($pid=fork()) == 0); $work{$pid}="select";
-}
-$threads+=$i;
-for ($i=0 ; $i < $opt_join ; $i ++)
-{
-  test_join() if (($pid=fork()) == 0); $work{$pid}="join";
-}
-$threads+=$i;
+for ($i=0 ; $i < $opt_select ; $i ++)\r
+{\r
+  test_select() if (($pid=fork()) == 0); $work{$pid}="select";\r
+}\r
+$threads+=$i;\r
+for ($i=0 ; $i < $opt_join ; $i ++)\r
+{\r
+  test_join() if (($pid=fork()) == 0); $work{$pid}="join";\r
+}\r
+$threads+=$i;\r
 for ($i=0 ; $i < $opt_select_count ; $i ++)
 {
   test_select_count() if (($pid=fork()) == 0); $work{$pid}="select_count";
 }
-$threads+=$i;
-for ($i=0 ; $i < $opt_join_count ; $i ++)
-{
-  test_join_count() if (($pid=fork()) == 0); $work{$pid}="join_count";
-}
-$threads+=$i;
-for ($i=0 ; $i < $opt_update ; $i ++)
-{
-  test_update() if (($pid=fork()) == 0); $work{$pid}="update";
-}
-$threads+=$i;
-for ($i=0 ; $i < $opt_delete ; $i ++)
-{
-  test_delete() if (($pid=fork()) == 0); $work{$pid}="delete";
-}
-$threads+=$i;
-for ($i=0 ; $i < $opt_flush ; $i ++)
-{
-  test_flush() if (($pid=fork()) == 0); $work{$pid}="flush";
-}
-$threads+=$i;
-for ($i=0 ; $i < $opt_check ; $i ++)
-{
-  test_check() if (($pid=fork()) == 0); $work{$pid}="check";
-}
-$threads+=$i;
-for ($i=0 ; $i < $opt_repair ; $i ++)
-{
-  test_repair() if (($pid=fork()) == 0); $work{$pid}="repair";
-}
-$threads+=$i;
-for ($i=0 ; $i < $opt_alter ; $i ++)
-{
-  test_alter() if (($pid=fork()) == 0); $work{$pid}="alter";
-}
-$threads+=$i;
+$threads+=$i;\r
+for ($i=0 ; $i < $opt_join_count ; $i ++)\r
+{\r
+  test_join_count() if (($pid=fork()) == 0); $work{$pid}="join_count";\r
+}\r
+$threads+=$i;\r
+for ($i=0 ; $i < $opt_update ; $i ++)\r
+{\r
+  test_update() if (($pid=fork()) == 0); $work{$pid}="update";\r
+}\r
+$threads+=$i;\r
+for ($i=0 ; $i < $opt_delete ; $i ++)\r
+{\r
+  test_delete() if (($pid=fork()) == 0); $work{$pid}="delete";\r
+}\r
+$threads+=$i;\r
+for ($i=0 ; $i < $opt_flush ; $i ++)\r
+{\r
+  test_flush() if (($pid=fork()) == 0); $work{$pid}="flush";\r
+}\r
+$threads+=$i;\r
+for ($i=0 ; $i < $opt_check ; $i ++)\r
+{\r
+  test_check() if (($pid=fork()) == 0); $work{$pid}="check";\r
+}\r
+$threads+=$i;\r
+for ($i=0 ; $i < $opt_repair ; $i ++)\r
+{\r
+  test_repair() if (($pid=fork()) == 0); $work{$pid}="repair";\r
+}\r
+$threads+=$i;\r
+for ($i=0 ; $i < $opt_alter ; $i ++)\r
+{\r
+  test_alter() if (($pid=fork()) == 0); $work{$pid}="alter";\r
+}\r
+$threads+=$i;\r
 if ($opt_resize_interval != 0)
 {
   test_resize() if (($pid=fork()) == 0); $work{$pid}="resize";
   $threads+=1;
 }
-
+\r
 print "Started $threads threads\n";
 
 $errors=0;
@@ -189,17 +189,17 @@ $running_insert_threads=$opt_insert;
 while (($pid=wait()) != -1)
 {
   $ret=$?/256;
-  print "thread '" . $work{$pid} . "' finished with exit code $ret\n";
-  if ($opt_time == 0)
+  print "thread '" . $work{$pid} . "' finished with exit code $ret\n";\r
+  if ($opt_time == 0)\r
   {
     if ($work{$pid} =~ /^insert/)
     {
       if (!--$running_insert_threads)
-      {
-
+      {\r
+\r
         # Time to stop other threads
         signal_abort();
-      }
+      }\r
        }
   }
   $errors++ if ($ret != 0);
@@ -231,17 +231,17 @@ print "Total time: " .
 
 exit(0);
 
-#
-# Sleep and then abort other threads
-#
-
-sub test_abort
-{
-  sleep($opt_time);
-  signal_abort();
-  exit(0);
-}
-
+#\r
+# Sleep and then abort other threads\r
+#\r
+\r
+sub test_abort\r
+{\r
+  sleep($opt_time);\r
+  signal_abort();\r
+  exit(0);\r
+}\r
+\r
 
 #
 # Insert records in the table
@@ -380,58 +380,58 @@ sub test_join
   $dbh->disconnect; $dbh=0;
   print "Test_join: Executed $count joins\n";
   exit(0);
-}
-
-#
-# select records
-# Do continously joins between the first and second for range and count selected rows
-#
-
-sub test_join_count
-{
-  my ($dbh, $i, $j, $count, $loop);
-
-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
-                     $opt_user, $opt_password,
-                   { PrintError => 0}) || die $DBI::errstr;
-
-  $count_query=make_count_query($numtables);
-  $count=0;
-  $loop=9999;
-  $sum=0;
-
-  srand();
-
-  $i=0;
-  while (($i++ % 10) || !test_if_abort($dbh))
-  {
-    if ($loop++ >= 10)
-    {
-      $loop=0;
-      $row_counts=simple_query($dbh, $count_query);
-    }
-    for ($j=0 ; $j < $numtables-1 ; $j++)
-    {
-      my ($id1)= int rand $row_counts->[$j];
-      my ($id2)= int rand $row_counts->[$j];
-         if ($id1 > $id2)
-         {
-           my $id0=$id1; $id1=$id2; $id2=$id0;
-               if ($id2-$id1 > $opt_join_range)
-               {
-                 $id2=$id1+$opt_join_range;
-               }
-         }
-      my ($t1,$t2)= ($testtables[$j]->[0],$testtables[$j+1]->[0]);
-      $row=simple_query($dbh, "select count(*) from $t1, $t2 where $t1.id=$t2.id and $t1.id between $id1 and $id2");
-      $sum+=$row->[0];
-      $count++;
-    }
-  }
-  $dbh->disconnect; $dbh=0;
-  print "Test_join_count: Executed $count joins: total $sum rows\n";
-  exit(0);
-}
+}\r
+\r
+#\r
+# select records\r
+# Do continously joins between the first and second for range and count selected rows\r
+#\r
+\r
+sub test_join_count\r
+{\r
+  my ($dbh, $i, $j, $count, $loop);\r
+\r
+  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",\r
+                     $opt_user, $opt_password,\r
+                   { PrintError => 0}) || die $DBI::errstr;\r
+\r
+  $count_query=make_count_query($numtables);\r
+  $count=0;\r
+  $loop=9999;\r
+  $sum=0;\r
+\r
+  srand();\r
+\r
+  $i=0;\r
+  while (($i++ % 10) || !test_if_abort($dbh))\r
+  {\r
+    if ($loop++ >= 10)\r
+    {\r
+      $loop=0;\r
+      $row_counts=simple_query($dbh, $count_query);\r
+    }\r
+    for ($j=0 ; $j < $numtables-1 ; $j++)\r
+    {\r
+      my ($id1)= int rand $row_counts->[$j];\r
+      my ($id2)= int rand $row_counts->[$j];\r
+         if ($id1 > $id2)\r
+         {\r
+           my $id0=$id1; $id1=$id2; $id2=$id0;\r
+               if ($id2-$id1 > $opt_join_range)\r
+               {\r
+                 $id2=$id1+$opt_join_range;\r
+               }\r
+         }\r
+      my ($t1,$t2)= ($testtables[$j]->[0],$testtables[$j+1]->[0]);\r
+      $row=simple_query($dbh, "select count(*) from $t1, $t2 where $t1.id=$t2.id and $t1.id between $id1 and $id2");\r
+      $sum+=$row->[0];\r
+      $count++;\r
+    }\r
+  }\r
+  $dbh->disconnect; $dbh=0;\r
+  print "Test_join_count: Executed $count joins: total $sum rows\n";\r
+  exit(0);\r
+}\r
 
 
 #
index a3b9080e6a705cae91fdc7e10fca75f73ededa7b..e21b9f28fe5f9a822b9a78870892052c9cc276b1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
@@ -19398,6 +19398,96 @@ static void test_bug17512527()
 }
 
 
+/**
+   BUG#20810928: CANNOT SHUTDOWN MYSQL USING JDBC DRIVER
+*/
+static void test_bug20810928()
+{
+  MYSQL *l_mysql;
+  int rc;
+  uint error_code;
+
+  myheader("test_bug20810928");
+
+  /* initialize the server user */
+  rc= mysql_query(mysql,
+                  "CREATE USER bug20810928@localhost IDENTIFIED BY 'bug20810928'");
+  myquery(rc);
+
+  /* prepare the connection */
+  l_mysql= mysql_client_init(NULL);
+  DIE_UNLESS(l_mysql != NULL);
+
+  l_mysql= mysql_real_connect(l_mysql, opt_host, "bug20810928",
+                              "bug20810928", "test", opt_port,
+                              opt_unix_socket, 0);
+
+  /*
+    Try the 0 length shutdown command.
+    Should fail with the right error code to avoid server restart.
+  */
+  rc= simple_command(l_mysql, COM_SHUTDOWN, NULL, 0, 0);
+  DIE_UNLESS(rc != 0);
+
+  /* check if it's the right error */
+  error_code= mysql_errno(l_mysql);
+  DIE_UNLESS(error_code == ER_SPECIFIC_ACCESS_DENIED_ERROR);
+
+  mysql_close(l_mysql);
+
+  /* clean up the server user */
+  rc= mysql_query(mysql, "DROP USER bug20810928@localhost");
+  myquery(rc);
+}
+
+
+/*
+  BUG#17883203: MYSQL EMBEDDED MYSQL_STMT_EXECUTE RETURN
+                "MALFORMED COMMUNICATION PACKET" ERROR
+*/
+#define BUG17883203_STRING_SIZE 100
+
+static void test_bug17883203()
+{
+  MYSQL_STMT *stmt;
+  MYSQL_BIND bind;
+  char str_data[BUG17883203_STRING_SIZE];
+  my_bool is_null;
+  my_bool error;
+  unsigned long length;
+  const char stmt_text[] ="SELECT VERSION()";
+  int rc;
+
+  myheader("test_bug17883203");
+
+  stmt = mysql_stmt_init(mysql);
+  check_stmt(stmt);
+  rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+  check_execute(stmt, rc);
+  rc= mysql_stmt_execute(stmt);
+  check_execute(stmt, rc);
+  memset(&bind, 0, sizeof(bind));
+
+  bind.buffer_type= MYSQL_TYPE_STRING;
+  bind.buffer= (char *)str_data;
+  bind.buffer_length= BUG17883203_STRING_SIZE;
+  bind.is_null= &is_null;
+  bind.length= &length;
+  bind.error= &error;
+
+  rc= mysql_stmt_bind_result(stmt, &bind);
+  check_execute(stmt, rc);
+  rc= mysql_stmt_fetch(stmt);
+  check_execute(stmt, rc);
+
+  if (!opt_silent)
+  {
+    fprintf(stdout, "\n Version: %s", str_data);
+  }
+  mysql_stmt_close(stmt);
+}
+
+
 static struct my_tests_st my_tests[]= {
   { "disable_query_logs", disable_query_logs },
   { "test_view_sp_list_fields", test_view_sp_list_fields },
@@ -19673,6 +19763,8 @@ static struct my_tests_st my_tests[]= {
   { "test_bug17309863", test_bug17309863},
 #endif
   { "test_bug17512527", test_bug17512527},
+  { "test_bug20810928", test_bug20810928 },
+  { "test_bug17883203", test_bug17883203 },
   { 0, 0 }
 };
 
index 4dafdbc1c98d0178636477c3d0dedb140abe49ca..db53c655022fa9f68285e708d7dce4316ae869e2 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 2014, 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
@@ -221,6 +221,8 @@ MESSAGE(STATUS "GTEST_LIBRARIES:${GTEST_LIBRARIES}")
 
 # Add some defines.
 ADD_DEFINITIONS(-DMYSQL_SERVER)
+ADD_DEFINITIONS(-DERRMSG_DIR="${PROJECT_BINARY_DIR}/sql/share")
+ADD_DEFINITIONS(-DDATA_DIR="${CMAKE_CURRENT_BINARY_DIR}")
 
 # Add tests (link them with gunit/gmock libraries) 
 SET(TESTS
@@ -253,7 +255,6 @@ SET(TESTS
   sql_list
   sql_plist
   sql_string
-  stdcxx
   strtoll
   thread_utils
   )
@@ -324,12 +325,19 @@ IF (MERGE_UNITTESTS)
   ADD_TEST(merge_large_tests merge_large_tests-t)
   ADD_TEST(merge_small_tests merge_small_tests-t)
 
-ELSE()
+ENDIF(MERGE_UNITTESTS)
 
   FOREACH(test ${TESTS})
     ADD_EXECUTABLE(${test}-t ${test}-t.cc)
     TARGET_LINK_LIBRARIES(${test}-t gunit_small sqlgunitlib strings dbug regex)
-    ADD_TEST(${test} ${test}-t)
+    IF(MERGE_UNITTESTS)
+      SET_PROPERTY(TARGET ${test}-t PROPERTY EXCLUDE_FROM_ALL TRUE)
+      IF(WIN32)
+        SET_PROPERTY(TARGET ${test}-t PROPERTY EXCLUDE_FROM_DEFAULT_BUILD TRUE)
+      ENDIF()
+    ELSE()
+      ADD_TEST(${test} ${test}-t)
+    ENDIF()
   ENDFOREACH()
   
   FOREACH(test ${SERVER_TESTS})
@@ -348,10 +356,15 @@ ELSE()
     TARGET_LINK_LIBRARIES(${test}-t sql binlog rpl master slave sql)
     TARGET_LINK_LIBRARIES(${test}-t gunit_large strings dbug regex mysys)
     TARGET_LINK_LIBRARIES(${test}-t sql binlog rpl master slave sql)
-    ADD_TEST(${test} ${test}-t)
+    IF(MERGE_UNITTESTS)
+      SET_PROPERTY(TARGET ${test}-t PROPERTY EXCLUDE_FROM_ALL TRUE)
+      IF(WIN32)
+        SET_PROPERTY(TARGET ${test}-t PROPERTY EXCLUDE_FROM_DEFAULT_BUILD TRUE)
+      ENDIF()
+    ELSE()
+      ADD_TEST(${test} ${test}-t)
+    ENDIF()
   ENDFOREACH()
 
-ENDIF()
-
 ## Most executables depend on libeay32.dll (through mysys_ssl).
 COPY_OPENSSL_DLLS(copy_openssl_gunit)
index deabc51b3969ffe104fe7d45e36f6188c33b6074..0ad40c155d387fc1a6017de8c22d6d60ec7b8bb4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 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
   waiting for a signal that it has already lost.
 */
 
-// First include (the generated) my_config.h, to get correct platform defines.
-#include "my_config.h"
+#include "my_global.h"
 #include <gtest/gtest.h>
-
-#ifdef _WIN32
-#include <Windows.h>
-#else
-#include <pthread.h>
-#endif
-#include "my_pthread.h"
 #include "test_utils.h"
 #include "thread_utils.h"
 #include "debug_sync.h"
index 896c203a914ee285de89002f697334db9d396cea..caae9dff3db24b58e486c7729909e9e266647d1b 100644 (file)
@@ -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
@@ -80,4 +80,48 @@ TEST_F(RegexTest, BasicTest)
   }
 }
 
+/*
+  Bug#20642505: HENRY SPENCER REGULAR EXPRESSIONS (REGEX) LIBRARY
+
+  We have our own variant of the regex code that understands MySQL charsets.
+  This test is hear to make sure that we never checkpoint or cherrypick from
+  the upstream and end up with a version that isn't patched against a
+  potential overflow.
+*/
+TEST_F(RegexTest, Bug20642505)
+{
+  my_regex_t  re;
+  char       *pattern;
+  int         err;
+  size_t      len= 684 * 1024 * 1024;
+
+  /*
+    We're testing on 32-bit/32-bit only. We could test e.g. with
+    64-bit size_t, 32-bit long (for 64-bit Windows and such), but
+    then we'd have to allocate twice as much memory, and it's a
+    bit heavy as it is.  (In 32/32, we exceed the size_t parameter
+    to malloc() as new_ssize exceeds UINT32 / 4, whereas in 64/32,
+    new_ssize would exceed LONG_MAX at UINT32 / 2.  (64/32 verified
+    in debugger.)
+  */
+  if ((sizeof(size_t) > 4) || (sizeof(long) > 4))
+    return;
+
+  /* set up an empty C string as pattern as regcomp() will strlen() this */
+  pattern= (char *) malloc(len);
+  EXPECT_FALSE(pattern == NULL);
+  memset(pattern, (int) ' ', len);
+  pattern[len - 1]= '\0';
+
+  err= my_regcomp(&re, pattern, MY_REG_BASIC,
+                  &my_charset_latin1);
+
+  my_regfree(&re);
+  free(pattern);
+
+  EXPECT_EQ(err, MY_REG_ESPACE)
+    << "my_regcomp returned " << err
+    << " instead of MY_REG_ESPACE (" << MY_REG_ESPACE << ")";
+}
+
 }  // namespace
diff --git a/mysql-wsrep-5.6/unittest/gunit/stdcxx-t.cc b/mysql-wsrep-5.6/unittest/gunit/stdcxx-t.cc
deleted file mode 100644 (file)
index 0de7ba1..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright (c) 2011, 2012, 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 */
-
-// First include (the generated) my_config.h, to get correct platform defines.
-#include "my_config.h"
-#include <gtest/gtest.h>
-
-#if defined(_LIBCPP_VERSION)
-#include <unordered_map>
-#elif defined(__GNUC__) && __GNUC__ > 3
-#include <tr1/unordered_map>
-#elif defined(__WIN__)
-#include <hash_map>
-#elif  defined(__SUNPRO_CC)
-#include <hash_map>
-#else 
-#error "Don't know how to implement hash_map"
-#endif
-
-
-template<typename K, typename T>
-struct MyHashMap
-{
-#if defined(_LIBCPP_VERSION)
-  typedef std::unordered_map<K, T> Type;
-#elif defined(__GNUC__) && __GNUC__ > 3
-  typedef std::tr1::unordered_map<K, T> Type;
-#elif defined(__WIN__)
-  typedef stdext::hash_map<K, T> Type;
-#elif defined(__SUNPRO_CC)
-  typedef std::hash_map<K, T> Type;
-#endif
-};
-
-
-TEST(STDfeatures, HashMap)
-{
-  MyHashMap<int, int>::Type intmap;
-  for (int ix= 0; ix < 10; ++ix)
-  {
-    intmap[ix]= ix * ix;
-  }
-  int t= intmap[0];
-  EXPECT_EQ(0, t);
-  EXPECT_TRUE(0 == intmap.count(42));
-  EXPECT_TRUE(intmap.end() == intmap.find(42));
-}
index 5ffd0055b52a77f53899a7e50e7d844d9fe71aec..d1400787c02925f3cf733ae189bf12893fcc1696 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -42,8 +42,12 @@ extern "C" void test_error_handler_hook(uint err, const char *str, myf MyFlags)
 void setup_server_for_unit_tests()
 {
   static char *my_name= strdup(my_progname);
-  char *argv[] = { my_name, 0 };
-  set_remaining_args(1, argv);
+  char *argv[] = { my_name,
+                   const_cast<char*>("--log_syslog=0"),
+                   const_cast<char*>("--explicit_defaults_for_timestamp"),
+                   const_cast<char*>("--datadir=" DATA_DIR),
+                   const_cast<char*>("--lc-messages-dir=" ERRMSG_DIR), 0 };
+  set_remaining_args(5, argv);
   mysql_mutex_init(key_LOCK_error_log, &LOCK_error_log, MY_MUTEX_INIT_FAST);
   system_charset_info= &my_charset_utf8_general_ci;
   sys_var_init();
index eaa84b92ea0e1fab412265809cf8841c8f12a45a..206d94e9438ec7e3e9e3a7f4118f2e09aee96885 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -157,6 +157,16 @@ static void vio_init(Vio *vio, enum enum_vio_type type,
           to another socket-based transport type. For example,
           rebind a TCP/IP transport to SSL.
 
+  @remark If new socket handle passed to vio_reset() is not equal
+          to the socket handle stored in Vio then socket handle will
+          be closed before storing new value. If handles are equal
+          then old socket is not closed. This is important for
+          vio_reset() usage in ssl_do().
+
+  @remark If any error occurs then Vio members won't be altered thus
+          preserving socket handle stored in Vio and not taking
+          ownership over socket handle passed as parameter.
+
   @param vio    A VIO object.
   @param type   A socket-based transport type.
   @param sd     The socket.
@@ -170,25 +180,19 @@ my_bool vio_reset(Vio* vio, enum enum_vio_type type,
                   my_socket sd, void *ssl __attribute__((unused)), uint flags)
 {
   int ret= FALSE;
-  Vio old_vio= *vio;
+  Vio new_vio;
   DBUG_ENTER("vio_reset");
 
   /* The only supported rebind is from a socket-based transport type. */
   DBUG_ASSERT(vio->type == VIO_TYPE_TCPIP || vio->type == VIO_TYPE_SOCKET);
 
-  /*
-    Will be reinitialized depending on the flags.
-    Nonetheless, already buffered inside the SSL layer.
-  */
-  my_free(vio->read_buffer);
-
-  vio_init(vio, type, sd, flags);
+  vio_init(&new_vio, type, sd, flags);
 
   /* Preserve perfschema info for this connection */
-  vio->mysql_socket.m_psi= old_vio.mysql_socket.m_psi;
+  new_vio.mysql_socket.m_psi= vio->mysql_socket.m_psi;
 
 #ifdef HAVE_OPENSSL
-  vio->ssl_arg= ssl;
+  new_vio.ssl_arg= ssl;
 #endif
 
   /*
@@ -196,11 +200,38 @@ my_bool vio_reset(Vio* vio, enum enum_vio_type type,
     the underlying proprieties associated with the timeout,
     such as the socket blocking mode.
   */
-  if (old_vio.read_timeout >= 0)
-    ret|= vio_timeout(vio, 0, old_vio.read_timeout);
+  if (vio->read_timeout >= 0)
+    ret|= vio_timeout(&new_vio, 0, vio->read_timeout / 1000);
 
-  if (old_vio.write_timeout >= 0)
-    ret|= vio_timeout(vio, 1, old_vio.write_timeout);
+  if (vio->write_timeout >= 0)
+    ret|= vio_timeout(&new_vio, 1, vio->write_timeout / 1000);
+
+  if (ret)
+  {
+    /*
+      vio_reset() failed
+      free resources allocated by vio_init
+    */
+    my_free(new_vio.read_buffer);
+  }
+  else
+  {
+    /*
+      vio_reset() succeeded
+      free old resources and then overwrite VIO structure
+    */
+
+    /*
+      Close socket only when it is not equal to the new one.
+    */
+    if (sd != mysql_socket_getfd(vio->mysql_socket))
+      if (vio->inactive == FALSE)
+        vio->vioshutdown(vio);
+
+    my_free(vio->read_buffer);
+
+    *vio= new_vio;
+  }
 
   DBUG_RETURN(MY_TEST(ret));
 }
index 7cbf931f0fafb6ff42a69d83fcbc04f3c956ab24..744a8fe32f068d9674f24ba578d31bd0bcc4d48c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2001, 2013, 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
@@ -735,7 +735,7 @@ static my_bool socket_peek_read(Vio *vio, uint *bytes)
 int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
 {
   int ret;
-  short revents= 0;
+  short revents __attribute__((unused)) = 0;
   struct pollfd pfd;
   my_socket sd= mysql_socket_getfd(vio->mysql_socket);
   MYSQL_SOCKET_WAIT_VARIABLES(locker, state) /* no ';' */
index 2efd020e51b65ae0aed1a2e34e13bf109f38a4cf..ee99f9350d4c88822ab79499ccf003377dddbeea 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -377,6 +377,12 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
   int r;
   SSL *ssl;
   my_socket sd= mysql_socket_getfd(vio->mysql_socket);
+
+  /* Declared here to make compiler happy */
+#if !defined(HAVE_YASSL) && !defined(DBUG_OFF)
+  int j, n;
+#endif
+
   DBUG_ENTER("ssl_do");
   DBUG_PRINT("enter", ("ptr: 0x%lx, sd: %d  ctx: 0x%lx",
                        (long) ptr, sd, (long) ptr->ssl_context));
@@ -391,8 +397,27 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
   SSL_clear(ssl);
   SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
   SSL_set_fd(ssl, sd);
-#ifndef HAVE_YASSL
-  SSL_set_options(ssl, SSL_OP_NO_COMPRESSION);
+#if !defined(HAVE_YASSL) && defined(SSL_OP_NO_COMPRESSION)
+  SSL_set_options(ssl, SSL_OP_NO_COMPRESSION); /* OpenSSL >= 1.0 only */
+#elif OPENSSL_VERSION_NUMBER >= 0x00908000L /* workaround for OpenSSL 0.9.8 */
+  sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
+#endif
+
+#if !defined(HAVE_YASSL) && !defined(DBUG_OFF)
+  {
+    STACK_OF(SSL_COMP) *ssl_comp_methods = NULL;
+    ssl_comp_methods = SSL_COMP_get_compression_methods();
+    n= sk_SSL_COMP_num(ssl_comp_methods);
+    DBUG_PRINT("info", ("Available compression methods:\n"));
+    if (n == 0)
+      DBUG_PRINT("info", ("NONE\n"));
+    else
+      for (j = 0; j < n; j++)
+      {
+        SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j);
+        DBUG_PRINT("info", ("  %d: %s\n", c->id, c->name));
+      }
+  }
 #endif
 
   /*
index 4d5ff71a4ce064e3e5833a1027bb8c27785e9dff..aef870032bea81a499c50cdc3bb282d8f631be07 100644 (file)
@@ -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
 static my_bool     ssl_algorithms_added    = FALSE;
 static my_bool     ssl_error_strings_loaded= FALSE;
 
-static unsigned char dh512_p[]=
+/*
+  Diffie-Hellman key.
+  Generated using: >openssl dhparam -5 -C 2048
+
+  -----BEGIN DH PARAMETERS-----
+  MIIBCAKCAQEAil36wGZ2TmH6ysA3V1xtP4MKofXx5n88xq/aiybmGnReZMviCPEJ
+  46+7VCktl/RZ5iaDH1XNG1dVQmznt9pu2G3usU+k1/VB4bQL4ZgW4u0Wzxh9PyXD
+  glm99I9Xyj4Z5PVE4MyAsxCRGA1kWQpD9/zKAegUBPLNqSo886Uqg9hmn8ksyU9E
+  BV5eAEciCuawh6V0O+Sj/C3cSfLhgA0GcXp3OqlmcDu6jS5gWjn3LdP1U0duVxMB
+  h/neTSCSvtce4CAMYMjKNVh9P1nu+2d9ZH2Od2xhRIqMTfAS1KTqF3VmSWzPFCjG
+  mjxx/bg6bOOjpgZapvB6ABWlWmRmAAWFtwIBBQ==
+  -----END DH PARAMETERS-----
+ */
+static unsigned char dh2048_p[]=
 {
-  0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75,
-  0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F,
-  0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3,
-  0x69,0x99,0xDB,0x29,0xD7,0x76,0x27,0x6B,0xA2,0xD3,0xD4,0x12,
-  0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C,
-  0x47,0x74,0xE8,0x33,
+  0x8A, 0x5D, 0xFA, 0xC0, 0x66, 0x76, 0x4E, 0x61, 0xFA, 0xCA, 0xC0, 0x37,
+  0x57, 0x5C, 0x6D, 0x3F, 0x83, 0x0A, 0xA1, 0xF5, 0xF1, 0xE6, 0x7F, 0x3C,
+  0xC6, 0xAF, 0xDA, 0x8B, 0x26, 0xE6, 0x1A, 0x74, 0x5E, 0x64, 0xCB, 0xE2,
+  0x08, 0xF1, 0x09, 0xE3, 0xAF, 0xBB, 0x54, 0x29, 0x2D, 0x97, 0xF4, 0x59,
+  0xE6, 0x26, 0x83, 0x1F, 0x55, 0xCD, 0x1B, 0x57, 0x55, 0x42, 0x6C, 0xE7,
+  0xB7, 0xDA, 0x6E, 0xD8, 0x6D, 0xEE, 0xB1, 0x4F, 0xA4, 0xD7, 0xF5, 0x41,
+  0xE1, 0xB4, 0x0B, 0xE1, 0x98, 0x16, 0xE2, 0xED, 0x16, 0xCF, 0x18, 0x7D,
+  0x3F, 0x25, 0xC3, 0x82, 0x59, 0xBD, 0xF4, 0x8F, 0x57, 0xCA, 0x3E, 0x19,
+  0xE4, 0xF5, 0x44, 0xE0, 0xCC, 0x80, 0xB3, 0x10, 0x91, 0x18, 0x0D, 0x64,
+  0x59, 0x0A, 0x43, 0xF7, 0xFC, 0xCA, 0x01, 0xE8, 0x14, 0x04, 0xF2, 0xCD,
+  0xA9, 0x2A, 0x3C, 0xF3, 0xA5, 0x2A, 0x83, 0xD8, 0x66, 0x9F, 0xC9, 0x2C,
+  0xC9, 0x4F, 0x44, 0x05, 0x5E, 0x5E, 0x00, 0x47, 0x22, 0x0A, 0xE6, 0xB0,
+  0x87, 0xA5, 0x74, 0x3B, 0xE4, 0xA3, 0xFC, 0x2D, 0xDC, 0x49, 0xF2, 0xE1,
+  0x80, 0x0D, 0x06, 0x71, 0x7A, 0x77, 0x3A, 0xA9, 0x66, 0x70, 0x3B, 0xBA,
+  0x8D, 0x2E, 0x60, 0x5A, 0x39, 0xF7, 0x2D, 0xD3, 0xF5, 0x53, 0x47, 0x6E,
+  0x57, 0x13, 0x01, 0x87, 0xF9, 0xDE, 0x4D, 0x20, 0x92, 0xBE, 0xD7, 0x1E,
+  0xE0, 0x20, 0x0C, 0x60, 0xC8, 0xCA, 0x35, 0x58, 0x7D, 0x3F, 0x59, 0xEE,
+  0xFB, 0x67, 0x7D, 0x64, 0x7D, 0x8E, 0x77, 0x6C, 0x61, 0x44, 0x8A, 0x8C,
+  0x4D, 0xF0, 0x12, 0xD4, 0xA4, 0xEA, 0x17, 0x75, 0x66, 0x49, 0x6C, 0xCF,
+  0x14, 0x28, 0xC6, 0x9A, 0x3C, 0x71, 0xFD, 0xB8, 0x3A, 0x6C, 0xE3, 0xA3,
+  0xA6, 0x06, 0x5A, 0xA6, 0xF0, 0x7A, 0x00, 0x15, 0xA5, 0x5A, 0x64, 0x66,
+  0x00, 0x05, 0x85, 0xB7,
 };
 
-static unsigned char dh512_g[]={
-  0x02,
+static unsigned char dh2048_g[]={
+  0x05,
 };
 
-static DH *get_dh512(void)
+static DH *get_dh2048(void)
 {
   DH *dh;
   if ((dh=DH_new()))
   {
-    dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
-    dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
+    dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
+    dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL);
     if (! dh->p || ! dh->g)
     {
       DH_free(dh);
@@ -81,7 +110,8 @@ ssl_error_string[] =
   "Private key does not match the certificate public key",
   "SSL_CTX_set_default_verify_paths failed",
   "Failed to set ciphers to use",
-  "SSL_CTX_new failed"
+  "SSL_CTX_new failed",
+  "SSL_CTX_set_tmp_dh failed"
 };
 
 const char*
@@ -285,8 +315,17 @@ new_VioSSLFd(const char *key_file, const char *cert_file,
   }
 
   /* DH stuff */
-  dh=get_dh512();
-  SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh);
+  dh= get_dh2048();
+  if (SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh) == 0)
+  {
+    *error= SSL_INITERR_DHFAIL;
+    DBUG_PRINT("error", ("%s", sslGetErrString(*error)));
+    report_errors();
+    DH_free(dh);
+    SSL_CTX_free(ssl_fd->ssl_context);
+    my_free(ssl_fd);
+    DBUG_RETURN(0);
+  }
   DH_free(dh);
 
   DBUG_PRINT("exit", ("OK 1"));
diff --git a/mysql-wsrep-5.6/wsrep/CMakeLists.txt b/mysql-wsrep-5.6/wsrep/CMakeLists.txt
new file mode 100644 (file)
index 0000000..182e458
--- /dev/null
@@ -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/mysql-wsrep-5.6/wsrep/Makefile.am b/mysql-wsrep-5.6/wsrep/Makefile.am
new file mode 100644 (file)
index 0000000..a748ece
--- /dev/null
@@ -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/mysql-wsrep-5.6/wsrep/wsrep_api.h b/mysql-wsrep-5.6/wsrep/wsrep_api.h
new file mode 100644 (file)
index 0000000..c3304d7
--- /dev/null
@@ -0,0 +1,1118 @@
+/* Copyright (C) 2009-2013 Codership Oy <info@codership.com>
+
+   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 <stdint.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+
+#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/mysql-wsrep-5.6/wsrep/wsrep_dummy.c b/mysql-wsrep-5.6/wsrep/wsrep_dummy.c
new file mode 100644 (file)
index 0000000..bab5329
--- /dev/null
@@ -0,0 +1,407 @@
+/* Copyright (C) 2009-2010 Codership Oy <info@codersihp.com>
+
+   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 <errno.h>
+#include <stdbool.h>
+#include <string.h>
+
+/*! 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 <info@codership.com>",
+    &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/mysql-wsrep-5.6/wsrep/wsrep_gtid.c b/mysql-wsrep-5.6/wsrep/wsrep_gtid.c
new file mode 100644 (file)
index 0000000..e618c5a
--- /dev/null
@@ -0,0 +1,74 @@
+/* Copyright (C) 2013 Codership Oy <info@codersihp.com>
+
+   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 <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#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, &gtid->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(&gtid->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/mysql-wsrep-5.6/wsrep/wsrep_loader.c b/mysql-wsrep-5.6/wsrep/wsrep_loader.c
new file mode 100644 (file)
index 0000000..c330c77
--- /dev/null
@@ -0,0 +1,203 @@
+/* Copyright (C) 2009-2011 Codership Oy <info@codersihp.com>
+
+   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 <dlfcn.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+
+#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/mysql-wsrep-5.6/wsrep/wsrep_uuid.c b/mysql-wsrep-5.6/wsrep/wsrep_uuid.c
new file mode 100644 (file)
index 0000000..baa95b2
--- /dev/null
@@ -0,0 +1,83 @@
+/* Copyright (C) 2009 Codership Oy <info@codersihp.com>
+
+   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 <errno.h>
+#include <ctype.h>
+#include <stdio.h>
+
+#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;
+    }
+}